1 #pragma once 2 3 #define WINSTA_OBJ_DIR L"\\Windows\\WindowStations" 4 #define SESSION_DIR L"\\Sessions" 5 6 /* Window Station Status Flags */ 7 #define WSS_LOCKED (1) 8 #define WSS_NOINTERACTIVE (2) 9 #define WSS_NOIO (4) 10 #define WSS_SHUTDOWN (8) 11 #define WSS_DYING (16) 12 #define WSS_REALSHUTDOWN (32) 13 14 typedef struct _WINSTATION_OBJECT 15 { 16 DWORD dwSessionId; 17 18 UNICODE_STRING Name; 19 LIST_ENTRY DesktopListHead; 20 PRTL_ATOM_TABLE AtomTable; 21 HANDLE ShellWindow; 22 HANDLE ShellListView; 23 24 ULONG Flags; 25 struct _DESKTOP* ActiveDesktop; 26 27 PTHREADINFO ptiClipLock; 28 PTHREADINFO ptiDrawingClipboard; 29 PWND spwndClipOpen; 30 PWND spwndClipViewer; 31 PWND spwndClipOwner; 32 PCLIP pClipBase; // Not a clip object. 33 DWORD cNumClipFormats; 34 INT iClipSerialNumber; 35 INT iClipSequenceNumber; 36 INT fClipboardChanged : 1; 37 INT fInDelayedRendering : 1; 38 39 PWND spwndClipboardListener; 40 LUID luidEndSession; 41 LUID luidUser; 42 PVOID psidUser; 43 44 } WINSTATION_OBJECT, *PWINSTATION_OBJECT; 45 46 extern WINSTATION_OBJECT *InputWindowStation; 47 extern HANDLE gpidLogon; 48 extern HWND hwndSAS; 49 extern UNICODE_STRING gustrWindowStationsDir; 50 51 #define WINSTA_READ STANDARD_RIGHTS_READ | \ 52 WINSTA_ENUMDESKTOPS | \ 53 WINSTA_ENUMERATE | \ 54 WINSTA_READATTRIBUTES | \ 55 WINSTA_READSCREEN 56 57 #define WINSTA_WRITE STANDARD_RIGHTS_WRITE | \ 58 WINSTA_ACCESSCLIPBOARD | \ 59 WINSTA_CREATEDESKTOP | \ 60 WINSTA_WRITEATTRIBUTES 61 62 #define WINSTA_EXECUTE STANDARD_RIGHTS_EXECUTE | \ 63 WINSTA_ACCESSGLOBALATOMS | \ 64 WINSTA_EXITWINDOWS 65 66 #define WINSTA_ACCESS_ALL STANDARD_RIGHTS_REQUIRED | \ 67 WINSTA_ACCESSCLIPBOARD | \ 68 WINSTA_ACCESSGLOBALATOMS | \ 69 WINSTA_CREATEDESKTOP | \ 70 WINSTA_ENUMDESKTOPS | \ 71 WINSTA_ENUMERATE | \ 72 WINSTA_EXITWINDOWS | \ 73 WINSTA_READATTRIBUTES | \ 74 WINSTA_READSCREEN | \ 75 WINSTA_WRITEATTRIBUTES 76 77 INIT_FUNCTION 78 NTSTATUS 79 NTAPI 80 InitWindowStationImpl(VOID); 81 82 NTSTATUS 83 NTAPI 84 UserCreateWinstaDirectory(VOID); 85 86 NTSTATUS 87 APIENTRY 88 IntWinStaObjectDelete( 89 _In_ PVOID Parameters); 90 91 NTSTATUS 92 APIENTRY 93 IntWinStaObjectParse( 94 _In_ PVOID Parameters); 95 96 NTSTATUS 97 NTAPI 98 IntWinstaOkToClose( 99 _In_ PVOID Parameters); 100 101 NTSTATUS 102 FASTCALL 103 IntValidateWindowStationHandle( 104 HWINSTA WindowStation, 105 KPROCESSOR_MODE AccessMode, 106 ACCESS_MASK DesiredAccess, 107 PWINSTATION_OBJECT *Object, 108 POBJECT_HANDLE_INFORMATION pObjectHandleInfo); 109 110 BOOL FASTCALL UserSetProcessWindowStation(HWINSTA hWindowStation); 111 112 BOOL FASTCALL co_IntInitializeDesktopGraphics(VOID); 113 VOID FASTCALL IntEndDesktopGraphics(VOID); 114 BOOL FASTCALL CheckWinstaAttributeAccess(ACCESS_MASK); 115 /* EOF */ 116