2 * Implementation of reactos RtlpExecuteHandler() of libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /* No reactos public include prototype for RtlpExecuteHandlerForException() */
23 #include <glib/gtypes.h>
24 #include <glib/gmessages.h>
25 #include "reactos/ntos/except.h"
28 EXCEPTION_DISPOSITION RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord,
29 PEXCEPTION_REGISTRATION RegistrationFrame,PCONTEXT Context,PVOID DispatcherContext,PEXCEPTION_HANDLER ExceptionHandler)
32 EXCEPTION_DISPOSITION r;
34 g_return_val_if_fail(ExceptionRecord!=NULL,ExceptionNestedException);
35 g_return_val_if_fail(RegistrationFrame!=NULL,ExceptionNestedException);
36 /* 'Context' can be NULL during ExRaiseStatus() */
37 g_return_val_if_fail(DispatcherContext!=NULL,ExceptionNestedException);
38 g_return_val_if_fail(ExceptionHandler!=NULL,ExceptionNestedException);
40 /* Nest-counting is provided here just for debugging reasons. */
41 /* Nesting must be permitted for proper FSCTL_DISMOUNT_VOLUME execution. */
44 r=(*ExceptionHandler)(ExceptionRecord,RegistrationFrame,Context,DispatcherContext);
48 g_assert(r==ExceptionContinueExecution || r==ExceptionContinueSearch);
53 EXCEPTION_DISPOSITION RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord,
54 PEXCEPTION_REGISTRATION RegistrationFrame,PCONTEXT Context,PVOID DispatcherContext,PEXCEPTION_HANDLER ExceptionHandler)
57 EXCEPTION_DISPOSITION r;
59 g_return_val_if_fail(ExceptionRecord!=NULL,ExceptionNestedException);
60 g_return_val_if_fail(RegistrationFrame!=NULL,ExceptionNestedException);
61 /* 'Context' can be NULL during ExRaiseStatus() */
62 g_return_val_if_fail(DispatcherContext!=NULL,ExceptionNestedException);
63 g_return_val_if_fail(ExceptionHandler!=NULL,ExceptionNestedException);
65 /* Nest-counting is provided here just for debugging reasons. */
67 g_assert_not_reached();
70 r=(*ExceptionHandler)(ExceptionRecord,RegistrationFrame,Context,DispatcherContext);
74 g_assert(r==ExceptionContinueExecution || r==ExceptionContinueSearch);