From 2fcc1cf78f2639a9ccf1cbfcba0b44037a3f91f7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 12 Apr 2008 23:22:58 +0000 Subject: [PATCH] PatchPatch by Stefan Ginsberg (stefan__100__ AT hotmail DOT com): - remove NtUserGetWindowRect, use GetWindowRect instead - remove NtUserGetClientOrigin and NtUserGetClientRect (unused) - remove NtUserManualGuiCheck, use NtUserCallOneParam like other private CSRSS functions do svn path=/trunk/; revision=32935 --- reactos/dll/win32/user32/controls/scrollbar.c | 2 +- reactos/dll/win32/user32/misc/misc.c | 2 +- reactos/include/reactos/win32k/ntuser.h | 22 +----- .../subsystems/win32/win32k/include/misc.h | 1 + .../subsystems/win32/win32k/ntuser/guicheck.c | 11 ++- .../win32/win32k/ntuser/simplecall.c | 4 + .../subsystems/win32/win32k/ntuser/window.c | 77 ------------------- .../subsystems/win32/win32k/ntuser/winpos.c | 21 ----- reactos/subsystems/win32/win32k/w32ksvc.db | 4 - 9 files changed, 13 insertions(+), 131 deletions(-) diff --git a/reactos/dll/win32/user32/controls/scrollbar.c b/reactos/dll/win32/user32/controls/scrollbar.c index a00edf19c0d..2a8da9f2569 100644 --- a/reactos/dll/win32/user32/controls/scrollbar.c +++ b/reactos/dll/win32/user32/controls/scrollbar.c @@ -1193,7 +1193,7 @@ ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt) if (SB_CTL != SBType) { - NtUserGetWindowRect(Wnd, &WindowRect); + GetWindowRect(Wnd, &WindowRect); Pt.x -= WindowRect.left; Pt.y -= WindowRect.top; diff --git a/reactos/dll/win32/user32/misc/misc.c b/reactos/dll/win32/user32/misc/misc.c index 00d2d6a1fe5..bbe7322e44c 100644 --- a/reactos/dll/win32/user32/misc/misc.c +++ b/reactos/dll/win32/user32/misc/misc.c @@ -55,7 +55,7 @@ VOID STDCALL PrivateCsrssManualGuiCheck(LONG Check) { - NtUserManualGuiCheck(Check); + NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK); } VOID diff --git a/reactos/include/reactos/win32k/ntuser.h b/reactos/include/reactos/win32k/ntuser.h index 2ddeac5f138..5977b547ff1 100644 --- a/reactos/include/reactos/win32k/ntuser.h +++ b/reactos/include/reactos/win32k/ntuser.h @@ -2503,6 +2503,7 @@ typedef struct tagKMDDELPARAM #define NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO 0xffff0005 #define NOPARAM_ROUTINE_ANYPOPUP 0xffff0006 #define NOPARAM_ROUTINE_CSRSS_INITIALIZED 0xffff0007 +#define ONEPARAM_ROUTINE_CSRSS_GUICHECK 0xffff0008 #define ONEPARAM_ROUTINE_GETMENU 0xfffe0001 // usermode #define ONEPARAM_ROUTINE_ISWINDOWUNICODE 0xfffe0002 #define ONEPARAM_ROUTINE_GETCARETINFO 0xfffe0007 @@ -2562,16 +2563,6 @@ ULONG_PTR NTAPI NtUserGetClassLong(HWND hWnd, INT Offset, BOOL Ansi); -/* Should be done in usermode */ -BOOL -NTAPI -NtUserGetClientOrigin(HWND hWnd, LPPOINT Point); - -/* Should be done in usermode */ -BOOL -NTAPI -NtUserGetClientRect(HWND hWnd, LPRECT Rect); - UINT NTAPI NtUserGetMenuDefaultItem( @@ -2626,23 +2617,12 @@ LONG NTAPI NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi); -/* Should be done in usermode */ -BOOL -NTAPI -NtUserGetWindowRect(HWND hWnd, LPRECT Rect); - DWORD NTAPI NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid); -VOID -NTAPI -NtUserManualGuiCheck(LONG Check); - - - /* (other FocusedItem values give the position of the focused item) */ #define NO_SELECTED_ITEM 0xffff diff --git a/reactos/subsystems/win32/win32k/include/misc.h b/reactos/subsystems/win32/win32k/include/misc.h index dea96f80ad9..044a80716b4 100644 --- a/reactos/subsystems/win32/win32k/include/misc.h +++ b/reactos/subsystems/win32/win32k/include/misc.h @@ -8,5 +8,6 @@ ULONG FASTCALL IntSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni); DWORD STDCALL IntGetQueueStatus(BOOL ClearChanges); +VOID FASTCALL IntUserManualGuiCheck(LONG Check); #endif /* __WIN32K_MISC_H */ diff --git a/reactos/subsystems/win32/win32k/ntuser/guicheck.c b/reactos/subsystems/win32/win32k/ntuser/guicheck.c index 805cdb1a08b..d77fbabccad 100644 --- a/reactos/subsystems/win32/win32k/ntuser/guicheck.c +++ b/reactos/subsystems/win32/win32k/ntuser/guicheck.c @@ -98,13 +98,13 @@ co_IntGraphicsCheck(BOOL Create) return TRUE; } -VOID STDCALL -NtUserManualGuiCheck(LONG Check) +VOID +FASTCALL +IntUserManualGuiCheck(LONG Check) { PW32PROCESS W32Data; - DPRINT("Enter NtUserManualGuiCheck\n"); - UserEnterExclusive(); + DPRINT("Enter IntUserManualGuiCheck\n"); W32Data = PsGetCurrentProcessWin32Process(); if (0 == Check) @@ -126,8 +126,7 @@ NtUserManualGuiCheck(LONG Check) } } - DPRINT("Leave NtUserManualGuiCheck\n"); - UserLeave(); + DPRINT("Leave IntUserManualGuiCheck\n"); } diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index c645e5204ef..d212c307b78 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -395,6 +395,10 @@ NtUserCallOneParam( case ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS: /* FIXME: Should use UserEnterShared */ RETURN(IntEnumClipboardFormats(Param)); + + case ONEPARAM_ROUTINE_CSRSS_GUICHECK: + IntUserManualGuiCheck(Param); + RETURN(TRUE); } DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n", Routine, Param); diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index 0514f883488..658e675cc56 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -2887,45 +2887,6 @@ CLEANUP: END_CLEANUP; } -/*! - * Returns client window rectangle relative to the upper-left corner of client area. - * - * \param hWnd window handle. - * \param Rect pointer to the buffer where the coordinates are returned. - * -*/ -/* - * @implemented - */ -BOOL STDCALL -NtUserGetClientRect(HWND hWnd, LPRECT Rect) -{ - PWINDOW_OBJECT Window; - RECT SafeRect; - DECLARE_RETURN(BOOL); - - DPRINT("Enter NtUserGetClientRect\n"); - UserEnterShared(); - - if(!(Window = UserGetWindowObject(hWnd))) - { - RETURN( FALSE); - } - - IntGetClientRect(Window, &SafeRect); - - if(!NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT)))) - { - RETURN( FALSE); - } - RETURN( TRUE); - -CLEANUP: - DPRINT("Leave NtUserGetClientRect, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - BOOL STDCALL @@ -3907,44 +3868,6 @@ CLEANUP: } -/*! - * Return the dimension of the window in the screen coordinates. - * \param hWnd window handle. - * \param Rect pointer to the buffer where the coordinates are returned. -*/ -/* - * @implemented - */ -BOOL STDCALL -NtUserGetWindowRect(HWND hWnd, LPRECT Rect) -{ - PWINDOW_OBJECT Wnd; - NTSTATUS Status; - DECLARE_RETURN(BOOL); - - DPRINT("Enter NtUserGetWindowRect\n"); - UserEnterShared(); - - if (!(Wnd = UserGetWindowObject(hWnd))) - { - RETURN(FALSE); - } - Status = MmCopyToCaller(Rect, &Wnd->Wnd->WindowRect, sizeof(RECT)); - if (!NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN( FALSE); - } - - RETURN( TRUE); - -CLEANUP: - DPRINT("Leave NtUserGetWindowRect, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - - /* * @implemented */ diff --git a/reactos/subsystems/win32/win32k/ntuser/winpos.c b/reactos/subsystems/win32/win32k/ntuser/winpos.c index 43359ea376c..0a41768db5d 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winpos.c +++ b/reactos/subsystems/win32/win32k/ntuser/winpos.c @@ -106,27 +106,6 @@ UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point) -BOOL STDCALL -NtUserGetClientOrigin(HWND hWnd, LPPOINT Point) -{ - DECLARE_RETURN(BOOL); - PWINDOW_OBJECT Window; - - DPRINT("Enter NtUserGetClientOrigin\n"); - UserEnterShared(); - - if (!(Window = UserGetWindowObject(hWnd))) - RETURN(FALSE); - - RETURN(UserGetClientOrigin(Window, Point)); - -CLEANUP: - DPRINT("Leave NtUserGetClientOrigin, ret=%i\n",_ret_); - UserLeave(); - END_CLEANUP; -} - - /******************************************************************* * can_activate_window * diff --git a/reactos/subsystems/win32/win32k/w32ksvc.db b/reactos/subsystems/win32/win32k/w32ksvc.db index 20bb3799c1c..47bc3406548 100644 --- a/reactos/subsystems/win32/win32k/w32ksvc.db +++ b/reactos/subsystems/win32/win32k/w32ksvc.db @@ -682,8 +682,6 @@ NtGdiSetWindowOrgEx 4 NtUserBuildMenuItemList 4 NtUserCreateCursorIconHandle 2 NtUserGetClassLong 3 -NtUserGetClientOrigin 2 -NtUserGetClientRect 2 NtUserGetMenuDefaultItem 3 NtUserGetLastInputInfo 1 NtUserGetMinMaxInfo 3 @@ -694,9 +692,7 @@ NtUserGetShellWindow 0 NtUserGetSystemMetrics 1 NtUserGetWindow 2 NtUserGetWindowLong 3 -NtUserGetWindowRect 2 NtUserGetWindowThreadProcessId 2 -NtUserManualGuiCheck 1 NtUserMenuInfo 3 NtUserMenuItemInfo 5 NtUserMonitorFromPoint 3