Fix indentation.

svn path=/trunk/; revision=14198
This commit is contained in:
Filip Navara 2005-03-19 19:52:36 +00:00
parent 6c8fad94ac
commit 52a70e745d

View file

@ -118,68 +118,67 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord,
if (Action == kdContinue) return; if (Action == kdContinue) return;
#endif #endif
/* FIXME: Forward exception to user mode debugger */ /* FIXME: Forward exception to user mode debugger */
/* FIXME: Check user mode stack for enough space */ /* FIXME: Check user mode stack for enough space */
/* Let usermode try and handle the exception. Setup Stack */ /* Let usermode try and handle the exception. Setup Stack */
Stack = (PULONG)temp_space; Stack = (PULONG)temp_space;
CDest = 3 + (ROUND_UP(sizeof(EXCEPTION_RECORD), 4) / 4); CDest = 3 + (ROUND_UP(sizeof(EXCEPTION_RECORD), 4) / 4);
/* Return Address */ /* Return Address */
Stack[0] = 0; Stack[0] = 0;
/* Pointer to EXCEPTION_RECORD structure */ /* Pointer to EXCEPTION_RECORD structure */
Stack[1] = (ULONG)&pNewUserStack[3]; Stack[1] = (ULONG)&pNewUserStack[3];
/* Pointer to CONTEXT structure */ /* Pointer to CONTEXT structure */
Stack[2] = (ULONG)&pNewUserStack[CDest]; Stack[2] = (ULONG)&pNewUserStack[CDest];
memcpy(&Stack[3], ExceptionRecord, sizeof(EXCEPTION_RECORD)); memcpy(&Stack[3], ExceptionRecord, sizeof(EXCEPTION_RECORD));
memcpy(&Stack[CDest], Context, sizeof(CONTEXT)); memcpy(&Stack[CDest], Context, sizeof(CONTEXT));
/* Copy Stack */ /* Copy Stack */
StatusOfCopy = MmCopyToCaller(pNewUserStack, StatusOfCopy = MmCopyToCaller(pNewUserStack,
temp_space, temp_space,
(12 + sizeof(EXCEPTION_RECORD) + sizeof(CONTEXT))); (12 + sizeof(EXCEPTION_RECORD) + sizeof(CONTEXT)));
/* Check for success */ /* Check for success */
if (NT_SUCCESS(StatusOfCopy)) { if (NT_SUCCESS(StatusOfCopy)) {
/* Set new Stack Pointer */ /* Set new Stack Pointer */
Tf->Esp = (ULONG)pNewUserStack; Tf->Esp = (ULONG)pNewUserStack;
} else { } else {
/* /*
* Now it really hit the ventilation device. Sorry, * Now it really hit the ventilation device. Sorry,
* can do nothing but kill the sucker. * can do nothing but kill the sucker.
*/ */
ZwTerminateThread(NtCurrentThread(), ExceptionRecord->ExceptionCode); ZwTerminateThread(NtCurrentThread(), ExceptionRecord->ExceptionCode);
DPRINT1("User-mode stack was invalid. Terminating target thread\n"); DPRINT1("User-mode stack was invalid. Terminating target thread\n");
}
/* Set EIP to the User-mode Dispathcer */
Tf->Eip = (ULONG)LdrpGetSystemDllExceptionDispatcher();
return;
} }
/* Set EIP to the User-mode Dispathcer */ /* FIXME: Forward the exception to the debugger */
Tf->Eip = (ULONG)LdrpGetSystemDllExceptionDispatcher();
return;
}
/* FIXME: Forward the exception to the debugger */
/* FIXME: Forward the exception to the process exception port */
/* FIXME: Forward the exception to the process exception port */
#ifdef KDBG #ifdef KDBG
/* Enter KDB if available */ /* Enter KDB if available */
Action = KdbEnterDebuggerException(ExceptionRecord, Action = KdbEnterDebuggerException(ExceptionRecord,
PreviousMode, PreviousMode,
Context, Context,
Tf, Tf,
FALSE); FALSE);
/* Exit if we're continuing */ /* Exit if we're continuing */
if (Action == kdContinue) return; if (Action == kdContinue) return;
#endif #endif
/* Terminate the offending thread */ /* Terminate the offending thread */
DPRINT1("Unhandled UserMode exception, terminating thread\n"); DPRINT1("Unhandled UserMode exception, terminating thread\n");
ZwTerminateThread(NtCurrentThread(), ExceptionRecord->ExceptionCode); ZwTerminateThread(NtCurrentThread(), ExceptionRecord->ExceptionCode);
} else { } else {