MiWaitForVadDeletion

void __fastcall MiWaitForVadDeletion(__int64 a1){
  _ETHREAD *CurrentThread; 
  INT64 result; 
  __int16 PcValue; 
  char v5; 
  int v6; 
  __int64 v7[6]; 
  int v8; 
  memset((INT64)&result, 0i64);
  if( *(_QWORD *)(a1 + 16) != -1i64 )
  {
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    v6 = 0;
    v7[1] = (__int64)v7;
    v8 = 1;
    v7[0] = (__int64)v7;
    PcValue = 263;
    v5 = 6;
    MiInsertVadEvent((_MMVAD_SHORT *)a1, (_MI_VAD_EVENT_BLOCK *)&result, 1ui64);
    MiUnlockVad((__int64)CurrentThread, a1);
    KeWaitForGate(&PcValue, 18);
    --*((_WORD *)CurrentThread + 243);
    ExAcquirePushLockExclusiveEx(a1 + 40, 0i64);
    *((_BYTE *)CurrentThread + 1304) |= 0x80u;
  }
}

Referenced by:

MiLockVadRange
MiObtainReferencedSecureVad
MiObtainReferencedVadEx
MmQueryVirtualMemory