MiGetValidAwePartitionId

NTSTATUS __stdcall MiGetValidAwePartitionId(INT64 a1){
  unsigned __int64 v1; 
  unsigned __int64 EntireField; 
  UINT64 v5; 

  v5 = a1;
  v1 = a1;
  if( (a1 & 1) != 0 )
  {
    MiPteInShadowRange((UINT64)&v5);
  }
  else if( *(&stru_140C4DB30 + 42) && (a1 & 0x10) == 0 )
  {
    v1 = a1 & ~*(&stru_140C4DB30 + 42);
  }
  EntireField = MmGetPfnDb()[(v1 >> 12) & 0xFFFFFFFFFi64].u4.EntireField;
  if( ((EntireField >> 50) & 1) != 0 )
    return(EntireField >> 39) & 0x3FF;
  else
    return 0;
}

Referenced by:

MiGetPageProtection