reactos/win32ss/user/ntuser/winsta.h
George Bișoc 878c2f4444
[WIN32K:NTUSER] Implement security infrastructure for NTUSER component
Implement a base security infrastructure with code that sets up a security descriptor for the service that we're going to connect through it. Such service is based upon a desktop and a window station.

=== DOCUMENTATION REMARKS ===
The authenticated user, represented by an access token that describes its security context, is the main holder and has ultimate power against the default created desktop and window station objects in USER. The authenticated user in question
is the actual logged in user, this is the case when the server is impersonating a client. Administrators on the other hand have some share of power against default desktop but their power in question is extremely limited against the default
window station as admins can only just enumerate the available and valid handle stations within a desktop.
2022-05-06 10:09:48 +02:00

103 lines
2.3 KiB
C

#pragma once
#define WINSTA_OBJ_DIR L"\\Windows\\WindowStations"
#define SESSION_DIR L"\\Sessions"
/* Window Station Status Flags */
#define WSS_LOCKED (1)
#define WSS_NOINTERACTIVE (2)
#define WSS_NOIO (4)
#define WSS_SHUTDOWN (8)
#define WSS_DYING (16)
#define WSS_REALSHUTDOWN (32)
typedef struct _WINSTATION_OBJECT
{
DWORD dwSessionId;
LIST_ENTRY DesktopListHead;
PRTL_ATOM_TABLE AtomTable;
HANDLE ShellWindow;
HANDLE ShellListView;
ULONG Flags;
struct _DESKTOP* ActiveDesktop;
PTHREADINFO ptiClipLock;
PTHREADINFO ptiDrawingClipboard;
PWND spwndClipOpen;
PWND spwndClipViewer;
PWND spwndClipOwner;
PCLIP pClipBase; // Not a clip object.
DWORD cNumClipFormats;
INT iClipSerialNumber;
INT iClipSequenceNumber;
INT fClipboardChanged : 1;
INT fInDelayedRendering : 1;
PWND spwndClipboardListener;
LUID luidEndSession;
LUID luidUser;
PVOID psidUser;
} WINSTATION_OBJECT, *PWINSTATION_OBJECT;
extern WINSTATION_OBJECT *InputWindowStation;
extern HANDLE gpidLogon;
extern HWND hwndSAS;
extern UNICODE_STRING gustrWindowStationsDir;
CODE_SEG("INIT")
NTSTATUS
NTAPI
InitWindowStationImpl(VOID);
NTSTATUS
NTAPI
UserCreateWinstaDirectory(VOID);
NTSTATUS
NTAPI
IntWinStaObjectDelete(
_In_ PVOID Parameters);
NTSTATUS
NTAPI
IntWinStaObjectParse(
_In_ PVOID Parameters);
NTSTATUS
NTAPI
IntWinStaOkToClose(
_In_ PVOID Parameters);
NTSTATUS
FASTCALL
IntValidateWindowStationHandle(
HWINSTA WindowStation,
KPROCESSOR_MODE AccessMode,
ACCESS_MASK DesiredAccess,
PWINSTATION_OBJECT *Object,
POBJECT_HANDLE_INFORMATION pObjectHandleInfo);
NTSTATUS
FASTCALL
IntCreateWindowStation(
OUT HWINSTA* phWinSta,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN KPROCESSOR_MODE AccessMode,
IN KPROCESSOR_MODE OwnerMode,
IN ACCESS_MASK dwDesiredAccess,
DWORD Unknown2,
DWORD Unknown3,
DWORD Unknown4,
DWORD Unknown5,
DWORD Unknown6);
BOOL FASTCALL UserSetProcessWindowStation(HWINSTA hWindowStation);
BOOL FASTCALL co_IntInitializeDesktopGraphics(VOID);
VOID FASTCALL IntEndDesktopGraphics(VOID);
BOOL FASTCALL CheckWinstaAttributeAccess(ACCESS_MASK);
/* EOF */