From: Jacek Caban jacek@codeweavers.com
--- dlls/win32u/gdiobj.c | 6 ---- dlls/win32u/syscall.c | 6 ++++ dlls/win32u/sysparams.c | 5 ++- dlls/win32u/win32u.spec | 12 +++---- dlls/win32u/win32u_private.h | 17 --------- dlls/win32u/wrappers.c | 40 --------------------- dlls/wow64win/syscall.h | 6 ++++ dlls/wow64win/user.c | 67 ++++++++++++++++++++++++++++++++++++ 8 files changed, 89 insertions(+), 70 deletions(-)
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c index aeb043b33d1..4ccfd77dfa0 100644 --- a/dlls/win32u/gdiobj.c +++ b/dlls/win32u/gdiobj.c @@ -1136,7 +1136,6 @@ static struct unix_funcs unix_funcs = NtGdiUnrealizeObject, NtGdiUpdateColors, NtGdiWidenPath, - NtUserChangeDisplaySettings, NtUserClipCursor, NtUserCreateCaret, NtUserCreateWindowEx, @@ -1153,13 +1152,9 @@ static struct unix_funcs unix_funcs = NtUserEnableScrollBar, NtUserEndDeferWindowPosEx, NtUserEndPaint, - NtUserEnumDisplayDevices, - NtUserEnumDisplayMonitors, - NtUserEnumDisplaySettings, NtUserExcludeUpdateRgn, NtUserFlashWindowEx, NtUserGetClassInfoEx, - NtUserGetDisplayConfigBufferSizes, NtUserGetIconInfo, NtUserGetMenuBarInfo, NtUserGetScrollBarInfo, @@ -1186,7 +1181,6 @@ static struct unix_funcs unix_funcs = NtUserSetMenu, NtUserSetParent, NtUserSetScrollInfo, - NtUserSetSysColors, NtUserSetSystemMenu, NtUserSetWindowLong, NtUserSetWindowLongPtr, diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 3a4fc085ac6..982a75a0bd9 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -114,6 +114,7 @@ static void * const syscalls[] = NtUserCallOneParam, NtUserCallTwoParam, NtUserChangeClipboardChain, + NtUserChangeDisplaySettings, NtUserCheckMenuItem, NtUserChildWindowFromPointEx, NtUserCloseClipboard, @@ -131,6 +132,9 @@ static void * const syscalls[] = NtUserDispatchMessage, NtUserEmptyClipboard, NtUserEndMenu, + NtUserEnumDisplayDevices, + NtUserEnumDisplayMonitors, + NtUserEnumDisplaySettings, NtUserFindExistingCursorIcon, NtUserFindWindowEx, NtUserGetAncestor, @@ -148,6 +152,7 @@ static void * const syscalls[] = NtUserGetCursorFrameInfo, NtUserGetCursorInfo, NtUserGetDCEx, + NtUserGetDisplayConfigBufferSizes, NtUserGetDoubleClickTime, NtUserGetDpiForMonitor, NtUserGetForegroundWindow, @@ -220,6 +225,7 @@ static void * const syscalls[] = NtUserSetProcessDpiAwarenessContext, NtUserSetProcessWindowStation, NtUserSetProp, + NtUserSetSysColors, NtUserSetSystemTimer, NtUserSetThreadDesktop, NtUserSetTimer, diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 8bb6b46397e..056a0e2a40b 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -2155,9 +2155,12 @@ BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc params.lparam = lparam; for (i = 0; i < count; i++) { + void *ret_ptr; + ULONG ret_len; params.monitor = enum_info[i].handle; params.rect = enum_info[i].rect; - if (!user32_call( NtUserCallEnumDisplayMonitor, ¶ms, sizeof(params) )) + if (!KeUserModeCallback( NtUserCallEnumDisplayMonitor, ¶ms, sizeof(params), + &ret_ptr, &ret_len )) { ret = FALSE; break; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 3db0092e8a9..a15e1cadbd3 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -783,7 +783,7 @@ @ stdcall -syscall NtUserCallTwoParam(long long long) @ stub NtUserCanBrokerForceForeground @ stdcall -syscall NtUserChangeClipboardChain(long long) -@ stdcall NtUserChangeDisplaySettings(ptr ptr long long ptr) +@ stdcall -syscall NtUserChangeDisplaySettings(ptr ptr long long ptr) @ stub NtUserChangeWindowMessageFilterEx @ stub NtUserCheckAccessForIntegrityLevel @ stdcall -syscall NtUserCheckMenuItem(long long long) @@ -875,9 +875,9 @@ @ stdcall NtUserEndDeferWindowPosEx(long long) @ stdcall -syscall NtUserEndMenu() @ stdcall NtUserEndPaint(long ptr) -@ stdcall NtUserEnumDisplayDevices(ptr long ptr long) -@ stdcall NtUserEnumDisplayMonitors(long ptr ptr long) -@ stdcall NtUserEnumDisplaySettings(ptr long ptr long) +@ stdcall -syscall NtUserEnumDisplayDevices(ptr long ptr long) +@ stdcall -syscall NtUserEnumDisplayMonitors(long ptr ptr long) +@ stdcall -syscall NtUserEnumDisplaySettings(ptr long ptr long) @ stub NtUserEvent @ stdcall NtUserExcludeUpdateRgn(long long) @ stub NtUserFillWindow @@ -921,7 +921,7 @@ @ stub NtUserGetDesktopID @ stub NtUserGetDisplayAutoRotationPreferences @ stub NtUserGetDisplayAutoRotationPreferencesByProcessId -@ stdcall NtUserGetDisplayConfigBufferSizes(long ptr ptr) +@ stdcall -syscall NtUserGetDisplayConfigBufferSizes(long ptr ptr) @ stdcall -syscall NtUserGetDoubleClickTime() @ stub NtUserGetDpiForCurrentProcess @ stdcall -syscall NtUserGetDpiForMonitor(long long ptr ptr) @@ -1227,7 +1227,7 @@ @ stub NtUserSetSensorPresence @ stub NtUserSetSharedWindowData @ stub NtUserSetShellWindowEx -@ stdcall NtUserSetSysColors(long ptr ptr) +@ stdcall -syscall NtUserSetSysColors(long ptr ptr) @ stub NtUserSetSystemCursor @ stdcall NtUserSetSystemMenu(long long) @ stdcall -syscall NtUserSetSystemTimer(long long long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 5351f98022b..50236ea2c63 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -186,8 +186,6 @@ struct unix_funcs BOOL (WINAPI *pNtGdiUnrealizeObject)( HGDIOBJ obj ); BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc ); BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc ); - LONG (WINAPI *pNtUserChangeDisplaySettings)( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, - DWORD flags, void *lparam ); BOOL (WINAPI *pNtUserClipCursor)( const RECT *rect ); BOOL (WINAPI *pNtUserCreateCaret)( HWND hwnd, HBITMAP bitmap, int width, int height ); HWND (WINAPI *pNtUserCreateWindowEx)( DWORD ex_style, UNICODE_STRING *class_name, @@ -212,17 +210,10 @@ struct unix_funcs BOOL (WINAPI *pNtUserEnableScrollBar)( HWND hwnd, UINT bar, UINT flags ); BOOL (WINAPI *pNtUserEndDeferWindowPosEx)( HDWP hdwp, BOOL async ); BOOL (WINAPI *pNtUserEndPaint)( HWND hwnd, const PAINTSTRUCT *ps ); - NTSTATUS (WINAPI *pNtUserEnumDisplayDevices)( UNICODE_STRING *device, DWORD index, - DISPLAY_DEVICEW *info, DWORD flags ); - BOOL (WINAPI *pNtUserEnumDisplayMonitors)( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ); - BOOL (WINAPI *pNtUserEnumDisplaySettings)( UNICODE_STRING *device, DWORD mode, - DEVMODEW *dev_mode, DWORD flags ); INT (WINAPI *pNtUserExcludeUpdateRgn)( HDC hdc, HWND hwnd ); BOOL (WINAPI *pNtUserFlashWindowEx)( FLASHWINFO *info ); ATOM (WINAPI *pNtUserGetClassInfoEx)( HINSTANCE instance, UNICODE_STRING *name, WNDCLASSEXW *wc, struct client_menu_name *menu_name, BOOL ansi ); - LONG (WINAPI *pNtUserGetDisplayConfigBufferSizes)( UINT32 flags, UINT32 *num_path_info, - UINT32 *num_mode_info ); BOOL (WINAPI *pNtUserGetIconInfo)( HICON icon, ICONINFO *info, UNICODE_STRING *module, UNICODE_STRING *res_name, DWORD *bpp, LONG unk ); BOOL (WINAPI *pNtUserGetMenuBarInfo)( HWND hwnd, LONG id, LONG item, MENUBARINFO *info ); @@ -255,7 +246,6 @@ struct unix_funcs BOOL (WINAPI *pNtUserSetMenu)( HWND hwnd, HMENU menu ); HWND (WINAPI *pNtUserSetParent)( HWND hwnd, HWND parent ); INT (WINAPI *pNtUserSetScrollInfo)( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL redraw ); - BOOL (WINAPI *pNtUserSetSysColors)( INT count, const INT *colors, const COLORREF *values ); BOOL (WINAPI *pNtUserSetSystemMenu)( HWND hwnd, HMENU menu ); LONG (WINAPI *pNtUserSetWindowLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi ); LONG_PTR (WINAPI *pNtUserSetWindowLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi ); @@ -520,13 +510,6 @@ static inline struct user_thread_info *get_user_thread_info(void)
extern const struct user_driver_funcs *user_driver DECLSPEC_HIDDEN;
-static inline NTSTATUS user32_call( ULONG id, void *args, ULONG len ) -{ - /* FIXME: use KeUserModeCallback instead */ - NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id]; - return func( args, len ); -} - static inline BOOL set_ntstatus( NTSTATUS status ) { if (status) SetLastError( RtlNtStatusToDosError( status )); diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c index 678cc6af6ef..5b0e4f19b0f 100644 --- a/dlls/win32u/wrappers.c +++ b/dlls/win32u/wrappers.c @@ -725,13 +725,6 @@ NTSTATUS WINAPI NtGdiDdDDISetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER return unix_funcs->pNtGdiDdDDISetVidPnSourceOwner( desc ); }
-LONG WINAPI NtUserChangeDisplaySettings( UNICODE_STRING *devname, DEVMODEW *devmode, HWND hwnd, - DWORD flags, void *lparam ) -{ - if (!unix_funcs) return DISP_CHANGE_FAILED; - return unix_funcs->pNtUserChangeDisplaySettings( devname, devmode, hwnd, flags, lparam ); -} - BOOL WINAPI NtUserClipCursor( const RECT *rect ) { if (!unix_funcs) return FALSE; @@ -833,26 +826,6 @@ BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async ) return unix_funcs->pNtUserEndDeferWindowPosEx( hdwp, async ); }
-NTSTATUS WINAPI NtUserEnumDisplayDevices( UNICODE_STRING *device, DWORD index, - DISPLAY_DEVICEW *info, DWORD flags ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->pNtUserEnumDisplayDevices( device, index, info, flags ); -} - -BOOL WINAPI NtUserEnumDisplayMonitors( HDC hdc, RECT *rect, MONITORENUMPROC proc, LPARAM lp ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->pNtUserEnumDisplayMonitors( hdc, rect, proc, lp ); -} - -BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD mode, - DEVMODEW *dev_mode, DWORD flags ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->pNtUserEnumDisplaySettings( device, mode, dev_mode, flags ); -} - INT WINAPI NtUserExcludeUpdateRgn( HDC hdc, HWND hwnd ) { if (!unix_funcs) return ERROR; @@ -872,13 +845,6 @@ ATOM WINAPI NtUserGetClassInfoEx( HINSTANCE instance, UNICODE_STRING *name, WNDC return unix_funcs->pNtUserGetClassInfoEx( instance, name, wc, menu_name, ansi ); }
-LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path_info, - UINT32 *num_mode_info ) -{ - if (!unix_funcs) return ERROR_NOT_SUPPORTED; - return unix_funcs->pNtUserGetDisplayConfigBufferSizes( flags, num_path_info, num_mode_info ); -} - BOOL WINAPI NtUserGetIconInfo( HICON icon, ICONINFO *info, UNICODE_STRING *module, UNICODE_STRING *res_name, DWORD *bpp, LONG unk ) { @@ -1040,12 +1006,6 @@ INT WINAPI NtUserSetScrollInfo( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL return unix_funcs->pNtUserSetScrollInfo( hwnd, bar, info, redraw ); }
-BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values ) -{ - if (!unix_funcs) return FALSE; - return unix_funcs->pNtUserSetSysColors( count, colors, values ); -} - BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu ) { if (!unix_funcs) return FALSE; diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 82849ccd466..b5fa4cb9e48 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -101,6 +101,7 @@ SYSCALL_ENTRY( NtUserCallOneParam ) \ SYSCALL_ENTRY( NtUserCallTwoParam ) \ SYSCALL_ENTRY( NtUserChangeClipboardChain ) \ + SYSCALL_ENTRY( NtUserChangeDisplaySettings ) \ SYSCALL_ENTRY( NtUserCheckMenuItem ) \ SYSCALL_ENTRY( NtUserChildWindowFromPointEx ) \ SYSCALL_ENTRY( NtUserCloseClipboard ) \ @@ -118,6 +119,9 @@ SYSCALL_ENTRY( NtUserDispatchMessage ) \ SYSCALL_ENTRY( NtUserEmptyClipboard ) \ SYSCALL_ENTRY( NtUserEndMenu ) \ + SYSCALL_ENTRY( NtUserEnumDisplayDevices ) \ + SYSCALL_ENTRY( NtUserEnumDisplayMonitors ) \ + SYSCALL_ENTRY( NtUserEnumDisplaySettings ) \ SYSCALL_ENTRY( NtUserFindExistingCursorIcon ) \ SYSCALL_ENTRY( NtUserFindWindowEx ) \ SYSCALL_ENTRY( NtUserGetAncestor ) \ @@ -135,6 +139,7 @@ SYSCALL_ENTRY( NtUserGetCursorFrameInfo ) \ SYSCALL_ENTRY( NtUserGetCursorInfo ) \ SYSCALL_ENTRY( NtUserGetDCEx ) \ + SYSCALL_ENTRY( NtUserGetDisplayConfigBufferSizes ) \ SYSCALL_ENTRY( NtUserGetDoubleClickTime ) \ SYSCALL_ENTRY( NtUserGetDpiForMonitor ) \ SYSCALL_ENTRY( NtUserGetForegroundWindow ) \ @@ -207,6 +212,7 @@ SYSCALL_ENTRY( NtUserSetProcessDpiAwarenessContext ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetProp ) \ + SYSCALL_ENTRY( NtUserSetSysColors ) \ SYSCALL_ENTRY( NtUserSetSystemTimer ) \ SYSCALL_ENTRY( NtUserSetThreadDesktop ) \ SYSCALL_ENTRY( NtUserSetTimer ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 564f17f720b..8b81baa0e58 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -294,6 +294,20 @@ NTSTATUS WINAPI wow64_NtUserChangeClipboardChain( UINT *args ) return NtUserChangeClipboardChain( hwnd, next ); }
+NTSTATUS WINAPI wow64_NtUserChangeDisplaySettings( UINT *args ) +{ + UNICODE_STRING32 *devname32 = get_ptr( &args ); + DEVMODEW *devmode = get_ptr( &args ); + HWND hwnd = get_handle( &args ); + DWORD flags = get_ulong( &args ); + void *lparam = get_ptr( &args ); + + UNICODE_STRING devname; + + return NtUserChangeDisplaySettings( unicode_str_32to64( &devname, devname32 ), + devmode, hwnd, flags, lparam ); +} + NTSTATUS WINAPI wow64_NtUserCheckMenuItem( UINT *args ) { HMENU handle = get_handle( &args ); @@ -437,6 +451,41 @@ NTSTATUS WINAPI wow64_NtUserEndMenu( UINT *args ) return NtUserEndMenu(); }
+NTSTATUS WINAPI wow64_NtUserEnumDisplayDevices( UINT *args ) +{ + UNICODE_STRING32 *device32 = get_ptr( &args ); + DWORD index = get_ulong( &args ); + DISPLAY_DEVICEW *info = get_ptr( &args ); + DWORD flags = get_ulong( &args ); + + UNICODE_STRING device; + + return NtUserEnumDisplayDevices( unicode_str_32to64( &device, device32 ), index, info, flags ); +} + +NTSTATUS WINAPI wow64_NtUserEnumDisplayMonitors( UINT *args ) +{ + HDC hdc = get_handle( &args ); + RECT *rect = get_ptr( &args ); + MONITORENUMPROC proc = get_ptr( &args ); + LPARAM lp = get_ulong( &args ); + + return NtUserEnumDisplayMonitors( hdc, rect, proc, lp ); +} + +NTSTATUS WINAPI wow64_NtUserEnumDisplaySettings( UINT *args ) +{ + UNICODE_STRING32 *device32 = get_ptr( &args ); + DWORD mode = get_ulong( &args ); + DEVMODEW *dev_mode = get_ptr( &args ); + DWORD flags = get_ulong( &args ); + + UNICODE_STRING device; + + return NtUserEnumDisplaySettings( unicode_str_32to64( &device, device32 ), + mode, dev_mode, flags ); +} + NTSTATUS WINAPI wow64_NtUserFindExistingCursorIcon( UINT *args ) { UNICODE_STRING32 *module32 = get_ptr( &args ); @@ -610,6 +659,15 @@ NTSTATUS WINAPI wow64_NtUserGetDCEx( UINT *args ) return HandleToUlong( NtUserGetDCEx( hwnd, clip_rgn, flags )); }
+NTSTATUS WINAPI wow64_NtUserGetDisplayConfigBufferSizes( UINT *args ) +{ + UINT32 flags = get_ulong( &args ); + UINT32 *num_path_info = get_ptr( &args ); + UINT32 *num_mode_info = get_ptr( &args ); + + return NtUserGetDisplayConfigBufferSizes( flags, num_path_info, num_mode_info ); +} + NTSTATUS WINAPI wow64_NtUserGetDoubleClickTime( UINT *args ) { return NtUserGetDoubleClickTime(); @@ -1514,6 +1572,15 @@ NTSTATUS WINAPI wow64_NtUserSetProp( UINT *args ) return NtUserSetProp( hwnd, str, handle ); }
+NTSTATUS WINAPI wow64_NtUserSetSysColors( UINT *args ) +{ + INT count = get_ulong( &args ); + const INT *colors = get_ptr( &args ); + const COLORREF *values = get_ptr( &args ); + + return NtUserSetSysColors( count, colors, values ); +} + NTSTATUS WINAPI wow64_NtUserSetSystemTimer( UINT *args ) { HWND hwnd = get_handle( &args );