Commit fd840680 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserOpenWindowStation implementation from user32.

parent 1d30bac7
......@@ -163,28 +163,17 @@ HWINSTA WINAPI OpenWindowStationA( LPCSTR name, BOOL inherit, ACCESS_MASK access
*/
HWINSTA WINAPI OpenWindowStationW( LPCWSTR name, BOOL inherit, ACCESS_MASK access )
{
HANDLE ret = 0;
DWORD len = name ? lstrlenW(name) : 0;
if (len >= MAX_PATH)
{
SetLastError( ERROR_FILENAME_EXCED_RANGE );
return 0;
}
if (!len)
{
name = get_winstation_default_name();
len = lstrlenW( name );
}
SERVER_START_REQ( open_winstation )
{
req->access = access;
req->attributes = OBJ_CASE_INSENSITIVE | (inherit ? OBJ_INHERIT : 0);
req->rootdir = wine_server_obj_handle( get_winstations_dir_handle() );
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;
OBJECT_ATTRIBUTES attr;
UNICODE_STRING str;
RtlInitUnicodeString( &str, name );
if (!str.Length) RtlInitUnicodeString( &str, get_winstation_default_name() );
InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE,
get_winstations_dir_handle(), NULL );
if (inherit) attr.Attributes |= OBJ_INHERIT;
return NtUserOpenWindowStation( &attr, access );
}
......
......@@ -101,6 +101,7 @@ static void * const syscalls[] =
NtUserGetProcessWindowStation,
NtUserGetThreadDesktop,
NtUserOpenInputDesktop,
NtUserOpenWindowStation,
NtUserSetObjectInformation,
NtUserSetProcessWindowStation,
NtUserSetThreadDesktop,
......
......@@ -1094,7 +1094,7 @@
@ stub NtUserOpenDesktop
@ stdcall -syscall NtUserOpenInputDesktop(long long long)
@ stub NtUserOpenThreadDesktop
@ stub NtUserOpenWindowStation
@ stdcall -syscall NtUserOpenWindowStation(ptr long)
@ stub NtUserPaintDesktop
@ stub NtUserPaintMenuBar
@ stub NtUserPaintMonitor
......
......@@ -61,6 +61,25 @@ HWINSTA WINAPI NtUserCreateWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK a
return ret;
}
/******************************************************************************
* NtUserOpenWindowStation (win32u.@)
*/
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access )
{
HANDLE ret = 0;
SERVER_START_REQ( open_winstation )
{
req->access = access;
req->attributes = attr->Attributes;
req->rootdir = wine_server_obj_handle( attr->RootDirectory );
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;
}
/***********************************************************************
* NtUserCloseWindowStation (win32u.@)
*/
......
......@@ -87,6 +87,7 @@
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserSetObjectInformation ) \
SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserSetThreadDesktop )
......
......@@ -44,6 +44,16 @@ NTSTATUS WINAPI wow64_NtUserCreateWindowStation( UINT *args )
arg3, arg4, arg5, arg6, arg7 ));
}
NTSTATUS WINAPI wow64_NtUserOpenWindowStation( UINT *args )
{
OBJECT_ATTRIBUTES32 *attr32 = get_ptr( &args );
ACCESS_MASK access = get_ulong( &args );
struct object_attr64 attr;
return HandleToUlong( NtUserOpenWindowStation( objattr_32to64( &attr, attr32 ), access ));
}
NTSTATUS WINAPI wow64_NtUserCloseWindowStation( UINT *args )
{
HWINSTA handle = get_handle( &args );
......
......@@ -30,6 +30,7 @@ BOOL WINAPI NtUserGetObjectInformation( HANDLE handle, INT index, void *info,
DWORD len, DWORD *needed );
HWINSTA WINAPI NtUserGetProcessWindowStation(void);
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access );
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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment