win32u: Move NtUserSetThreadDesktop implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-10-13 14:54:21 +02:00 committed by Alexandre Julliard
parent 915fb5681e
commit ce9fc213a7
8 changed files with 32 additions and 10 deletions

View File

@ -311,7 +311,7 @@ static void winstation_init(void)
{
handle = CreateDesktopW( desktop ? desktop : get_default_desktop(),
NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );
if (handle) SetThreadDesktop( handle );
if (handle) NtUserSetThreadDesktop( handle );
}
HeapFree( GetProcessHeap(), 0, buffer );

View File

@ -362,14 +362,8 @@ HDESK WINAPI OpenDesktopW( LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK
*/
BOOL WINAPI SetThreadDesktop( HDESK handle )
{
BOOL ret;
BOOL ret = NtUserSetThreadDesktop( handle );
SERVER_START_REQ( set_thread_desktop )
{
req->handle = wine_server_obj_handle( handle );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
if (ret) /* reset the desktop windows */
{
struct user_thread_info *thread_info = get_user_thread_info();

View File

@ -99,6 +99,7 @@ static void * const syscalls[] =
NtUserGetProcessWindowStation,
NtUserGetThreadDesktop,
NtUserSetProcessWindowStation,
NtUserSetThreadDesktop,
};
static BYTE arguments[ARRAY_SIZE(syscalls)];

View File

@ -1232,7 +1232,7 @@
@ stub NtUserSetSystemMenu
@ stub NtUserSetSystemTimer
@ stub NtUserSetTargetForResourceBrokering
@ stub NtUserSetThreadDesktop
@ stdcall -syscall NtUserSetThreadDesktop(long)
@ stub NtUserSetThreadInputBlocked
@ stub NtUserSetThreadLayoutHandles
@ stub NtUserSetThreadState

View File

@ -106,3 +106,21 @@ HDESK WINAPI NtUserGetThreadDesktop( DWORD thread )
SERVER_END_REQ;
return ret;
}
/***********************************************************************
* NtUserSetThreadDesktop (win32u.@)
*/
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle )
{
BOOL ret;
SERVER_START_REQ( set_thread_desktop )
{
req->handle = wine_server_obj_handle( handle );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
/* FIXME: reset uset thread info */
return ret;
}

View File

@ -85,6 +85,7 @@
SYSCALL_ENTRY( NtUserCloseWindowStation ) \
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserSetProcessWindowStation )
SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserSetThreadDesktop )
#endif /* __WOW64WIN_SYSCALL_H */

View File

@ -59,3 +59,10 @@ NTSTATUS WINAPI wow64_NtUserGetThreadDesktop( UINT *args )
return HandleToUlong( NtUserGetThreadDesktop( thread ));
}
NTSTATUS WINAPI wow64_NtUserSetThreadDesktop( UINT *args )
{
HDESK handle = get_handle( &args );
return NtUserSetThreadDesktop( handle );
}

View File

@ -27,5 +27,6 @@ BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle );
HWINSTA WINAPI NtUserGetProcessWindowStation(void);
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
#endif /* _NTUSER_ */