ReactOS  0.4.14-dev-57-g333b8f1
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 /* 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 {
57 
58 typedef struct _SMP_SUBSYSTEM
59 {
71 
72 /* EXTERNALS ******************************************************************/
73 
78 extern ULONG SmpNextSessionId;
80 extern BOOLEAN SmpDbgSsLoaded;
86 extern PVOID SmpHeap;
87 extern ULONG SmBaseTag;
96 extern BOOLEAN SmpDebug;
97 
98 /* FUNCTIONS ******************************************************************/
99 
100 NTSTATUS
101 NTAPI
104  IN ULONG ParameterMask,
105  IN ULONG ParameterCount
106 );
107 
108 NTSTATUS
109 NTAPI
111  IN BOOLEAN InitialCall
112 );
113 
114 NTSTATUS
115 NTAPI
116 SmpInit(
117  IN PUNICODE_STRING InitialCommand,
119 );
120 
121 NTSTATUS
122 NTAPI
125  OUT PVOID *PrivilegeStat
126 );
127 
128 VOID
129 NTAPI
131  IN PVOID State
132 );
133 
134 ULONG
135 NTAPI
136 SmpApiLoop(
138 );
139 
140 NTSTATUS
141 NTAPI
143  IN PUNICODE_STRING CommandLine,
144  IN ULONG MuSessionId,
146  IN ULONG Flags
147 );
148 
149 NTSTATUS
150 NTAPI
152  IN PULONG MuSessionId,
154  IN PUNICODE_STRING InitialCommand
155 );
156 
157 VOID
158 NTAPI
160  VOID
161 );
162 
163 NTSTATUS
164 NTAPI
166  IN PUNICODE_STRING PageFileToken
167 );
168 
169 NTSTATUS
170 NTAPI
172  VOID
173 );
174 
175 NTSTATUS
176 NTAPI
178  IN PUNICODE_STRING CommandLine,
179  OUT PULONG Flags,
182  OUT PUNICODE_STRING Arguments
183 );
184 
185 NTSTATUS
186 NTAPI
190  IN PUNICODE_STRING CommandLine,
191  IN ULONG MuSessionId,
193  IN ULONG Flags
194 );
195 
196 NTSTATUS
197 NTAPI
201 );
202 
203 BOOLEAN
204 NTAPI
206  VOID
207 );
208 
209 BOOLEAN
210 NTAPI
212  OUT PBOOLEAN BootOkay,
213  OUT PBOOLEAN ShutdownOkay
214 );
215 
216 VOID
217 NTAPI
219  IN BOOLEAN BootOkay,
220  IN BOOLEAN ShutdownOkay
221 );
222 
223 BOOLEAN
224 NTAPI
227 );
228 
229 VOID
230 NTAPI
232  VOID
233 );
234 
236 NTAPI
239 );
240 
242 NTAPI
244  IN ULONG MuSessionId,
246 );
247 
248 NTSTATUS
249 NTAPI
253 );
254 
255 VOID
256 NTAPI
258  IN PSMP_SUBSYSTEM SubSystem
259 );
260 
261 NTSTATUS
262 NTAPI
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
274  IN PSMP_SUBSYSTEM Subsystem,
275  IN PSMP_SUBSYSTEM OtherSubsystem
276 );
277 
278 VOID
279 NTAPI
282 );
283 
284 BOOLEAN
285 NTAPI
287  IN ULONG MuSessionId
288 );
289 
290 NTSTATUS
291 NTAPI
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_ */
NTSTATUS NTAPI SmpExecuteCommand(IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, OUT PHANDLE ProcessId, IN ULONG Flags)
Definition: smss.c:221
signed char * PCHAR
Definition: retypes.h:7
LIST_ENTRY SmpSubSystemsToLoad
Definition: sminit.c:21
#define IN
Definition: typedefs.h:38
ULONG ReferenceCount
Definition: smss.h:69
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2697
HANDLE PortHandle
Definition: smss.h:64
UNICODE_STRING SmpDefaultLibPath
Definition: sminit.c:28
struct _SMP_REGISTRY_VALUE * PSMP_REGISTRY_VALUE
ULONG NTAPI SmpApiLoop(IN PVOID Parameter)
Definition: smloop.c:335
ULONG SmBaseTag
Definition: sminit.c:25
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
ULONG SmpNextSessionIdScanMode
Definition: smsessn.c:29
ULONG SessionId
Definition: dllmain.c:28
HANDLE SmpWindowsSubSysProcess
Definition: smsubsys.c:20
BOOLEAN SmpDebug
Definition: smss.c:22
LONG NTSTATUS
Definition: precomp.h:26
PWCHAR SmpDefaultEnvironment
Definition: sminit.c:27
BOOLEAN Terminating
Definition: smss.h:68
UNICODE_STRING SmpSystemRoot
Definition: smss.c:20
BOOLEAN NTAPI SmpCheckDuplicateMuSessionId(IN ULONG MuSessionId)
Definition: smsessn.c:37
uint16_t * PWCHAR
Definition: typedefs.h:54
_In_ PVOID Parameter
Definition: ldrtypes.h:241
ULONG ImageType
Definition: smss.h:63
NTSTATUS NTAPI SmpCreatePagingFiles(VOID)
Definition: pagefile.c:998
ULONG SmpNextSessionId
Definition: smsessn.c:28
BOOLEAN RegPosixSingleInstance
Definition: smsubsys.c:22
UNICODE_STRING SmpASyncKeyword
Definition: smutil.c:34
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByCid(IN PCLIENT_ID ClientId)
Definition: smsubsys.c:68
HANDLE SmpWindowsSubSysProcessId
Definition: smsubsys.c:21
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
RTL_CRITICAL_SECTION SmpSessionListLock
Definition: smsessn.c:26
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
HANDLE ProcessHandle
Definition: smss.h:62
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:42
struct _SMP_SUBSYSTEM SMP_SUBSYSTEM
PCHAR AnsiValue
Definition: smss.h:55
NTSTATUS NTAPI SmpCreatePagingFileDescriptor(IN PUNICODE_STRING PageFileToken)
Definition: pagefile.c:84
PVOID SmpHeap
Definition: sminit.c:24
unsigned char BOOLEAN
BOOLEAN NTAPI SmpCheckForCrashDump(IN PUNICODE_STRING FileName)
Definition: crashdmp.c:20
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
HANDLE Event
Definition: smss.h:61
LIST_ENTRY SmpSubSystemList
Definition: sminit.c:21
ULONG NTAPI SmpAllocateSessionId(IN PSMP_SUBSYSTEM Subsystem, IN PSMP_SUBSYSTEM OtherSubsystem)
Definition: smsessn.c:123
ULONG AttachedSessionId
Definition: smss.c:21
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
NTSTATUS NTAPI SmpSetProcessMuSessionId(IN HANDLE ProcessHandle, IN ULONG SessionId)
Definition: smsessn.c:199
LIST_ENTRY SmpExecuteList
Definition: sminit.c:22
NTSTATUS NTAPI SmpInit(IN PUNICODE_STRING InitialCommand, OUT PHANDLE ProcessHandle)
Definition: sminit.c:2391
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByType(IN ULONG MuSessionId, IN ULONG ImageType)
Definition: smsubsys.c:102
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
HANDLE SbApiPort
Definition: smss.h:65
VOID NTAPI SmpRestoreBootStatusData(IN BOOLEAN BootOkay, IN BOOLEAN ShutdownOkay)
Definition: smutil.c:529
VOID NTAPI SmpReleasePrivilege(IN PVOID State)
Definition: smutil.c:129
LIST_ENTRY Entry
Definition: smss.h:52
LIST_ENTRY SmpSessionListHead
Definition: smsessn.c:27
UNICODE_STRING SmpDebugKeyword
Definition: smutil.c:34
char * PBOOLEAN
Definition: retypes.h:11
struct _SMP_SUBSYSTEM * PSMP_SUBSYSTEM
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
UNICODE_STRING Name
Definition: smss.h:53
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
Definition: typedefs.h:117
NTSTATUS NTAPI SmpAcquirePrivilege(IN ULONG Privilege, OUT PVOID *PrivilegeStat)
Definition: smutil.c:40
NTSTATUS NTAPI SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId, OUT PHANDLE ProcessId, IN PUNICODE_STRING InitialCommand)
Definition: smsubsys.c:513
BOOLEAN NTAPI SmpSaveAndClearBootStatusData(OUT PBOOLEAN BootOkay, OUT PBOOLEAN ShutdownOkay)
Definition: smutil.c:479
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
Definition: smsubsys.c:47
ULONG MuSessionId
Definition: smss.h:67
NTSTATUS NTAPI SmpSbCreateSession(IN PVOID Reserved, IN PSMP_SUBSYSTEM OtherSubsystem, IN PRTL_USER_PROCESS_INFORMATION ProcessInformation, IN ULONG MuSessionId, IN PCLIENT_ID DbgClientId)
Definition: smsbapi.c:31
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
LIST_ENTRY Entry
Definition: smss.h:60
NTSTATUS NTAPI SmpGetProcessMuSessionId(IN HANDLE ProcessHandle, OUT PULONG SessionId)
Definition: smsessn.c:168
VOID NTAPI SmpDeleteSession(IN ULONG SessionId)
Definition: smsessn.c:98
NTSTATUS NTAPI SmpTerminate(IN PULONG_PTR Parameters, IN ULONG ParameterMask, IN ULONG ParameterCount)
Definition: smss.c:391
unsigned int * PULONG
Definition: retypes.h:1
VOID NTAPI SmpTranslateSystemPartitionInformation(VOID)
Definition: sminit.c:786
NTSTATUS NTAPI SmpCreateSecurityDescriptors(IN BOOLEAN InitialCall)
Definition: sminit.c:941
ImageType
Definition: gdiplusenums.h:191
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
base for all directory entries
Definition: entries.h:138
BOOLEAN NTAPI SmpQueryRegistrySosOption(VOID)
Definition: smutil.c:424
uint32_t * PULONG_PTR
Definition: typedefs.h:63
BOOLEAN SmpDbgSsLoaded
Definition: smsessn.c:30
VOID NTAPI SmpPagingFileInitialize(VOID)
Definition: pagefile.c:75
HANDLE SmpSessionsObjectDirectory
Definition: smsessn.c:31
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
UNICODE_STRING Value
Definition: smss.h:54
UNICODE_STRING SmpAutoChkKeyword
Definition: smutil.c:34
LIST_ENTRY SmpSetupExecuteList
Definition: sminit.c:19
CLIENT_ID ClientId
Definition: smss.h:66
struct _SMP_REGISTRY_VALUE SMP_REGISTRY_VALUE
RTL_CRITICAL_SECTION SmpKnownSubSysLock
Definition: smsubsys.c:18
LIST_ENTRY SmpKnownSubSysHead
Definition: smsubsys.c:19