mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
modified ntoskrnl/ke/i386/exp.c
Slight refactoring to make exception-safety auditing easier Remove an unnecessary local variable, reuse another instead svn path=/trunk/; revision=38624
This commit is contained in:
parent
8b74932e9c
commit
542b6ccb3d
|
@ -831,10 +831,7 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
|
|||
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 @@ KiDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
|
|||
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 @@ DispatchToUser:
|
|||
/* 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 @@ KeRaiseUserException(IN NTSTATUS ExceptionCode)
|
|||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Save exception code */
|
||||
Status = ExceptionCode;
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
|
Loading…
Reference in a new issue