MiInitializeEnclavePfn
VOID __stdcall MiInitializeEnclavePfn(UINT64 PageFrameIndex, MMPTE *PointerPte, UINT64 ProtectionMask){
char v3;
char *v5;
unsigned __int64 v6;
unsigned __int64 v7;
char v8;
v3 = ProtectionMask;
v5 = (char *)MmGetPfnDb() + 48 * PageFrameIndex;
v6 = (unsigned __int8)MiLockPageInline((INT64)v5);
v5[34] = v5[34] & 0xF8 | 6;
v7 = *((_QWORD *)v5 + 3) & 0xC000000000000001ui64;
*((_WORD *)v5 + 16) = 1;
v8 = v5[34];
*((_QWORD *)v5 + 3) = v7 | 1;
v5[34] = v8 | 0x10;
*((_QWORD *)v5 + 1) = PointerPte;
*((_QWORD *)v5 + 2) = MiSwizzleInvalidPte(32i64 * (v3 & 0x1F));
_InterlockedAnd64((volatile signed __int64 *)v5 + 3, 0x7FFFFFFFFFFFFFFFui64);
__writecr8(v6);
}Referenced by:
MiAddPagesToEnclave
MiCopyPagesIntoEnclave
MiCreateHardwareEnclave