win32u: Introduce inline helpers for NtUserCallNoParam calls.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-04-13 15:06:44 +02:00 committed by Alexandre Julliard
parent 47ce525c2b
commit 6f1e48f424
5 changed files with 48 additions and 21 deletions

View File

@ -173,7 +173,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
*/
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseCapture(void)
{
return NtUserCallNoParam( NtUserReleaseCapture );
return NtUserReleaseCapture();
}
@ -193,7 +193,7 @@ HWND WINAPI GetCapture(void)
*/
BOOL WINAPI GetInputState(void)
{
return NtUserCallNoParam( NtUserGetInputState );
return NtUserGetInputState();
}

View File

@ -4213,7 +4213,7 @@ BOOL WINAPI SetMenuItemBitmaps( HMENU hMenu, UINT nPos, UINT wFlags,
*/
HMENU WINAPI CreateMenu(void)
{
return UlongToHandle( NtUserCallNoParam( NtUserCreateMenu ));
return NtUserCreateMenu();
}

View File

@ -871,7 +871,7 @@ HWND WINAPI GetDesktopWindow(void)
struct user_thread_info *thread_info = get_user_thread_info();
if (thread_info->top_window) return thread_info->top_window;
return UlongToHandle( NtUserCallNoParam( NtUserGetDesktopWindow ));
return NtUserGetDesktopWindow();
}

View File

@ -4632,24 +4632,31 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code )
{
switch(code)
{
case NtUserCreateMenu:
case NtUserCallNoParam_CreateMenu:
return HandleToUlong( create_menu() );
case NtUserGetDesktopWindow:
case NtUserCallNoParam_GetDesktopWindow:
return HandleToUlong( get_desktop_window() );
case NtUserGetInputState:
case NtUserCallNoParam_GetInputState:
return get_input_state();
case NtUserReleaseCapture:
case NtUserCallNoParam_ReleaseCapture:
return release_capture();
/* temporary exports */
case NtUserExitingThread:
exiting_thread_id = GetCurrentThreadId();
return 0;
case NtUserThreadDetach:
thread_detach();
return 0;
case NtUserUpdateClipboard:
user_driver->pUpdateClipboard();
return 0;
default:
FIXME( "invalid code %u\n", code );
return 0;

View File

@ -131,19 +131,6 @@ struct win_hook_params
#define NTUSER_DPI_PER_MONITOR_AWARE_V2 0x00000022
#define NTUSER_DPI_PER_UNAWARE_GDISCALED 0x40006010
/* NtUserCallNoParam codes, not compatible with Windows */
enum
{
NtUserCreateMenu,
NtUserGetDesktopWindow,
NtUserGetInputState,
NtUserReleaseCapture,
/* temporary exports */
NtUserExitingThread,
NtUserThreadDetach,
NtUserUpdateClipboard,
};
/* NtUserCallOneParam codes, not compatible with Windows */
enum
{
@ -676,4 +663,37 @@ DWORD WINAPI NtUserWaitForInputIdle( HANDLE process, DWORD timeout, BOOL wow )
HWND WINAPI NtUserWindowFromDC( HDC hdc );
HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y );
/* NtUserCallNoParam codes, not compatible with Windows */
enum
{
NtUserCallNoParam_CreateMenu,
NtUserCallNoParam_GetDesktopWindow,
NtUserCallNoParam_GetInputState,
NtUserCallNoParam_ReleaseCapture,
/* temporary exports */
NtUserExitingThread,
NtUserThreadDetach,
NtUserUpdateClipboard,
};
static inline HMENU NtUserCreateMenu(void)
{
return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_CreateMenu ));
}
static inline HWND NtUserGetDesktopWindow(void)
{
return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetDesktopWindow ));
}
static inline BOOL NtUserGetInputState(void)
{
return NtUserCallNoParam( NtUserCallNoParam_GetInputState );
}
static inline BOOL NtUserReleaseCapture(void)
{
return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture );
}
#endif /* _NTUSER_ */