PspTerminateSiloSubsystemProcesses

VOID __stdcall PspTerminateSiloSubsystemProcesses(PEJOB Silo){
  _ETHREAD *CurrentThread; 
  int ServerSiloServiceSessionId; 
  ULONG_PTR i; 
  int v5; 
  unsigned int ProcessSessionId; 
  __int64 NextJobProcess; 
  ULONG_PTR v8; 
  __int64 *ServerSiloGlobals; 
  __int64 v10; 
  ULONG_PTR v11; 
  __int128 v12; 
  __int64 v13; 
  __int64 v14; 
  v14 = 0i64;
  v12 = 0i64;
  v13 = 0i64;
  PspEnumJobsAndProcessesInJobHierarchy(
    Silo,
    0i64,
    (unsigned int(__fastcall *)(__int64, __int64))PspWaitOnAllProcessesJobCallback,
    0i64,
    (__int64)&v14,
    2);
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  ServerSiloServiceSessionId = PsGetServerSiloServiceSessionId(Silo);
  for( i = 0i64; ; i = v8 )
  {
    NextJobProcess = PspGetNextJobProcess(Silo, CurrentThread, &v12, i);
    v8 = NextJobProcess;
    if( !NextJobProcess )
      break;
    v5 = *(_DWORD *)(NextJobProcess + 2172);
    if( ((v5 & 0x40) != 0 || (*(_DWORD *)(NextJobProcess + 1120) & 1) == 0) && (v5 & 0x1000) == 0 )
    {
      ProcessSessionId = PsGetProcessSessionId(NextJobProcess);
      if( ProcessSessionId != ServerSiloServiceSessionId )
        PspShutdownCsrProcess((__int64)Silo, ProcessSessionId, v8);
    }
  }
  ServerSiloGlobals = PsGetServerSiloGlobals((__int64)Silo);
  v11 = ServerSiloGlobals[110];
  if( v11 )
    PspShutdownCsrProcess(v10, *(_DWORD *)ServerSiloGlobals[141], v11);
}

Referenced by:

PspCompleteServerSiloShutdownDeferred