Commit 2ebfe2fd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Use syscall interface for window class functions.

parent 561890f4
......@@ -1140,17 +1140,11 @@ static struct unix_funcs unix_funcs =
NtUserDrawMenuBarTemp,
NtUserEndPaint,
NtUserExcludeUpdateRgn,
NtUserGetClassInfoEx,
NtUserRegisterClassExWOW,
NtUserReleaseDC,
NtUserScrollDC,
NtUserSelectPalette,
NtUserSetClassLong,
NtUserSetClassLongPtr,
NtUserSetClassWord,
NtUserSystemParametersInfo,
NtUserSystemParametersInfoForDpi,
NtUserUnregisterClass,
NtUserUpdateLayeredWindow,
SetDIBits,
......
......@@ -156,6 +156,7 @@ static void * const syscalls[] =
NtUserGetAtomName,
NtUserGetCaretBlinkTime,
NtUserGetCaretPos,
NtUserGetClassInfoEx,
NtUserGetClassName,
NtUserGetClipboardData,
NtUserGetClipboardFormatName,
......@@ -231,6 +232,7 @@ static void * const syscalls[] =
NtUserPostThreadMessage,
NtUserQueryInputContext,
NtUserRedrawWindow,
NtUserRegisterClassExWOW,
NtUserRegisterHotKey,
NtUserRegisterRawInputDevices,
NtUserRemoveClipboardFormatListener,
......@@ -240,6 +242,9 @@ static void * const syscalls[] =
NtUserSendInput,
NtUserSetActiveWindow,
NtUserSetCapture,
NtUserSetClassLong,
NtUserSetClassLongPtr,
NtUserSetClassWord,
NtUserSetClipboardData,
NtUserSetClipboardViewer,
NtUserSetCursor,
......@@ -285,6 +290,7 @@ static void * const syscalls[] =
NtUserTranslateMessage,
NtUserUnhookWinEvent,
NtUserUnhookWindowsHookEx,
NtUserUnregisterClass,
NtUserUnregisterHotKey,
NtUserUpdateInputContext,
NtUserVkKeyScanEx,
......
......@@ -898,7 +898,7 @@
@ stub NtUserGetCPD
@ stdcall -syscall NtUserGetCaretBlinkTime()
@ stdcall -syscall NtUserGetCaretPos(ptr)
@ stdcall NtUserGetClassInfoEx(ptr ptr ptr ptr long)
@ stdcall -syscall NtUserGetClassInfoEx(ptr ptr ptr ptr long)
@ stdcall -syscall NtUserGetClassName(long long ptr)
@ stub NtUserGetClipCursor
@ stub NtUserGetClipboardAccessToken
......@@ -1122,7 +1122,7 @@
@ stub NtUserRealWaitMessageEx
@ stdcall -syscall NtUserRedrawWindow(long ptr long long)
@ stub NtUserRegisterBSDRWindow
@ stdcall NtUserRegisterClassExWOW(ptr ptr ptr ptr long long long)
@ stdcall -syscall NtUserRegisterClassExWOW(ptr ptr ptr ptr long long long)
@ stub NtUserRegisterDManipHook
@ stub NtUserRegisterEdgy
@ stub NtUserRegisterErrorReportingDialog
......@@ -1171,9 +1171,9 @@
@ stub NtUserSetCalibrationData
@ stdcall -syscall NtUserSetCapture(long)
@ stub NtUserSetChildWindowNoActivate
@ stdcall NtUserSetClassLong(long long long long)
@ stdcall NtUserSetClassLongPtr(long long long long)
@ stdcall NtUserSetClassWord(long long long)
@ stdcall -syscall NtUserSetClassLong(long long long long)
@ stdcall -syscall NtUserSetClassLongPtr(long long long long)
@ stdcall -syscall NtUserSetClassWord(long long long)
@ stdcall -syscall NtUserSetClipboardData(long ptr ptr)
@ stdcall -syscall NtUserSetClipboardViewer(long)
@ stub NtUserSetCoreWindow
......@@ -1288,7 +1288,7 @@
@ stdcall -syscall NtUserUnhookWindowsHookEx(long)
@ stub NtUserUnloadKeyboardLayout
@ stub NtUserUnlockWindowStation
@ stdcall NtUserUnregisterClass(ptr ptr ptr)
@ stdcall -syscall NtUserUnregisterClass(ptr ptr ptr)
@ stdcall -syscall NtUserUnregisterHotKey(long long)
@ stub NtUserUnregisterSessionPort
@ stub NtUserUnregisterUserApiHook
......
......@@ -191,24 +191,13 @@ struct unix_funcs
DWORD (WINAPI *pNtUserDrawMenuBarTemp)( HWND hwnd, HDC hdc, RECT *rect, HMENU handle, HFONT font );
BOOL (WINAPI *pNtUserEndPaint)( HWND hwnd, const PAINTSTRUCT *ps );
INT (WINAPI *pNtUserExcludeUpdateRgn)( HDC hdc, HWND hwnd );
ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,
struct client_menu_name *menu_name, BOOL ansi );
ATOM (WINAPI *pNtUserRegisterClassExWOW)( const WNDCLASSEXW *wc, UNICODE_STRING *name,
UNICODE_STRING *version,
struct client_menu_name *client_menu_name,
DWORD fnid, DWORD flags, DWORD *wow );
INT (WINAPI *pNtUserReleaseDC)( HWND hwnd, HDC hdc );
BOOL (WINAPI *pNtUserScrollDC)( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
HRGN ret_update_rgn, RECT *update_rect );
HPALETTE (WINAPI *pNtUserSelectPalette)( HDC hdc, HPALETTE hpal, WORD bkg );
DWORD (WINAPI *pNtUserSetClassLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
ULONG_PTR (WINAPI *pNtUserSetClassLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
WORD (WINAPI *pNtUserSetClassWord)( HWND hwnd, INT offset, WORD newval );
BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini );
BOOL (WINAPI *pNtUserSystemParametersInfoForDpi)( UINT action, UINT val, PVOID ptr,
UINT winini, UINT dpi );
BOOL (WINAPI *pNtUserUnregisterClass)( UNICODE_STRING *name, HINSTANCE instance,
struct client_menu_name *client_menu_name );
BOOL (WINAPI *pNtUserUpdateLayeredWindow)( HWND hwnd, HDC hdc_dst, const POINT *pts_dst,
const SIZE *size, HDC hdc_src, const POINT *pts_src,
COLORREF key, const BLENDFUNCTION *blend,
......
......@@ -744,21 +744,6 @@ INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd )
return unix_funcs->pNtUserExcludeUpdateRgn( hdc, hwnd );
}
ATOM WINAPI NtUserGetClassInfoEx( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc,
struct client_menu_name *menu_name, BOOL ansi )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserGetClassInfoEx( instance, name, wc, menu_name, ansi );
}
ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *name, UNICODE_STRING *version,
struct client_menu_name *client_menu_name, DWORD fnid, DWORD flags,
DWORD *wow )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserRegisterClassExWOW( wc, name, version, client_menu_name, fnid, flags, wow );
}
INT WINAPI NtUserReleaseDC( HWND hwnd, HDC hdc )
{
if (!unix_funcs) return 0;
......@@ -778,24 +763,6 @@ HPALETTE WINAPI NtUserSelectPalette( HDC hdc, HPALETTE hpal, WORD bkg )
return unix_funcs->pNtUserSelectPalette( hdc, hpal, bkg );
}
DWORD WINAPI NtUserSetClassLong( HWND hwnd, INT offset, LONG newval, BOOL ansi )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetClassLong( hwnd, offset, newval, ansi );
}
ULONG_PTR WINAPI NtUserSetClassLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetClassLongPtr( hwnd, offset, newval, ansi );
}
WORD WINAPI NtUserSetClassWord( HWND hwnd, INT offset, WORD newval )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetClassWord( hwnd, offset, newval );
}
BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, PVOID ptr, UINT winini )
{
if (!unix_funcs) return FALSE;
......@@ -808,13 +775,6 @@ BOOL WINAPI NtUserSystemParametersInfoForDpi( UINT action, UINT val, PVOID ptr,
return unix_funcs->pNtUserSystemParametersInfoForDpi( action, val, ptr, winini, dpi );
}
BOOL WINAPI NtUserUnregisterClass( UNICODE_STRING *name, HINSTANCE instance,
struct client_menu_name *client_menu_name )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserUnregisterClass( name, instance, client_menu_name );
}
BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *pts_dst, const SIZE *size,
HDC hdc_src, const POINT *pts_src, COLORREF key,
const BLENDFUNCTION *blend, DWORD flags, const RECT *dirty )
......
......@@ -143,6 +143,7 @@
SYSCALL_ENTRY( NtUserGetAtomName ) \
SYSCALL_ENTRY( NtUserGetCaretBlinkTime ) \
SYSCALL_ENTRY( NtUserGetCaretPos ) \
SYSCALL_ENTRY( NtUserGetClassInfoEx ) \
SYSCALL_ENTRY( NtUserGetClassName ) \
SYSCALL_ENTRY( NtUserGetClipboardData ) \
SYSCALL_ENTRY( NtUserGetClipboardFormatName ) \
......@@ -218,6 +219,7 @@
SYSCALL_ENTRY( NtUserPostThreadMessage ) \
SYSCALL_ENTRY( NtUserQueryInputContext ) \
SYSCALL_ENTRY( NtUserRedrawWindow ) \
SYSCALL_ENTRY( NtUserRegisterClassExWOW ) \
SYSCALL_ENTRY( NtUserRegisterHotKey ) \
SYSCALL_ENTRY( NtUserRegisterRawInputDevices ) \
SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \
......@@ -227,6 +229,9 @@
SYSCALL_ENTRY( NtUserSendInput ) \
SYSCALL_ENTRY( NtUserSetActiveWindow ) \
SYSCALL_ENTRY( NtUserSetCapture ) \
SYSCALL_ENTRY( NtUserSetClassLong ) \
SYSCALL_ENTRY( NtUserSetClassLongPtr ) \
SYSCALL_ENTRY( NtUserSetClassWord ) \
SYSCALL_ENTRY( NtUserSetClipboardData ) \
SYSCALL_ENTRY( NtUserSetClipboardViewer ) \
SYSCALL_ENTRY( NtUserSetCursor ) \
......@@ -272,6 +277,7 @@
SYSCALL_ENTRY( NtUserTranslateMessage ) \
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
SYSCALL_ENTRY( NtUserUnhookWindowsHookEx ) \
SYSCALL_ENTRY( NtUserUnregisterClass ) \
SYSCALL_ENTRY( NtUserUnregisterHotKey ) \
SYSCALL_ENTRY( NtUserUpdateInputContext ) \
SYSCALL_ENTRY( NtUserVkKeyScanEx ) \
......
......@@ -118,6 +118,29 @@ typedef struct
BYTE rgbReserved[32];
} PAINTSTRUCT32;
typedef struct
{
UINT cbSize;
UINT style;
ULONG lpfnWndProc;
INT cbClsExtra;
INT cbWndExtra;
ULONG hInstance;
ULONG hIcon;
ULONG hCursor;
ULONG hbrBackground;
ULONG lpszMenuName;
ULONG lpszClassName;
ULONG hIconSm;
} WNDCLASSEXW32;
struct client_menu_name32
{
ULONG nameA;
ULONG nameW;
ULONG nameUS;
};
static MSG *msg_32to64( MSG *msg, const MSG32 *msg32 )
{
if (!msg32) return NULL;
......@@ -144,6 +167,28 @@ static MSG32 *msg_64to32( MSG *msg, MSG32 *msg32 )
return msg32;
}
static struct client_menu_name *client_menu_name_32to64( struct client_menu_name *name,
const struct client_menu_name32 *name32 )
{
if (!name32) return NULL;
name->nameA = UlongToPtr( name32->nameA );
name->nameW = UlongToPtr( name32->nameW );
name->nameUS = UlongToPtr( name32->nameUS );
return name;
}
static struct client_menu_name32 *client_menu_name_64to32( const struct client_menu_name *name,
struct client_menu_name32 *name32 )
{
if (name32)
{
name32->nameA = PtrToUlong( name->nameA );
name32->nameW = PtrToUlong( name->nameW );
name32->nameUS = PtrToUlong( name->nameUS );
}
return name32;
}
NTSTATUS WINAPI wow64_NtUserActivateKeyboardLayout( UINT *args )
{
HKL layout = get_handle( &args );
......@@ -732,6 +777,38 @@ NTSTATUS WINAPI wow64_NtUserGetCaretPos( UINT *args )
return NtUserGetCaretPos( pt );
}
NTSTATUS WINAPI wow64_NtUserGetClassInfoEx( UINT *args )
{
HINSTANCE instance = get_ptr( &args );
UNICODE_STRING32 *name32 = get_ptr( &args );
WNDCLASSEXW32 *wc32 = get_ptr( &args );
struct client_menu_name32 *client_name32 = get_ptr( &args );
BOOL ansi = get_ulong( &args );
struct client_menu_name client_name;
UNICODE_STRING name;
WNDCLASSEXW wc;
wc.cbSize = sizeof(wc);
if (!NtUserGetClassInfoEx( instance, unicode_str_32to64( &name, name32 ), &wc,
&client_name, ansi ))
return FALSE;
wc32->style = wc.style;
wc32->lpfnWndProc = PtrToUlong( wc.lpfnWndProc );
wc32->cbClsExtra = wc.cbClsExtra;
wc32->cbWndExtra = wc.cbWndExtra;
wc32->hInstance = HandleToUlong( wc.hInstance );
wc32->hIcon = HandleToUlong( wc.hIcon );
wc32->hCursor = HandleToUlong( wc.hCursor );
wc32->hbrBackground = HandleToUlong( wc.hbrBackground );
wc32->lpszMenuName = PtrToUlong( wc.lpszMenuName );
wc32->lpszClassName = PtrToUlong( wc.lpszClassName );
wc32->hIconSm = HandleToUlong( wc.hIconSm );
client_menu_name_64to32( &client_name, client_name32 );
return TRUE;
}
NTSTATUS WINAPI wow64_NtUserGetClassName( UINT *args )
{
HWND hwnd = get_handle( &args );
......@@ -1283,6 +1360,46 @@ NTSTATUS WINAPI wow64_NtUserGetRawInputDeviceList( UINT *args )
}
}
NTSTATUS WINAPI wow64_NtUserRegisterClassExWOW( UINT *args )
{
const WNDCLASSEXW32 *wc32 = get_ptr( &args );
UNICODE_STRING32 *name32 = get_ptr( &args );
UNICODE_STRING32 *version32 = get_ptr( &args );
struct client_menu_name32 *client_name32 = get_ptr( &args );
DWORD fnid = get_ulong( &args );
DWORD flags = get_ulong( &args );
DWORD *wow = get_ptr( &args );
struct client_menu_name client_name;
UNICODE_STRING name, version;
WNDCLASSEXW wc;
if (wc32->cbSize != sizeof(*wc32))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
wc.cbSize = sizeof(wc);
wc.style = wc32->style;
wc.lpfnWndProc = UlongToPtr( wc32->lpfnWndProc );
wc.cbClsExtra = wc32->cbClsExtra;
wc.cbWndExtra = wc32->cbWndExtra;
wc.hInstance = UlongToHandle( wc32->hInstance );
wc.hIcon = UlongToHandle( wc32->hIcon );
wc.hCursor = UlongToHandle( wc32->hCursor );
wc.hbrBackground = UlongToHandle( wc32->hbrBackground );
wc.lpszMenuName = UlongToPtr( wc32->lpszMenuName );
wc.lpszClassName = UlongToPtr( wc32->lpszClassName );
wc.hIconSm = UlongToHandle( wc32->hIconSm );
return NtUserRegisterClassExWOW( &wc,
unicode_str_32to64( &name, name32 ),
unicode_str_32to64( &version, version32 ),
client_menu_name_32to64( &client_name, client_name32 ),
fnid, flags, wow );
}
NTSTATUS WINAPI wow64_NtUserGetRegisteredRawInputDevices( UINT *args )
{
RAWINPUTDEVICE32 *devices32 = get_ptr( &args );
......@@ -1797,6 +1914,35 @@ NTSTATUS WINAPI wow64_NtUserSetCapture( UINT *args )
return HandleToUlong( NtUserSetCapture( hwnd ));
}
NTSTATUS WINAPI wow64_NtUserSetClassLong( UINT *args )
{
HWND hwnd = get_handle( &args );
INT offset = get_ulong( &args );
LONG newval = get_ulong( &args );
BOOL ansi = get_ulong( &args );
return NtUserSetClassLong( hwnd, offset, newval, ansi );
}
NTSTATUS WINAPI wow64_NtUserSetClassLongPtr( UINT *args )
{
HWND hwnd = get_handle( &args );
INT offset = get_ulong( &args );
LONG_PTR newval = get_ulong( &args );
BOOL ansi = get_ulong( &args );
return NtUserSetClassLongPtr( hwnd, offset, newval, ansi );
}
NTSTATUS WINAPI wow64_NtUserSetClassWord( UINT *args )
{
HWND hwnd = get_handle( &args );
INT offset = get_ulong( &args );
WORD newval = get_ulong( &args );
return NtUserSetClassWord( hwnd, offset, newval );
}
NTSTATUS WINAPI wow64_NtUserSetClipboardData( UINT *args )
{
UINT format = get_ulong( &args );
......@@ -2290,6 +2436,21 @@ NTSTATUS WINAPI wow64_NtUserUnhookWindowsHookEx( UINT *args )
return NtUserUnhookWindowsHookEx( handle );
}
NTSTATUS WINAPI wow64_NtUserUnregisterClass( UINT *args )
{
UNICODE_STRING32 *name32 = get_ptr( &args );
HINSTANCE instance = get_ptr( &args );
struct client_menu_name32 *menu_name32 = get_ptr( &args );
UNICODE_STRING name;
struct client_menu_name menu_name;
BOOL ret;
ret = NtUserUnregisterClass( unicode_str_32to64( &name, name32 ), instance, &menu_name );
if (ret) client_menu_name_64to32( &menu_name, menu_name32 );
return ret;
}
NTSTATUS WINAPI wow64_NtUserUnregisterHotKey( UINT *args )
{
HWND hwnd = get_handle( &args );
......
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