ReactOS  0.4.14-dev-358-gbef841c
rtlp.h
Go to the documentation of this file.
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 #if 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 #ifdef _PPC_
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)))
23 #else
24 #define SWAPD(x) (x)
25 #define SWAPW(x) (x)
26 #define SWAPQ(x) (x)
27 #endif
28 
29 #define ROUND_DOWN(n, align) \
30  (((ULONG_PTR)(n)) & ~((align) - 1l))
31 
32 #define ROUND_UP(n, align) \
33  ROUND_DOWN(((ULONG_PTR)(n)) + (align) - 1, (align))
34 
35 #define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
36 
38 
40 NTAPI
45 
46 VOID
47 NTAPI
50 
52 NTAPI
54 
55 VOID
56 NTAPI
58 
59 VOID
60 NTAPI
62 
63 BOOLEAN
64 NTAPI
66  IN PEXCEPTION_RECORD ExceptionRecord,
68 );
69 
70 VOID
71 NTAPI
73  IN PEXCEPTION_RECORD ExceptionRecord,
75 );
76 
77 #ifdef _M_IX86
78 typedef struct _DISPATCHER_CONTEXT
79 {
80  PEXCEPTION_REGISTRATION_RECORD RegistrationPointer;
82 #endif
83 
84 /* These provide support for sharing code between User and Kernel RTL */
85 PVOID
86 NTAPI
88  SIZE_T Bytes,
89  ULONG Tag);
90 
91 VOID
92 NTAPI
94  PVOID Mem,
95  ULONG Tag);
96 
98 NTAPI
100 
101 BOOLEAN
102 NTAPI
104  IN ULONG_PTR Ebp,
105  IN ULONG_PTR *StackBegin,
106  IN ULONG_PTR *StackEnd
107 );
108 
109 NTSTATUS
110 NTAPI
112 
113 NTSTATUS
114 NTAPI
116 
117 BOOLEAN
118 NTAPI
120 
121 NTSTATUS
122 NTAPI
124 
125 NTSTATUS
126 NTAPI
128 
129 BOOLEAN
130 NTAPI
132 
133 BOOLEAN
134 NTAPI
136  IN ULONG_PTR RegistrationFrameEnd,
137  IN OUT PULONG_PTR StackLow,
138  IN OUT PULONG_PTR StackHigh);
139 
140 #define RtlpAllocateStringMemory RtlpAllocateMemory
141 #define RtlpFreeStringMemory RtlpFreeMemory
142 
143 ULONG
144 NTAPI
146 #define NtGetTickCount RtlGetTickCount
147 
148 BOOLEAN
149 NTAPI
151  VOID
152 );
153 
154 VOID
155 NTAPI
157  VOID
158 );
159 
160 /* i386/except.S */
161 
162 #ifdef _M_IX86
164 NTAPI
165 RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord,
166  PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
169  PEXCEPTION_ROUTINE ExceptionHandler);
170 #endif
171 
173 NTAPI
175  PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
178  PEXCEPTION_ROUTINE ExceptionHandler);
179 
180 VOID
181 NTAPI
184  IN PVOID ContextData,
185  IN ULONG Size);
186 
187 VOID
188 NTAPI
190 
191 //
192 // Debug Service calls
193 //
194 ULONG
195 NTAPI
197  IN ULONG Service,
200  IN PVOID Argument3,
201  IN PVOID Argument4
202 );
203 
204 VOID
205 NTAPI
210 );
211 
212 /* Tags for the String Allocators */
213 #define TAG_USTR 'RTSU'
214 #define TAG_ASTR 'RTSA'
215 #define TAG_OSTR 'RTSO'
216 
217 /* Timer Queue */
218 
220 
221 NTSTATUS
223 
224 /* bitmap64.c */
225 typedef struct _RTL_BITMAP64
226 {
230 
231 typedef struct _RTL_BITMAP_RUN64
232 {
236 
237 /* nls.c */
238 WCHAR
239 NTAPI
241 
242 WCHAR
243 NTAPI
245 
246 /* ReactOS only */
247 VOID
248 NTAPI
249 LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData);
250 
251 
252 /* EOF */
NTSTATUS NTAPI RtlEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:108
VOID NTAPI RtlpSetHeapParameters(IN PRTL_HEAP_PARAMETERS Parameters)
Definition: libsupp.c:174
#define IN
Definition: typedefs.h:38
_Out_ PULONG_PTR HighLimit
Definition: iofuncs.h:2837
struct _RTL_BITMAP_RUN64 RTL_BITMAP_RUN64
_In_ ULONG _Out_writes_bytes_all_(Length) PUCHAR Buffer
Definition: ntddpcm.h:100
NTSTATUS NTAPI RtlpSafeCopyMemory(_Out_writes_bytes_all_(Length) VOID UNALIGNED *Destination, _In_reads_bytes_(Length) CONST VOID UNALIGNED *Source, _In_ SIZE_T Length)
Definition: rtlcompat.c:56
VOID NTAPI RtlpGetStackLimits(PULONG_PTR LowLimit, PULONG_PTR HighLimit)
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:694
struct _RTL_BITMAP64 * PRTL_BITMAP64
ULONG64 NumberOfBits
Definition: rtlp.h:234
ULONG NTAPI DebugService(IN ULONG Service, IN PVOID Argument1, IN PVOID Argument2, IN PVOID Argument3, IN PVOID Argument4)
NTSTATUS RtlpInitializeTimerThread(VOID)
Definition: timerqueue.c:27
BOOLEAN NTAPI RtlpSetInDbgPrint(VOID)
Definition: libsupp.c:33
LONG NTSTATUS
Definition: precomp.h:26
_In_ UINT Bytes
Definition: mmcopy.h:9
VOID NTAPI RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN PVOID ContextData, IN ULONG Size)
Definition: libsupp.c:201
PVOID MmHighestUserAddress
Definition: rtlcompat.c:29
NTSTATUS NTAPI RtlDeleteHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:101
#define FASTCALL
Definition: nt_native.h:50
ULONG64 StartingIndex
Definition: rtlp.h:233
NTSTATUS NTAPI RtlLeaveHeapLock(IN OUT PHEAP_LOCK Lock)
Definition: libsupp.c:133
VOID NTAPI DebugService2(IN PVOID Argument1, IN PVOID Argument2, IN ULONG Service)
VOID NTAPI RtlpClearInDbgPrint(VOID)
Definition: libsupp.c:45
EXCEPTION_DISPOSITION NTAPI RtlpExecuteHandlerForUnwind(PEXCEPTION_RECORD ExceptionRecord, PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, PCONTEXT Context, PVOID DispatcherContext, PEXCEPTION_ROUTINE ExceptionHandler)
uint32_t ULONG_PTR
Definition: typedefs.h:63
WCHAR NTAPI RtlpUpcaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:715
VOID NTAPI RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
BOOLEAN NTAPI RtlpCheckForActiveDebugger(VOID)
Definition: libsupp.c:25
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT _In_ PVOID DispatcherContext
Definition: ntbasedef.h:661
HANDLE TimerThreadHandle
Definition: timerqueue.c:24
unsigned char BOOLEAN
NTSTATUS NTAPI RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock)
Definition: libsupp.c:126
WCHAR NTAPI RtlpDowncaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:89
struct _DISPATCHER_CONTEXT * PDISPATCHER_CONTEXT
Definition: parser.c:48
_In_ PVOID Argument2
Definition: classpnp.h:680
EXCEPTION_ROUTINE * PEXCEPTION_ROUTINE
Definition: compat.h:377
BOOLEAN NTAPI RtlpCaptureStackLimits(IN ULONG_PTR Ebp, IN ULONG_PTR *StackBegin, IN ULONG_PTR *StackEnd)
Definition: libsupp.c:211
#define UNALIGNED
Definition: crtdefs.h:132
VOID NTAPI RtlCallVectoredContinueHandlers(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
Definition: vectoreh.c:284
VOID NTAPI RtlpCaptureContext(OUT PCONTEXT ContextRecord)
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _RTL_BITMAP64 RTL_BITMAP64
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
PVOID NTAPI RtlpAllocateMemory(SIZE_T Bytes, ULONG Tag)
Definition: libsupp.c:35
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID NTAPI RtlpFreeMemory(PVOID Mem, ULONG Tag)
Definition: libsupp.c:44
BOOLEAN NTAPI RtlCallVectoredExceptionHandlers(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
Definition: vectoreh.c:273
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:661
unsigned __int64 ULONG64
Definition: imports.h:198
VOID NTAPI LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID *pOldShimData)
Definition: ldrinit.c:1542
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
struct _DISPATCHER_CONTEXT DISPATCHER_CONTEXT
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
PEXCEPTION_REGISTRATION_RECORD NTAPI RtlpGetExceptionList(VOID)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define _In_
Definition: no_sal2.h:204
ULONG_PTR SIZE_T
Definition: typedefs.h:78
ULONG NTAPI RtlGetTickCount(VOID)
Definition: libsupp.c:1015
ULONG64 SizeOfBitMap
Definition: rtlp.h:227
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define OUT
Definition: typedefs.h:39
struct _RTL_BITMAP_RUN64 * PRTL_BITMAP_RUN64
BOOLEAN NTAPI RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
Definition: libsupp.c:117
unsigned int ULONG
Definition: retypes.h:1
enum _EXCEPTION_DISPOSITION EXCEPTION_DISPOSITION
KPROCESSOR_MODE NTAPI RtlpGetMode(VOID)
Definition: libsupp.c:53
uint32_t * PULONG_PTR
Definition: typedefs.h:63
unsigned __int64 * PULONG64
Definition: imports.h:198
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
BOOLEAN NTAPI RtlpHandleDpcStackException(IN PEXCEPTION_REGISTRATION_RECORD RegistrationFrame, IN ULONG_PTR RegistrationFrameEnd, IN OUT PULONG_PTR StackLow, IN OUT PULONG_PTR StackHigh)
Definition: libsupp.c:190
PULONG64 Buffer
Definition: rtlp.h:228
#define CONST
Definition: pedump.c:81
Definition: fci.c:126