ReactOS 0.4.16-dev-197-g92996da
dispatch.c File Reference
#include <ntdll.h>
#include <debug.h>
Include dependency graph for dispatch.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Typedefs

typedef NTSTATUS(NTAPIUSER_CALL) (PVOID Argument, ULONG ArgumentLength)
 

Functions

VOID NTAPI KiUserExceptionDispatcher (PEXCEPTION_RECORD ExceptionRecord, PCONTEXT Context)
 
VOID NTAPI KiRaiseUserExceptionDispatcher (VOID)
 
VOID NTAPI KiUserCallbackDispatcher (ULONG Index, PVOID Argument, ULONG ArgumentLength)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file dispatch.c.

Typedef Documentation

◆ USER_CALL

typedef NTSTATUS(NTAPI * USER_CALL) (PVOID Argument, ULONG ArgumentLength)

Definition at line 17 of file dispatch.c.

Function Documentation

◆ KiRaiseUserExceptionDispatcher()

VOID NTAPI KiRaiseUserExceptionDispatcher ( VOID  )

Definition at line 59 of file dispatch.c.

60{
61 EXCEPTION_RECORD ExceptionRecord;
62
63 /* Setup the exception record */
64 ExceptionRecord.ExceptionCode = ((PTEB)NtCurrentTeb())->ExceptionCode;
65 ExceptionRecord.ExceptionFlags = 0;
66 ExceptionRecord.ExceptionRecord = NULL;
67 ExceptionRecord.NumberParameters = 0;
68
69 /* Raise the exception */
70 RtlRaiseException(&ExceptionRecord);
71}
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
Definition: cdprocs.h:1774
#define NULL
Definition: types.h:112
struct _TEB * PTEB
#define NtCurrentTeb
NTSYSAPI VOID NTAPI RtlRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord)
struct _EXCEPTION_RECORD * ExceptionRecord
Definition: compat.h:210
DWORD ExceptionCode
Definition: compat.h:208
DWORD NumberParameters
Definition: compat.h:212
DWORD ExceptionFlags
Definition: compat.h:209

◆ KiUserCallbackDispatcher()

VOID NTAPI KiUserCallbackDispatcher ( ULONG  Index,
PVOID  Argument,
ULONG  ArgumentLength 
)

Definition at line 78 of file dispatch.c.

81{
82 /* Return with the result of the callback function */
83 USER_CALL *KernelCallbackTable = NtCurrentPeb()->KernelCallbackTable;
85 0,
86 KernelCallbackTable[Index](Argument, ArgumentLength));
87}
#define NtCurrentPeb()
Definition: FLS.c:22
NTSTATUS(NTAPI * USER_CALL)(PVOID Argument, ULONG ArgumentLength)
Definition: dispatch.c:17
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_In_ WDFCOLLECTION _In_ ULONG Index

◆ KiUserExceptionDispatcher()

VOID NTAPI KiUserExceptionDispatcher ( PEXCEPTION_RECORD  ExceptionRecord,
PCONTEXT  Context 
)

Definition at line 26 of file dispatch.c.

28{
29 EXCEPTION_RECORD NestedExceptionRecord;
31
32 /* Dispatch the exception and check the result */
33 if (RtlDispatchException(ExceptionRecord, Context))
34 {
35 /* Continue executing */
37 }
38 else
39 {
40 /* Raise an exception */
41 Status = NtRaiseException(ExceptionRecord, Context, FALSE);
42 }
43
44 /* Setup the Exception record */
45 NestedExceptionRecord.ExceptionCode = Status;
46 NestedExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
47 NestedExceptionRecord.ExceptionRecord = ExceptionRecord;
48 NestedExceptionRecord.NumberParameters = Status;
49
50 /* Raise the exception */
51 RtlRaiseException(&NestedExceptionRecord);
52}
LONG NTSTATUS
Definition: precomp.h:26
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:25
NTSYSAPI BOOLEAN NTAPI RtlDispatchException(_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context)
Definition: except.c:43
NTSTATUS NTAPI NtRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context, _In_ BOOLEAN FirstChance)
Definition: except.c:173
NTSTATUS NTAPI NtContinue(_In_ PCONTEXT Context, _In_ BOOLEAN TestAlert)
Definition: except.c:216
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23