Major refactoring of the exception handling code + misc fixes:
[reactos.git] / reactos / lib / rtl / rtlp.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
4 * FILE: lib/rtl/rtlp.h
5 * PURPOSE: Run-Time Libary Internal Header
6 * PROGRAMMER: Alex Ionescu
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 /* PAGED_CODE equivalent for user-mode RTL */
12 #ifdef DBG
13 extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line);
14 #define PAGED_CODE_RTL() CHECK_PAGED_CODE_RTL(__FILE__, __LINE__)
15 #else
16 #define PAGED_CODE_RTL()
17 #endif
18
19 /* These provide support for sharing code between User and Kernel RTL */
20 PVOID
21 STDCALL
22 RtlpAllocateMemory(
23 ULONG Bytes,
24 ULONG Tag);
25
26 VOID
27 STDCALL
28 RtlpFreeMemory(
29 PVOID Mem,
30 ULONG Tag);
31
32 KPROCESSOR_MODE
33 STDCALL
34 RtlpGetMode(VOID);
35
36 NTSTATUS
37 STDCALL
38 RtlDeleteHeapLock(PRTL_CRITICAL_SECTION CriticalSection);
39
40 NTSTATUS
41 STDCALL
42 RtlEnterHeapLock(PRTL_CRITICAL_SECTION CriticalSection);
43
44 NTSTATUS
45 STDCALL
46 RtlInitializeHeapLock(PRTL_CRITICAL_SECTION CriticalSection);
47
48 NTSTATUS
49 STDCALL
50 RtlLeaveHeapLock(PRTL_CRITICAL_SECTION CriticalSection);
51
52 BOOLEAN
53 NTAPI
54 RtlpCheckForActiveDebugger(VOID);
55
56 BOOLEAN
57 NTAPI
58 RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
59 IN ULONG_PTR RegistrationFrameEnd,
60 IN OUT PULONG_PTR StackLow,
61 IN OUT PULONG_PTR StackHigh);
62
63 #define RtlpAllocateStringMemory RtlpAllocateMemory
64 #define RtlpFreeStringMemory RtlpFreeMemory
65
66 /* i386/except.S */
67
68 EXCEPTION_DISPOSITION
69 STDCALL
70 RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord,
71 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
72 PCONTEXT Context,
73 PVOID DispatcherContext,
74 PEXCEPTION_HANDLER ExceptionHandler);
75
76 EXCEPTION_DISPOSITION
77 STDCALL
78 RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord,
79 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
80 PCONTEXT Context,
81 PVOID DispatcherContext,
82 PEXCEPTION_HANDLER ExceptionHandler);
83
84 VOID
85 NTAPI
86 RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord,
87 IN PCONTEXT ContextRecord,
88 IN PVOID ContextData,
89 IN ULONG Size);
90
91 PVOID
92 NTAPI
93 RtlpGetExceptionAddress(VOID);
94
95 VOID
96 NTAPI
97 RtlpCaptureContext(OUT PCONTEXT ContextRecord);
98
99 /* Tags for the String Allocators */
100 #define TAG_USTR TAG('U', 'S', 'T', 'R')
101 #define TAG_ASTR TAG('A', 'S', 'T', 'R')
102 #define TAG_OSTR TAG('O', 'S', 'T', 'R')
103
104 /* EOF */