- Bugcheck on a page fault, if the reason was code executing in a non executable...
authorHartmut Birr <osexpert@googlemail.com>
Tue, 5 Oct 2004 19:11:17 +0000 (19:11 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Tue, 5 Oct 2004 19:11:17 +0000 (19:11 +0000)
svn path=/trunk/; revision=11204

reactos/ntoskrnl/ke/i386/exp.c
reactos/ntoskrnl/ntoskrnl.mc

index fcdeadb..0e6250e 100644 (file)
@@ -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();
index 80e551e..8af28f3 100644 (file)
@@ -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