diff --git a/ntoskrnl/include/internal/amd64/mm.h b/ntoskrnl/include/internal/amd64/mm.h index 3d45788222e..a335728b3b9 100644 --- a/ntoskrnl/include/internal/amd64/mm.h +++ b/ntoskrnl/include/internal/amd64/mm.h @@ -118,9 +118,16 @@ #endif /* Macros to identify the page fault reason from the error code */ -#define MI_IS_NOT_PRESENT_FAULT(FaultCode) !BooleanFlagOn(FaultCode, 0x1) -#define MI_IS_WRITE_ACCESS(FaultCode) BooleanFlagOn(FaultCode, 0x2) -#define MI_IS_INSTRUCTION_FETCH(FaultCode) BooleanFlagOn(FaultCode, 0x10) +#define MI_IS_NOT_PRESENT_FAULT(FaultCode) !BooleanFlagOn(FaultCode, 0x00000001) +#define MI_IS_WRITE_ACCESS(FaultCode) BooleanFlagOn(FaultCode, 0x00000002) +// 0x00000004: user-mode access. +// 0x00000008: reserved bit violation. +#define MI_IS_INSTRUCTION_FETCH(FaultCode) BooleanFlagOn(FaultCode, 0x00000010) +// 0x00000020: protection-key violation. +// 0x00000040: shadow-stack access. +// Bits 7-14: reserved. +// 0x00008000: violation of SGX-specific access-control requirements. +// Bits 16-31: reserved. /* On x64, these are the same */ #define MI_WRITE_VALID_PPE MI_WRITE_VALID_PTE diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h index f0622f685de..57b24e46d78 100644 --- a/ntoskrnl/include/internal/i386/mm.h +++ b/ntoskrnl/include/internal/i386/mm.h @@ -110,9 +110,16 @@ /* Macros to identify the page fault reason from the error code */ -#define MI_IS_NOT_PRESENT_FAULT(FaultCode) !BooleanFlagOn(FaultCode, 0x1) -#define MI_IS_WRITE_ACCESS(FaultCode) BooleanFlagOn(FaultCode, 0x2) -#define MI_IS_INSTRUCTION_FETCH(FaultCode) BooleanFlagOn(FaultCode, 0x10) +#define MI_IS_NOT_PRESENT_FAULT(FaultCode) !BooleanFlagOn(FaultCode, 0x00000001) +#define MI_IS_WRITE_ACCESS(FaultCode) BooleanFlagOn(FaultCode, 0x00000002) +// 0x00000004: user-mode access. +// 0x00000008: reserved bit violation. +#define MI_IS_INSTRUCTION_FETCH(FaultCode) BooleanFlagOn(FaultCode, 0x00000010) +// 0x00000020: protection-key violation. +// 0x00000040: shadow-stack access. +// Bits 7-14: reserved. +// 0x00008000: violation of SGX-specific access-control requirements. +// Bits 16-31: reserved. /* On x86, these two are the same */ #define MI_WRITE_VALID_PPE MI_WRITE_VALID_PTE