MiCreateVadEventBitmap

NTSTATUS __stdcall MiCreateVadEventBitmap(
        _EPROCESS *Process,
        _MMVAD_SHORT *Vad,
        UINT64 NumberOfPages,
        UINT64 WaitReason){
  int v7; 
  UINT64 v8; 
  char *Pool; 
  int v10; 

  v7 = WaitReason;
  v8 = 8 * ((NumberOfPages >> 6) + ((NumberOfPages & 0x3F) != 0) + 9i64);
  Pool = (char *)MiAllocatePool(64i64, v8, 0x77776D4Dui64);
  if( !Pool )
    return -1073741670;
  v10 = PsChargeProcessNonPagedPoolQuota(Process, v8);
  if( v10 < 0 )
  {
    ExFreePoolWithTag(Pool, 0);
    return v10;
  }
  else
  {
    *((_DWORD *)Pool + 16) = v7;
    *((_QWORD *)Pool + 2) = Pool + 72;
    *((_QWORD *)Pool + 1) = NumberOfPages;
    MiInsertVadEvent((__int64)Vad, Pool, 1);
    return 0;
  }
}

Referenced by:

MiAllocateNewSubAllocatedRegion
MiCreateWriteWatchView