PsTerminateMinimalProcess

INT64 __stdcall PsTerminateMinimalProcess(PVOID BugCheckParameter1){
  int v1; 
  _ETHREAD *CurrentThread; 
  int v3; 
  unsigned int v5; 
  volatile INT64 *v6; 
  signed __int32 v7; 
  INT64 result; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v3 = v1;
  v5 = 8;
  --*((_WORD *)CurrentThread + 242);
  v6 = (volatile INT64 *)((char *)BugCheckParameter1 + 1080);
  ExAcquirePushLockExclusiveEx((UINT64)BugCheckParameter1 + 1080, 0i64);
  if( !*((_DWORD *)BugCheckParameter1 + 380) )
  {
    v5 = 33554440;
    if( *((_DWORD *)BugCheckParameter1 + 501) == 259 )
      *((_DWORD *)BugCheckParameter1 + 501) = v3;
  }
  _m_prefetchw((char *)BugCheckParameter1 + 1124);
  v7 = _InterlockedOr((volatile signed __int32 *)BugCheckParameter1 + 281, v5);
  if( (_InterlockedExchangeAdd64(v6, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
    ExfTryToWakePushLock(v6);
  KeAbPostRelease((PVOID)v6);
  result = (INT64)KeLeaveCriticalRegionThread((__int64)CurrentThread);
  LOBYTE(result) = (v5 & 0x2000000) != 0;
  if( (((v7 & 0x2000000) == 0) & (unsigned __int8)result) != 0 )
    LOBYTE(result) = PspRundownSingleProcess((ULONG_PTR)BugCheckParameter1, 1);
  return result;
}

Referenced by:

PspTeardownPartition
VmTerminateMemoryProcess