Author: jimtabor
Date: Wed Sep 16 00:13:16 2009
New Revision: 43056
URL:
http://svn.reactos.org/svn/reactos?rev=43056&view=rev
Log:
- Patch by Smiley <johnyadams(a)hotmail.com>om>: remove redundant system calls when
window structure is available to user space.
Modified:
trunk/reactos/dll/win32/user32/include/user32p.h
trunk/reactos/dll/win32/user32/windows/menu.c
trunk/reactos/dll/win32/user32/windows/window.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
Modified: trunk/reactos/dll/win32/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Wed Sep 16 00:13:16
2009
@@ -49,9 +49,6 @@
#define NtUserSetGUIThreadHandle(field, hwnd) \
(BOOL)NtUserCallTwoParam((DWORD)field, (DWORD)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE)
-#define NtUserSetMenuItemRect(menu, mir) \
- (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT)
-
#define NtUserSetMenuBarHeight(menu, height) \
(BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height,
TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
@@ -81,20 +78,11 @@
#define NtUserSwapMouseButton(fSwap) \
(BOOL)NtUserCallOneParam((DWORD)fSwap, ONEPARAM_ROUTINE_SWAPMOUSEBUTTON)
-#define NtUserGetMenu(hWnd) \
- (HMENU)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_GETMENU)
-
#define NtUserSetMessageExtraInfo(lParam) \
(LPARAM)NtUserCallOneParam((DWORD)lParam, ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO)
-#define NtUserIsWindowUnicode(hWnd) \
- (BOOL)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_ISWINDOWUNICODE)
-
#define NtUserGetWindowContextHelpId(hwnd) \
NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID)
-
-#define NtUserGetWindowInstance(hwnd) \
- (HINSTANCE)NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWINDOWINSTANCE)
#define NtUserGetCursorPos(lpPoint) \
(BOOL)NtUserCallOneParam((DWORD)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOSITION)
Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Wed Sep 16 00:13:16 2009
@@ -4234,7 +4234,12 @@
HMENU WINAPI
GetMenu(HWND hWnd)
{
- return NtUserGetMenu(hWnd);
+ PWND Wnd = ValidateHwnd(hWnd);
+
+ if (!Wnd)
+ return NULL;
+
+ return (HMENU)Wnd->IDMenu;
}
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Wed Sep 16 00:13:16 2009
@@ -1129,14 +1129,12 @@
LPSTR lpszFileName,
UINT cchFileNameMax)
{
- HINSTANCE hWndInst;
-
- if(!(hWndInst = NtUserGetWindowInstance(hwnd)))
- {
+ PWND Wnd = ValidateHwnd(hwnd);
+
+ if (!Wnd)
return 0;
- }
-
- return GetModuleFileNameA(hWndInst, lpszFileName, cchFileNameMax);
+
+ return GetModuleFileNameA(Wnd->hModule, lpszFileName, cchFileNameMax);
}
@@ -1148,14 +1146,12 @@
LPWSTR lpszFileName,
UINT cchFileNameMax)
{
- HINSTANCE hWndInst;
-
- if(!(hWndInst = NtUserGetWindowInstance(hwnd)))
- {
+ PWND Wnd = ValidateHwnd(hwnd);
+
+ if (!Wnd)
return 0;
- }
-
- return GetModuleFileNameW(hWndInst, lpszFileName, cchFileNameMax);
+
+ return GetModuleFileNameW( Wnd->hModule, lpszFileName, cchFileNameMax );
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Wed Sep 16 00:13:16 2009
@@ -3024,21 +3024,16 @@
#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
#define ONEPARAM_ROUTINE_SWITCHCARETSHOWING 0xfffe0008
#define ONEPARAM_ROUTINE_ISWINDOWINDESTROY 0xfffe000c
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e
-#define ONEPARAM_ROUTINE_GETWINDOWINSTANCE 0xfffe0010
#define ONEPARAM_ROUTINE_CREATECURICONHANDLE 0xfffe0025 // CREATE_EMPTY_CURSOR_OBJECT ?
#define ONEPARAM_ROUTINE_MSQSETWAKEMASK 0xfffe0027
#define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM
routine ?
#define TWOPARAM_ROUTINE_GETWINDOWRGNBOX 0xfffd0048 // user mode
#define TWOPARAM_ROUTINE_GETWINDOWRGN 0xfffd0049 // user mode
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050
-#define TWOPARAM_ROUTINE_SETMENUITEMRECT 0xfffd0051
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052
#define MSQ_STATE_CAPTURE 0x1
#define MSQ_STATE_ACTIVE 0x2
@@ -3048,8 +3043,6 @@
#define MSQ_STATE_CARET 0x6
#define TWOPARAM_ROUTINE_SETCARETPOS 0xfffd0060
#define TWOPARAM_ROUTINE_REGISTERLOGONPROC 0xfffd0062
-#define TWOPARAM_ROUTINE_ROS_ISACTIVEICON 0x1001
-#define TWOPARAM_ROUTINE_ROS_NCDESTROY 0x1002
#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE 0x1004
DWORD
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] Wed Sep 16
00:13:16 2009
@@ -178,35 +178,6 @@
}
}
- case ONEPARAM_ROUTINE_GETMENU:
- {
- PWINDOW_OBJECT Window;
- DWORD Result;
-
- if(!(Window = UserGetWindowObject((HWND)Param)))
- {
- RETURN( FALSE);
- }
-
- Result = (DWORD)Window->Wnd->IDMenu;
-
- RETURN( Result);
- }
-
- case ONEPARAM_ROUTINE_ISWINDOWUNICODE:
- {
- PWINDOW_OBJECT Window;
- DWORD Result;
-
- Window = UserGetWindowObject((HWND)Param);
- if(!Window)
- {
- RETURN( FALSE);
- }
- Result = Window->Wnd->Unicode;
- RETURN( Result);
- }
-
case ONEPARAM_ROUTINE_WINDOWFROMDC:
RETURN( (DWORD)IntWindowFromDC((HDC)Param));
@@ -225,20 +196,6 @@
case ONEPARAM_ROUTINE_SETCARETBLINKTIME:
RETURN( (DWORD)IntSetCaretBlinkTime((UINT)Param));
-
- case ONEPARAM_ROUTINE_GETWINDOWINSTANCE:
- {
- PWINDOW_OBJECT Window;
- DWORD Result;
-
- if(!(Window = UserGetWindowObject((HWND)Param)))
- {
- RETURN( FALSE);
- }
-
- Result = (DWORD)Window->Wnd->hModule;
- RETURN( Result);
- }
case ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO:
RETURN( (DWORD)MsqSetMessageExtraInfo((LPARAM)Param));
@@ -457,25 +414,6 @@
IntReleaseMenuObject(MenuObject);
RETURN( Ret);
}
- case TWOPARAM_ROUTINE_SETMENUITEMRECT:
- {
- BOOL Ret;
- SETMENUITEMRECT smir;
- PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
- if(!MenuObject)
- RETURN( 0);
-
- if(!NT_SUCCESS(MmCopyFromCaller(&smir, (PVOID)Param2,
sizeof(SETMENUITEMRECT))))
- {
- IntReleaseMenuObject(MenuObject);
- RETURN( 0);
- }
-
- Ret = IntSetMenuItemRect(MenuObject, smir.uItem, smir.fByPosition,
&smir.rcRect);
-
- IntReleaseMenuObject(MenuObject);
- RETURN( (DWORD)Ret);
- }
case TWOPARAM_ROUTINE_SETGUITHRDHANDLE:
{