PspEvaluateAndNotifyEmptyJob

VOID __stdcall PspEvaluateAndNotifyEmptyJob(_EJOB *Job, UINT8 RemoveProcess, UINT8 SendZeroProcessCountMessage){
  _ETHREAD *CurrentThread; 
  int v7; 

  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  PspLockJobExclusive(Job, CurrentThread);
  v7 = *((_DWORD *)Job + 306);
  if( RemoveProcess )
    *((_DWORD *)Job + 306) = --v7;
  if( !v7 )
  {
    if( _interlockedbittestandreset((volatile signed __int32 *)Job + 330, 7u) )
      KeSetEvent((PRKEVENT)Job, 0, 0);
    if( !_interlockedbittestandset((volatile signed __int32 *)Job + 330, 0x15u) )
    {
      if( SendZeroProcessCountMessage && *((_QWORD *)Job + 57) && (*((_DWORD *)Job + 219) & 0x10) != 0 )
        PspSendReliableJobNotification(Job, 4ui64);
      if( (*((_DWORD *)Job + 64) & 0x400000) != 0
        && !_interlockedbittestandset((volatile signed __int32 *)Job + 330, 0x1Du)
        && (*((_DWORD *)Job + 330) & 0x40000000) != 0 )
      {
        PspHardDereferenceSiloWorker(Job);
      }
    }
  }
  PspUnlockJob(Job, CurrentThread);
}

Referenced by:

PspNotifyEmptyJobsInJobChain