[NtUser] - Use window object instead of handle.

svn path=/trunk/; revision=57081
This commit is contained in:
James Tabor 2012-08-15 23:31:30 +00:00
parent 0aebbd328d
commit 92544fb525
6 changed files with 13 additions and 13 deletions

View file

@ -29,7 +29,7 @@ HWND FASTCALL
IntGetCaptureWindow(VOID)
{
PUSER_MESSAGE_QUEUE ForegroundQueue = IntGetFocusMessageQueue();
return ForegroundQueue != NULL ? ForegroundQueue->CaptureWindow : 0;
return ( ForegroundQueue ? (ForegroundQueue->spwndCapture ? UserHMGetHandle(ForegroundQueue->spwndCapture) : 0) : 0);
}
HWND FASTCALL
@ -655,7 +655,7 @@ IntGetCapture(VOID)
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
RETURN( ThreadQueue ? ThreadQueue->CaptureWindow : 0);
RETURN( ThreadQueue ? (ThreadQueue->spwndCapture ? UserHMGetHandle(ThreadQueue->spwndCapture) : 0) : 0);
CLEANUP:
TRACE("Leave IntGetCapture, ret=%i\n",_ret_);
@ -705,7 +705,7 @@ co_UserSetCapture(HWND hWnd)
ThreadQueue->QF_flags &= ~QF_CAPTURELOCKED;
}
ThreadQueue->CaptureWindow = hWnd;
ThreadQueue->spwndCapture = Window;
if (hWnd == NULL) // Release mode.
{

View file

@ -454,7 +454,6 @@ UserAttachThreadInput(PTHREADINFO ptiFrom, PTHREADINFO ptiTo, BOOL fAttach)
ptiFrom->MessageQueue->spwndActive = ptiFrom->pqAttach->spwndActive;
ptiFrom->MessageQueue->spwndFocus = ptiFrom->pqAttach->spwndFocus;
ptiFrom->MessageQueue->CursorObject = ptiFrom->pqAttach->CursorObject;
ptiFrom->MessageQueue->CaptureWindow = ptiFrom->pqAttach->CaptureWindow;
ptiFrom->MessageQueue->spwndCapture = ptiFrom->pqAttach->spwndCapture;
ptiFrom->MessageQueue->QF_flags ^= ((ptiFrom->MessageQueue->QF_flags ^ ptiFrom->pqAttach->QF_flags) & QF_CAPTURELOCKED);
ptiFrom->MessageQueue->CaretInfo = ptiFrom->pqAttach->CaretInfo;
@ -489,6 +488,7 @@ UserAttachThreadInput(PTHREADINFO ptiFrom, PTHREADINFO ptiTo, BOOL fAttach)
ptiFrom->MessageQueue->CursorObject = NULL;
ptiFrom->MessageQueue->spwndActive = NULL;
ptiFrom->MessageQueue->spwndFocus = NULL;
ptiFrom->MessageQueue->spwndCapture = NULL;
ptiFrom->pqAttach = NULL;
ptiTo->MessageQueue->iCursorLevel -= ptiFrom->iCursorLevel;
}

View file

@ -360,7 +360,7 @@ NtUserGetGUIThreadInfo(
SafeGui.hwndActive = MsgQueue->spwndActive ? UserHMGetHandle(MsgQueue->spwndActive) : 0;
SafeGui.hwndFocus = MsgQueue->spwndFocus ? UserHMGetHandle(MsgQueue->spwndFocus) : 0;
SafeGui.hwndCapture = MsgQueue->CaptureWindow;
SafeGui.hwndCapture = MsgQueue->spwndCapture ? UserHMGetHandle(MsgQueue->spwndCapture) : 0;
SafeGui.hwndMenuOwner = MsgQueue->MenuOwner;
SafeGui.hwndMoveSize = MsgQueue->MoveSize;
SafeGui.hwndCaret = CaretInfo->hWnd;

View file

@ -1343,10 +1343,11 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT
pDesk = pwndDesktop->head.rpdesk;
/* find the window to dispatch this mouse message to */
if (MessageQueue->CaptureWindow)
if (MessageQueue->spwndCapture)
{
hittest = HTCLIENT;
pwndMsg = IntGetWindowObject(MessageQueue->CaptureWindow);
pwndMsg = MessageQueue->spwndCapture;
if (pwndMsg) UserReferenceObject(pwndMsg);
}
else
{
@ -1521,7 +1522,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT
RETURN(FALSE);
}
if ((*RemoveMessages == FALSE) || MessageQueue->CaptureWindow)
if ((*RemoveMessages == FALSE) || MessageQueue->spwndCapture)
{
/* Accept the message */
msg->message = message;
@ -2180,8 +2181,8 @@ MsqSetStateWindow(PUSER_MESSAGE_QUEUE MessageQueue, ULONG Type, HWND hWnd)
switch(Type)
{
case MSQ_STATE_CAPTURE:
Prev = MessageQueue->CaptureWindow;
MessageQueue->CaptureWindow = hWnd;
Prev = MessageQueue->spwndCapture ? UserHMGetHandle(MessageQueue->spwndCapture) : 0;
MessageQueue->spwndCapture = UserGetWindowObject(hWnd);
return Prev;
case MSQ_STATE_ACTIVE:
Prev = MessageQueue->spwndActive ? UserHMGetHandle(MessageQueue->spwndActive) : 0;

View file

@ -75,7 +75,6 @@ typedef struct _USER_MESSAGE_QUEUE
/* Last time PeekMessage() was called. */
ULONG LastMsgRead;
/* Current capture window for this queue. */
HWND CaptureWindow;
PWND spwndCapture;
/* Current window with focus (ie. receives keyboard input) for this queue. */
PWND spwndFocus;

View file

@ -2430,8 +2430,8 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
Window->head.pti->MessageQueue->spwndFocus = NULL;
if (Window->head.pti->MessageQueue->spwndActivePrev == Window)
Window->head.pti->MessageQueue->spwndActivePrev = NULL;
if (Window->head.pti->MessageQueue->CaptureWindow == Window->head.h)
Window->head.pti->MessageQueue->CaptureWindow = NULL;
if (Window->head.pti->MessageQueue->spwndCapture == Window)
Window->head.pti->MessageQueue->spwndCapture = NULL;
/*
* Check if this window is the Shell's Desktop Window. If so set hShellWindow to NULL