MiGetProtectionFromPte

NTSTATUS __stdcall MiGetProtectionFromPte(PVOID BugCheckParameter2, PVOID BugCheckParameter3){
  unsigned int v2; 
  NTSTATUS result; 
  unsigned int v4; 

  if( ((unsigned __int8)BugCheckParameter3 & 1) != 0 )
  {
    v2 = *((_DWORD *)BugCheckParameter2 + 12);
    result = (((unsigned __int16)BugCheckParameter3 & 0x800) != 0i64 ? 4 : 1) | 2;
    if( (__int64)BugCheckParameter3 < 0 )
      result = ((unsigned __int16)BugCheckParameter3 & 0x800) != 0i64 ? 4 : 1;
    v4 = (v2 >> 7) & 0x1F;
    if( v4 >> 3 == 3 && (v4 & 7) != 0 )
    {
      return result | 0x18;
    }
    else if( v4 >> 3 == 1 )
    {
      return result | 8;
    }
  }
  else
  {
    if( ((unsigned __int16)BugCheckParameter3 & 0x400) != 0 )
      KeBugCheckEx(0x1Au, (PVOID)0x8700, BugCheckParameter2, BugCheckParameter3, 0i64);
    return((unsigned __int64)BugCheckParameter3 >> 8) & 8 | 0x10;
  }
  return result;
}

Referenced by:

MiGetPageProtection
MiGetWorkingSetInfoList
MiQueryAddressState