win32u: Move NtUserGetThreadDesktop 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:00 +02:00 committed by Alexandre Julliard
parent ccf00c6d95
commit 915fb5681e
10 changed files with 30 additions and 21 deletions

View File

@ -387,7 +387,7 @@
@ stdcall GetTabbedTextExtentA(long str long long ptr)
@ stdcall GetTabbedTextExtentW(long wstr long long ptr)
@ stdcall GetTaskmanWindow ()
@ stdcall GetThreadDesktop(long)
@ stdcall GetThreadDesktop(long) NtUserGetThreadDesktop
@ stdcall GetThreadDpiAwarenessContext()
@ stdcall GetTitleBarInfo(long ptr)
@ stdcall GetTopWindow(long)

View File

@ -307,7 +307,7 @@ static void winstation_init(void)
}
}
}
if (buffer || !GetThreadDesktop( GetCurrentThreadId() ))
if (buffer || !NtUserGetThreadDesktop( GetCurrentThreadId() ))
{
handle = CreateDesktopW( desktop ? desktop : get_default_desktop(),
NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL );

View File

@ -2231,7 +2231,7 @@ HWND WINAPI GetDesktopWindow(void)
SERVER_START_REQ( set_user_object_info )
{
req->handle = wine_server_obj_handle( GetThreadDesktop(GetCurrentThreadId()) );
req->handle = wine_server_obj_handle( NtUserGetThreadDesktop(GetCurrentThreadId()) );
req->flags = SET_USER_OBJECT_GET_FULL_NAME;
wine_server_set_reply( req, desktop, sizeof(desktop) - sizeof(WCHAR) );
if (!wine_server_call( req ))

View File

@ -357,23 +357,6 @@ HDESK WINAPI OpenDesktopW( LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK
}
/******************************************************************************
* GetThreadDesktop (USER32.@)
*/
HDESK WINAPI GetThreadDesktop( DWORD thread )
{
HDESK ret = 0;
SERVER_START_REQ( get_thread_desktop )
{
req->tid = thread;
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
return ret;
}
/******************************************************************************
* SetThreadDesktop (USER32.@)
*/

View File

@ -97,6 +97,7 @@ static void * const syscalls[] =
NtUserCloseDesktop,
NtUserCloseWindowStation,
NtUserGetProcessWindowStation,
NtUserGetThreadDesktop,
NtUserSetProcessWindowStation,
};

View File

@ -995,7 +995,7 @@
@ stub NtUserGetSharedWindowData
@ stub NtUserGetSystemDpiForProcess
@ stub NtUserGetSystemMenu
@ stub NtUserGetThreadDesktop
@ stdcall -syscall NtUserGetThreadDesktop(long)
@ stub NtUserGetThreadState
@ stub NtUserGetTitleBarInfo
@ stub NtUserGetTopLevelWindow

View File

@ -90,3 +90,19 @@ BOOL WINAPI NtUserCloseDesktop( HDESK handle )
SERVER_END_REQ;
return ret;
}
/***********************************************************************
* NtUserGetThreadDesktop (win32u.@)
*/
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread )
{
HDESK ret = 0;
SERVER_START_REQ( get_thread_desktop )
{
req->tid = thread;
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
return ret;
}

View File

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

View File

@ -52,3 +52,10 @@ NTSTATUS WINAPI wow64_NtUserCloseDesktop( UINT *args )
return NtUserCloseDesktop( handle );
}
NTSTATUS WINAPI wow64_NtUserGetThreadDesktop( UINT *args )
{
DWORD thread = get_ulong( &args );
return HandleToUlong( NtUserGetThreadDesktop( thread ));
}

View File

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