[ros-diffs] [hyperion] 38624: modified ntoskrnl/ke/i386/exp.c Slight refactoring to make exception-safety auditing easier Remove an unnecessary local variable, reuse another instead

hyperion at svn.reactos.org hyperion at svn.reactos.org
Wed Jan 7 11:36:07 CET 2009


Author: hyperion
Date: Wed Jan  7 04:36:06 2009
New Revision: 38624

URL: http://svn.reactos.org/svn/reactos?rev=38624&view=rev
Log:
modified   ntoskrnl/ke/i386/exp.c
   Slight refactoring to make exception-safety auditing easier
   Remove an unnecessary local variable, reuse another instead

Modified:
    trunk/reactos/ntoskrnl/ke/i386/exp.c

Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/exp.c?rev=38624&r1=38623&r2=38624&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c [iso-8859-1] Wed Jan  7 04:36:06 2009
@@ -831,10 +831,7 @@
                     IN BOOLEAN FirstChance)
 {
     CONTEXT Context;
-    ULONG_PTR Stack, NewStack;
-    ULONG Size;
     EXCEPTION_RECORD LocalExceptRecord;
-    EXCEPTION_RECORD SehExceptRecord;
 
     /* Increase number of Exception Dispatches */
     KeGetCurrentPrcb()->KeExceptionDispatchCount++;
@@ -955,6 +952,9 @@
 DispatchToUser:
             _SEH2_TRY
             {
+				ULONG Size;
+				ULONG_PTR Stack, NewStack;
+
                 /* Make sure we have a valid SS and that this isn't V86 mode */
                 if ((TrapFrame->HardwareSegSs != (KGDT_R3_DATA | RPL_MASK)) ||
                     (TrapFrame->EFlags & EFLAGS_V86_MASK))
@@ -1008,17 +1008,17 @@
                 /* Dispatch exception to user-mode */
                 _SEH2_YIELD(return);
             }
-            _SEH2_EXCEPT((RtlCopyMemory(&SehExceptRecord, _SEH2_GetExceptionInformation()->ExceptionRecord, sizeof(EXCEPTION_RECORD)), EXCEPTION_EXECUTE_HANDLER))
+            _SEH2_EXCEPT((RtlCopyMemory(&LocalExceptRecord, _SEH2_GetExceptionInformation()->ExceptionRecord, sizeof(EXCEPTION_RECORD)), EXCEPTION_EXECUTE_HANDLER))
             {
                 /* Check if we got a stack overflow and raise that instead */
-                if ((NTSTATUS)SehExceptRecord.ExceptionCode ==
+                if ((NTSTATUS)LocalExceptRecord.ExceptionCode ==
                     STATUS_STACK_OVERFLOW)
                 {
                     /* Copy the exception address and record */
-                    SehExceptRecord.ExceptionAddress =
+                    LocalExceptRecord.ExceptionAddress =
                         ExceptionRecord->ExceptionAddress;
                     RtlCopyMemory(ExceptionRecord,
-                                  (PVOID)&SehExceptRecord,
+                                  (PVOID)&LocalExceptRecord,
                                   sizeof(EXCEPTION_RECORD));
 
                     /* Do the exception again */
@@ -1086,7 +1086,7 @@
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
         /* Save exception code */
-        Status = ExceptionCode;
+        Status = _SEH2_GetExceptionCode();
     }
     _SEH2_END;
     if (!NT_SUCCESS(Status)) return Status;



More information about the Ros-diffs mailing list