Author: jimtabor
Date: Sat Apr 9 20:32:52 2011
New Revision: 51305
URL:
http://svn.reactos.org/svn/reactos?rev=51305&view=rev
Log:
[Win32k]
- Revert parts of 51283, thanks to Giannis for setting me straight on SetCursorPos and
without breaking setting the Track window for TrackMouseEvent. Pass the new SetCursorPos,
and wine test_TrackMouseEvent and input test_mouse_ll_hook tests.
Modified:
trunk/reactos/subsystems/win32/win32k/include/cursoricon.h
trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
trunk/reactos/subsystems/win32/win32k/ntuser/input.c
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] Sat Apr 9
20:32:52 2011
@@ -69,7 +69,7 @@
INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon);
-BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo);
+BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook);
int UserShowCursor(BOOL bShow);
Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h [iso-8859-1] Sat Apr 9
20:32:52 2011
@@ -245,7 +245,7 @@
VOID FASTCALL
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam);
VOID FASTCALL
-co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo);
+co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook);
BOOL FASTCALL
MsqIsClkLck(LPMSG Msg, BOOL Remove);
BOOL FASTCALL
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Sat Apr 9
20:32:52 2011
@@ -159,7 +159,7 @@
return OldCursor;
}
-BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo)
+BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
{
PWND DesktopWindow;
PSYSTEM_CURSORINFO CurInfo;
@@ -194,12 +194,12 @@
pt.x = x;
pt.y = y;
- /* 3. Generate a mouse move message, this sets the htEx. */
+ /* 3. Generate a mouse move message, this sets the htEx and Track Window too. */
Msg.message = WM_MOUSEMOVE;
Msg.wParam = CurInfo->ButtonsDown;
Msg.lParam = MAKELPARAM(x, y);
Msg.pt = pt;
- co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, flags, dwExtraInfo, Hook);
/* 1. Store the new cursor position */
gpsi->ptCursor = pt;
@@ -677,7 +677,7 @@
{
CurInfo->bClipped = TRUE;
RECTL_bIntersectRect(&CurInfo->rcClip, prcl,
&DesktopWindow->rcWindow);
- UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, 0, 0);
+ UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, 0, 0, FALSE);
}
else
{
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Sat Apr 9 20:32:52
2011
@@ -1046,7 +1046,7 @@
ObDereferenceObject(Hook->Thread);
}
- if ( Global && !pti->sphkCurrent)
+ if ( Global )
{
PTHREADINFO ptiHook;
@@ -1061,7 +1061,6 @@
* hook ID, this will have to post to each of the thread message queues
* or make a direct call.
*/
- pti->sphkCurrent = Hook; // Prevent recursion within this thread.
do
{
/* Hook->Thread is null, we hax around this with Hook->head.pti. */
@@ -1109,7 +1108,6 @@
}
while ( Hook );
DPRINT("Ret: Global HookId %d Result 0x%x\n", HookId,Result);
- pti->sphkCurrent = NULL;
}
Exit:
return Result;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/input.c [iso-8859-1] Sat Apr 9 20:32:52
2011
@@ -1138,7 +1138,7 @@
if(mi->dwFlags & MOUSEEVENTF_MOVE)
{
- UserSetCursorPos(MousePos.x, MousePos.y, Injected, mi->dwExtraInfo);
+ UserSetCursorPos(MousePos.x, MousePos.y, Injected, mi->dwExtraInfo, TRUE);
}
if(mi->dwFlags & MOUSEEVENTF_LEFTDOWN)
{
@@ -1146,7 +1146,7 @@
Msg.message = SwapBtnMsg[0][SwapButtons];
CurInfo->ButtonsDown |= SwapBtn[SwapButtons];
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
else if(mi->dwFlags & MOUSEEVENTF_LEFTUP)
{
@@ -1154,7 +1154,7 @@
Msg.message = SwapBtnMsg[1][SwapButtons];
CurInfo->ButtonsDown &= ~SwapBtn[SwapButtons];
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
if(mi->dwFlags & MOUSEEVENTF_MIDDLEDOWN)
{
@@ -1162,7 +1162,7 @@
Msg.message = WM_MBUTTONDOWN;
CurInfo->ButtonsDown |= MK_MBUTTON;
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
else if(mi->dwFlags & MOUSEEVENTF_MIDDLEUP)
{
@@ -1170,7 +1170,7 @@
Msg.message = WM_MBUTTONUP;
CurInfo->ButtonsDown &= ~MK_MBUTTON;
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
if(mi->dwFlags & MOUSEEVENTF_RIGHTDOWN)
{
@@ -1178,7 +1178,7 @@
Msg.message = SwapBtnMsg[0][!SwapButtons];
CurInfo->ButtonsDown |= SwapBtn[!SwapButtons];
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
else if(mi->dwFlags & MOUSEEVENTF_RIGHTUP)
{
@@ -1186,7 +1186,7 @@
Msg.message = SwapBtnMsg[1][!SwapButtons];
CurInfo->ButtonsDown &= ~SwapBtn[!SwapButtons];
Msg.wParam |= CurInfo->ButtonsDown;
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
if((mi->dwFlags & (MOUSEEVENTF_XDOWN | MOUSEEVENTF_XUP)) &&
@@ -1204,14 +1204,14 @@
gQueueKeyStateTable[VK_XBUTTON1] |= 0xc0;
CurInfo->ButtonsDown |= MK_XBUTTON1;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1);
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
if(mi->mouseData & XBUTTON2)
{
gQueueKeyStateTable[VK_XBUTTON2] |= 0xc0;
CurInfo->ButtonsDown |= MK_XBUTTON2;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2);
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
}
else if(mi->dwFlags & MOUSEEVENTF_XUP)
@@ -1222,21 +1222,21 @@
gQueueKeyStateTable[VK_XBUTTON1] &= ~0x80;
CurInfo->ButtonsDown &= ~MK_XBUTTON1;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1);
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
if(mi->mouseData & XBUTTON2)
{
gQueueKeyStateTable[VK_XBUTTON2] &= ~0x80;
CurInfo->ButtonsDown &= ~MK_XBUTTON2;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2);
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
}
if(mi->dwFlags & MOUSEEVENTF_WHEEL)
{
Msg.message = WM_MOUSEWHEEL;
Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, mi->mouseData);
- co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo);
+ co_MsqInsertMouseMessage(&Msg, Injected, mi->dwExtraInfo, TRUE);
}
return TRUE;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Sat Apr 9
20:32:52 2011
@@ -291,7 +291,7 @@
}
VOID FASTCALL
-co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo)
+co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
{
LARGE_INTEGER LargeTickCount;
MSLLHOOKSTRUCT MouseHookData;
@@ -326,8 +326,11 @@
MouseHookData.dwExtraInfo = dwExtraInfo;
/* If the hook procedure returned non zero, dont send the message */
- if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM)
&MouseHookData))
- return;
+ if (Hook)
+ {
+ if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM)
&MouseHookData))
+ return;
+ }
/* Get the desktop window */
pwndDesktop = UserGetDesktopWindow();
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Sat Apr 9
20:32:52 2011
@@ -473,7 +473,7 @@
RETURN( (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2));
case TWOPARAM_ROUTINE_SETCURSORPOS:
- RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0));
+ RETURN( (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE));
case TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK:
RETURN( IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2));