Don't use alloca in a macro, which may be used in a loop. This does fix bug #805.

svn path=/trunk/; revision=18481
This commit is contained in:
Hartmut Birr 2005-10-15 13:22:13 +00:00
parent 36c303f191
commit 00a4a8acbd
14 changed files with 107 additions and 62 deletions

View file

@ -90,20 +90,18 @@ typedef struct _USER_REFERENCE_ENTRY
ASSERT(_obj_ == ref->obj); \ ASSERT(_obj_ == ref->obj); \
\ \
} }
#define UserRefObjectCo(_obj_) \ #define UserRefObjectCo(_obj_, _ref_) \
{ \ { \
PW32THREAD t; \ PW32THREAD t; \
PUSER_REFERENCE_ENTRY ref; \
\ \
ASSERT(_obj_); \ ASSERT(_obj_); \
t = PsGetWin32Thread(); \ t = PsGetWin32Thread(); \
ASSERT(t); \ ASSERT(t); \
ref = (PUSER_REFERENCE_ENTRY)_alloca(sizeof(USER_REFERENCE_ENTRY)); \ ASSERT(_ref_); \
ASSERT(ref); \ (_ref_)->obj = _obj_; \
ref->obj = _obj_; \
ObmReferenceObject(_obj_); \ ObmReferenceObject(_obj_); \
\ \
PushEntryList(&t->ReferencesList, &ref->Entry); \ PushEntryList(&t->ReferencesList, &(_ref_)->Entry); \
\ \
} }

View file

@ -433,6 +433,7 @@ NtUserTranslateAccelerator(
PWINDOW_OBJECT Window = NULL; PWINDOW_OBJECT Window = NULL;
PACCELERATOR_TABLE Accel = NULL; PACCELERATOR_TABLE Accel = NULL;
ULONG i; ULONG i;
USER_REFERENCE_ENTRY AccelRef, WindowRef;
DECLARE_RETURN(int); DECLARE_RETURN(int);
DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p)\n", DPRINT("NtUserTranslateAccelerator(hWnd %x, Table %x, Message %p)\n",
@ -458,14 +459,14 @@ NtUserTranslateAccelerator(
RETURN( 0); RETURN( 0);
} }
UserRefObjectCo(Accel); UserRefObjectCo(Accel, &AccelRef);
if (!(Window = UserGetWindowObject(hWnd))) if (!(Window = UserGetWindowObject(hWnd)))
{ {
RETURN( 0); RETURN( 0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &WindowRef);
/* FIXME: Associate AcceleratorTable with the current thread */ /* FIXME: Associate AcceleratorTable with the current thread */

View file

@ -405,6 +405,7 @@ STDCALL
NtUserShowCaret(HWND hWnd OPTIONAL, BOOL bShow) NtUserShowCaret(HWND hWnd OPTIONAL, BOOL bShow)
{ {
PWINDOW_OBJECT Window = NULL; PWINDOW_OBJECT Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
BOOL ret; BOOL ret;
@ -416,7 +417,7 @@ NtUserShowCaret(HWND hWnd OPTIONAL, BOOL bShow)
RETURN(FALSE); RETURN(FALSE);
} }
if (Window) UserRefObjectCo(Window); if (Window) UserRefObjectCo(Window, &Ref);
if (bShow) if (bShow)
ret = co_UserShowCaret(Window); ret = co_UserShowCaret(Window);

View file

@ -547,6 +547,7 @@ NtUserSetClassLong(HWND hWnd,
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
LONG Ret; LONG Ret;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(DWORD); DECLARE_RETURN(DWORD);
DPRINT("Enter NtUserSetClassLong\n"); DPRINT("Enter NtUserSetClassLong\n");
@ -557,7 +558,7 @@ NtUserSetClassLong(HWND hWnd,
RETURN(0); RETURN(0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Ret = IntGetClassLong(Window, Offset, Ansi); Ret = IntGetClassLong(Window, Offset, Ansi);
co_IntSetClassLong(Window, Offset, dwNewLong, Ansi); co_IntSetClassLong(Window, Offset, dwNewLong, Ansi);

View file

@ -61,12 +61,13 @@ co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
VOID FASTCALL VOID FASTCALL
co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
{ {
USER_REFERENCE_ENTRY Ref;
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
if ((Window = UserGetWindowObject(hWnd))) if ((Window = UserGetWindowObject(hWnd)))
{ {
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
/* Send palette messages */ /* Send palette messages */
if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0)) if (co_IntPostOrSendMessage(hWnd, WM_QUERYNEWPALETTE, 0, 0))
@ -218,6 +219,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
{ {
HWND Top; HWND Top;
PWINDOW_OBJECT TopWindow; PWINDOW_OBJECT TopWindow;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
@ -231,7 +233,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
Top = IntFindChildWindowToOwner(DesktopWindow, Window); Top = IntFindChildWindowToOwner(DesktopWindow, Window);
if((TopWnd = UserGetWindowObject(Top))) if((TopWnd = UserGetWindowObject(Top)))
{ {
UserRefObjectCo(TopWnd); UserRefObjectCo(TopWnd, &Ref);
Ret = co_IntMouseActivateWindow(TopWnd); Ret = co_IntMouseActivateWindow(TopWnd);
UserDerefObjectCo(TopWnd); UserDerefObjectCo(TopWnd);
@ -246,7 +248,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
if (!TopWindow) return FALSE; if (!TopWindow) return FALSE;
/* TMN: Check return valud from this function? */ /* TMN: Check return valud from this function? */
UserRefObjectCo(TopWindow); UserRefObjectCo(TopWindow, &Ref);
co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE); co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
@ -386,6 +388,7 @@ CLEANUP:
HWND STDCALL HWND STDCALL
NtUserSetActiveWindow(HWND hWnd) NtUserSetActiveWindow(HWND hWnd)
{ {
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(HWND); DECLARE_RETURN(HWND);
DPRINT("Enter NtUserSetActiveWindow(%x)\n", hWnd); DPRINT("Enter NtUserSetActiveWindow(%x)\n", hWnd);
@ -412,7 +415,7 @@ NtUserSetActiveWindow(HWND hWnd)
RETURN( 0); RETURN( 0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
hWndPrev = co_IntSetActiveWindow(Window); hWndPrev = co_IntSetActiveWindow(Window);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -503,6 +506,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
PUSER_MESSAGE_QUEUE ThreadQueue; PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev; HWND hWndPrev;
PWINDOW_OBJECT TopWnd; PWINDOW_OBJECT TopWnd;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
@ -523,7 +527,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
if (TopWnd && TopWnd->hSelf != UserGetActiveWindow()) if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
{ {
// PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop); // PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
UserRefObjectCo(TopWnd); UserRefObjectCo(TopWnd, &Ref);
co_IntSetActiveWindow(TopWnd); co_IntSetActiveWindow(TopWnd);
UserDerefObjectCo(TopWnd); UserDerefObjectCo(TopWnd);
} }
@ -547,6 +551,7 @@ HWND STDCALL
NtUserSetFocus(HWND hWnd) NtUserSetFocus(HWND hWnd)
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(HWND); DECLARE_RETURN(HWND);
HWND ret; HWND ret;
@ -558,7 +563,7 @@ NtUserSetFocus(HWND hWnd)
RETURN(NULL); RETURN(NULL);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ret = co_UserSetFocus(Window); ret = co_UserSetFocus(Window);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);

View file

@ -547,6 +547,7 @@ BOOL FASTCALL
co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *HitTest, BOOL Remove) co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *HitTest, BOOL Remove)
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
USER_REFERENCE_ENTRY Ref, DesktopRef;
if(!(Window = UserGetWindowObject(Msg->hwnd))) if(!(Window = UserGetWindowObject(Msg->hwnd)))
{ {
@ -554,7 +555,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
return TRUE; return TRUE;
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
if(ThreadQueue == Window->MessageQueue && if(ThreadQueue == Window->MessageQueue &&
ThreadQueue->CaptureWindow != Window->hSelf) ThreadQueue->CaptureWindow != Window->hSelf)
@ -572,7 +573,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
{ {
PWINDOW_OBJECT Wnd; PWINDOW_OBJECT Wnd;
UserRefObjectCo(DesktopWindow); UserRefObjectCo(DesktopWindow, &DesktopRef);
co_WinPosWindowFromPoint(DesktopWindow, Window->MessageQueue, &Msg->pt, &Wnd); co_WinPosWindowFromPoint(DesktopWindow, Window->MessageQueue, &Msg->pt, &Wnd);
if(Wnd) if(Wnd)
@ -664,6 +665,7 @@ co_IntPeekMessage(PUSER_MESSAGE Msg,
PUSER_MESSAGE_QUEUE ThreadQueue; PUSER_MESSAGE_QUEUE ThreadQueue;
PUSER_MESSAGE Message; PUSER_MESSAGE Message;
BOOL Present, RemoveMessages; BOOL Present, RemoveMessages;
USER_REFERENCE_ENTRY Ref;
/* The queues and order in which they are checked are documented in the MSDN /* The queues and order in which they are checked are documented in the MSDN
article on GetMessage() */ article on GetMessage() */
@ -772,7 +774,7 @@ MessageFound:
{ {
USHORT HitTest; USHORT HitTest;
UserRefObjectCo(MsgWindow); UserRefObjectCo(MsgWindow, &Ref);
if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE)) if(co_IntTranslateMouseMessage(ThreadQueue, &Msg->Msg, &HitTest, TRUE))
/* FIXME - check message filter again, if the message doesn't match anymore, /* FIXME - check message filter again, if the message doesn't match anymore,
@ -972,6 +974,7 @@ NtUserGetMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
UINT Size; UINT Size;
USER_MESSAGE Msg; USER_MESSAGE Msg;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
// USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserGetMessage\n"); DPRINT("Enter NtUserGetMessage\n");
UserEnterExclusive(); UserEnterExclusive();
@ -982,7 +985,7 @@ NtUserGetMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
RETURN(-1); RETURN(-1);
} }
// if (Window) UserRefObjectCo(Window); // if (Window) UserRefObjectCo(Window, &Ref);
if (MsgFilterMax < MsgFilterMin) if (MsgFilterMax < MsgFilterMin)
{ {
@ -1357,6 +1360,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd,
LPARAM lParamPacked; LPARAM lParamPacked;
PW32THREAD Win32Thread; PW32THREAD Win32Thread;
DECLARE_RETURN(LRESULT); DECLARE_RETURN(LRESULT);
USER_REFERENCE_ENTRY Ref;
/* FIXME: Call hooks. */ /* FIXME: Call hooks. */
if (!(Window = UserGetWindowObject(hWnd))) if (!(Window = UserGetWindowObject(hWnd)))
@ -1364,7 +1368,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd,
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Win32Thread = PsGetWin32Thread(); Win32Thread = PsGetWin32Thread();

View file

@ -689,6 +689,7 @@ NtUserCallHwndLock(
{ {
BOOL Ret = 0; BOOL Ret = 0;
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOLEAN); DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserCallHwndLock\n"); DPRINT("Enter NtUserCallHwndLock\n");
@ -698,7 +699,7 @@ NtUserCallHwndLock(
{ {
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
/* FIXME: Routine can be 0x53 - 0x5E */ /* FIXME: Routine can be 0x53 - 0x5E */
switch (Routine) switch (Routine)

View file

@ -477,6 +477,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
PVOID WaitObjects[2]; PVOID WaitObjects[2];
NTSTATUS WaitStatus; NTSTATUS WaitStatus;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
if( !IntGetScreenDC() || if( !IntGetScreenDC() ||
PsGetWin32Thread()->MessageQueue == W32kGetPrimitiveMessageQueue() ) PsGetWin32Thread()->MessageQueue == W32kGetPrimitiveMessageQueue() )
@ -504,7 +505,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd,
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if (DesktopWindow) UserRefObjectCo(DesktopWindow);//can DesktopWindow be NULL? if (DesktopWindow) UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
/* Process messages in the message queue itself. */ /* Process messages in the message queue itself. */
IntLockHardwareMessageQueue(MessageQueue); IntLockHardwareMessageQueue(MessageQueue);

View file

@ -295,7 +295,8 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags)
Window = UserGetWindowObject(*phWnd); Window = UserGetWindowObject(*phWnd);
if (Window && (Window->Style & WS_VISIBLE)) if (Window && (Window->Style & WS_VISIBLE))
{ {
UserRefObjectCo(Window); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
co_IntPaintWindows(Window, Flags); co_IntPaintWindows(Window, Flags);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
} }
@ -722,6 +723,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
PROSRGNDATA Rgn; PROSRGNDATA Rgn;
NTSTATUS Status; NTSTATUS Status;
DECLARE_RETURN(HDC); DECLARE_RETURN(HDC);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserBeginPaint\n"); DPRINT("Enter NtUserBeginPaint\n");
UserEnterExclusive(); UserEnterExclusive();
@ -731,7 +733,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
RETURN( NULL); RETURN( NULL);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
co_UserHideCaret(Window); co_UserHideCaret(Window);
@ -828,6 +830,7 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserEndPaint\n"); DPRINT("Enter NtUserEndPaint\n");
UserEnterExclusive(); UserEnterExclusive();
@ -839,7 +842,7 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
UserReleaseDC(Window, lPs->hdc, TRUE); UserReleaseDC(Window, lPs->hdc, TRUE);
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
co_UserShowCaret(Window); co_UserShowCaret(Window);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -894,6 +897,7 @@ NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
DECLARE_RETURN(INT); DECLARE_RETURN(INT);
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
INT ret; INT ret;
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserGetUpdateRgn\n"); DPRINT("Enter NtUserGetUpdateRgn\n");
UserEnterExclusive(); UserEnterExclusive();
@ -903,7 +907,7 @@ NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
RETURN(ERROR); RETURN(ERROR);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ret = co_UserGetUpdateRgn(Window, hRgn, bErase); ret = co_UserGetUpdateRgn(Window, hRgn, bErase);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -975,7 +979,8 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
if (bErase && !IntGdiIsEmptyRect(&Rect)) if (bErase && !IntGdiIsEmptyRect(&Rect))
{ {
UserRefObjectCo(Window); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
co_UserRedrawWindow(Window, NULL, NULL, RDW_ERASENOW | RDW_NOCHILDREN); co_UserRedrawWindow(Window, NULL, NULL, RDW_ERASENOW | RDW_NOCHILDREN);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
} }
@ -1013,6 +1018,7 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
NTSTATUS Status; NTSTATUS Status;
PWINDOW_OBJECT Wnd; PWINDOW_OBJECT Wnd;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserRedrawWindow\n"); DPRINT("Enter NtUserRedrawWindow\n");
UserEnterExclusive(); UserEnterExclusive();
@ -1034,7 +1040,7 @@ NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
} }
} }
UserRefObjectCo(Wnd); UserRefObjectCo(Wnd, &Ref);
Status = co_UserRedrawWindow(Wnd, NULL == lprcUpdate ? NULL : &SafeUpdateRect, Status = co_UserRedrawWindow(Wnd, NULL == lprcUpdate ? NULL : &SafeUpdateRect,
hrgnUpdate, flags); hrgnUpdate, flags);
@ -1206,6 +1212,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
BOOL bOwnRgn = TRUE; BOOL bOwnRgn = TRUE;
NTSTATUS Status; NTSTATUS Status;
DECLARE_RETURN(DWORD); DECLARE_RETURN(DWORD);
USER_REFERENCE_ENTRY Ref, CaretRef;
DPRINT("Enter NtUserScrollWindowEx\n"); DPRINT("Enter NtUserScrollWindowEx\n");
UserEnterExclusive(); UserEnterExclusive();
@ -1216,7 +1223,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
Window = NULL; /* prevent deref at cleanup */ Window = NULL; /* prevent deref at cleanup */
RETURN( ERROR); RETURN( ERROR);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
IntGetClientRect(Window, &rc); IntGetClientRect(Window, &rc);
@ -1292,6 +1299,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
RECT r, dummy; RECT r, dummy;
POINT ClientOrigin; POINT ClientOrigin;
PWINDOW_OBJECT Wnd; PWINDOW_OBJECT Wnd;
USER_REFERENCE_ENTRY WndRef;
IntGetClientOrigin(Window, &ClientOrigin); IntGetClientOrigin(Window, &ClientOrigin);
for (i = 0; List[i]; i++) for (i = 0; List[i]; i++)
@ -1307,7 +1315,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
if (! UnsafeRect || IntGdiIntersectRect(&dummy, &r, &rc)) if (! UnsafeRect || IntGdiIntersectRect(&dummy, &r, &rc))
{ {
UserRefObjectCo(Wnd); UserRefObjectCo(Wnd, &WndRef);
co_WinPosSetWindowPos(Wnd, 0, r.left + dx, r.top + dy, 0, 0, co_WinPosSetWindowPos(Wnd, 0, r.left + dx, r.top + dy, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
SWP_NOREDRAW); SWP_NOREDRAW);
@ -1329,7 +1337,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *UnsafeRect,
if ((CaretWnd = UserGetWindowObject(hwndCaret))) if ((CaretWnd = UserGetWindowObject(hwndCaret)))
{ {
UserRefObjectCo(CaretWnd); UserRefObjectCo(CaretWnd, &CaretRef);
co_IntSetCaretPos(caretrc.left + dx, caretrc.top + dy); co_IntSetCaretPos(caretrc.left + dx, caretrc.top + dy);
co_UserShowCaret(CaretWnd); co_UserShowCaret(CaretWnd);

View file

@ -548,6 +548,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
BOOL Ret; BOOL Ret;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserGetScrollBarInfo\n"); DPRINT("Enter NtUserGetScrollBarInfo\n");
UserEnterExclusive(); UserEnterExclusive();
@ -564,7 +565,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi); Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -595,6 +596,7 @@ NtUserGetScrollInfo(HWND hWnd, int fnBar, LPSCROLLINFO lpsi)
DWORD sz; DWORD sz;
BOOL Ret; BOOL Ret;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserGetScrollInfo\n"); DPRINT("Enter NtUserGetScrollInfo\n");
UserEnterExclusive(); UserEnterExclusive();
@ -619,7 +621,7 @@ NtUserGetScrollInfo(HWND hWnd, int fnBar, LPSCROLLINFO lpsi)
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Ret = co_IntGetScrollInfo(Window, fnBar, &psi); Ret = co_IntGetScrollInfo(Window, fnBar, &psi);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -650,6 +652,7 @@ NtUserEnableScrollBar(
PSCROLLBARINFO InfoV = NULL, InfoH = NULL; PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
BOOL Chg = FALSE; BOOL Chg = FALSE;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserEnableScrollBar\n"); DPRINT("Enter NtUserEnableScrollBar\n");
UserEnterExclusive(); UserEnterExclusive();
@ -658,7 +661,7 @@ NtUserEnableScrollBar(
{ {
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
if(wSBflags == SB_CTL) if(wSBflags == SB_CTL)
{ {
@ -732,6 +735,7 @@ NtUserSetScrollBarInfo(
NTSTATUS Status; NTSTATUS Status;
LONG Obj; LONG Obj;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserSetScrollBarInfo\n"); DPRINT("Enter NtUserSetScrollBarInfo\n");
UserEnterExclusive(); UserEnterExclusive();
@ -740,7 +744,7 @@ NtUserSetScrollBarInfo(
{ {
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Obj = SBOBJ_TO_SBID(idObject); Obj = SBOBJ_TO_SBID(idObject);
if(!SBID_IS_VALID(Obj)) if(!SBID_IS_VALID(Obj))
@ -792,6 +796,7 @@ NtUserSetScrollInfo(
NTSTATUS Status; NTSTATUS Status;
SCROLLINFO ScrollInfo; SCROLLINFO ScrollInfo;
DECLARE_RETURN(DWORD); DECLARE_RETURN(DWORD);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserSetScrollInfo\n"); DPRINT("Enter NtUserSetScrollInfo\n");
UserEnterExclusive(); UserEnterExclusive();
@ -800,7 +805,7 @@ NtUserSetScrollInfo(
{ {
RETURN( 0); RETURN( 0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos)); Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
if(!NT_SUCCESS(Status)) if(!NT_SUCCESS(Status))
@ -892,6 +897,7 @@ NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
DECLARE_RETURN(DWORD); DECLARE_RETURN(DWORD);
DWORD ret; DWORD ret;
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserShowScrollBar\n"); DPRINT("Enter NtUserShowScrollBar\n");
UserEnterExclusive(); UserEnterExclusive();
@ -901,7 +907,7 @@ NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
RETURN(0); RETURN(0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ret = co_UserShowScrollBar(Window, wBar, bShow); ret = co_UserShowScrollBar(Window, wBar, bShow);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);

View file

@ -151,6 +151,7 @@ co_VIS_WindowLayoutChanged(
{ {
HRGN Temp; HRGN Temp;
PWINDOW_OBJECT Parent; PWINDOW_OBJECT Parent;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
@ -164,7 +165,7 @@ co_VIS_WindowLayoutChanged(
Window->WindowRect.left - Parent->ClientRect.left, Window->WindowRect.left - Parent->ClientRect.left,
Window->WindowRect.top - Parent->ClientRect.top); Window->WindowRect.top - Parent->ClientRect.top);
UserRefObjectCo(Parent); UserRefObjectCo(Parent, &Ref);
co_UserRedrawWindow(Parent, NULL, Temp, co_UserRedrawWindow(Parent, NULL, Temp,
RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_INVALIDATE |
RDW_ALLCHILDREN); RDW_ALLCHILDREN);

View file

@ -239,7 +239,8 @@ static void IntSendDestroyMsg(HWND hWnd)
Window = UserGetWindowObject(hWnd); Window = UserGetWindowObject(hWnd);
if (Window) if (Window)
{ {
// UserRefObjectCo(Window); // USER_REFERENCE_ENTRY Ref;
// UserRefObjectCo(Window, &Ref);
if (!IntGetOwner(Window) && !IntGetParent(Window)) if (!IntGetOwner(Window) && !IntGetParent(Window))
{ {
@ -569,7 +570,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
PW32THREAD WThread; PW32THREAD WThread;
PLIST_ENTRY Current; PLIST_ENTRY Current;
PWINDOW_OBJECT Wnd; PWINDOW_OBJECT Wnd;
USER_REFERENCE_ENTRY Ref;
WThread = Thread->Tcb.Win32Thread; WThread = Thread->Tcb.Win32Thread;
while (!IsListEmpty(&WThread->WindowListHead)) while (!IsListEmpty(&WThread->WindowListHead))
@ -588,7 +589,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
//ASSERT(co_UserDestroyWindow(Wnd)); //ASSERT(co_UserDestroyWindow(Wnd));
UserRefObjectCo(Wnd);//faxme: temp hack?? UserRefObjectCo(Wnd, &Ref);//faxme: temp hack??
if (!co_UserDestroyWindow(Wnd)) if (!co_UserDestroyWindow(Wnd))
{ {
DPRINT1("Unable to destroy window 0x%x at thread cleanup... This is _VERY_ bad!\n", Wnd); DPRINT1("Unable to destroy window 0x%x at thread cleanup... This is _VERY_ bad!\n", Wnd);
@ -1355,6 +1356,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
BOOL MenuChanged; BOOL MenuChanged;
DECLARE_RETURN(HWND); DECLARE_RETURN(HWND);
BOOL HasOwner; BOOL HasOwner;
USER_REFERENCE_ENTRY ParentRef, Ref;
ParentWindowHandle = PsGetWin32Thread()->Desktop->DesktopWindow; ParentWindowHandle = PsGetWin32Thread()->Desktop->DesktopWindow;
OwnerWindowHandle = NULL; OwnerWindowHandle = NULL;
@ -1388,7 +1390,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
// { // {
ParentWindow = UserGetWindowObject(ParentWindowHandle); ParentWindow = UserGetWindowObject(ParentWindowHandle);
if (ParentWindow) UserRefObjectCo(ParentWindow); if (ParentWindow) UserRefObjectCo(ParentWindow, &ParentRef);
// } // }
// else // else
// { // {
@ -1441,7 +1443,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
RETURN( (HWND)0); RETURN( (HWND)0);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ObDereferenceObject(WinSta); ObDereferenceObject(WinSta);
@ -2118,8 +2120,8 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
if (IntWndBelongsToThread(Child, PsGetWin32Thread())) if (IntWndBelongsToThread(Child, PsGetWin32Thread()))
{ {
USER_REFERENCE_ENTRY ChildRef;
UserRefObjectCo(Child);//temp hack? UserRefObjectCo(Child, &ChildRef);//temp hack?
co_UserDestroyWindow(Child); co_UserDestroyWindow(Child);
UserDerefObjectCo(Child);//temp hack? UserDerefObjectCo(Child);//temp hack?
@ -2165,6 +2167,7 @@ NtUserDestroyWindow(HWND Wnd)
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
DECLARE_RETURN(BOOLEAN); DECLARE_RETURN(BOOLEAN);
BOOLEAN ret; BOOLEAN ret;
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserDestroyWindow\n"); DPRINT("Enter NtUserDestroyWindow\n");
UserEnterExclusive(); UserEnterExclusive();
@ -2174,7 +2177,7 @@ NtUserDestroyWindow(HWND Wnd)
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window);//faxme: dunno if win should be reffed during destroy.. UserRefObjectCo(Window, &Ref);//faxme: dunno if win should be reffed during destroy..
ret = co_UserDestroyWindow(Window); ret = co_UserDestroyWindow(Window);
UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy.. UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
@ -2778,6 +2781,7 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
{ {
PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent; PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent;
HWND hWndOldParent = NULL; HWND hWndOldParent = NULL;
USER_REFERENCE_ENTRY Ref, ParentRef;
if (IntIsBroadcastHwnd(hWndChild) || IntIsBroadcastHwnd(hWndNewParent)) if (IntIsBroadcastHwnd(hWndChild) || IntIsBroadcastHwnd(hWndNewParent))
{ {
@ -2811,8 +2815,8 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
return( NULL); return( NULL);
} }
UserRefObjectCo(Wnd); UserRefObjectCo(Wnd, &Ref);
UserRefObjectCo(WndParent); UserRefObjectCo(WndParent, &ParentRef);
WndOldParent = co_IntSetParent(Wnd, WndParent); WndOldParent = co_IntSetParent(Wnd, WndParent);
@ -2930,6 +2934,7 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
PWINSTATION_OBJECT WinStaObject; PWINSTATION_OBJECT WinStaObject;
PWINDOW_OBJECT WndShell; PWINDOW_OBJECT WndShell;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserSetShellWindowEx\n"); DPRINT("Enter NtUserSetShellWindowEx\n");
UserEnterExclusive(); UserEnterExclusive();
@ -2985,7 +2990,7 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(WndShell); UserRefObjectCo(WndShell, &Ref);
co_WinPosSetWindowPos(WndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); co_WinPosSetWindowPos(WndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
WinStaObject->ShellWindow = hwndShell; WinStaObject->ShellWindow = hwndShell;
@ -3876,7 +3881,9 @@ NtUserSetMenu(
if (Changed && Repaint) if (Changed && Repaint)
{ {
UserRefObjectCo(Window); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED); SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
@ -3917,6 +3924,7 @@ NtUserSetWindowPlacement(HWND hWnd,
WINDOWPLACEMENT Safepl; WINDOWPLACEMENT Safepl;
NTSTATUS Status; NTSTATUS Status;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserSetWindowPlacement\n"); DPRINT("Enter NtUserSetWindowPlacement\n");
UserEnterExclusive(); UserEnterExclusive();
@ -3936,7 +3944,7 @@ NtUserSetWindowPlacement(HWND hWnd,
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
if ((Window->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0) if ((Window->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
{ {
@ -3982,6 +3990,7 @@ NtUserSetWindowPos(
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
BOOL ret; BOOL ret;
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserSetWindowPos\n"); DPRINT("Enter NtUserSetWindowPos\n");
UserEnterExclusive(); UserEnterExclusive();
@ -3991,7 +4000,7 @@ NtUserSetWindowPos(
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags); ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -4114,7 +4123,8 @@ NtUserSetWindowRgn(
if(bRedraw) if(bRedraw)
{ {
UserRefObjectCo(Window); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE); co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
} }
@ -4137,6 +4147,7 @@ NtUserShowWindow(HWND hWnd, LONG nCmdShow)
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window;
BOOL ret; BOOL ret;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserShowWindow\n"); DPRINT("Enter NtUserShowWindow\n");
UserEnterExclusive(); UserEnterExclusive();
@ -4146,7 +4157,7 @@ NtUserShowWindow(HWND hWnd, LONG nCmdShow)
RETURN(FALSE); RETURN(FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
ret = co_WinPosShowWindow(Window, nCmdShow); ret = co_WinPosShowWindow(Window, nCmdShow);
UserDerefObjectCo(Window); UserDerefObjectCo(Window);
@ -4206,6 +4217,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
HWND Ret; HWND Ret;
PWINDOW_OBJECT DesktopWindow = NULL, Window = NULL; PWINDOW_OBJECT DesktopWindow = NULL, Window = NULL;
DECLARE_RETURN(HWND); DECLARE_RETURN(HWND);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserWindowFromPoint\n"); DPRINT("Enter NtUserWindowFromPoint\n");
UserEnterExclusive(); UserEnterExclusive();
@ -4219,7 +4231,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
//hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window //hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window
//its possible this referencing is useless, thou it shouldnt hurt... //its possible this referencing is useless, thou it shouldnt hurt...
UserRefObjectCo(DesktopWindow); UserRefObjectCo(DesktopWindow, &Ref);
Hit = co_WinPosWindowFromPoint(DesktopWindow, PsGetWin32Thread()->MessageQueue, &pt, &Window); Hit = co_WinPosWindowFromPoint(DesktopWindow, PsGetWin32Thread()->MessageQueue, &pt, &Window);

View file

@ -149,6 +149,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
{ {
PWINDOW_OBJECT WndTo = NULL; PWINDOW_OBJECT WndTo = NULL;
HWND Fg; HWND Fg;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
@ -176,7 +177,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
done: done:
if (WndTo) UserRefObjectCo(WndTo); if (WndTo) UserRefObjectCo(WndTo, &Ref);
Fg = UserGetForegroundWindow(); Fg = UserGetForegroundWindow();
if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL?? if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL??
@ -224,7 +225,8 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
if((WndChild->Style & WS_MINIMIZE) != 0 ) if((WndChild->Style & WS_MINIMIZE) != 0 )
{ {
UserRefObjectCo(WndChild); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(WndChild, &Ref);
co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER), co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER),
y - yspacing - UserGetSystemMetrics(SM_CYBORDER) y - yspacing - UserGetSystemMetrics(SM_CYBORDER)
@ -709,7 +711,8 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
if ((Wnd->Style & WS_POPUP) && if ((Wnd->Style & WS_POPUP) &&
UserGetWindow(List[i], GW_OWNER) == hWnd) UserGetWindow(List[i], GW_OWNER) == hWnd)
{ {
UserRefObjectCo(Wnd); USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Wnd, &Ref);
co_WinPosSetWindowPos(Wnd, hWndInsertAfter, 0, 0, 0, 0, co_WinPosSetWindowPos(Wnd, hWndInsertAfter, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
@ -1530,6 +1533,7 @@ co_WinPosSearchChildren(
{ {
PWINDOW_OBJECT Current; PWINDOW_OBJECT Current;
HWND *List, *phWnd; HWND *List, *phWnd;
USER_REFERENCE_ENTRY Ref;
ASSERT_REFS_CO(ScopeWin); ASSERT_REFS_CO(ScopeWin);
@ -1572,7 +1576,7 @@ co_WinPosSearchChildren(
break; break;
} }
UserRefObjectCo(Current); UserRefObjectCo(Current, &Ref);
if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests)) if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests))
{ {
@ -1657,6 +1661,7 @@ NtUserGetMinMaxInfo(
MINMAXINFO SafeMinMax; MINMAXINFO SafeMinMax;
NTSTATUS Status; NTSTATUS Status;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
DPRINT("Enter NtUserGetMinMaxInfo\n"); DPRINT("Enter NtUserGetMinMaxInfo\n");
UserEnterExclusive(); UserEnterExclusive();
@ -1666,7 +1671,7 @@ NtUserGetMinMaxInfo(
RETURN( FALSE); RETURN( FALSE);
} }
UserRefObjectCo(Window); UserRefObjectCo(Window, &Ref);
Size.x = Window->WindowRect.left; Size.x = Window->WindowRect.left;
Size.y = Window->WindowRect.top; Size.y = Window->WindowRect.top;

View file

@ -638,6 +638,7 @@ NtGdiUpdateColors(HDC hDC)
{ {
PWINDOW_OBJECT Wnd; PWINDOW_OBJECT Wnd;
BOOL calledFromUser, ret; BOOL calledFromUser, ret;
USER_REFERENCE_ENTRY Ref;
calledFromUser = UserIsEntered(); calledFromUser = UserIsEntered();
@ -657,7 +658,7 @@ NtGdiUpdateColors(HDC hDC)
return FALSE; return FALSE;
} }
UserRefObjectCo(Wnd); UserRefObjectCo(Wnd, &Ref);
ret = co_UserRedrawWindow(Wnd, NULL, 0, RDW_INVALIDATE); ret = co_UserRedrawWindow(Wnd, NULL, 0, RDW_INVALIDATE);
UserDerefObjectCo(Wnd); UserDerefObjectCo(Wnd);