[MSIEXEC] Sync with Wine Staging 2.16. CORE-13762
[reactos.git] / base / system / smss / smss.h
1 /*
2 * PROJECT: ReactOS Windows-Compatible Session Manager
3 * LICENSE: BSD 2-Clause License
4 * FILE: base/system/smss/smss.h
5 * PURPOSE: Main SMSS Header
6 * PROGRAMMERS: Alex Ionescu
7 */
8
9 /* DEPENDENCIES ***************************************************************/
10 #ifndef _SM_
11 #define _SM_
12
13 #include <stdio.h>
14
15 /* Native Headers */
16 #define WIN32_NO_STATUS
17 #include <windef.h>
18 #include <winbase.h>
19 #include <winreg.h>
20
21 #define NTOS_MODE_USER
22 #include <ndk/iofuncs.h>
23 #include <ndk/obfuncs.h>
24 #include <ndk/rtlfuncs.h>
25 #include <ndk/cmfuncs.h>
26 #include <ndk/exfuncs.h>
27 #include <ndk/mmfuncs.h>
28 #include <ndk/psfuncs.h>
29 #include <ndk/lpcfuncs.h>
30 #include <ndk/setypes.h>
31 #include <ndk/umfuncs.h>
32 #include <ndk/kefuncs.h>
33
34 /* SM Protocol Header */
35 #include <sm/smmsg.h>
36
37 /* DEFINES ********************************************************************/
38
39 #define SMP_DEBUG_FLAG 0x01
40 #define SMP_ASYNC_FLAG 0x02
41 #define SMP_AUTOCHK_FLAG 0x04
42 #define SMP_SUBSYSTEM_FLAG 0x08
43 #define SMP_INVALID_PATH 0x10
44 #define SMP_DEFERRED_FLAG 0x20
45 #define SMP_POSIX_FLAG 0x100
46 #define SMP_OS2_FLAG 0x200
47
48 /* STRUCTURES *****************************************************************/
49
50 typedef struct _SMP_REGISTRY_VALUE
51 {
52 LIST_ENTRY Entry;
53 UNICODE_STRING Name;
54 UNICODE_STRING Value;
55 PCHAR AnsiValue;
56 } SMP_REGISTRY_VALUE, *PSMP_REGISTRY_VALUE;
57
58 typedef struct _SMP_SUBSYSTEM
59 {
60 LIST_ENTRY Entry;
61 HANDLE Event;
62 HANDLE ProcessHandle;
63 ULONG ImageType;
64 HANDLE PortHandle;
65 HANDLE SbApiPort;
66 CLIENT_ID ClientId;
67 ULONG MuSessionId;
68 BOOLEAN Terminating;
69 ULONG ReferenceCount;
70 } SMP_SUBSYSTEM, *PSMP_SUBSYSTEM;
71
72 /* EXTERNALS ******************************************************************/
73
74 extern RTL_CRITICAL_SECTION SmpKnownSubSysLock;
75 extern LIST_ENTRY SmpKnownSubSysHead;
76 extern RTL_CRITICAL_SECTION SmpSessionListLock;
77 extern LIST_ENTRY SmpSessionListHead;
78 extern ULONG SmpNextSessionId;
79 extern ULONG SmpNextSessionIdScanMode;
80 extern BOOLEAN SmpDbgSsLoaded;
81 extern HANDLE SmpWindowsSubSysProcess;
82 extern HANDLE SmpSessionsObjectDirectory;
83 extern HANDLE SmpWindowsSubSysProcessId;
84 extern BOOLEAN RegPosixSingleInstance;
85 extern UNICODE_STRING SmpDebugKeyword, SmpASyncKeyword, SmpAutoChkKeyword;
86 extern PVOID SmpHeap;
87 extern ULONG SmBaseTag;
88 extern UNICODE_STRING SmpSystemRoot;
89 extern PWCHAR SmpDefaultEnvironment;
90 extern UNICODE_STRING SmpDefaultLibPath;
91 extern LIST_ENTRY SmpSetupExecuteList;
92 extern LIST_ENTRY SmpSubSystemsToLoad;
93 extern LIST_ENTRY SmpExecuteList;
94 extern LIST_ENTRY SmpSubSystemList;
95 extern ULONG AttachedSessionId;
96 extern BOOLEAN SmpDebug;
97
98 /* FUNCTIONS ******************************************************************/
99
100 NTSTATUS
101 NTAPI
102 SmpTerminate(
103 IN PULONG_PTR Parameters,
104 IN ULONG ParameterMask,
105 IN ULONG ParameterCount
106 );
107
108 NTSTATUS
109 NTAPI
110 SmpCreateSecurityDescriptors(
111 IN BOOLEAN InitialCall
112 );
113
114 NTSTATUS
115 NTAPI
116 SmpInit(
117 IN PUNICODE_STRING InitialCommand,
118 OUT PHANDLE ProcessHandle
119 );
120
121 NTSTATUS
122 NTAPI
123 SmpAcquirePrivilege(
124 IN ULONG Privilege,
125 OUT PVOID *PrivilegeStat
126 );
127
128 VOID
129 NTAPI
130 SmpReleasePrivilege(
131 IN PVOID State
132 );
133
134 ULONG
135 NTAPI
136 SmpApiLoop(
137 IN PVOID Parameter
138 );
139
140 NTSTATUS
141 NTAPI
142 SmpExecuteCommand(
143 IN PUNICODE_STRING CommandLine,
144 IN ULONG MuSessionId,
145 OUT PHANDLE ProcessId,
146 IN ULONG Flags
147 );
148
149 NTSTATUS
150 NTAPI
151 SmpLoadSubSystemsForMuSession(
152 IN PULONG MuSessionId,
153 OUT PHANDLE ProcessId,
154 IN PUNICODE_STRING InitialCommand
155 );
156
157 VOID
158 NTAPI
159 SmpPagingFileInitialize(
160 VOID
161 );
162
163 NTSTATUS
164 NTAPI
165 SmpCreatePagingFileDescriptor(
166 IN PUNICODE_STRING PageFileToken
167 );
168
169 NTSTATUS
170 NTAPI
171 SmpCreatePagingFiles(
172 VOID
173 );
174
175 NTSTATUS
176 NTAPI
177 SmpParseCommandLine(
178 IN PUNICODE_STRING CommandLine,
179 OUT PULONG Flags,
180 OUT PUNICODE_STRING FileName,
181 OUT PUNICODE_STRING Directory,
182 OUT PUNICODE_STRING Arguments
183 );
184
185 NTSTATUS
186 NTAPI
187 SmpLoadSubSystem(
188 IN PUNICODE_STRING FileName,
189 IN PUNICODE_STRING Directory,
190 IN PUNICODE_STRING CommandLine,
191 IN ULONG MuSessionId,
192 OUT PHANDLE ProcessId,
193 IN ULONG Flags
194 );
195
196 NTSTATUS
197 NTAPI
198 SmpSetProcessMuSessionId(
199 IN HANDLE ProcessHandle,
200 IN ULONG SessionId
201 );
202
203 BOOLEAN
204 NTAPI
205 SmpQueryRegistrySosOption(
206 VOID
207 );
208
209 BOOLEAN
210 NTAPI
211 SmpSaveAndClearBootStatusData(
212 OUT PBOOLEAN BootOkay,
213 OUT PBOOLEAN ShutdownOkay
214 );
215
216 VOID
217 NTAPI
218 SmpRestoreBootStatusData(
219 IN BOOLEAN BootOkay,
220 IN BOOLEAN ShutdownOkay
221 );
222
223 BOOLEAN
224 NTAPI
225 SmpCheckForCrashDump(
226 IN PUNICODE_STRING FileName
227 );
228
229 VOID
230 NTAPI
231 SmpTranslateSystemPartitionInformation(
232 VOID
233 );
234
235 PSMP_SUBSYSTEM
236 NTAPI
237 SmpLocateKnownSubSysByCid(
238 IN PCLIENT_ID ClientId
239 );
240
241 PSMP_SUBSYSTEM
242 NTAPI
243 SmpLocateKnownSubSysByType(
244 IN ULONG MuSessionId,
245 IN ULONG ImageType
246 );
247
248 NTSTATUS
249 NTAPI
250 SmpGetProcessMuSessionId(
251 IN HANDLE ProcessHandle,
252 OUT PULONG SessionId
253 );
254
255 VOID
256 NTAPI
257 SmpDereferenceSubsystem(
258 IN PSMP_SUBSYSTEM SubSystem
259 );
260
261 NTSTATUS
262 NTAPI
263 SmpSbCreateSession(
264 IN PVOID Reserved,
265 IN PSMP_SUBSYSTEM OtherSubsystem,
266 IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
267 IN ULONG MuSessionId,
268 IN PCLIENT_ID DbgClientId
269 );
270
271 ULONG
272 NTAPI
273 SmpAllocateSessionId(
274 IN PSMP_SUBSYSTEM Subsystem,
275 IN PSMP_SUBSYSTEM OtherSubsystem
276 );
277
278 VOID
279 NTAPI
280 SmpDeleteSession(
281 IN ULONG SessionId
282 );
283
284 BOOLEAN
285 NTAPI
286 SmpCheckDuplicateMuSessionId(
287 IN ULONG MuSessionId
288 );
289
290 NTSTATUS
291 NTAPI
292 SmpExecuteImage(
293 IN PUNICODE_STRING FileName,
294 IN PUNICODE_STRING Directory,
295 IN PUNICODE_STRING CommandLine,
296 IN ULONG MuSessionId,
297 IN ULONG Flags,
298 IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
299 );
300
301 #endif /* _SM_ */