mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 19:43:33 +00:00
[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. svn path=/trunk/; revision=51305
This commit is contained in:
parent
36147ed99d
commit
86153cc8a8
7 changed files with 26 additions and 25 deletions
|
@ -69,7 +69,7 @@ BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxW
|
|||
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);
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|||
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
|
||||
|
|
|
@ -159,7 +159,7 @@ UserSetCursor(
|
|||
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 @@ BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo)
|
|||
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 @@ UserClipCursor(
|
|||
{
|
||||
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
|
||||
{
|
||||
|
|
|
@ -1046,7 +1046,7 @@ co_HOOK_CallHooks( INT HookId,
|
|||
ObDereferenceObject(Hook->Thread);
|
||||
}
|
||||
|
||||
if ( Global && !pti->sphkCurrent)
|
||||
if ( Global )
|
||||
{
|
||||
PTHREADINFO ptiHook;
|
||||
|
||||
|
@ -1061,7 +1061,6 @@ co_HOOK_CallHooks( INT HookId,
|
|||
* 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 @@ co_HOOK_CallHooks( INT HookId,
|
|||
}
|
||||
while ( Hook );
|
||||
DPRINT("Ret: Global HookId %d Result 0x%x\n", HookId,Result);
|
||||
pti->sphkCurrent = NULL;
|
||||
}
|
||||
Exit:
|
||||
return Result;
|
||||
|
|
|
@ -1138,7 +1138,7 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
|
||||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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 @@ IntMouseInput(MOUSEINPUT *mi, BOOL Injected)
|
|||
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;
|
||||
|
|
|
@ -291,7 +291,7 @@ MsqPostMouseMove(PUSER_MESSAGE_QUEUE MessageQueue, MSG* Msg)
|
|||
}
|
||||
|
||||
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 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo)
|
|||
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();
|
||||
|
|
|
@ -473,7 +473,7 @@ NtUserCallTwoParam(
|
|||
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue