ReactOS  0.4.15-dev-4863-gba0d16f
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 #ifndef _BLDR_
47 
48 VOID
49 NTAPI
52 
53 #ifdef _M_IX86
54 
56 NTAPI
57 RtlpGetExceptionList(VOID);
58 
59 VOID
60 NTAPI
61 RtlpSetExceptionList(PEXCEPTION_REGISTRATION_RECORD NewExceptionList);
62 
63 #endif /* _M_IX86 */
64 
65 /* For heap.c */
66 VOID
67 NTAPI
69 
70 /* For vectoreh.c */
71 BOOLEAN
72 NTAPI
74  IN PEXCEPTION_RECORD ExceptionRecord,
76 );
77 
78 VOID
79 NTAPI
81  IN PEXCEPTION_RECORD ExceptionRecord,
83 );
84 
85 #ifdef _M_IX86
86 typedef struct _DISPATCHER_CONTEXT
87 {
88  PEXCEPTION_REGISTRATION_RECORD RegistrationPointer;
90 #endif
91 
92 #endif /* !_BLDR_ */
93 
94 /* These provide support for sharing code between User and Kernel RTL */
95 PVOID
96 NTAPI
98  SIZE_T Bytes,
99  ULONG Tag);
100 
101 VOID
102 NTAPI
104  PVOID Mem,
105  ULONG Tag);
106 
107 #ifndef _BLDR_
108 
110 NTAPI
112 
113 BOOLEAN
114 NTAPI
116  IN ULONG_PTR Ebp,
117  IN ULONG_PTR *StackBegin,
118  IN ULONG_PTR *StackEnd
119 );
120 
121 /* For heap.c and heappage.c */
122 NTSTATUS
123 NTAPI
125 
126 NTSTATUS
127 NTAPI
129 
130 BOOLEAN
131 NTAPI
133 
134 NTSTATUS
135 NTAPI
137 
138 NTSTATUS
139 NTAPI
141 
142 BOOLEAN
143 NTAPI
145 
146 BOOLEAN
147 NTAPI
149  IN ULONG_PTR RegistrationFrameEnd,
150  IN OUT PULONG_PTR StackLow,
151  IN OUT PULONG_PTR StackHigh);
152 
153 #endif /* !_BLDR_ */
154 
155 #define RtlpAllocateStringMemory RtlpAllocateMemory
156 #define RtlpFreeStringMemory RtlpFreeMemory
157 
158 #ifndef _BLDR_
159 
160 ULONG
161 NTAPI
163 #define NtGetTickCount RtlGetTickCount
164 
165 BOOLEAN
166 NTAPI
168  VOID
169 );
170 
171 VOID
172 NTAPI
174  VOID
175 );
176 
177 /* i386/except.S */
178 
179 #ifdef _M_IX86
181 NTAPI
182 RtlpExecuteHandlerForException(PEXCEPTION_RECORD ExceptionRecord,
183  PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
186  PEXCEPTION_ROUTINE ExceptionHandler);
187 #endif
188 
190 NTAPI
192  PEXCEPTION_REGISTRATION_RECORD RegistrationFrame,
195  PEXCEPTION_ROUTINE ExceptionHandler);
196 
197 VOID
198 NTAPI
201  IN PVOID ContextData,
202  IN ULONG Size);
203 
204 VOID
205 NTAPI
207 
208 //
209 // Debug Service calls
210 //
211 ULONG
212 NTAPI
214  IN ULONG Service,
217  IN PVOID Argument3,
219 );
220 
221 VOID
222 NTAPI
227 );
228 
229 /* Timer Queue */
231 
232 NTSTATUS
234 
235 #endif /* !_BLDR_ */
236 
237 /* bitmap64.c */
238 typedef struct _RTL_BITMAP64
239 {
243 
244 typedef struct _RTL_BITMAP_RUN64
245 {
249 
250 /* Tags for the String Allocators */
251 #define TAG_USTR 'RTSU'
252 #define TAG_ASTR 'RTSA'
253 #define TAG_OSTR 'RTSO'
254 
255 /* nls.c */
256 WCHAR
257 NTAPI
259 
260 WCHAR
261 NTAPI
263 
264 #ifndef _BLDR_
265 
266 /* ReactOS only */
267 VOID
268 NTAPI
269 LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID* pOldShimData);
270 
271 PVOID
272 NTAPI
274  _In_ SIZE_T Size);
275 
276 #endif /* !_BLDR_ */
277 
278 /* 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:39
_Out_ PULONG_PTR HighLimit
Definition: iofuncs.h:2885
struct _RTL_BITMAP_RUN64 RTL_BITMAP_RUN64
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
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:696
#define _Inout_
Definition: ms_sal.h:378
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
struct _RTL_BITMAP64 * PRTL_BITMAP64
ULONG64 NumberOfBits
Definition: rtlp.h:247
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
PVOID NTAPI RtlpDebugBufferCommit(_Inout_ PRTL_DEBUG_INFORMATION Buffer, _In_ SIZE_T Size)
Definition: dbgbuffer.c:20
VOID NTAPI RtlpCheckLogException(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN PVOID ContextData, IN ULONG Size)
Definition: libsupp.c:201
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
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:246
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:65
WCHAR NTAPI RtlpUpcaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:695
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:654
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
#define _Out_writes_bytes_all_(size)
Definition: ms_sal.h:362
struct _DISPATCHER_CONTEXT * PDISPATCHER_CONTEXT
#define _In_
Definition: ms_sal.h:308
Definition: parser.c:48
Definition: bufpool.h:45
_In_ PVOID Argument2
Definition: classpnp.h:721
EXCEPTION_ROUTINE * PEXCEPTION_ROUTINE
Definition: compat.h:568
BOOLEAN NTAPI RtlpCaptureStackLimits(IN ULONG_PTR Ebp, IN ULONG_PTR *StackBegin, IN ULONG_PTR *StackEnd)
Definition: libsupp.c:211
#define UNALIGNED
Definition: crtdefs.h:144
VOID NTAPI RtlCallVectoredContinueHandlers(IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
Definition: vectoreh.c:284
InternalIoctlParams Argument4
VOID NTAPI RtlpCaptureContext(OUT PCONTEXT ContextRecord)
__wchar_t WCHAR
Definition: xmlstorage.h:180
struct _RTL_BITMAP64 RTL_BITMAP64
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2950
PVOID NTAPI RtlpAllocateMemory(SIZE_T Bytes, ULONG Tag)
Definition: libsupp.c:35
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:654
unsigned __int64 ULONG64
Definition: imports.h:198
VOID NTAPI LdrpInitializeProcessCompat(PVOID pProcessActctx, PVOID *pOldShimData)
Definition: ldrinit.c:1576
struct _DISPATCHER_CONTEXT DISPATCHER_CONTEXT
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
ULONG_PTR SIZE_T
Definition: typedefs.h:80
ULONG NTAPI RtlGetTickCount(VOID)
Definition: libsupp.c:1058
ULONG64 SizeOfBitMap
Definition: rtlp.h:240
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
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:65
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:241
#define CONST
Definition: pedump.c:81
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
Definition: fci.c:126