From 9f041bb21e1140825a2cea72bf7c795800ee1609 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 13 Oct 2021 14:56:22 +0200 Subject: [PATCH] win32u: Move NtUserSetObjectInformation implementation from user32. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 2 +- dlls/user32/winstation.c | 28 +--------------------------- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/winstation.c | 25 +++++++++++++++++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 10 ++++++++++ include/ntuser.h | 1 + 9 files changed, 42 insertions(+), 30 deletions(-) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 97ad596e518..306f955b2a2 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -713,7 +713,7 @@ @ stdcall SetThreadDpiAwarenessContext(ptr) @ stdcall SetTimer(long long long ptr) @ stdcall SetUserObjectInformationA(long long ptr long) -@ stdcall SetUserObjectInformationW(long long ptr long) +@ stdcall SetUserObjectInformationW(long long ptr long) NtUserSetObjectInformation @ stdcall SetUserObjectSecurity(long ptr ptr) @ stdcall SetWinEventHook(long long long ptr long long long) @ stdcall SetWindowCompositionAttribute(ptr ptr) diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 5a786ad7f83..0046d475fbc 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -303,7 +303,7 @@ static void winstation_init(void) flags.fInherit = FALSE; flags.fReserved = FALSE; flags.dwFlags = WSF_VISIBLE; - SetUserObjectInformationW( handle, UOI_FLAGS, &flags, sizeof(flags) ); + NtUserSetObjectInformation( handle, UOI_FLAGS, &flags, sizeof(flags) ); } } } diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 1a955879f3d..e2c4f0f251f 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -461,33 +461,7 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW */ BOOL WINAPI SetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DWORD len ) { - return SetUserObjectInformationW( handle, index, info, len ); -} - - -/****************************************************************************** - * SetUserObjectInformationW (USER32.@) - */ -BOOL WINAPI SetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DWORD len ) -{ - BOOL ret; - const USEROBJECTFLAGS *obj_flags = info; - - if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) - { - SetLastError( ERROR_INVALID_PARAMETER ); - return FALSE; - } - /* FIXME: inherit flag */ - SERVER_START_REQ( set_user_object_info ) - { - req->handle = wine_server_obj_handle( handle ); - req->flags = SET_USER_OBJECT_SET_FLAGS; - req->obj_flags = obj_flags->dwFlags; - ret = !wine_server_call_err( req ); - } - SERVER_END_REQ; - return ret; + return NtUserSetObjectInformation( handle, index, info, len ); } diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 06fc68f00cf..f54098c5d4f 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -100,6 +100,7 @@ static void * const syscalls[] = NtUserGetProcessWindowStation, NtUserGetThreadDesktop, NtUserOpenInputDesktop, + NtUserSetObjectInformation, NtUserSetProcessWindowStation, NtUserSetThreadDesktop, }; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 5c477f75bfd..c82e974be04 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1213,7 +1213,7 @@ @ stub NtUserSetMirrorRendering @ stub NtUserSetMonitorWorkArea @ stub NtUserSetMouseInputRateLimitingTimer -@ stub NtUserSetObjectInformation +@ stdcall -syscall NtUserSetObjectInformation(long long ptr long) @ stub NtUserSetParent @ stub NtUserSetPrecisionTouchPadConfiguration @ stub NtUserSetProcessDpiAwarenessContext diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index 6bf2cd5e2c1..e787cc3884c 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -246,3 +246,28 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, return FALSE; } } + +/*********************************************************************** + * NtUserSetObjectInformation (win32u.@) + */ +BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ) +{ + BOOL ret; + const USEROBJECTFLAGS *obj_flags = info; + + if (index != UOI_FLAGS || !info || len < sizeof(*obj_flags)) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + /* FIXME: inherit flag */ + SERVER_START_REQ( set_user_object_info ) + { + req->handle = wine_server_obj_handle( handle ); + req->flags = SET_USER_OBJECT_SET_FLAGS; + req->obj_flags = obj_flags->dwFlags; + ret = !wine_server_call_err( req ); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 154c21e5cc6..303bdf08c57 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -86,6 +86,7 @@ SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserGetThreadDesktop ) \ SYSCALL_ENTRY( NtUserOpenInputDesktop ) \ + SYSCALL_ENTRY( NtUserSetObjectInformation ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetThreadDesktop ) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 47a7263ab46..59286969283 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -86,3 +86,13 @@ NTSTATUS WINAPI wow64_NtUserGetObjectInformation( UINT *args ) return NtUserGetObjectInformation( handle, index, info, len, needed ); } + +NTSTATUS WINAPI wow64_NtUserSetObjectInformation( UINT *args ) +{ + HANDLE handle = get_handle( &args ); + INT index = get_ulong( &args ); + void *info = get_ptr( &args ); + DWORD len = get_ulong( &args ); + + return NtUserSetObjectInformation( handle, index, info, len ); +} diff --git a/include/ntuser.h b/include/ntuser.h index 0478ab69967..e5d16afdd53 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -28,6 +28,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info, DWORD len, DWORD *needed ); HWINSTA WINAPI NtUserGetProcessWindowStation(void); HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); +BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );