[NTOS:KE]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 11 Oct 2014 23:07:04 +0000 (23:07 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 11 Oct 2014 23:07:04 +0000 (23:07 +0000)
- Make fastfail exception noncontinuable
CORE-8419

svn path=/trunk/; revision=64685

reactos/ntoskrnl/include/internal/i386/ke.h
reactos/ntoskrnl/ke/i386/exp.c
reactos/ntoskrnl/ke/i386/traphdlr.c

index 64d876d..cfe674c 100644 (file)
@@ -504,6 +504,7 @@ VOID
 NTAPI
 KiDispatchExceptionFromTrapFrame(
     IN NTSTATUS Code,
+    IN ULONG Flags,
     IN ULONG_PTR Address,
     IN ULONG ParameterCount,
     IN ULONG_PTR Parameter1,
@@ -623,7 +624,7 @@ KiDispatchException0Args(IN NTSTATUS Code,
                          IN PKTRAP_FRAME TrapFrame)
 {
     /* Helper for exceptions with no arguments */
-    KiDispatchExceptionFromTrapFrame(Code, Address, 0, 0, 0, 0, TrapFrame);
+    KiDispatchExceptionFromTrapFrame(Code, 0, Address, 0, 0, 0, 0, TrapFrame);
 }
 
 //
@@ -638,7 +639,7 @@ KiDispatchException1Args(IN NTSTATUS Code,
                          IN PKTRAP_FRAME TrapFrame)
 {
     /* Helper for exceptions with no arguments */
-    KiDispatchExceptionFromTrapFrame(Code, Address, 1, P1, 0, 0, TrapFrame);
+    KiDispatchExceptionFromTrapFrame(Code, 0, Address, 1, P1, 0, 0, TrapFrame);
 }
 
 //
@@ -654,7 +655,7 @@ KiDispatchException2Args(IN NTSTATUS Code,
                          IN PKTRAP_FRAME TrapFrame)
 {
     /* Helper for exceptions with no arguments */
-    KiDispatchExceptionFromTrapFrame(Code, Address, 2, P1, P2, 0, TrapFrame);
+    KiDispatchExceptionFromTrapFrame(Code, 0, Address, 2, P1, P2, 0, TrapFrame);
 }
 
 //
index 976d2eb..6d3151f 100644 (file)
@@ -1097,6 +1097,7 @@ DECLSPEC_NORETURN
 VOID
 NTAPI
 KiDispatchExceptionFromTrapFrame(IN NTSTATUS Code,
+                                 IN ULONG Flags,
                                  IN ULONG_PTR Address,
                                  IN ULONG ParameterCount,
                                  IN ULONG_PTR Parameter1,
@@ -1108,7 +1109,7 @@ KiDispatchExceptionFromTrapFrame(IN NTSTATUS Code,
 
     /* Build the exception record */
     ExceptionRecord.ExceptionCode = Code;
-    ExceptionRecord.ExceptionFlags = 0;
+    ExceptionRecord.ExceptionFlags = Flags;
     ExceptionRecord.ExceptionRecord = NULL;
     ExceptionRecord.ExceptionAddress = (PVOID)Address;
     ExceptionRecord.NumberParameters = ParameterCount;
index 80ab637..571d88c 100644 (file)
@@ -223,6 +223,7 @@ KiDebugHandler(IN PKTRAP_FRAME TrapFrame,
 
     /* Dispatch the exception  */
     KiDispatchExceptionFromTrapFrame(STATUS_BREAKPOINT,
+                                     0,
                                      TrapFrame->Eip - 1,
                                      3,
                                      Parameter1,
@@ -1311,6 +1312,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
 
     /* Only other choice is an in-page error, with 3 parameters */
     KiDispatchExceptionFromTrapFrame(STATUS_IN_PAGE_ERROR,
+                                     0,
                                      TrapFrame->Eip,
                                      3,
                                      TrapFrame->ErrCode & 2 ? TRUE : FALSE,
@@ -1474,10 +1476,14 @@ KiRaiseSecurityCheckFailureHandler(IN PKTRAP_FRAME TrapFrame)
     if (KiUserTrap(TrapFrame))
     {
         /* Dispatch exception to user mode */
-        KiDispatchException1Args(STATUS_STACK_BUFFER_OVERRUN,
-                                 TrapFrame->Eip,
-                                 TrapFrame->Ecx,
-                                 TrapFrame);
+        KiDispatchExceptionFromTrapFrame(STATUS_STACK_BUFFER_OVERRUN,
+                                         EXCEPTION_NONCONTINUABLE,
+                                         TrapFrame->Eip,
+                                         1,
+                                         TrapFrame->Ecx,
+                                         0,
+                                         0,
+                                         TrapFrame);
     }
     else
     {