ReactOS 0.4.15-dev-5672-gf73ac17
smss.h
Go to the documentation of this file.
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#ifndef _SM_
10#define _SM_
11
12#pragma once
13
14/* DEPENDENCIES ***************************************************************/
15
16#include <stdio.h>
17
18/* Native Headers */
19#define WIN32_NO_STATUS
20#include <windef.h>
21#include <winbase.h>
22#include <winreg.h>
23
24#define NTOS_MODE_USER
25#include <ndk/cmfuncs.h>
26#include <ndk/exfuncs.h>
27#include <ndk/iofuncs.h>
28#include <ndk/kefuncs.h>
29#include <ndk/lpcfuncs.h>
30#include <ndk/mmfuncs.h>
31#include <ndk/obfuncs.h>
32#include <ndk/psfuncs.h>
33#include <ndk/rtlfuncs.h>
34#include <ndk/setypes.h>
35#include <ndk/umfuncs.h>
36
37#include <ntstrsafe.h>
38
39/* SM Protocol Header */
40#include <sm/smmsg.h>
41
42/* DEFINES ********************************************************************/
43
44#define SMP_DEBUG_FLAG 0x01
45#define SMP_ASYNC_FLAG 0x02
46#define SMP_AUTOCHK_FLAG 0x04
47#define SMP_SUBSYSTEM_FLAG 0x08
48#define SMP_INVALID_PATH 0x10
49#define SMP_DEFERRED_FLAG 0x20
50#define SMP_POSIX_FLAG 0x100
51#define SMP_OS2_FLAG 0x200
52
53/* STRUCTURES *****************************************************************/
54
55typedef struct _SMP_REGISTRY_VALUE
56{
62
63typedef struct _SMP_SUBSYSTEM
64{
76
77/* EXTERNALS ******************************************************************/
78
91extern PVOID SmpHeap;
92extern ULONG SmBaseTag;
102extern BOOLEAN SmpDebug;
103
104/* FUNCTIONS ******************************************************************/
105
106/* crashdmp.c */
107
109NTAPI
112);
113
114/* pagefile.c */
115
116VOID
117NTAPI
119 VOID
120);
121
123NTAPI
125 IN PUNICODE_STRING PageFileToken
126);
127
129NTAPI
131 VOID
132);
133
134/* sminit.c */
135
136VOID
137NTAPI
139 VOID
140);
141
143NTAPI
145 IN BOOLEAN InitialCall
146);
147
149NTAPI
150SmpInit(
151 IN PUNICODE_STRING InitialCommand,
153);
154
155/* smloop.c */
156
157ULONG
158NTAPI
161);
162
163/* smsbapi.c */
164
166NTAPI
169 IN PSMP_SUBSYSTEM OtherSubsystem,
170 IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
171 IN ULONG DbgSessionId,
172 IN PCLIENT_ID DbgUiClientId
173);
174
175/* smsessn.c */
176
178NTAPI
180 IN ULONG MuSessionId
181);
182
183VOID
184NTAPI
187);
188
189ULONG
190NTAPI
192 IN PSMP_SUBSYSTEM Subsystem,
193 IN PSMP_SUBSYSTEM OtherSubsystem
194);
195
197NTAPI
201);
202
204NTAPI
208);
209
210/* smss.c */
211
213NTAPI
217 IN PUNICODE_STRING CommandLine,
218 IN ULONG MuSessionId,
219 IN ULONG Flags,
220 IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
221);
222
224NTAPI
226 IN PUNICODE_STRING CommandLine,
227 IN ULONG MuSessionId,
230);
231
233NTAPI
235 IN PUNICODE_STRING InitialCommand,
236 IN HANDLE InitialCommandProcess,
237 OUT PHANDLE ReturnPid);
238
240NTAPI
243 IN ULONG ParameterMask,
244 IN ULONG ParameterCount
245);
246
247/* smsubsys.c */
248
249VOID
250NTAPI
252 IN PSMP_SUBSYSTEM SubSystem
253);
254
256NTAPI
259);
260
262NTAPI
264 IN ULONG MuSessionId,
266);
267
269NTAPI
273 IN PUNICODE_STRING CommandLine,
274 IN ULONG MuSessionId,
277);
278
280NTAPI
282 IN PULONG MuSessionId,
284 IN PUNICODE_STRING InitialCommand
285);
286
287/* smutil.c */
288
290NTAPI
293 OUT PVOID *PrivilegeStat
294);
295
296VOID
297NTAPI
300);
301
303NTAPI
305 IN PUNICODE_STRING CommandLine,
309 OUT PUNICODE_STRING Arguments
310);
311
313NTAPI
315 VOID
316);
317
319NTAPI
321 OUT PBOOLEAN BootOkay,
322 OUT PBOOLEAN ShutdownOkay
323);
324
325VOID
326NTAPI
328 IN BOOLEAN BootOkay,
329 IN BOOLEAN ShutdownOkay
330);
331
332#endif /* _SM_ */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
ULONG SessionId
Definition: dllmain.c:28
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
ImageType
Definition: gdiplusenums.h:193
_In_ PVOID Parameter
Definition: ldrtypes.h:241
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI SmpSbCreateSession(IN PVOID Reserved, IN PSMP_SUBSYSTEM OtherSubsystem, IN PRTL_USER_PROCESS_INFORMATION ProcessInformation, IN ULONG DbgSessionId, IN PCLIENT_ID DbgUiClientId)
Definition: smsbapi.c:36
PVOID SmpHeap
Definition: sminit.c:25
HANDLE SmpWindowsSubSysProcess
Definition: smsubsys.c:20
NTSTATUS NTAPI SmpGetProcessMuSessionId(IN HANDLE ProcessHandle, OUT PULONG SessionId)
Definition: smsessn.c:168
struct _SMP_REGISTRY_VALUE SMP_REGISTRY_VALUE
VOID NTAPI SmpPagingFileInitialize(VOID)
Definition: pagefile.c:130
BOOLEAN SmpDebug
Definition: smss.c:22
LIST_ENTRY SmpSubSystemList
Definition: sminit.c:22
UNICODE_STRING SmpAutoChkKeyword
Definition: smss.h:90
struct _SMP_SUBSYSTEM SMP_SUBSYSTEM
LIST_ENTRY SmpSessionListHead
Definition: smsessn.c:27
LIST_ENTRY SmpSubSystemsToLoad
Definition: sminit.c:22
ULONG NTAPI SmpApiLoop(IN PVOID Parameter)
Definition: smloop.c:423
VOID NTAPI SmpReleasePrivilege(IN PVOID State)
Definition: smutil.c:129
NTSTATUS NTAPI SmpTerminate(IN PULONG_PTR Parameters, IN ULONG ParameterMask, IN ULONG ParameterCount)
Definition: smss.c:374
BOOLEAN NTAPI SmpQueryRegistrySosOption(VOID)
Definition: smutil.c:424
NTSTATUS NTAPI SmpCreatePagingFiles(VOID)
Definition: pagefile.c:1049
BOOLEAN NTAPI SmpCheckDuplicateMuSessionId(IN ULONG MuSessionId)
Definition: smsessn.c:37
NTSTATUS NTAPI SmpExecuteInitialCommand(IN ULONG MuSessionId, IN PUNICODE_STRING InitialCommand, IN HANDLE InitialCommandProcess, OUT PHANDLE ReturnPid)
Definition: smss.c:283
RTL_CRITICAL_SECTION SmpSessionListLock
Definition: smsessn.c:26
ULONG AttachedSessionId
Definition: smss.c:21
NTSTATUS NTAPI SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId, OUT PHANDLE ProcessId, IN PUNICODE_STRING InitialCommand)
Definition: smsubsys.c:510
LIST_ENTRY SmpSubSystemsToDefer
Definition: sminit.c:22
RTL_CRITICAL_SECTION SmpKnownSubSysLock
Definition: smsubsys.c:18
struct _SMP_SUBSYSTEM * PSMP_SUBSYSTEM
NTSTATUS NTAPI SmpParseCommandLine(IN PUNICODE_STRING CommandLine, OUT PULONG Flags, OUT PUNICODE_STRING FileName, OUT PUNICODE_STRING Directory, OUT PUNICODE_STRING Arguments)
Definition: smutil.c:233
LIST_ENTRY SmpExecuteList
Definition: sminit.c:23
BOOLEAN SmpNextSessionIdScanMode
Definition: smsessn.c:29
UNICODE_STRING SmpDebugKeyword
Definition: smutil.c:34
NTSTATUS NTAPI SmpSetProcessMuSessionId(IN HANDLE ProcessHandle, IN ULONG SessionId)
Definition: smsessn.c:199
ULONG SmBaseTag
Definition: sminit.c:26
ULONG NTAPI SmpAllocateSessionId(IN PSMP_SUBSYSTEM Subsystem, IN PSMP_SUBSYSTEM OtherSubsystem)
Definition: smsessn.c:123
NTSTATUS NTAPI SmpCreatePagingFileDescriptor(IN PUNICODE_STRING PageFileToken)
Definition: pagefile.c:139
struct _SMP_REGISTRY_VALUE * PSMP_REGISTRY_VALUE
UNICODE_STRING SmpDefaultLibPath
Definition: sminit.c:29
VOID NTAPI SmpTranslateSystemPartitionInformation(VOID)
Definition: sminit.c:811
VOID NTAPI SmpDeleteSession(IN ULONG SessionId)
Definition: smsessn.c:98
PWCHAR SmpDefaultEnvironment
Definition: sminit.c:28
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
Definition: smsubsys.c:47
HANDLE SmpSessionsObjectDirectory
Definition: smsessn.c:31
BOOLEAN SmpDbgSsLoaded
Definition: smsessn.c:30
NTSTATUS NTAPI SmpExecuteCommand(IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, OUT PHANDLE ProcessId, IN ULONG Flags)
Definition: smss.c:210
NTSTATUS NTAPI SmpLoadSubSystem(IN PUNICODE_STRING FileName, IN PUNICODE_STRING Directory, IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, OUT PHANDLE ProcessId, IN ULONG Flags)
Definition: smsubsys.c:138
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByCid(IN PCLIENT_ID ClientId)
Definition: smsubsys.c:68
NTSTATUS NTAPI SmpAcquirePrivilege(IN ULONG Privilege, OUT PVOID *PrivilegeStat)
Definition: smutil.c:40
NTSTATUS NTAPI SmpExecuteImage(IN PUNICODE_STRING FileName, IN PUNICODE_STRING Directory, IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, IN ULONG Flags, IN PRTL_USER_PROCESS_INFORMATION ProcessInformation)
Definition: smss.c:30
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByType(IN ULONG MuSessionId, IN ULONG ImageType)
Definition: smsubsys.c:102
HANDLE SmpWindowsSubSysProcessId
Definition: smsubsys.c:21
LIST_ENTRY SmpSetupExecuteList
Definition: sminit.c:19
NTSTATUS NTAPI SmpInit(IN PUNICODE_STRING InitialCommand, OUT PHANDLE ProcessHandle)
Definition: sminit.c:2449
BOOLEAN NTAPI SmpSaveAndClearBootStatusData(OUT PBOOLEAN BootOkay, OUT PBOOLEAN ShutdownOkay)
Definition: smutil.c:481
UNICODE_STRING SmpASyncKeyword
Definition: smss.h:90
BOOLEAN RegPosixSingleInstance
Definition: smsubsys.c:22
BOOLEAN NTAPI SmpCheckForCrashDump(IN PUNICODE_STRING FileName)
Definition: crashdmp.c:20
ULONG SmpNextSessionId
Definition: smsessn.c:28
LIST_ENTRY SmpKnownSubSysHead
Definition: smsubsys.c:19
UNICODE_STRING SmpSystemRoot
Definition: smss.c:20
VOID NTAPI SmpRestoreBootStatusData(IN BOOLEAN BootOkay, IN BOOLEAN ShutdownOkay)
Definition: smutil.c:531
NTSTATUS NTAPI SmpCreateSecurityDescriptors(IN BOOLEAN InitialCall)
Definition: sminit.c:975
base for all directory entries
Definition: entries.h:138
Definition: typedefs.h:120
UNICODE_STRING Name
Definition: smss.h:58
LIST_ENTRY Entry
Definition: smss.h:57
PCHAR AnsiValue
Definition: smss.h:60
UNICODE_STRING Value
Definition: smss.h:59
ULONG MuSessionId
Definition: smss.h:72
HANDLE ProcessHandle
Definition: smss.h:67
HANDLE SbApiPort
Definition: smss.h:70
CLIENT_ID ClientId
Definition: smss.h:71
HANDLE Event
Definition: smss.h:66
ULONG ImageType
Definition: smss.h:68
BOOLEAN Terminating
Definition: smss.h:73
LIST_ENTRY Entry
Definition: smss.h:65
HANDLE PortHandle
Definition: smss.h:69
ULONG ReferenceCount
Definition: smss.h:74
uint32_t * PULONG_PTR
Definition: typedefs.h:65
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1165