Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendispatch.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS NT Library 00004 * FILE: dll/ntdll/dispatch/dispatch.c 00005 * PURPOSE: User-Mode NT Dispatchers 00006 * PROGRAMERS: Alex Ionescu (alex@relsoft.net) 00007 * David Welch <welch@cwcom.net> 00008 */ 00009 00010 /* INCLUDES *****************************************************************/ 00011 00012 #include <ntdll.h> 00013 #define NDEBUG 00014 #include <debug.h> 00015 00016 typedef NTSTATUS (NTAPI *USER_CALL)(PVOID Argument, ULONG ArgumentLength); 00017 00018 /* FUNCTIONS ****************************************************************/ 00019 00020 /* 00021 * @implemented 00022 */ 00023 VOID 00024 NTAPI 00025 KiUserExceptionDispatcher(PEXCEPTION_RECORD ExceptionRecord, 00026 PCONTEXT Context) 00027 { 00028 EXCEPTION_RECORD NestedExceptionRecord; 00029 NTSTATUS Status; 00030 00031 /* Dispatch the exception and check the result */ 00032 if (RtlDispatchException(ExceptionRecord, Context)) 00033 { 00034 /* Continue executing */ 00035 Status = NtContinue(Context, FALSE); 00036 } 00037 else 00038 { 00039 /* Raise an exception */ 00040 Status = NtRaiseException(ExceptionRecord, Context, FALSE); 00041 } 00042 00043 /* Setup the Exception record */ 00044 NestedExceptionRecord.ExceptionCode = Status; 00045 NestedExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE; 00046 NestedExceptionRecord.ExceptionRecord = ExceptionRecord; 00047 NestedExceptionRecord.NumberParameters = Status; 00048 00049 /* Raise the exception */ 00050 RtlRaiseException(&NestedExceptionRecord); 00051 } 00052 00053 /* 00054 * @implemented 00055 */ 00056 VOID 00057 NTAPI 00058 KiRaiseUserExceptionDispatcher(VOID) 00059 { 00060 EXCEPTION_RECORD ExceptionRecord; 00061 00062 /* Setup the exception record */ 00063 ExceptionRecord.ExceptionCode = ((PTEB)NtCurrentTeb())->ExceptionCode; 00064 ExceptionRecord.ExceptionFlags = 0; 00065 ExceptionRecord.ExceptionRecord = NULL; 00066 ExceptionRecord.NumberParameters = 0; 00067 00068 /* Raise the exception */ 00069 RtlRaiseException(&ExceptionRecord); 00070 } 00071 00072 /* 00073 * @implemented 00074 */ 00075 VOID 00076 NTAPI 00077 KiUserCallbackDispatcher(ULONG Index, 00078 PVOID Argument, 00079 ULONG ArgumentLength) 00080 { 00081 /* Return with the result of the callback function */ 00082 USER_CALL *KernelCallbackTable = NtCurrentPeb()->KernelCallbackTable; 00083 ZwCallbackReturn(NULL, 00084 0, 00085 KernelCallbackTable[Index](Argument, ArgumentLength)); 00086 } Generated on Fri May 25 2012 04:18:19 for ReactOS by
1.7.6.1
|