MiSubsectionProtosCreated

VOID __stdcall MiSubsectionProtosCreated(_SUBSECTION *Subsection, _MI_CONTROL_AREA_WAIT_BLOCK *CreationGate){
  int v2; 
  int v3; 
  _CONTROL_AREA *ControlArea; 
  int v5; 
  int v6; 
  unsigned __int64 v9; 
  _RTL_BALANCED_NODE *WaitList; 
  __int32 bf_34; 
  __int32 v12; 
  _RTL_BALANCED_NODE *v13; 
  int Right; 
  int v15; 

  ControlArea = Subsection->ControlArea;
  v5 = v3;
  v6 = v2;
  KeAbPostRelease(Subsection);
  v9 = (unsigned __int8)ExAcquireSpinLockExclusive((INT64 *)&ControlArea->ControlAreaLock);
  if( (ControlArea->u.LongFlags & 0x20) != 0 )
  {
    WaitList = (_RTL_BALANCED_NODE *)ControlArea->WaitList;
    ControlArea->WaitList = 0i64;
    goto LABEL_9;
  }
  bf_34 = Subsection->_bf_34;
  if( v5 )
  {
    v12 = bf_34 | 0x40000000;
LABEL_7:
    Subsection->_bf_34 = v12;
    goto LABEL_8;
  }
  if( v6 == Subsection->PtesInSubsection - (bf_34 & 0x3FFFFFFF) )
  {
    v12 = bf_34 & 0xBFFFFFFF;
    goto LABEL_7;
  }
LABEL_8:
  WaitList = Subsection->GlobalPerSessionHead.Root;
  Subsection->GlobalPerSessionHead.Root = 0i64;
LABEL_9:
  if( WaitList )
  {
    do
    {
      v13 = WaitList->Children[0];
      if( WaitList != (_RTL_BALANCED_NODE *)CreationGate )
      {
        Right = (int)WaitList->Right;
        HIDWORD(WaitList->Right) = 1;
        if( (Right & 0x40) == 0 )
        {
          v15 = 1;
          if( (*((_DWORD *)CreationGate + 2) & 0x100) != 0 )
            v15 = 2;
          HIDWORD(WaitList->Right) = v15;
          KeSignalGate((_KGATE *)&WaitList->16, 1i64);
        }
      }
      WaitList = v13;
    }
    while( v13 );
  }
  ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&ControlArea->ControlAreaLock);
  __writecr8(v9);
}

Referenced by:

MiAllocateFileExtents
MiPurgeFileOnlyPfn
MmPurgeSection