diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index fcdeadba6cd..0e6250ebd42 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -65,6 +65,8 @@ extern VOID KiTrapUnknown(VOID); extern ULONG init_stack; extern ULONG init_stack_top; +extern BOOLEAN Ke386NoExecute; + static char *ExceptionTypeStrings[] = { "Divide Error", @@ -572,6 +574,10 @@ KiTrapHandler(PKTRAP_FRAME Tf, ULONG ExceptionNr) */ if (ExceptionNr == 14) { + if (Ke386NoExecute && Tf->ErrorCode & 0x10 && cr2_ >= KERNEL_BASE) + { + KEBUGCHECKWITHTF(ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY, 0, 0, 0, 0, Tf); + } if (Tf->Eflags & FLAG_IF) { Ke386EnableInterrupts(); diff --git a/reactos/ntoskrnl/ntoskrnl.mc b/reactos/ntoskrnl/ntoskrnl.mc index 80e551ed824..8af28f3e9f1 100644 --- a/reactos/ntoskrnl/ntoskrnl.mc +++ b/reactos/ntoskrnl/ntoskrnl.mc @@ -1029,4 +1029,12 @@ Language=English certain\n conditions. There is absolutely no warranty for ReactOS.\n . +MessageId=0xFC +Severity=Success +Facility=System +SymbolicName=ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY +Language=English +ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY +. + ; EOF \ No newline at end of file