Author: jimtabor
Date: Wed Aug 15 23:31:30 2012
New Revision: 57081
URL:
http://svn.reactos.org/svn/reactos?rev=57081&view=rev
Log:
[NtUser] - Use window object instead of handle.
Modified:
trunk/reactos/win32ss/user/ntuser/focus.c
trunk/reactos/win32ss/user/ntuser/input.c
trunk/reactos/win32ss/user/ntuser/misc.c
trunk/reactos/win32ss/user/ntuser/msgqueue.c
trunk/reactos/win32ss/user/ntuser/msgqueue.h
trunk/reactos/win32ss/user/ntuser/window.c
Modified: trunk/reactos/win32ss/user/ntuser/focus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/focus.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/focus.c [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -29,7 +29,7 @@
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 @@
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 @@
ThreadQueue->QF_flags &= ~QF_CAPTURELOCKED;
}
- ThreadQueue->CaptureWindow = hWnd;
+ ThreadQueue->spwndCapture = Window;
if (hWnd == NULL) // Release mode.
{
Modified: trunk/reactos/win32ss/user/ntuser/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/input.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/input.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/input.c [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -454,7 +454,6 @@
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 @@
ptiFrom->MessageQueue->CursorObject = NULL;
ptiFrom->MessageQueue->spwndActive = NULL;
ptiFrom->MessageQueue->spwndFocus = NULL;
+ ptiFrom->MessageQueue->spwndCapture = NULL;
ptiFrom->pqAttach = NULL;
ptiTo->MessageQueue->iCursorLevel -= ptiFrom->iCursorLevel;
}
Modified: trunk/reactos/win32ss/user/ntuser/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc.c…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/misc.c [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -360,7 +360,7 @@
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;
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -1343,10 +1343,11 @@
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 @@
RETURN(FALSE);
}
- if ((*RemoveMessages == FALSE) || MessageQueue->CaptureWindow)
+ if ((*RemoveMessages == FALSE) || MessageQueue->spwndCapture)
{
/* Accept the message */
msg->message = message;
@@ -2180,8 +2181,8 @@
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;
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.h [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -75,7 +75,6 @@
/* 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;
Modified: trunk/reactos/win32ss/user/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Wed Aug 15 23:31:30 2012
@@ -2430,8 +2430,8 @@
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