ReactOS  0.4.15-dev-1392-g3014417
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 #include <ntstrsafe.h>
35 
36 /* SM Protocol Header */
37 #include <sm/smmsg.h>
38 
39 /* DEFINES ********************************************************************/
40 
41 #define SMP_DEBUG_FLAG 0x01
42 #define SMP_ASYNC_FLAG 0x02
43 #define SMP_AUTOCHK_FLAG 0x04
44 #define SMP_SUBSYSTEM_FLAG 0x08
45 #define SMP_INVALID_PATH 0x10
46 #define SMP_DEFERRED_FLAG 0x20
47 #define SMP_POSIX_FLAG 0x100
48 #define SMP_OS2_FLAG 0x200
49 
50 /* STRUCTURES *****************************************************************/
51 
52 typedef struct _SMP_REGISTRY_VALUE
53 {
59 
60 typedef struct _SMP_SUBSYSTEM
61 {
73 
74 /* EXTERNALS ******************************************************************/
75 
80 extern ULONG SmpNextSessionId;
82 extern BOOLEAN SmpDbgSsLoaded;
88 extern PVOID SmpHeap;
89 extern ULONG SmBaseTag;
98 extern BOOLEAN SmpDebug;
99 
100 /* FUNCTIONS ******************************************************************/
101 
102 NTSTATUS
103 NTAPI
106  IN ULONG ParameterMask,
107  IN ULONG ParameterCount
108 );
109 
110 NTSTATUS
111 NTAPI
113  IN BOOLEAN InitialCall
114 );
115 
116 NTSTATUS
117 NTAPI
118 SmpInit(
119  IN PUNICODE_STRING InitialCommand,
121 );
122 
123 NTSTATUS
124 NTAPI
127  OUT PVOID *PrivilegeStat
128 );
129 
130 VOID
131 NTAPI
133  IN PVOID State
134 );
135 
136 ULONG
137 NTAPI
138 SmpApiLoop(
140 );
141 
142 NTSTATUS
143 NTAPI
145  IN PUNICODE_STRING CommandLine,
146  IN ULONG MuSessionId,
148  IN ULONG Flags
149 );
150 
151 NTSTATUS
152 NTAPI
154  IN PULONG MuSessionId,
156  IN PUNICODE_STRING InitialCommand
157 );
158 
159 VOID
160 NTAPI
162  VOID
163 );
164 
165 NTSTATUS
166 NTAPI
168  IN PUNICODE_STRING PageFileToken
169 );
170 
171 NTSTATUS
172 NTAPI
174  VOID
175 );
176 
177 NTSTATUS
178 NTAPI
180  IN PUNICODE_STRING CommandLine,
181  OUT PULONG Flags,
184  OUT PUNICODE_STRING Arguments
185 );
186 
187 NTSTATUS
188 NTAPI
192  IN PUNICODE_STRING CommandLine,
193  IN ULONG MuSessionId,
195  IN ULONG Flags
196 );
197 
198 NTSTATUS
199 NTAPI
203 );
204 
205 BOOLEAN
206 NTAPI
208  VOID
209 );
210 
211 BOOLEAN
212 NTAPI
214  OUT PBOOLEAN BootOkay,
215  OUT PBOOLEAN ShutdownOkay
216 );
217 
218 VOID
219 NTAPI
221  IN BOOLEAN BootOkay,
222  IN BOOLEAN ShutdownOkay
223 );
224 
225 BOOLEAN
226 NTAPI
229 );
230 
231 VOID
232 NTAPI
234  VOID
235 );
236 
238 NTAPI
241 );
242 
244 NTAPI
246  IN ULONG MuSessionId,
248 );
249 
250 NTSTATUS
251 NTAPI
255 );
256 
257 VOID
258 NTAPI
260  IN PSMP_SUBSYSTEM SubSystem
261 );
262 
263 NTSTATUS
264 NTAPI
266  IN PVOID Reserved,
267  IN PSMP_SUBSYSTEM OtherSubsystem,
268  IN PRTL_USER_PROCESS_INFORMATION ProcessInformation,
269  IN ULONG MuSessionId,
270  IN PCLIENT_ID DbgClientId
271 );
272 
273 ULONG
274 NTAPI
276  IN PSMP_SUBSYSTEM Subsystem,
277  IN PSMP_SUBSYSTEM OtherSubsystem
278 );
279 
280 VOID
281 NTAPI
284 );
285 
286 BOOLEAN
287 NTAPI
289  IN ULONG MuSessionId
290 );
291 
292 NTSTATUS
293 NTAPI
297  IN PUNICODE_STRING CommandLine,
298  IN ULONG MuSessionId,
299  IN ULONG Flags,
300  IN PRTL_USER_PROCESS_INFORMATION ProcessInformation
301 );
302 
303 #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:39
ULONG ReferenceCount
Definition: smss.h:71
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2706
HANDLE PortHandle
Definition: smss.h:66
UNICODE_STRING SmpDefaultLibPath
Definition: sminit.c:28
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
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:70
UNICODE_STRING SmpSystemRoot
Definition: smss.c:20
BOOLEAN NTAPI SmpCheckDuplicateMuSessionId(IN ULONG MuSessionId)
Definition: smsessn.c:37
uint16_t * PWCHAR
Definition: typedefs.h:56
_In_ PVOID Parameter
Definition: ldrtypes.h:241
ULONG ImageType
Definition: smss.h:65
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
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:64
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:57
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:63
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
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:2423
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:67
VOID NTAPI SmpRestoreBootStatusData(IN BOOLEAN BootOkay, IN BOOLEAN ShutdownOkay)
Definition: smutil.c:531
VOID NTAPI SmpReleasePrivilege(IN PVOID State)
Definition: smutil.c:129
LIST_ENTRY Entry
Definition: smss.h:54
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
UNICODE_STRING Name
Definition: smss.h:55
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
Definition: typedefs.h:119
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:481
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
Definition: smsubsys.c:47
ULONG MuSessionId
Definition: smss.h:69
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:62
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:950
ImageType
Definition: gdiplusenums.h:192
#define OUT
Definition: typedefs.h:40
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:65
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:56
UNICODE_STRING SmpAutoChkKeyword
Definition: smutil.c:34
LIST_ENTRY SmpSetupExecuteList
Definition: sminit.c:19
CLIENT_ID ClientId
Definition: smss.h:68
struct _SMP_REGISTRY_VALUE SMP_REGISTRY_VALUE
RTL_CRITICAL_SECTION SmpKnownSubSysLock
Definition: smsubsys.c:18
LIST_ENTRY SmpKnownSubSysHead
Definition: smsubsys.c:19