win32u: Move NtUserOpenDesktop implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
50013758ff
commit
c07dcf5968
|
@ -290,24 +290,13 @@ HDESK WINAPI OpenDesktopA( LPCSTR name, DWORD flags, BOOL inherit, ACCESS_MASK a
|
||||||
|
|
||||||
HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access )
|
HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access )
|
||||||
{
|
{
|
||||||
HANDLE ret = 0;
|
OBJECT_ATTRIBUTES attr;
|
||||||
DWORD len = name ? lstrlenW(name) : 0;
|
UNICODE_STRING str;
|
||||||
if (len >= MAX_PATH)
|
|
||||||
{
|
RtlInitUnicodeString( &str, name );
|
||||||
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE, hwinsta, NULL );
|
||||||
return 0;
|
if (inherit) attr.Attributes |= OBJ_INHERIT;
|
||||||
}
|
return NtUserOpenDesktop( &attr, flags, access );
|
||||||
SERVER_START_REQ( open_desktop )
|
|
||||||
{
|
|
||||||
req->winsta = wine_server_obj_handle( hwinsta );
|
|
||||||
req->flags = flags;
|
|
||||||
req->access = access;
|
|
||||||
req->attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0);
|
|
||||||
wine_server_add_data( req, name, len * sizeof(WCHAR) );
|
|
||||||
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
|
|
||||||
}
|
|
||||||
SERVER_END_REQ;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ static void * const syscalls[] =
|
||||||
NtUserGetObjectInformation,
|
NtUserGetObjectInformation,
|
||||||
NtUserGetProcessWindowStation,
|
NtUserGetProcessWindowStation,
|
||||||
NtUserGetThreadDesktop,
|
NtUserGetThreadDesktop,
|
||||||
|
NtUserOpenDesktop,
|
||||||
NtUserOpenInputDesktop,
|
NtUserOpenInputDesktop,
|
||||||
NtUserOpenWindowStation,
|
NtUserOpenWindowStation,
|
||||||
NtUserSetObjectInformation,
|
NtUserSetObjectInformation,
|
||||||
|
|
|
@ -1091,7 +1091,7 @@
|
||||||
@ stub NtUserNotifyProcessCreate
|
@ stub NtUserNotifyProcessCreate
|
||||||
@ stub NtUserNotifyWinEvent
|
@ stub NtUserNotifyWinEvent
|
||||||
@ stub NtUserOpenClipboard
|
@ stub NtUserOpenClipboard
|
||||||
@ stub NtUserOpenDesktop
|
@ stdcall -syscall NtUserOpenDesktop(ptr long long)
|
||||||
@ stdcall -syscall NtUserOpenInputDesktop(long long long)
|
@ stdcall -syscall NtUserOpenInputDesktop(long long long)
|
||||||
@ stub NtUserOpenThreadDesktop
|
@ stub NtUserOpenThreadDesktop
|
||||||
@ stdcall -syscall NtUserOpenWindowStation(ptr long)
|
@ stdcall -syscall NtUserOpenWindowStation(ptr long)
|
||||||
|
|
|
@ -159,6 +159,30 @@ HDESK WINAPI NtUserCreateDesktopEx( OBJECT_ATTRIBUTES *attr, UNICODE_STRING *dev
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* NtUserOpenDesktop (win32u.@)
|
||||||
|
*/
|
||||||
|
HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MASK access )
|
||||||
|
{
|
||||||
|
HANDLE ret = 0;
|
||||||
|
if (attr->ObjectName->Length >= MAX_PATH * sizeof(WCHAR))
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
SERVER_START_REQ( open_desktop )
|
||||||
|
{
|
||||||
|
req->winsta = wine_server_obj_handle( attr->RootDirectory );
|
||||||
|
req->flags = flags;
|
||||||
|
req->access = access;
|
||||||
|
req->attributes = attr->Attributes;
|
||||||
|
wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length );
|
||||||
|
if (!wine_server_call_err( req )) ret = wine_server_ptr_handle( reply->handle );
|
||||||
|
}
|
||||||
|
SERVER_END_REQ;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* NtUserCloseDesktop (win32u.@)
|
* NtUserCloseDesktop (win32u.@)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -87,6 +87,7 @@
|
||||||
SYSCALL_ENTRY( NtUserCreateWindowStation ) \
|
SYSCALL_ENTRY( NtUserCreateWindowStation ) \
|
||||||
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
|
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
|
||||||
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
|
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
|
||||||
|
SYSCALL_ENTRY( NtUserOpenDesktop ) \
|
||||||
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
|
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
|
||||||
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
|
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
|
||||||
SYSCALL_ENTRY( NtUserSetObjectInformation ) \
|
SYSCALL_ENTRY( NtUserSetObjectInformation ) \
|
||||||
|
|
|
@ -92,6 +92,19 @@ NTSTATUS WINAPI wow64_NtUserCreateDesktopEx( UINT *args )
|
||||||
return HandleToUlong( ret );
|
return HandleToUlong( ret );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS WINAPI wow64_NtUserOpenDesktop( UINT *args )
|
||||||
|
{
|
||||||
|
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
|
||||||
|
DWORD flags = get_ulong( &args );
|
||||||
|
ACCESS_MASK access = get_ulong( &args );
|
||||||
|
|
||||||
|
struct object_attr64 attr;
|
||||||
|
HANDLE ret;
|
||||||
|
|
||||||
|
ret = NtUserOpenDesktop( objattr_32to64( &attr, attr32 ), flags, access );
|
||||||
|
return HandleToUlong( ret );
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI wow64_NtUserCloseDesktop( UINT *args )
|
NTSTATUS WINAPI wow64_NtUserCloseDesktop( UINT *args )
|
||||||
{
|
{
|
||||||
HDESK handle = get_handle( &args );
|
HDESK handle = get_handle( &args );
|
||||||
|
|
|
@ -36,6 +36,7 @@ HWINSTA WINAPI NtUserGetProcessWindowStation(void);
|
||||||
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
|
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
|
||||||
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access );
|
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access );
|
||||||
BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len );
|
BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len );
|
||||||
|
HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MASK access );
|
||||||
HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access );
|
HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access );
|
||||||
BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
|
BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
|
||||||
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
|
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
|
||||||
|
|
Loading…
Reference in New Issue