3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: User-mode exception support
6 * FILE: lib/ntdll/rtl/exception.c
7 * PROGRAMER: David Welch <welch@cwcom.net>
10 /* INCLUDES *****************************************************************/
12 #include <ddk/ntddk.h>
19 /* FUNCTIONS ***************************************************************/
22 RtlBaseProcessStart(PTHREAD_START_ROUTINE StartAddress,
26 PRTL_BASE_PROCESS_START_ROUTINE RtlBaseProcessStartRoutine = RtlBaseProcessStart;
29 RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord,
33 KiUserExceptionDispatcher(PEXCEPTION_RECORD ExceptionRecord,
36 EXCEPTION_RECORD NestedExceptionRecord;
39 DPRINT("KiUserExceptionDispatcher()\n");
41 if (RtlpDispatchException(ExceptionRecord, Context) != ExceptionContinueExecution)
43 Status = NtContinue(Context, FALSE);
47 Status = NtRaiseException(ExceptionRecord, Context, FALSE);
50 NestedExceptionRecord.ExceptionCode = Status;
51 NestedExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
52 NestedExceptionRecord.ExceptionRecord = ExceptionRecord;
53 NestedExceptionRecord.NumberParameters = Status;
55 RtlRaiseException(&NestedExceptionRecord);
59 RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
61 DPRINT("RtlRaiseException()\n");
65 RtlBaseProcessStart(PTHREAD_START_ROUTINE StartAddress,
68 NTSTATUS ExitStatus = STATUS_SUCCESS;
70 ExitStatus = (NTSTATUS) (StartAddress)(Parameter);
72 NtTerminateProcess(NtCurrentProcess(), ExitStatus);