Fix locking with proper calls to WIN_ReleaseWndPtr.

oldstable
Guy Albertelli 1999-04-24 11:54:40 +00:00 committed by Alexandre Julliard
parent 819791ba0a
commit 2fa281f90f
3 changed files with 19 additions and 13 deletions

View File

@ -1730,7 +1730,7 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
goto END; goto END;
case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGING:
retvalue = COMBO_WindowPosChanging(hwnd, lphc, (LPWINDOWPOS)lParam); retvalue = COMBO_WindowPosChanging(hwnd, lphc, (LPWINDOWPOS)lParam);
return retvalue; goto END;
case WM_SIZE: case WM_SIZE:
if( lphc->hWndLBox && if( lphc->hWndLBox &&
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc ); !(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );

View File

@ -723,6 +723,7 @@ WORD WINAPI GetClassWord16( HWND16 hwnd, INT16 offset )
WORD WINAPI GetClassWord( HWND hwnd, INT offset ) WORD WINAPI GetClassWord( HWND hwnd, INT offset )
{ {
WND * wndPtr; WND * wndPtr;
WORD retvalue = 0;
TRACE(class,"%x %x\n",hwnd, offset); TRACE(class,"%x %x\n",hwnd, offset);
@ -731,29 +732,33 @@ WORD WINAPI GetClassWord( HWND hwnd, INT offset )
{ {
if (offset <= wndPtr->class->cbClsExtra - sizeof(WORD)) if (offset <= wndPtr->class->cbClsExtra - sizeof(WORD))
{ {
WORD retvalue = GET_WORD(((char *)wndPtr->class->wExtra) + offset); retvalue = GET_WORD(((char *)wndPtr->class->wExtra) + offset);
WIN_ReleaseWndPtr(wndPtr); goto END;
return retvalue;
} }
} }
else switch(offset) else switch(offset)
{ {
case GCW_HBRBACKGROUND: return wndPtr->class->hbrBackground; case GCW_HBRBACKGROUND: retvalue = wndPtr->class->hbrBackground;
case GCW_HCURSOR: return wndPtr->class->hCursor; goto END;
case GCW_HICON: return wndPtr->class->hIcon; case GCW_HCURSOR: retvalue = wndPtr->class->hCursor;
case GCW_HICONSM: return wndPtr->class->hIconSm; goto END;
case GCW_ATOM: return wndPtr->class->atomName; case GCW_HICON: retvalue = wndPtr->class->hIcon;
goto END;
case GCW_HICONSM: retvalue = wndPtr->class->hIconSm;
goto END;
case GCW_ATOM: retvalue = wndPtr->class->atomName;
goto END;
case GCW_STYLE: case GCW_STYLE:
case GCW_CBWNDEXTRA: case GCW_CBWNDEXTRA:
case GCW_CBCLSEXTRA: case GCW_CBCLSEXTRA:
case GCW_HMODULE: case GCW_HMODULE:
WIN_ReleaseWndPtr(wndPtr); retvalue = (WORD)GetClassLongA( hwnd, offset );
return (WORD)GetClassLongA( hwnd, offset );
} }
WIN_ReleaseWndPtr(wndPtr);
WARN(class, "Invalid offset %d\n", offset); WARN(class, "Invalid offset %d\n", offset);
return 0; END:
WIN_ReleaseWndPtr(wndPtr);
return retvalue;
} }

View File

@ -1015,6 +1015,7 @@ BOOL16 WINAPI DCHook16( HDC16 hDC, WORD code, DWORD data, LPARAM lParam )
DCE_OffsetVisRgn( hDC, hVisRgn ); DCE_OffsetVisRgn( hDC, hVisRgn );
SelectVisRgn16(hDC, hVisRgn); SelectVisRgn16(hDC, hVisRgn);
DeleteObject( hVisRgn ); DeleteObject( hVisRgn );
WIN_ReleaseWndPtr( wndPtr ); /* Release WIN_FindWndPtr lock */
} }
else /* non-fatal but shouldn't happen */ else /* non-fatal but shouldn't happen */
WARN(dc, "DC is not in use!\n"); WARN(dc, "DC is not in use!\n");