xref: /reactos/win32ss/user/ntuser/winsta.h (revision 40462c92)
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     LIST_ENTRY DesktopListHead;
19     PRTL_ATOM_TABLE AtomTable;
20     HANDLE ShellWindow;
21     HANDLE ShellListView;
22 
23     ULONG Flags;
24     struct _DESKTOP* ActiveDesktop;
25 
26     PTHREADINFO    ptiClipLock;
27     PTHREADINFO    ptiDrawingClipboard;
28     PWND           spwndClipOpen;
29     PWND           spwndClipViewer;
30     PWND           spwndClipOwner;
31     PCLIP          pClipBase;     // Not a clip object.
32     DWORD          cNumClipFormats;
33     INT            iClipSerialNumber;
34     INT            iClipSequenceNumber;
35     INT            fClipboardChanged : 1;
36     INT            fInDelayedRendering : 1;
37 
38     PWND           spwndClipboardListener;
39     LUID           luidEndSession;
40     LUID           luidUser;
41     PVOID          psidUser;
42 
43 } WINSTATION_OBJECT, *PWINSTATION_OBJECT;
44 
45 extern WINSTATION_OBJECT *InputWindowStation;
46 extern HANDLE gpidLogon;
47 extern HWND hwndSAS;
48 extern UNICODE_STRING gustrWindowStationsDir;
49 
50 #define WINSTA_READ       STANDARD_RIGHTS_READ     | \
51                           WINSTA_ENUMDESKTOPS      | \
52                           WINSTA_ENUMERATE         | \
53                           WINSTA_READATTRIBUTES    | \
54                           WINSTA_READSCREEN
55 
56 #define WINSTA_WRITE      STANDARD_RIGHTS_WRITE    | \
57                           WINSTA_ACCESSCLIPBOARD   | \
58                           WINSTA_CREATEDESKTOP     | \
59                           WINSTA_WRITEATTRIBUTES
60 
61 #define WINSTA_EXECUTE    STANDARD_RIGHTS_EXECUTE  | \
62                           WINSTA_ACCESSGLOBALATOMS | \
63                           WINSTA_EXITWINDOWS
64 
65 #define WINSTA_ACCESS_ALL STANDARD_RIGHTS_REQUIRED | \
66                           WINSTA_ACCESSCLIPBOARD   | \
67                           WINSTA_ACCESSGLOBALATOMS | \
68                           WINSTA_CREATEDESKTOP     | \
69                           WINSTA_ENUMDESKTOPS      | \
70                           WINSTA_ENUMERATE         | \
71                           WINSTA_EXITWINDOWS       | \
72                           WINSTA_READATTRIBUTES    | \
73                           WINSTA_READSCREEN        | \
74                           WINSTA_WRITEATTRIBUTES
75 
76 NTSTATUS
77 NTAPI
78 InitWindowStationImpl(VOID);
79 
80 NTSTATUS
81 NTAPI
82 UserCreateWinstaDirectory(VOID);
83 
84 NTSTATUS
85 NTAPI
86 IntWinStaObjectDelete(
87     _In_ PVOID Parameters);
88 
89 NTSTATUS
90 NTAPI
91 IntWinStaObjectParse(
92     _In_ PVOID Parameters);
93 
94 NTSTATUS
95 NTAPI
96 IntWinStaOkToClose(
97     _In_ PVOID Parameters);
98 
99 NTSTATUS
100 FASTCALL
101 IntValidateWindowStationHandle(
102    HWINSTA WindowStation,
103    KPROCESSOR_MODE AccessMode,
104    ACCESS_MASK DesiredAccess,
105    PWINSTATION_OBJECT *Object,
106    POBJECT_HANDLE_INFORMATION pObjectHandleInfo);
107 
108 NTSTATUS
109 FASTCALL
110 IntCreateWindowStation(
111     OUT HWINSTA* phWinSta,
112     IN POBJECT_ATTRIBUTES ObjectAttributes,
113     IN KPROCESSOR_MODE AccessMode,
114     IN KPROCESSOR_MODE OwnerMode,
115     IN ACCESS_MASK dwDesiredAccess,
116     DWORD Unknown2,
117     DWORD Unknown3,
118     DWORD Unknown4,
119     DWORD Unknown5,
120     DWORD Unknown6);
121 
122 BOOL FASTCALL UserSetProcessWindowStation(HWINSTA hWindowStation);
123 
124 BOOL FASTCALL co_IntInitializeDesktopGraphics(VOID);
125 VOID FASTCALL IntEndDesktopGraphics(VOID);
126 BOOL FASTCALL CheckWinstaAttributeAccess(ACCESS_MASK);
127 /* EOF */
128