Author: mjmartin
Date: Fri Jul 2 10:49:11 2010
New Revision: 47924
URL:
http://svn.reactos.org/svn/reactos?rev=47924&view=rev
Log:
[win32k]
- Revert changes done in 47325 which partially broke mouse hooks.
- If the UserSetCursorPos is reached due to SetCursorPos, dont generate a mouse move
message or call mouse hooks.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
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] Fri Jul 2
10:49:11 2010
@@ -175,11 +175,10 @@
return hOldCursor;
}
-BOOL UserSetCursorPos( INT x, INT y, BOOL CallHooks)
+BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
{
PWINDOW_OBJECT DesktopWindow;
PSYSTEM_CURSORINFO CurInfo;
- MSLLHOOKSTRUCT MouseHookData;
HDC hDC;
MSG Msg;
@@ -225,44 +224,16 @@
//Move the mouse pointer
GreMovePointer(hDC, x, y);
+ if (!SendMouseMoveMsg)
+ return TRUE;
+
//Generate a mouse move message
Msg.message = WM_MOUSEMOVE;
Msg.wParam = CurInfo->ButtonsDown;
Msg.lParam = MAKELPARAM(x, y);
Msg.pt = gpsi->ptCursor;
-
- MouseHookData.pt.x = LOWORD(Msg.lParam);
- MouseHookData.pt.y = HIWORD(Msg.lParam);
- switch(Msg.message)
- {
- case WM_MOUSEWHEEL:
- MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg.wParam));
- break;
- case WM_XBUTTONDOWN:
- case WM_XBUTTONUP:
- case WM_XBUTTONDBLCLK:
- case WM_NCXBUTTONDOWN:
- case WM_NCXBUTTONUP:
- case WM_NCXBUTTONDBLCLK:
- MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg.wParam));
- break;
- default:
- MouseHookData.mouseData = 0;
- break;
- }
-
- MouseHookData.flags = 0;
- MouseHookData.time = Msg.time;
- MouseHookData.dwExtraInfo = 0;
-
- if (CallHooks)
- {
- /* 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 FALSE;
- }
-
MsqInsertSystemMessage(&Msg);
+
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] Fri Jul 2
10:49:11 2010
@@ -174,9 +174,39 @@
LARGE_INTEGER LargeTickCount;
KIRQL OldIrql;
ULONG Prev;
+ MSLLHOOKSTRUCT MouseHookData;
KeQueryTickCount(&LargeTickCount);
Msg->time = MsqCalculateMessageTime(&LargeTickCount);
+
+ MouseHookData.pt.x = LOWORD(Msg->lParam);
+ MouseHookData.pt.y = HIWORD(Msg->lParam);
+ switch(Msg->message)
+ {
+ case WM_MOUSEWHEEL:
+ MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg->wParam));
+ break;
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP:
+ case WM_XBUTTONDBLCLK:
+ case WM_NCXBUTTONDOWN:
+ case WM_NCXBUTTONUP:
+ case WM_NCXBUTTONDBLCLK:
+ MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg->wParam));
+ break;
+ default:
+ MouseHookData.mouseData = 0;
+ break;
+ }
+
+ MouseHookData.flags = 0;
+ MouseHookData.time = Msg->time;
+ MouseHookData.dwExtraInfo = 0;
+
+ /* 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 we got WM_MOUSEMOVE and there are already messages in the
* system message queue, check if the last message is mouse move