indent with astyle v1.15.3: --style=ansi -c -s3 -S --convert-tabs
[reactos.git] / reactos / lib / rtl / callback.c
1 /* COPYRIGHT: See COPYING in the top level directory
2 * PROJECT: ReactOS system libraries
3 * PURPOSE: User-mode callback support
4 * FILE: lib/rtl/callback.c
5 * PROGRAMER: David Welch <welch@cwcom.net>
6 */
7
8 /* INCLUDES *****************************************************************/
9
10 #include <rtl.h>
11
12 #define NDEBUG
13 #include <debug.h>
14
15 /* FUNCTIONS *****************************************************************/
16
17 typedef NTSTATUS (STDCALL *KERNEL_CALLBACK_FUNCTION)(PVOID Argument,
18 ULONG ArgumentLength);
19
20 /* FUNCTIONS *****************************************************************/
21
22 VOID STDCALL
23 KiUserCallbackDispatcher(ULONG RoutineIndex,
24 PVOID Argument,
25 ULONG ArgumentLength)
26 {
27 PPEB Peb;
28 NTSTATUS Status;
29 KERNEL_CALLBACK_FUNCTION Callback;
30
31 Peb = NtCurrentPeb();
32 Callback = (KERNEL_CALLBACK_FUNCTION)Peb->KernelCallbackTable[RoutineIndex];
33 Status = Callback(Argument, ArgumentLength);
34 ZwCallbackReturn(NULL, 0, Status);
35 }