MiGetWsleProtection

INT64 __fastcall MiGetWsleProtection(UINT64 a1, UINT8 a2){
  INT64 result; 
  __int64 v3; 
  result = (a2 >> 4) & 7;
  if( ((a2 >> 4) & 7) != 0 )
  {
    v3 = *(_QWORD *)((char *)MmGetPteBase() + ((a1 >> 9) & 0x7FFFFFFFF8i64));
    if( (v3 & 0x18) == 8 )
    {
      return(unsigned int)result | 0x18;
    }
    else if( (v3 & 0x10) != 0 )
    {
      return(unsigned int)result | 8;
    }
  }
  return result;
}

Referenced by:

MiBuildForkPte
MiCopyOnWrite
MiGetPfnProtection
MiSetReadOnlyOnSectionView
MiWsleFlush