MiDrainControlAreaWrites

VOID __stdcall MiDrainControlAreaWrites(_CONTROL_AREA *ControlArea, UINT8 OldIrql){
  bool v3; 
  CHAR v5; 
  _MI_CONTROL_AREA_WAIT_BLOCK *WaitList; 
  int v7; 
  int v8; 
  __int16 v9; 
  char v10; 
  char v11; 
  int v12; 
  __int64 v13[3]; 

  v8 = 0;
  v3 = ControlArea->ModifiedWriteCount == 0;
  v11 = 0;
  if( !v3 )
  {
    do
    {
      v12 = 0;
      v13[1] = (__int64)v13;
      v7 = 8;
      v13[0] = (__int64)v13;
      WaitList = ControlArea->WaitList;
      ControlArea->WaitList = (_MI_CONTROL_AREA_WAIT_BLOCK *)&WaitList;
      v9 = 263;
      v10 = 6;
      ExReleaseSpinLockExclusiveFromDpcLevel((INT64 *)&ControlArea->ControlAreaLock);
      __writecr8(OldIrql);
      KeWaitForGate((_KGATE *)&v9, WrVirtualMemory, v5);
      OldIrql = ExAcquireSpinLockExclusive((INT64 *)&ControlArea->ControlAreaLock);
    }
    while( ControlArea->ModifiedWriteCount );
  }
}

Referenced by:

MiDestroySection
MiPrepareSegmentForDeletion