:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / ntdll / rtl / exception.c
1 /* $Id$
2  *
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>
8  */
9
10 /* INCLUDES *****************************************************************/
11
12 #include <ddk/ntddk.h>
13 #include <windows.h>
14 #include <string.h>
15
16 #define NDEBUG
17 #include <debug.h>
18
19 /* FUNCTIONS ***************************************************************/
20
21 ULONG
22 RtlpDispatchException(IN PEXCEPTION_RECORD  ExceptionRecord,
23         IN PCONTEXT  Context);
24
25 VOID STDCALL
26 KiUserExceptionDispatcher(PEXCEPTION_RECORD ExceptionRecord,
27                           PCONTEXT Context)
28 {
29   EXCEPTION_RECORD NestedExceptionRecord;
30   NTSTATUS Status;
31
32   DPRINT("KiUserExceptionDispatcher()\n");
33
34   if (RtlpDispatchException(ExceptionRecord, Context) != ExceptionContinueExecution)
35     {
36       Status = NtContinue(Context, FALSE);
37     }
38   else
39     {
40       Status = NtRaiseException(ExceptionRecord, Context, FALSE);
41     }
42
43   NestedExceptionRecord.ExceptionCode = Status;
44   NestedExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
45   NestedExceptionRecord.ExceptionRecord = ExceptionRecord;
46   NestedExceptionRecord.NumberParameters = Status;
47
48   RtlRaiseException(&NestedExceptionRecord);
49 }
50
51 VOID STDCALL
52 RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
53 {
54         DbgPrint("RtlRaiseException()");
55 }
56
57 /* EOF */