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))
37 RtlpGetStackLimits(PULONG_PTR StackBase
,
38 PULONG_PTR StackLimit
);
40 PEXCEPTION_REGISTRATION_RECORD
42 RtlpGetExceptionList(VOID
);
46 RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList
);
50 RtlCallVectoredExceptionHandlers(
51 IN PEXCEPTION_RECORD ExceptionRecord
,
55 typedef struct _DISPATCHER_CONTEXT
57 PEXCEPTION_REGISTRATION_RECORD RegistrationPointer
;
58 } DISPATCHER_CONTEXT
, *PDISPATCHER_CONTEXT
;
60 /* These provide support for sharing code between User and Kernel RTL */
79 RtlpCaptureStackLimits(
81 IN ULONG_PTR
*StackBegin
,
82 IN ULONG_PTR
*StackEnd
87 RtlDeleteHeapLock(PRTL_CRITICAL_SECTION CriticalSection
);
91 RtlEnterHeapLock(PRTL_CRITICAL_SECTION CriticalSection
);
95 RtlInitializeHeapLock(PRTL_CRITICAL_SECTION CriticalSection
);
99 RtlLeaveHeapLock(PRTL_CRITICAL_SECTION CriticalSection
);
103 RtlpCheckForActiveDebugger(VOID
);
107 RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
108 IN ULONG_PTR RegistrationFrameEnd
,
109 IN OUT PULONG_PTR StackLow
,
110 IN OUT PULONG_PTR StackHigh
);
112 #define RtlpAllocateStringMemory RtlpAllocateMemory
113 #define RtlpFreeStringMemory RtlpFreeMemory
129 EXCEPTION_DISPOSITION
131 RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord
,
132 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
134 PVOID DispatcherContext
,
135 PEXCEPTION_ROUTINE ExceptionHandler
);
137 EXCEPTION_DISPOSITION
139 RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord
,
140 PEXCEPTION_REGISTRATION_RECORD RegistrationFrame
,
142 PVOID DispatcherContext
,
143 PEXCEPTION_ROUTINE ExceptionHandler
);
147 RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord
,
148 IN PCONTEXT ContextRecord
,
149 IN PVOID ContextData
,
154 RtlpCaptureContext(OUT PCONTEXT ContextRecord
);
157 // Debug Service calls
177 /* Tags for the String Allocators */
178 #define TAG_USTR 'RTSU'
179 #define TAG_ASTR 'RTSA'
180 #define TAG_OSTR 'RTSO'
184 extern HANDLE TimerThreadHandle
;
187 RtlpInitializeTimerThread(VOID
);