From fc462652f0d04b9838c25df05cf8335d69ef2884 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Wed, 31 Oct 2012 14:55:23 +0000 Subject: [PATCH] [win32k] - Use ONEPARAM_ROUTINE_GETCURSORPOS instead of ONEPARAM_ROUTINE_GETCURSORPOSITION in GetCursorPos - Correctly check if the current thread belongs to the active desktop svn path=/trunk/; revision=57657 --- reactos/win32ss/include/ntuser.h | 1 - reactos/win32ss/user/ntuser/desktop.c | 6 ++--- reactos/win32ss/user/ntuser/simplecall.c | 22 ++----------------- .../win32ss/user/user32/include/ntwrapper.h | 2 +- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/reactos/win32ss/include/ntuser.h b/reactos/win32ss/include/ntuser.h index 7c6d5a40f98..84f315b0e88 100644 --- a/reactos/win32ss/include/ntuser.h +++ b/reactos/win32ss/include/ntuser.h @@ -3251,7 +3251,6 @@ typedef struct tagKMDDELPARAM #define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0xfffe0008 #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e -#define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM routine ? #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052 #define MSQ_STATE_CAPTURE 0x1 diff --git a/reactos/win32ss/user/ntuser/desktop.c b/reactos/win32ss/user/ntuser/desktop.c index da909322245..b518b2d1e4e 100644 --- a/reactos/win32ss/user/ntuser/desktop.c +++ b/reactos/win32ss/user/ntuser/desktop.c @@ -26,7 +26,7 @@ IntFreeDesktopHeap(IN PDESKTOP pdesk); /* GLOBALS *******************************************************************/ /* Currently active desktop */ -PDESKTOP InputDesktop = NULL; +PDESKTOP gpdeskInputDesktop = NULL; HDESK InputDesktopHandle = NULL; HDC ScreenDeviceContext = NULL; PTHREADINFO gptiDesktopThread; @@ -420,7 +420,7 @@ IntValidateDesktopHandle( PDESKTOP FASTCALL IntGetActiveDesktop(VOID) { - return InputDesktop; + return gpdeskInputDesktop; } /* @@ -1654,7 +1654,7 @@ NtUserSwitchDesktop(HDESK hdesk) InputWindowStation->ActiveDesktop = pdesk; /* Set the global state. */ - InputDesktop = pdesk; + gpdeskInputDesktop = pdesk; InputDesktopHandle = hdesk; TRACE("SwitchDesktop InputDesktopHandle 0x%p\n",InputDesktopHandle); ObDereferenceObject(pdesk); diff --git a/reactos/win32ss/user/ntuser/simplecall.c b/reactos/win32ss/user/ntuser/simplecall.c index 4278ddd2f0a..1ff0c80e535 100644 --- a/reactos/win32ss/user/ntuser/simplecall.c +++ b/reactos/win32ss/user/ntuser/simplecall.c @@ -259,25 +259,6 @@ NtUserCallOneParam( RETURN(Result); } - case ONEPARAM_ROUTINE_GETCURSORPOSITION: - { - BOOL ret = TRUE; - - _SEH2_TRY - { - ProbeForWrite((POINT*)Param,sizeof(POINT),1); - RtlCopyMemory((POINT*)Param,&gpsi->ptCursor,sizeof(POINT)); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - SetLastNtError(_SEH2_GetExceptionCode()); - ret = FALSE; - } - _SEH2_END; - - RETURN (ret); - } - case ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING: { BOOL Enable; @@ -334,9 +315,10 @@ NtUserCallOneParam( BOOL Ret = TRUE; PPOINTL pptl; PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - if (pti->hdesk != InputDesktopHandle) RETURN(FALSE); + if (pti->rpdesk != IntGetActiveDesktop()) RETURN(FALSE); _SEH2_TRY { + ProbeForWrite((POINT*)Param,sizeof(POINT),1); pptl = (PPOINTL)Param; *pptl = gpsi->ptCursor; } diff --git a/reactos/win32ss/user/user32/include/ntwrapper.h b/reactos/win32ss/user/user32/include/ntwrapper.h index a43042be247..b2ec18e1b7c 100644 --- a/reactos/win32ss/user/user32/include/ntwrapper.h +++ b/reactos/win32ss/user/user32/include/ntwrapper.h @@ -806,7 +806,7 @@ EXTINLINE PVOID NtUserxGetDesktopMapping(PVOID ptr) EXTINLINE BOOL NtUserxGetCursorPos(POINT* lpPoint) { - return (BOOL)NtUserCallOneParam((DWORD_PTR)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOSITION); + return (BOOL)NtUserCallOneParam((DWORD_PTR)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOS); } EXTINLINE BOOL NtUserxSetMenuBarHeight(HMENU menu, INT height)