KeCanChangeEnclavePageProtection

NTSTATUS __stdcall KeCanChangeEnclavePageProtection(){
  _DWORD *v0; 
  unsigned int v1; 
  NTSTATUS result; 
  int v3[16]; 

  v0 = (_DWORD *)((unsigned __int64)v3 & 0xFFFFFFFFFFFFFFC0ui64);
  if( ((unsigned __int64)KeFeatureBits & 0x80000000000i64) == 0 )
    return -1073741637;
  memset(v0 + 16, 0i64, 0x40u);
  *(_DWORD *)(((unsigned __int64)v3 & 0xFFFFFFFFFFFFFFC0ui64) + 0x40) = 7;
  do
    v1 = KiEncls(0xEui64);
  while( v1 == 15 );
  result = KiEnclsStatus(v1);
  *v0 = result;
  return result;
}

Referenced by:

MiProtectEnclavePages