KiSendThawExecution

VOID __stdcall KiSendThawExecution(){
  char v0; 
  char v1; 
  char v2; 
  unsigned int v3; 
  struct _KPRCB *v4; 
  int v5; 
  UINT64 ProcIndex; 
  _KAFFINITY_ENUMERATION_CONTEXT Context; 
  _KAFFINITY_EX Affinity; 

  v1 = v0;
  LODWORD(ProcIndex) = 0;
  *(_DWORD *)(&Context.CurrentIndex + 1) = 0;
  *(&Context.CurrentIndex + 3) = 0;
  memset(Affinity.Bitmap, 0i64, sizeof(Affinity.Bitmap));
  KeGetCurrentPrcb()->IpiFrozen = 0;
  KiSetDebuggerOwner(0i64);
  if( (KiBugCheckActive & 3) != 0 )
  {
    v2 = 1;
    LODWORD(ProcIndex) = (unsigned int)KiBugCheckActive >> 4;
  }
  else
  {
    v2 = 0;
  }
  if( KiRecoveryInProgress )
    v2 = 0;
  if( (!v2 || (_DWORD)ProcIndex != KeGetCurrentPrcb()->Number || KiResumeForReboot)
    && (unsigned int)KeNumberProcessors_0 >= 2
    && !PoAllProcIntrDisabled )
  {
    *(_DWORD *)&Affinity.Count = 1310721;
    memset(&Affinity.Reserved, 0i64, 0xA4u);
    LODWORD(ProcIndex) = 0;
    if( (_DWORD)KeNumberProcessors_0 )
    {
      v3 = ProcIndex;
      do
      {
        v4 = *(&KiProcessorBlock + v3);
        if( v4 != KeGetCurrentPrcb() )
        {
          if( (v4->IpiFrozen & 0xF) == 2 )
          {
            v4->IpiFrozen = 3;
            if( v1 )
              KeAddProcessorAffinityEx(&Affinity.Count, (unsigned int)ProcIndex);
          }
          else
          {
            v4->IpiFrozen = 0;
          }
        }
        LODWORD(ProcIndex) = ProcIndex + 1;
        v3 = ProcIndex;
      }
      while( (unsigned int)ProcIndex < (unsigned int)KeNumberProcessors_0 );
    }
    Context.CurrentMask = Affinity.Bitmap[0];
    Context.Affinity = &Affinity;
    Context.CurrentIndex = 0;
    while( 1 )
    {
      KeEnumerateNextProcessor(&ProcIndex, &Context);
      if( v5 )
        break;
      while( (*(&KiProcessorBlock + (unsigned int)ProcIndex))->IpiFrozen == 3 )
        _mm_pause();
    }
  }
}

Referenced by:

KeBugCheck2
KeThawExecution