ReactOS 0.4.15-dev-7842-g558ab78
smloop.c
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/smloop.c
5 * PURPOSE: Main SMSS Code
6 * PROGRAMMERS: Alex Ionescu
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "smss.h"
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
18typedef struct _SMP_CLIENT_CONTEXT
19{
25
26typedef
29 _In_ PSM_API_MSG SmApiMsg,
32
35
36/* API HANDLERS ***************************************************************/
37
43{
44 DPRINT1("%s is not yet implemented\n", __FUNCTION__);
46}
47
53{
54 DPRINT1("%s is not yet implemented\n", __FUNCTION__);
56}
57
63{
64 DPRINT1("%s is not yet implemented\n", __FUNCTION__);
66}
67
73{
77 RTL_USER_PROCESS_INFORMATION ProcessInformation;
79
80 /* Open the client process */
85 &SmApiMsg->h.ClientId);
86 if (!NT_SUCCESS(Status))
87 {
88 /* Fail */
89 DPRINT1("SmExecPgm: NtOpenProcess Failed %lx\n", Status);
90 return Status;
91 }
92
93 /* Copy the process information out of the message */
94 SmExecPgm = &SmApiMsg->u.ExecPgm;
95 ProcessInformation = SmExecPgm->ProcessInformation;
96
97 /* Duplicate the process handle */
99 SmExecPgm->ProcessInformation.ProcessHandle,
101 &ProcessInformation.ProcessHandle,
103 0,
104 0);
105 if (!NT_SUCCESS(Status))
106 {
107 /* Close the handle and fail */
109 DPRINT1("SmExecPgm: NtDuplicateObject (Process) Failed %lx\n", Status);
110 return Status;
111 }
112
113 /* Duplicate the thread handle */
115 SmExecPgm->ProcessInformation.ThreadHandle,
117 &ProcessInformation.ThreadHandle,
119 0,
120 0);
121 if (!NT_SUCCESS(Status))
122 {
123 /* Close both handles and fail */
124 NtClose(ProcessInformation.ProcessHandle);
126 DPRINT1("SmExecPgm: NtDuplicateObject (Thread) Failed %lx\n", Status);
127 return Status;
128 }
129
130 /* Close the process handle and call the internal client API */
133 NULL,
134 &ProcessInformation,
135 0,
136 SmExecPgm->DebugFlag ? &SmApiMsg->h.ClientId : NULL);
137}
138
140NTAPI
142 _In_ PSM_API_MSG SmApiMsg,
145{
147 PSM_LOAD_DEFERED_SUBSYSTEM_MSG SmLoadDefered = &SmApiMsg->u.LoadDefered;
148 UNICODE_STRING DeferedSubsystem;
149 ULONG MuSessionId;
150 PLIST_ENTRY NextEntry;
152
153 /* Validate DeferedSubsystem's length */
154 if ((SmLoadDefered->Length <= 0) ||
155 (SmLoadDefered->Length > sizeof(SmLoadDefered->Buffer)))
156 {
158 }
159
160 /* Get the name of the subsystem to start */
161 DeferedSubsystem.Length = (USHORT)SmLoadDefered->Length;
162 DeferedSubsystem.MaximumLength = DeferedSubsystem.Length;
163 DeferedSubsystem.Buffer = SmLoadDefered->Buffer;
164
165 /* Find a subsystem responsible for this session */
166 SmpGetProcessMuSessionId(ClientContext->ProcessHandle, &MuSessionId);
167 if (!SmpCheckDuplicateMuSessionId(MuSessionId))
168 {
169 DPRINT1("SMSS: Deferred subsystem load (%wZ) for MuSessionId %u, status=0x%x\n",
170 &DeferedSubsystem, MuSessionId, Status);
171 return Status;
172 }
173
174 /* Now process the deferred subsystems list */
175 for (NextEntry = SmpSubSystemsToDefer.Flink;
176 NextEntry != &SmpSubSystemsToDefer;
177 NextEntry = NextEntry->Flink)
178 {
179 /* Get each entry and check if it's the subsystem we are looking for */
181 if (RtlEqualUnicodeString(&RegEntry->Name, &DeferedSubsystem, TRUE))
182 {
183 // TODO: One may want to extra-flag the command for
184 // specific POSIX or OS2 processing...
185
186 /* Load the deferred subsystem */
188 MuSessionId,
189 NULL,
191 if (!NT_SUCCESS(Status))
192 DPRINT1("SMSS: Subsystem execute failed (%wZ)\n", &RegEntry->Value);
193
194 break;
195 }
196 }
197
198 /* Return status */
199 return Status;
200}
201
203NTAPI
207{
208 PSM_START_CSR_MSG SmStartCsr = &SmApiMsg->u.StartCsr;
209 UNICODE_STRING InitialCommand;
210 HANDLE InitialCommandProcess, InitialCommandProcessId, WindowsSubSysProcessId;
212
214 &WindowsSubSysProcessId,
215 &InitialCommand);
216 if (!NT_SUCCESS(Status))
217 {
218 DPRINT1("SMSS: SmpLoadSubSystemsForMuSession failed with status 0x%08x\n", Status);
219 return Status;
220 }
221
222 if (SmStartCsr->Length)
223 {
224 InitialCommand.Length = InitialCommand.MaximumLength = SmStartCsr->Length;
225 InitialCommand.Buffer = SmStartCsr->Buffer;
226 }
227
229 &InitialCommand,
230 &InitialCommandProcess,
231 &InitialCommandProcessId);
232 if (!NT_SUCCESS(Status))
233 {
234 DPRINT1("SMSS: SmpExecuteInitialCommand failed with status 0x%08x\n", Status);
235 /* FIXME: undo effects of SmpLoadSubSystemsForMuSession */
236 ASSERT(FALSE);
237 return Status;
238 }
239
240 NtClose(InitialCommandProcess);
241
242 SmStartCsr->WindowsSubSysProcessId = WindowsSubSysProcessId;
243 SmStartCsr->SmpInitialCommandProcessId = InitialCommandProcessId;
244
245 return STATUS_SUCCESS;
246}
247
249NTAPI
253{
254 DPRINT1("%s is not yet implemented\n", __FUNCTION__);
256}
257
259{
267};
268
269/* FUNCTIONS ******************************************************************/
270
272NTAPI
274 IN PSB_API_MSG SbApiMsg)
275{
276 BOOLEAN Accept = TRUE;
277 HANDLE PortHandle, ProcessHandle;
279 UNICODE_STRING SubsystemPort;
283 REMOTE_PORT_VIEW PortView;
284 SECURITY_QUALITY_OF_SERVICE SecurityQos;
285 PSMP_SUBSYSTEM CidSubsystem, TypeSubsystem;
286
287 /* Initialize QoS data */
290 SecurityQos.EffectiveOnly = TRUE;
291
292 /* Check if this is SM connecting to itself */
293 if (SbApiMsg->h.ClientId.UniqueProcess == SmUniqueProcessId)
294 {
295 /* No need to get any handle -- assume session 0 */
297 SessionId = 0;
298 }
299 else
300 {
301 /* Reference the foreign process */
306 &SbApiMsg->h.ClientId);
307 if (!NT_SUCCESS(Status)) Accept = FALSE;
308
309 /* Get its session ID */
311 }
312
313 /* See if we already know about the caller's subsystem */
314 CidSubsystem = SmpLocateKnownSubSysByCid(&SbApiMsg->h.ClientId);
315 if ((CidSubsystem) && (Accept))
316 {
317 /* Check if we already have a subsystem for this kind of image */
319 SbApiMsg->ConnectionInfo.SubsystemType);
320 if (TypeSubsystem == CidSubsystem)
321 {
322 /* Someone is trying to take control of an existing subsystem, fail */
323 Accept = FALSE;
324 DPRINT1("SMSS: Connection from SubSystem rejected\n");
325 DPRINT1("SMSS: Image type already being served\n");
326 }
327 else
328 {
329 /* Set this image type as the type for this subsystem */
330 CidSubsystem->ImageType = SbApiMsg->ConnectionInfo.SubsystemType;
331 }
332
333 /* Drop the reference we had acquired */
334 if (TypeSubsystem) SmpDereferenceSubsystem(TypeSubsystem);
335 }
336
337 /* Check if we'll be accepting the connection */
338 if (Accept)
339 {
340 /* We will, so create a client context for it */
342 if (ClientContext)
343 {
344 ClientContext->ProcessHandle = ProcessHandle;
345 ClientContext->Subsystem = CidSubsystem;
346 ClientContext->Reserved = NULL;
347 ClientContext->PortHandle = NULL;
348 }
349 else
350 {
351 /* Failed to allocate a client context, so reject the connection */
352 DPRINT1("Rejecting connection due to lack of memory\n");
353 Accept = FALSE;
354 }
355 }
356 else
357 {
358 /* Use a bogus context since we're going to reject the message */
360 }
361
362 /* Now send the actual accept reply (which could be a rejection) */
363 PortView.Length = sizeof(PortView);
364 Status = NtAcceptConnectPort(&PortHandle,
366 &SbApiMsg->h,
367 Accept,
368 NULL,
369 &PortView);
370 if (!(Accept) || !(NT_SUCCESS(Status)))
371 {
372 /* Close the process handle, reference the subsystem, and exit */
373 DPRINT1("Accept failed or rejected: %lx\n", Status);
374 if (ClientContext != (PVOID)SbApiMsg) RtlFreeHeap(SmpHeap, 0, ClientContext);
376 if (CidSubsystem) SmpDereferenceSubsystem(CidSubsystem);
377 return Status;
378 }
379
380 /* Save the port handle now that we've accepted it */
381 if (ClientContext) ClientContext->PortHandle = PortHandle;
382 if (CidSubsystem) CidSubsystem->PortHandle = PortHandle;
383
384 /* Complete the port connection */
385 Status = NtCompleteConnectPort(PortHandle);
386 if ((NT_SUCCESS(Status)) && (CidSubsystem))
387 {
388 /* This was an actual subsystem, so connect back to it */
389 SbApiMsg->ConnectionInfo.SbApiPortName[119] = UNICODE_NULL;
390 RtlCreateUnicodeString(&SubsystemPort,
391 SbApiMsg->ConnectionInfo.SbApiPortName);
392 Status = NtConnectPort(&CidSubsystem->SbApiPort,
393 &SubsystemPort,
394 &SecurityQos,
395 NULL,
396 NULL,
397 NULL,
398 NULL,
399 NULL);
400 if (!NT_SUCCESS(Status))
401 {
402 DPRINT1("SMSS: Connect back to Sb %wZ failed %lx\n", &SubsystemPort, Status);
403 }
404 RtlFreeUnicodeString(&SubsystemPort);
405
406 /* Now that we're connected, signal the event handle */
407 NtSetEvent(CidSubsystem->Event, NULL);
408 }
409 else if (CidSubsystem)
410 {
411 /* We failed to complete the connection, so clear the port handle */
412 DPRINT1("Completing the connection failed: %lx\n", Status);
413 CidSubsystem->PortHandle = NULL;
414 }
415
416 /* Dereference the subsystem and return the result */
417 if (CidSubsystem) SmpDereferenceSubsystem(CidSubsystem);
418 return Status;
419}
420
421ULONG
422NTAPI
424{
428 PSM_API_MSG ReplyMsg = NULL;
429 SM_API_MSG RequestMsg;
430 PROCESS_BASIC_INFORMATION ProcessInformation;
432
433 /* Increase the number of API threads for throttling code for later */
435
436 /* Mark us critical */
438
439 /* Set the PID of the SM process itself for later checking */
442 &ProcessInformation,
443 sizeof(ProcessInformation),
444 NULL);
445 SmUniqueProcessId = (HANDLE)ProcessInformation.UniqueProcessId;
446
447 /* Now process incoming messages */
448 while (TRUE)
449 {
450 /* Begin waiting on a request */
453 &ReplyMsg->h,
454 &RequestMsg.h);
456 {
457 /* Ran out of memory, so do a little timeout and try again */
458 if (ReplyMsg) DPRINT1("SMSS: Failed to reply to calling thread, retrying.\n");
459 Timeout.QuadPart = -50000000;
461 continue;
462 }
463
464 /* Check what kind of request we received */
465 switch (RequestMsg.h.u2.s2.Type)
466 {
467 /* A new connection */
469 /* Create the right structures for it */
471 ReplyMsg = NULL;
472 break;
473
474 /* A closed connection */
475 case LPC_PORT_CLOSED:
476 /* Destroy any state we had for this client */
477 DPRINT1("Port closed\n");
478 //if (ClientContext) SmpPushDeferredClientContext(ClientContext);
479 ReplyMsg = NULL;
480 break;
481
482 /* An actual API message */
483 default:
484 if (!ClientContext)
485 {
486 ReplyMsg = NULL;
487 break;
488 }
489
490 RequestMsg.ReturnValue = STATUS_PENDING;
491
492 /* Check if the API is valid */
493 if (RequestMsg.ApiNumber >= SmpMaxApiNumber)
494 {
495 /* It isn't, fail */
496 DPRINT1("Invalid API: %lx\n", RequestMsg.ApiNumber);
498 }
499 else if ((RequestMsg.ApiNumber <= SmpTerminateForeignSessionApi) &&
500 !(ClientContext->Subsystem))
501 {
502 /* It's valid, but doesn't have a subsystem with it */
503 DPRINT1("Invalid session API\n");
505 }
506 else
507 {
508 /* It's totally okay, so call the dispatcher for it */
509 Status = SmpApiDispatch[RequestMsg.ApiNumber](&RequestMsg,
511 SmApiPort);
512 }
513
514 /* Write the result value and return the message back */
515 RequestMsg.ReturnValue = Status;
516 ReplyMsg = &RequestMsg;
517 break;
518 }
519 }
520 return STATUS_SUCCESS;
521}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
NTSTATUS NTAPI NtAcceptConnectPort(OUT PHANDLE PortHandle, IN PVOID PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage, IN BOOLEAN AcceptConnection, IN OUT PPORT_VIEW ServerView OPTIONAL, OUT PREMOTE_PORT_VIEW ClientView OPTIONAL)
Definition: complete.c:40
NTSTATUS NTAPI NtCompleteConnectPort(IN HANDLE PortHandle)
Definition: complete.c:423
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NTSTATUS
Definition: precomp.h:21
ULONG SessionId
Definition: dllmain.c:28
#define __FUNCTION__
Definition: types.h:116
Status
Definition: gdiplustypes.h:25
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:166
@ ProcessBasicInformation
Definition: winternl.h:394
#define PROCESS_DUP_HANDLE
long __cdecl _InterlockedExchangeAdd(_Interlocked_operand_ long volatile *_Addend, long _Value)
@ SecurityIdentification
Definition: lsa.idl:56
#define ASSERT(a)
Definition: mode.c:44
#define LPC_CONNECTION_REQUEST
Definition: port.c:102
#define LPC_PORT_CLOSED
Definition: port.c:97
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define _In_
Definition: ms_sal.h:308
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
NTSYSAPI NTSTATUS __cdecl RtlSetThreadIsCritical(_In_ BOOLEAN NewValue, _Out_opt_ PBOOLEAN OldValue, _In_ BOOLEAN NeedBreaks)
_In_ PVOID ClientContext
Definition: netioddk.h:55
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define NtCurrentProcess()
Definition: nt_native.h:1657
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
Definition: wait.c:876
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UNICODE_NULL
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
Definition: event.c:455
NTSTATUS NTAPI NtConnectPort(OUT PHANDLE PortHandle, IN PUNICODE_STRING PortName, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos, IN OUT PPORT_VIEW ClientView OPTIONAL, IN OUT PREMOTE_PORT_VIEW ServerView OPTIONAL, OUT PULONG MaxMessageLength OPTIONAL, IN OUT PVOID ConnectionInformation OPTIONAL, IN OUT PULONG ConnectionInformationLength OPTIONAL)
Definition: connect.c:777
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
Definition: reply.c:743
NTSTATUS NTAPI NtOpenProcess(OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PCLIENT_ID ClientId)
Definition: process.c:1440
NTSTATUS NTAPI NtQueryInformationProcess(_In_ HANDLE ProcessHandle, _In_ PROCESSINFOCLASS ProcessInformationClass, _Out_ PVOID ProcessInformation, _In_ ULONG ProcessInformationLength, _Out_opt_ PULONG ReturnLength)
Definition: query.c:59
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
Definition: obhandle.c:3410
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
static ULONG Timeout
Definition: ping.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID SmpHeap
Definition: sminit.c:25
LIST_ENTRY SmpSubSystemsToDefer
Definition: sminit.c:22
NTSTATUS NTAPI SmpLoadDeferedSubsystem(_In_ PSM_API_MSG SmApiMsg, _In_ PSMP_CLIENT_CONTEXT ClientContext, _In_ HANDLE SmApiPort)
Definition: smloop.c:141
ULONG NTAPI SmpApiLoop(IN PVOID Parameter)
Definition: smloop.c:423
NTSTATUS(NTAPI * PSM_API_HANDLER)(_In_ PSM_API_MSG SmApiMsg, _In_ PSMP_CLIENT_CONTEXT ClientContext, _In_ HANDLE SmApiPort)
Definition: smloop.c:28
NTSTATUS NTAPI SmpExecPgm(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:70
NTSTATUS NTAPI SmpCreateForeignSession(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:40
struct _SMP_CLIENT_CONTEXT SMP_CLIENT_CONTEXT
struct _SMP_CLIENT_CONTEXT * PSMP_CLIENT_CONTEXT
HANDLE SmUniqueProcessId
Definition: smloop.c:34
NTSTATUS NTAPI SmpHandleConnectionRequest(IN HANDLE SmApiPort, IN PSB_API_MSG SbApiMsg)
Definition: smloop.c:273
NTSTATUS NTAPI SmpSessionComplete(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:50
NTSTATUS NTAPI SmpTerminateForeignSession(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:60
volatile LONG SmTotalApiThreads
Definition: smloop.c:33
NTSTATUS NTAPI SmpStartCsr(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:204
PSM_API_HANDLER SmpApiDispatch[SmpMaxApiNumber - SmpCreateForeignSessionApi]
Definition: smloop.c:258
NTSTATUS NTAPI SmpStopCsr(IN PSM_API_MSG SmApiMsg, IN PSMP_CLIENT_CONTEXT ClientContext, IN HANDLE SmApiPort)
Definition: smloop.c:250
NTSTATUS NTAPI SmStartCsr(_In_ HANDLE SmApiPort, _Out_ PULONG pMuSessionId, _In_opt_ PUNICODE_STRING CommandLine, _Out_ PHANDLE pWindowsSubSysProcessId, _Out_ PHANDLE pInitialCommandProcessId)
Requests the SM to create a new Terminal Services session and start an initial command.
Definition: smclient.c:376
NTSTATUS NTAPI SmExecPgm(_In_ HANDLE SmApiPort, _In_ PRTL_USER_PROCESS_INFORMATION ProcessInformation, _In_ BOOLEAN DebugFlag)
Requests the SM to start a process under a new environment session.
Definition: smclient.c:265
@ SmpTerminateForeignSessionApi
Definition: smmsg.h:30
@ SmpMaxApiNumber
Definition: smmsg.h:36
@ SmpCreateForeignSessionApi
Definition: smmsg.h:28
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
NTSTATUS NTAPI SmpGetProcessMuSessionId(IN HANDLE ProcessHandle, OUT PULONG SessionId)
Definition: smsessn.c:168
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
NTSTATUS NTAPI SmpExecuteCommand(IN PUNICODE_STRING CommandLine, IN ULONG MuSessionId, OUT PHANDLE ProcessId, IN ULONG Flags)
Definition: smss.c:210
HANDLE SmApiPort
Definition: smss.c:23
NTSTATUS NTAPI SmpLoadSubSystemsForMuSession(IN PULONG MuSessionId, OUT PHANDLE ProcessId, IN PUNICODE_STRING InitialCommand)
Definition: smsubsys.c:510
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
Definition: smsubsys.c:47
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByCid(IN PCLIENT_ID ClientId)
Definition: smsubsys.c:68
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByType(IN ULONG MuSessionId, IN ULONG ImageType)
Definition: smsubsys.c:102
#define SMP_SUBSYSTEM_FLAG
Definition: smss.h:47
base of all file and directory entries
Definition: entries.h:83
Registry entry.
Definition: regfs.h:31
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
NTSTATUS ReturnValue
Definition: smmsg.h:239
SB_API_NUMBER ApiNumber
Definition: smmsg.h:238
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
Definition: lsa.idl:66
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: lsa.idl:65
HANDLE ProcessHandle
Definition: smloop.c:21
HANDLE PortHandle
Definition: smloop.c:22
PSMP_SUBSYSTEM Subsystem
Definition: smloop.c:20
HANDLE SbApiPort
Definition: smss.h:70
HANDLE Event
Definition: smss.h:66
ULONG ImageType
Definition: smss.h:68
HANDLE PortHandle
Definition: smss.h:69
PORT_MESSAGE h
Definition: smmsg.h:104
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define NTAPI
Definition: typedefs.h:36
PVOID HANDLE
Definition: typedefs.h:73
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323
#define SECURITY_DYNAMIC_TRACKING
Definition: setypes.h:103