From af7ed8a538a51c120a7c0b82b2838c6310827b4e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 13 Oct 2021 14:54:56 +0200 Subject: [PATCH] win32u: Move NtUserOpenInputDesktop implementation from user32. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/user32/user32.spec | 2 +- dlls/user32/winstation.c | 25 ------------------------- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/winstation.c | 28 ++++++++++++++++++++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 9 +++++++++ include/ntuser.h | 1 + 8 files changed, 42 insertions(+), 27 deletions(-) diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index ecc7675403c..0c1066bc895 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -556,7 +556,7 @@ @ stdcall OpenDesktopA(str long long long) @ stdcall OpenDesktopW(wstr long long long) @ stdcall OpenIcon(long) -@ stdcall OpenInputDesktop(long long long) +@ stdcall OpenInputDesktop(long long long) NtUserOpenInputDesktop @ stdcall OpenWindowStationA(str long long) @ stdcall OpenWindowStationW(wstr long long) @ stdcall PackDDElParam(long long long) diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index a8140c34b8d..1899feb6a28 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -426,31 +426,6 @@ BOOL WINAPI EnumDesktopsW( HWINSTA winsta, DESKTOPENUMPROCW func, LPARAM lparam } -/****************************************************************************** - * OpenInputDesktop (USER32.@) - */ -HDESK WINAPI OpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ) -{ - HANDLE ret = 0; - - TRACE( "(%x,%i,%x)\n", flags, inherit, access ); - - if (flags) - FIXME( "partial stub flags %08x\n", flags ); - - SERVER_START_REQ( open_input_desktop ) - { - req->flags = flags; - req->access = access; - req->attributes = inherit ? OBJ_INHERIT : 0; - if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle ); - } - SERVER_END_REQ; - - return ret; -} - - /*********************************************************************** * GetUserObjectInformationA (USER32.@) */ diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 7ea1f30e3f9..2b54fddfb1a 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -98,6 +98,7 @@ static void * const syscalls[] = NtUserCloseWindowStation, NtUserGetProcessWindowStation, NtUserGetThreadDesktop, + NtUserOpenInputDesktop, NtUserSetProcessWindowStation, NtUserSetThreadDesktop, }; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index c24957a224c..dc380b84c34 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1092,7 +1092,7 @@ @ stub NtUserNotifyWinEvent @ stub NtUserOpenClipboard @ stub NtUserOpenDesktop -@ stub NtUserOpenInputDesktop +@ stdcall -syscall NtUserOpenInputDesktop(long long long) @ stub NtUserOpenThreadDesktop @ stub NtUserOpenWindowStation @ stub NtUserPaintDesktop diff --git a/dlls/win32u/winstation.c b/dlls/win32u/winstation.c index 7cebe5d44d7..af744ce89eb 100644 --- a/dlls/win32u/winstation.c +++ b/dlls/win32u/winstation.c @@ -28,6 +28,10 @@ #include "ntuser.h" #include "winternl.h" #include "wine/server.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(winstation); + /*********************************************************************** * NtUserCloseWindowStation (win32u.@) @@ -124,3 +128,27 @@ BOOL WINAPI NtUserSetThreadDesktop( HDESK handle ) /* FIXME: reset uset thread info */ return ret; } + +/*********************************************************************** + * NtUserOpenInputDesktop (win32u.@) + */ +HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ) +{ + HANDLE ret = 0; + + TRACE( "(%x,%i,%x)\n", flags, inherit, access ); + + if (flags) + FIXME( "partial stub flags %08x\n", flags ); + + SERVER_START_REQ( open_input_desktop ) + { + req->flags = flags; + req->access = access; + req->attributes = inherit ? OBJ_INHERIT : 0; + if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle ); + } + SERVER_END_REQ; + + return ret; +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index d6c4c5856bd..154c21e5cc6 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -85,6 +85,7 @@ SYSCALL_ENTRY( NtUserCloseWindowStation ) \ SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserGetThreadDesktop ) \ + SYSCALL_ENTRY( NtUserOpenInputDesktop ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetThreadDesktop ) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index a4b26c5ac96..9dca44286e3 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -66,3 +66,12 @@ NTSTATUS WINAPI wow64_NtUserSetThreadDesktop( UINT *args ) return NtUserSetThreadDesktop( handle ); } + +NTSTATUS WINAPI wow64_NtUserOpenInputDesktop( UINT *args ) +{ + DWORD flags = get_ulong( &args ); + BOOL inherit = get_ulong( &args ); + ACCESS_MASK access = get_ulong( &args ); + + return HandleToUlong( NtUserOpenInputDesktop( flags, inherit, access )); +} diff --git a/include/ntuser.h b/include/ntuser.h index b9d94ce66de..d253c127ad3 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -26,6 +26,7 @@ BOOL WINAPI NtUserCloseDesktop( HDESK handle ); BOOL WINAPI NtUserCloseWindowStation( HWINSTA handle ); HWINSTA WINAPI NtUserGetProcessWindowStation(void); HDESK WINAPI NtUserGetThreadDesktop( DWORD thread ); +HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );