Commit 31dbce96 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Introduce inline helpers for NtUserCallHwnd calls.

parent dae11519
......@@ -906,7 +906,7 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
*/
BOOL WINAPI IsWindowEnabled( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserIsWindowEnabled );
return NtUserIsWindowEnabled( hwnd );
}
/***********************************************************************
......@@ -914,7 +914,7 @@ BOOL WINAPI IsWindowEnabled( HWND hwnd )
*/
BOOL WINAPI IsWindowUnicode( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserIsWindowUnicode );
return NtUserIsWindowUnicode( hwnd );
}
......@@ -923,7 +923,7 @@ BOOL WINAPI IsWindowUnicode( HWND hwnd )
*/
DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd )
{
return (DPI_AWARENESS_CONTEXT)NtUserCallHwnd( hwnd, NtUserGetWindowDpiAwarenessContext );
return NtUserGetWindowDpiAwarenessContext( hwnd );
}
......@@ -932,7 +932,7 @@ DPI_AWARENESS_CONTEXT WINAPI GetWindowDpiAwarenessContext( HWND hwnd )
*/
UINT WINAPI GetDpiForWindow( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserGetDpiForWindow );
return NtUserGetDpiForWindow( hwnd );
}
......@@ -1215,7 +1215,7 @@ INT WINAPI GetWindowTextLengthA( HWND hwnd )
/* when window belongs to other process, don't send a message */
GetCPInfo( CP_ACP, &info );
return NtUserCallHwnd( hwnd, NtUserGetWindowTextLength ) * info.MaxCharSize;
return NtUserGetWindowTextLength( hwnd ) * info.MaxCharSize;
}
/*******************************************************************
......@@ -1226,7 +1226,7 @@ INT WINAPI GetWindowTextLengthW( HWND hwnd )
if (WIN_IsCurrentProcess( hwnd )) return SendMessageW( hwnd, WM_GETTEXTLENGTH, 0, 0 );
/* when window belongs to other process, don't send a message */
return NtUserCallHwnd( hwnd, NtUserGetWindowTextLength );
return NtUserGetWindowTextLength( hwnd );
}
......@@ -1235,7 +1235,7 @@ INT WINAPI GetWindowTextLengthW( HWND hwnd )
*/
BOOL WINAPI IsWindow( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserIsWindow );
return NtUserIsWindow( hwnd );
}
......@@ -1253,7 +1253,7 @@ DWORD WINAPI GetWindowThreadProcessId( HWND hwnd, LPDWORD process )
*/
HWND WINAPI GetParent( HWND hwnd )
{
return UlongToHandle( NtUserCallHwnd( hwnd, NtUserGetParent ));
return NtUserGetParent( hwnd );
}
......@@ -1271,7 +1271,7 @@ BOOL WINAPI IsChild( HWND parent, HWND child )
*/
BOOL WINAPI IsWindowVisible( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserIsWindowVisible );
return NtUserIsWindowVisible( hwnd );
}
......@@ -1564,7 +1564,7 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
*/
DWORD WINAPI GetWindowContextHelpId( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserGetWindowContextHelpId );
return NtUserGetWindowContextHelpId( hwnd );
}
......
......@@ -895,7 +895,7 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
*/
UINT WINAPI ArrangeIconicWindows( HWND parent )
{
return NtUserCallHwnd( parent, NtUserArrangeIconicWindows );
return NtUserArrangeIconicWindows( parent );
}
......
......@@ -4976,26 +4976,36 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
{
switch (code)
{
case NtUserArrangeIconicWindows:
case NtUserCallHwnd_ArrangeIconicWindows:
return arrange_iconic_windows( hwnd );
case NtUserGetDpiForWindow:
case NtUserCallHwnd_GetDpiForWindow:
return get_dpi_for_window( hwnd );
case NtUserGetParent:
case NtUserCallHwnd_GetParent:
return HandleToUlong( get_parent( hwnd ));
case NtUserGetWindowContextHelpId:
case NtUserCallHwnd_GetWindowContextHelpId:
return get_window_context_help_id( hwnd );
case NtUserGetWindowDpiAwarenessContext:
case NtUserCallHwnd_GetWindowDpiAwarenessContext:
return (ULONG_PTR)get_window_dpi_awareness_context( hwnd );
case NtUserGetWindowTextLength:
case NtUserCallHwnd_GetWindowTextLength:
return get_server_window_text( hwnd, NULL, 0 );
case NtUserIsWindow:
case NtUserCallHwnd_IsWindow:
return is_window( hwnd );
case NtUserIsWindowEnabled:
case NtUserCallHwnd_IsWindowEnabled:
return is_window_enabled( hwnd );
case NtUserIsWindowUnicode:
case NtUserCallHwnd_IsWindowUnicode:
return is_window_unicode( hwnd );
case NtUserIsWindowVisible:
case NtUserCallHwnd_IsWindowVisible:
return is_window_visible( hwnd );
default:
FIXME( "invalid code %u\n", code );
return 0;
......
......@@ -131,21 +131,6 @@ struct win_hook_params
#define NTUSER_DPI_PER_MONITOR_AWARE_V2 0x00000022
#define NTUSER_DPI_PER_UNAWARE_GDISCALED 0x40006010
/* NtUserCallHwnd codes, not compatible with Windows */
enum
{
NtUserArrangeIconicWindows,
NtUserGetDpiForWindow,
NtUserGetParent,
NtUserGetWindowContextHelpId,
NtUserGetWindowDpiAwarenessContext,
NtUserGetWindowTextLength,
NtUserIsWindow,
NtUserIsWindowEnabled,
NtUserIsWindowUnicode,
NtUserIsWindowVisible,
};
/* NtUserCallHwndParam codes, not compatible with Windows */
enum
{
......@@ -810,4 +795,70 @@ static inline BOOL NtUserUnhookWindowsHook( INT id, HOOKPROC proc )
return NtUserCallTwoParam( id, (UINT_PTR)proc, NtUserCallTwoParam_UnhookWindowsHook );
}
/* NtUserCallHwnd codes, not compatible with Windows */
enum
{
NtUserCallHwnd_ArrangeIconicWindows,
NtUserCallHwnd_GetDpiForWindow,
NtUserCallHwnd_GetParent,
NtUserCallHwnd_GetWindowContextHelpId,
NtUserCallHwnd_GetWindowDpiAwarenessContext,
NtUserCallHwnd_GetWindowTextLength,
NtUserCallHwnd_IsWindow,
NtUserCallHwnd_IsWindowEnabled,
NtUserCallHwnd_IsWindowUnicode,
NtUserCallHwnd_IsWindowVisible,
};
static inline UINT NtUserArrangeIconicWindows( HWND parent )
{
return NtUserCallHwnd( parent, NtUserCallHwnd_ArrangeIconicWindows );
}
static inline DWORD NtUserGetWindowContextHelpId( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_GetWindowContextHelpId );
}
static inline UINT NtUserGetDpiForWindow( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_GetDpiForWindow );
}
static inline HWND NtUserGetParent( HWND hwnd )
{
return UlongToHandle( NtUserCallHwnd( hwnd, NtUserCallHwnd_GetParent ));
}
static inline DPI_AWARENESS_CONTEXT NtUserGetWindowDpiAwarenessContext( HWND hwnd )
{
return (DPI_AWARENESS_CONTEXT)NtUserCallHwnd( hwnd,
NtUserCallHwnd_GetWindowDpiAwarenessContext );
}
static inline INT NtUserGetWindowTextLength( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_GetWindowTextLength );
}
static inline BOOL NtUserIsWindow( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindow );
}
static inline BOOL NtUserIsWindowEnabled( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowEnabled );
}
static inline BOOL NtUserIsWindowUnicode( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowUnicode );
}
static inline BOOL NtUserIsWindowVisible( HWND hwnd )
{
return NtUserCallHwnd( hwnd, NtUserCallHwnd_IsWindowVisible );
}
#endif /* _NTUSER_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment