2005-06-08 20:44:50 +02:00
|
|
|
/*
|
|
|
|
* Window stations and desktops
|
|
|
|
*
|
|
|
|
* Copyright 2002 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-06-08 20:44:50 +02:00
|
|
|
*/
|
|
|
|
|
2008-03-05 22:41:41 +01:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
|
2005-06-08 20:44:50 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
2016-01-20 14:02:03 +01:00
|
|
|
#include "winternl.h"
|
|
|
|
#include "ddk/wdm.h"
|
2005-06-08 20:44:50 +02:00
|
|
|
#include "wine/server.h"
|
|
|
|
#include "wine/debug.h"
|
2005-07-08 13:37:40 +02:00
|
|
|
#include "user_private.h"
|
2005-06-08 20:44:50 +02:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(winstation);
|
|
|
|
|
|
|
|
|
|
|
|
/* callback for enumeration functions */
|
|
|
|
struct enum_proc_lparam
|
|
|
|
{
|
|
|
|
NAMEENUMPROCA func;
|
|
|
|
LPARAM lparam;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK enum_names_WtoA( LPWSTR name, LPARAM lparam )
|
|
|
|
{
|
|
|
|
struct enum_proc_lparam *data = (struct enum_proc_lparam *)lparam;
|
|
|
|
char buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (!WideCharToMultiByte( CP_ACP, 0, name, -1, buffer, sizeof(buffer), NULL, NULL ))
|
|
|
|
return FALSE;
|
|
|
|
return data->func( buffer, data->lparam );
|
|
|
|
}
|
|
|
|
|
2016-01-20 14:02:03 +01:00
|
|
|
/* return a handle to the directory where window station objects are created */
|
|
|
|
static HANDLE get_winstations_dir_handle(void)
|
|
|
|
{
|
|
|
|
static HANDLE handle = NULL;
|
2016-07-18 08:38:42 +02:00
|
|
|
WCHAR buffer[64];
|
2016-01-20 14:02:03 +01:00
|
|
|
UNICODE_STRING str;
|
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
|
|
|
|
if (!handle)
|
|
|
|
{
|
|
|
|
HANDLE dir;
|
|
|
|
|
2020-09-21 16:31:11 +02:00
|
|
|
swprintf( buffer, ARRAY_SIZE(buffer), L"\\Sessions\\%u\\Windows\\WindowStations", NtCurrentTeb()->Peb->SessionId );
|
2016-07-18 08:38:42 +02:00
|
|
|
RtlInitUnicodeString( &str, buffer );
|
2016-01-20 14:02:03 +01:00
|
|
|
InitializeObjectAttributes( &attr, &str, 0, 0, NULL );
|
|
|
|
NtOpenDirectoryObject( &dir, DIRECTORY_CREATE_OBJECT | DIRECTORY_TRAVERSE, &attr );
|
|
|
|
if (InterlockedCompareExchangePointer( &handle, dir, 0 ) != 0) /* someone beat us here */
|
|
|
|
CloseHandle( dir );
|
|
|
|
}
|
|
|
|
return handle;
|
|
|
|
}
|
2005-06-08 20:44:50 +02:00
|
|
|
|
2020-09-21 13:53:21 +02:00
|
|
|
static WCHAR default_name[29];
|
|
|
|
|
2020-06-23 13:56:39 +02:00
|
|
|
static BOOL WINAPI winstation_default_name_once( INIT_ONCE *once, void *param, void **context )
|
|
|
|
{
|
|
|
|
TOKEN_STATISTICS stats;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
ret = GetTokenInformation( GetCurrentProcessToken(), TokenStatistics, &stats, sizeof(stats), NULL );
|
|
|
|
if (ret)
|
2020-09-21 16:31:11 +02:00
|
|
|
swprintf( default_name, ARRAY_SIZE(default_name), L"Service-0x%x-%x$",
|
2020-09-21 13:53:21 +02:00
|
|
|
stats.AuthenticationId.HighPart, stats.AuthenticationId.LowPart );
|
2020-06-23 13:56:39 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const WCHAR *get_winstation_default_name( void )
|
|
|
|
{
|
|
|
|
static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
|
|
|
|
BOOL ret;
|
|
|
|
|
2020-09-21 13:53:21 +02:00
|
|
|
ret = InitOnceExecuteOnce( &once, winstation_default_name_once, NULL, NULL );
|
|
|
|
return ret ? default_name : NULL;
|
2020-06-23 13:56:39 +02:00
|
|
|
}
|
|
|
|
|
2005-06-08 20:44:50 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CreateWindowStationA (USER32.@)
|
|
|
|
*/
|
2019-04-08 07:37:30 +02:00
|
|
|
HWINSTA WINAPI CreateWindowStationA( LPCSTR name, DWORD flags, ACCESS_MASK access,
|
2005-06-08 20:44:50 +02:00
|
|
|
LPSECURITY_ATTRIBUTES sa )
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
2019-04-08 07:37:30 +02:00
|
|
|
if (!name) return CreateWindowStationW( NULL, flags, access, sa );
|
2005-06-08 20:44:50 +02:00
|
|
|
|
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
2019-04-08 07:37:30 +02:00
|
|
|
return CreateWindowStationW( buffer, flags, access, sa );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateWindowStationW (USER32.@)
|
|
|
|
*/
|
2019-04-08 07:37:30 +02:00
|
|
|
HWINSTA WINAPI CreateWindowStationW( LPCWSTR name, DWORD flags, ACCESS_MASK access,
|
2005-06-08 20:44:50 +02:00
|
|
|
LPSECURITY_ATTRIBUTES sa )
|
|
|
|
{
|
2021-10-14 15:20:42 +02:00
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING str;
|
2005-06-08 20:44:50 +02:00
|
|
|
|
2021-10-14 15:20:42 +02:00
|
|
|
RtlInitUnicodeString( &str, name );
|
|
|
|
if (!str.Length) RtlInitUnicodeString( &str, get_winstation_default_name() );
|
|
|
|
|
|
|
|
InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE,
|
|
|
|
get_winstations_dir_handle(), sa );
|
|
|
|
if (!(flags & CWF_CREATE_ONLY)) attr.Attributes |= OBJ_OPENIF;
|
|
|
|
if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT;
|
|
|
|
|
|
|
|
return NtUserCreateWindowStation( &attr, access, 0, 0, 0, 0, 0 );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* OpenWindowStationA (USER32.@)
|
|
|
|
*/
|
|
|
|
HWINSTA WINAPI OpenWindowStationA( LPCSTR name, BOOL inherit, ACCESS_MASK access )
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (!name) return OpenWindowStationW( NULL, inherit, access );
|
|
|
|
|
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return OpenWindowStationW( buffer, inherit, access );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* OpenWindowStationW (USER32.@)
|
|
|
|
*/
|
|
|
|
HWINSTA WINAPI OpenWindowStationW( LPCWSTR name, BOOL inherit, ACCESS_MASK access )
|
|
|
|
{
|
2021-10-14 15:20:56 +02:00
|
|
|
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 );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* EnumWindowStationsA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumWindowStationsA( WINSTAENUMPROCA func, LPARAM lparam )
|
|
|
|
{
|
|
|
|
struct enum_proc_lparam data;
|
|
|
|
data.func = func;
|
|
|
|
data.lparam = lparam;
|
|
|
|
return EnumWindowStationsW( enum_names_WtoA, (LPARAM)&data );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
2007-12-05 16:45:32 +01:00
|
|
|
* EnumWindowStationsW (USER32.@)
|
2005-06-08 20:44:50 +02:00
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumWindowStationsW( WINSTAENUMPROCW func, LPARAM lparam )
|
|
|
|
{
|
2007-12-05 16:45:32 +01:00
|
|
|
unsigned int index = 0;
|
|
|
|
WCHAR name[MAX_PATH];
|
|
|
|
BOOL ret = TRUE;
|
2008-03-05 22:41:41 +01:00
|
|
|
NTSTATUS status;
|
2007-12-05 16:45:32 +01:00
|
|
|
|
|
|
|
while (ret)
|
|
|
|
{
|
|
|
|
SERVER_START_REQ( enum_winstation )
|
|
|
|
{
|
|
|
|
req->index = index;
|
2008-03-05 22:41:41 +01:00
|
|
|
wine_server_set_reply( req, name, sizeof(name) - sizeof(WCHAR) );
|
|
|
|
status = wine_server_call( req );
|
|
|
|
name[wine_server_reply_size(reply)/sizeof(WCHAR)] = 0;
|
2007-12-05 16:45:32 +01:00
|
|
|
index = reply->next;
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
2008-03-05 22:41:41 +01:00
|
|
|
if (status == STATUS_NO_MORE_ENTRIES)
|
|
|
|
break;
|
|
|
|
if (status)
|
|
|
|
{
|
|
|
|
SetLastError( RtlNtStatusToDosError( status ) );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ret = func( name, lparam );
|
2007-12-05 16:45:32 +01:00
|
|
|
}
|
|
|
|
return ret;
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateDesktopA (USER32.@)
|
|
|
|
*/
|
|
|
|
HDESK WINAPI CreateDesktopA( LPCSTR name, LPCSTR device, LPDEVMODEA devmode,
|
|
|
|
DWORD flags, ACCESS_MASK access, LPSECURITY_ATTRIBUTES sa )
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (device || devmode)
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (!name) return CreateDesktopW( NULL, NULL, NULL, flags, access, sa );
|
|
|
|
|
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return CreateDesktopW( buffer, NULL, NULL, flags, access, sa );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateDesktopW (USER32.@)
|
|
|
|
*/
|
|
|
|
HDESK WINAPI CreateDesktopW( LPCWSTR name, LPCWSTR device, LPDEVMODEW devmode,
|
|
|
|
DWORD flags, ACCESS_MASK access, LPSECURITY_ATTRIBUTES sa )
|
|
|
|
{
|
2021-10-14 15:21:15 +02:00
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING str;
|
2005-06-08 20:44:50 +02:00
|
|
|
|
|
|
|
if (device || devmode)
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return 0;
|
|
|
|
}
|
2021-10-14 15:21:15 +02:00
|
|
|
|
|
|
|
RtlInitUnicodeString( &str, name );
|
|
|
|
InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
|
|
|
|
get_winstations_dir_handle(), NULL );
|
|
|
|
if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT;
|
|
|
|
return NtUserCreateDesktopEx( &attr, NULL, devmode, flags, access, 0 );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* OpenDesktopA (USER32.@)
|
|
|
|
*/
|
|
|
|
HDESK WINAPI OpenDesktopA( LPCSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access )
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
|
|
|
|
|
|
|
if (!name) return OpenDesktopW( NULL, flags, inherit, access );
|
|
|
|
|
|
|
|
if (!MultiByteToWideChar( CP_ACP, 0, name, -1, buffer, MAX_PATH ))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_FILENAME_EXCED_RANGE );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return OpenDesktopW( buffer, flags, inherit, access );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-01 21:15:55 +02:00
|
|
|
HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access )
|
2005-06-08 20:44:50 +02:00
|
|
|
{
|
2021-10-14 15:21:33 +02:00
|
|
|
OBJECT_ATTRIBUTES attr;
|
|
|
|
UNICODE_STRING str;
|
|
|
|
|
|
|
|
RtlInitUnicodeString( &str, name );
|
|
|
|
InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE, hwinsta, NULL );
|
|
|
|
if (inherit) attr.Attributes |= OBJ_INHERIT;
|
|
|
|
return NtUserOpenDesktop( &attr, flags, access );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-01 21:15:55 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* OpenDesktopW (USER32.@)
|
|
|
|
*/
|
|
|
|
HDESK WINAPI OpenDesktopW( LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access )
|
|
|
|
{
|
|
|
|
return open_winstation_desktop( NULL, name, flags, inherit, access );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-08 20:44:50 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* SetThreadDesktop (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetThreadDesktop( HDESK handle )
|
|
|
|
{
|
2021-10-13 14:54:21 +02:00
|
|
|
BOOL ret = NtUserSetThreadDesktop( handle );
|
2005-06-08 20:44:50 +02:00
|
|
|
|
2008-06-25 14:26:06 +02:00
|
|
|
if (ret) /* reset the desktop windows */
|
|
|
|
{
|
|
|
|
struct user_thread_info *thread_info = get_user_thread_info();
|
2015-04-07 02:33:28 +02:00
|
|
|
struct user_key_state_info *key_state_info = thread_info->key_state;
|
2008-06-25 14:26:06 +02:00
|
|
|
thread_info->top_window = 0;
|
|
|
|
thread_info->msg_window = 0;
|
2015-04-07 02:33:28 +02:00
|
|
|
if (key_state_info) key_state_info->time = 0;
|
2008-06-25 14:26:06 +02:00
|
|
|
}
|
2005-06-08 20:44:50 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* EnumDesktopsA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDesktopsA( HWINSTA winsta, DESKTOPENUMPROCA func, LPARAM lparam )
|
|
|
|
{
|
|
|
|
struct enum_proc_lparam data;
|
|
|
|
data.func = func;
|
|
|
|
data.lparam = lparam;
|
|
|
|
return EnumDesktopsW( winsta, enum_names_WtoA, (LPARAM)&data );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* EnumDesktopsW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI EnumDesktopsW( HWINSTA winsta, DESKTOPENUMPROCW func, LPARAM lparam )
|
|
|
|
{
|
2007-12-05 16:45:32 +01:00
|
|
|
unsigned int index = 0;
|
|
|
|
WCHAR name[MAX_PATH];
|
|
|
|
BOOL ret = TRUE;
|
2008-03-05 22:41:41 +01:00
|
|
|
NTSTATUS status;
|
|
|
|
|
|
|
|
if (!winsta)
|
2021-10-13 14:52:53 +02:00
|
|
|
winsta = NtUserGetProcessWindowStation();
|
2007-12-05 16:45:32 +01:00
|
|
|
|
|
|
|
while (ret)
|
|
|
|
{
|
|
|
|
SERVER_START_REQ( enum_desktop )
|
|
|
|
{
|
2008-12-08 16:05:17 +01:00
|
|
|
req->winstation = wine_server_obj_handle( winsta );
|
2007-12-05 16:45:32 +01:00
|
|
|
req->index = index;
|
2008-03-05 22:41:41 +01:00
|
|
|
wine_server_set_reply( req, name, sizeof(name) - sizeof(WCHAR) );
|
|
|
|
status = wine_server_call( req );
|
|
|
|
name[wine_server_reply_size(reply)/sizeof(WCHAR)] = 0;
|
2007-12-05 16:45:32 +01:00
|
|
|
index = reply->next;
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
2008-03-05 22:41:41 +01:00
|
|
|
if (status == STATUS_NO_MORE_ENTRIES)
|
|
|
|
break;
|
|
|
|
if (status)
|
|
|
|
{
|
|
|
|
SetLastError( RtlNtStatusToDosError( status ) );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
ret = func(name, lparam);
|
2007-12-05 16:45:32 +01:00
|
|
|
}
|
|
|
|
return ret;
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetUserObjectInformationA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DWORD len, LPDWORD needed )
|
|
|
|
{
|
|
|
|
/* check for information types returning strings */
|
|
|
|
if (index == UOI_TYPE || index == UOI_NAME)
|
|
|
|
{
|
|
|
|
WCHAR buffer[MAX_PATH];
|
2012-05-14 16:25:03 +02:00
|
|
|
DWORD lenA, lenW;
|
2005-06-08 20:44:50 +02:00
|
|
|
|
2021-10-13 14:55:30 +02:00
|
|
|
if (!NtUserGetObjectInformation( handle, index, buffer, sizeof(buffer), &lenW )) return FALSE;
|
2005-06-08 20:44:50 +02:00
|
|
|
lenA = WideCharToMultiByte( CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL );
|
|
|
|
if (needed) *needed = lenA;
|
|
|
|
if (lenA > len)
|
|
|
|
{
|
2012-05-14 16:25:03 +02:00
|
|
|
/* If the buffer length supplied by the caller is insufficient, Windows returns a
|
|
|
|
'needed' length based upon the Unicode byte length, so we should do similarly. */
|
|
|
|
if (needed) *needed = lenW;
|
|
|
|
|
2012-05-14 16:23:29 +02:00
|
|
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
2005-06-08 20:44:50 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (info) WideCharToMultiByte( CP_ACP, 0, buffer, -1, info, len, NULL, NULL );
|
|
|
|
return TRUE;
|
|
|
|
}
|
2021-10-13 14:55:30 +02:00
|
|
|
return NtUserGetObjectInformation( handle, index, info, len, needed );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* SetUserObjectInformationA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DWORD len )
|
|
|
|
{
|
2021-10-13 14:56:22 +02:00
|
|
|
return NtUserSetObjectInformation( handle, index, info, len );
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetUserObjectSecurity (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetUserObjectSecurity( HANDLE handle, PSECURITY_INFORMATION info,
|
|
|
|
PSECURITY_DESCRIPTOR sid, DWORD len, LPDWORD needed )
|
|
|
|
{
|
2006-09-30 00:25:15 +02:00
|
|
|
FIXME( "(%p %p %p len=%d %p),stub!\n", handle, info, sid, len, needed );
|
2009-01-03 16:35:18 +01:00
|
|
|
if (needed)
|
|
|
|
*needed = sizeof(SECURITY_DESCRIPTOR);
|
|
|
|
if (len < sizeof(SECURITY_DESCRIPTOR))
|
|
|
|
{
|
|
|
|
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return InitializeSecurityDescriptor(sid, SECURITY_DESCRIPTOR_REVISION);
|
2005-06-08 20:44:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetUserObjectSecurity (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI SetUserObjectSecurity( HANDLE handle, PSECURITY_INFORMATION info,
|
|
|
|
PSECURITY_DESCRIPTOR sid )
|
|
|
|
{
|
|
|
|
FIXME( "(%p,%p,%p),stub!\n", handle, info, sid );
|
|
|
|
return TRUE;
|
|
|
|
}
|