275{
286
287
291
292
294 {
295
298 }
299 else
300 {
301
306 &SbApiMsg->h.ClientId);
308
309
311 }
312
313
315 if ((CidSubsystem) && (Accept))
316 {
317
319 SbApiMsg->ConnectionInfo.SubsystemType);
320 if (TypeSubsystem == CidSubsystem)
321 {
322
324 DPRINT1(
"SMSS: Connection from SubSystem rejected\n");
325 DPRINT1(
"SMSS: Image type already being served\n");
326 }
327 else
328 {
329
330 CidSubsystem->
ImageType = SbApiMsg->ConnectionInfo.SubsystemType;
331 }
332
333
335 }
336
337
338 if (Accept)
339 {
340
343 {
348 }
349 else
350 {
351
352 DPRINT1(
"Rejecting connection due to lack of memory\n");
354 }
355 }
356 else
357 {
358
360 }
361
362
363 PortView.
Length =
sizeof(PortView);
366 &SbApiMsg->h,
367 Accept,
369 &PortView);
371 {
372
378 }
379
380
382 if (CidSubsystem) CidSubsystem->
PortHandle = PortHandle;
383
384
387 {
388
389 SbApiMsg->ConnectionInfo.SbApiPortName[119] =
UNICODE_NULL;
391 SbApiMsg->ConnectionInfo.SbApiPortName);
393 &SubsystemPort,
394 &SecurityQos,
401 {
402 DPRINT1(
"SMSS: Connect back to Sb %wZ failed %lx\n", &SubsystemPort,
Status);
403 }
405
406
408 }
409 else if (CidSubsystem)
410 {
411
414 }
415
416
419}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
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)
NTSTATUS NTAPI NtCompleteConnectPort(IN HANDLE PortHandle)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define PROCESS_QUERY_INFORMATION
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
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)
struct _SMP_CLIENT_CONTEXT * PSMP_CLIENT_CONTEXT
NTSTATUS NTAPI SmpGetProcessMuSessionId(IN HANDLE ProcessHandle, OUT PULONG SessionId)
VOID NTAPI SmpDereferenceSubsystem(IN PSMP_SUBSYSTEM SubSystem)
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByCid(IN PCLIENT_ID ClientId)
PSMP_SUBSYSTEM NTAPI SmpLocateKnownSubSysByType(IN ULONG MuSessionId, IN ULONG ImageType)
SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
#define SECURITY_DYNAMIC_TRACKING