2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
5 * PURPOSE: Run-Time Libary Internal Header
6 * PROGRAMMER: Alex Ionescu
9 /* INCLUDES ******************************************************************/
11 /* PAGED_CODE equivalent for user-mode RTL */
13 extern VOID FASTCALL
CHECK_PAGED_CODE_RTL(char *file
, int line
);
14 #define PAGED_CODE_RTL() CHECK_PAGED_CODE_RTL(__FILE__, __LINE__)
16 #define PAGED_CODE_RTL()
20 #define SWAPD(x) ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)>>8)&0xff00)|(((x)>>24)&0xff))
21 #define SWAPW(x) ((((x)&0xff)<<8)|(((x)>>8)&0xff))
22 #define SWAPQ(x) ((SWAPD((x)&0xffffffff) << 32) | (SWAPD((x)>>32)))
29 #define ROUND_DOWN(n, align) \
30 (((ULONG)(n)) & ~((align) - 1l))
32 #define ROUND_UP(n, align) \
33 ROUND_DOWN(((ULONG)(n)) + (align) - 1, (align))
35 #define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
39 RtlpGetStackLimits(PULONG_PTR LowLimit
,
40 PULONG_PTR HighLimit
);
42 PEXCEPTION_REGISTRATION_RECORD
44 RtlpGetExceptionList(VOID
);
48 RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList
);
52 RtlCallVectoredExceptionHandlers(
53 IN PEXCEPTION_RECORD ExceptionRecord
,
57 typedef struct _DISPATCHER_CONTEXT
59 PEXCEPTION_REGISTRATION_RECORD RegistrationPointer
;
60 } DISPATCHER_CONTEXT
, *PDISPATCHER_CONTEXT
;
62 /* These provide support for sharing code between User and Kernel RTL */
81 RtlpCaptureStackLimits(
83 IN ULONG_PTR
*StackBegin
,
84 IN ULONG_PTR
*StackEnd
89 RtlDeleteHeapLock(PHEAP_LOCK Lock
);
93 RtlEnterHeapLock(PHEAP_LOCK Lock
);
97 RtlInitializeHeapLock(PHEAP_LOCK Lock
);
101 RtlLeaveHeapLock(PHEAP_LOCK Lock
);
105 RtlpCheckForActiveDebugger(VOID
);
109 RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
110 IN ULONG_PTR RegistrationFrameEnd
,
111 IN OUT PULONG_PTR StackLow
,
112 IN OUT PULONG_PTR StackHigh
);
114 #define RtlpAllocateStringMemory RtlpAllocateMemory
115 #define RtlpFreeStringMemory RtlpFreeMemory
131 EXCEPTION_DISPOSITION
133 RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord
,
134 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
136 PVOID DispatcherContext
,
137 PEXCEPTION_ROUTINE ExceptionHandler
);
139 EXCEPTION_DISPOSITION
141 RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord
,
142 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
144 PVOID DispatcherContext
,
145 PEXCEPTION_ROUTINE ExceptionHandler
);
149 RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord
,
150 IN PCONTEXT ContextRecord
,
151 IN PVOID ContextData
,
156 RtlpCaptureContext(OUT PCONTEXT ContextRecord
);
159 // Debug Service calls
179 /* Tags for the String Allocators */
180 #define TAG_USTR 'RTSU'
181 #define TAG_ASTR 'RTSA'
182 #define TAG_OSTR 'RTSO'
186 extern HANDLE TimerThreadHandle
;
189 RtlpInitializeTimerThread(VOID
);