d4b1f5f598248fad533daae15988e5ba98206fac
[reactos.git] / include / ndk / umfuncs.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 umfuncs.h
8
9 Abstract:
10
11 Function definitions for Native DLL (ntdll) APIs exclusive to User Mode.
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _UMFUNCS_H
20 #define _UMFUNCS_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <dbgktypes.h>
27
28 //
29 // Don't force inclusion of csrss header, leave this opaque.
30 //
31 struct _CSR_API_MESSAGE;
32 struct _CSR_CAPTURE_BUFFER;
33
34 //
35 // CSR Functions
36 //
37 PVOID
38 NTAPI
39 CsrAllocateCaptureBuffer(
40 ULONG ArgumentCount,
41 ULONG BufferSize
42 );
43
44 ULONG
45 NTAPI
46 CsrAllocateMessagePointer(
47 struct _CSR_CAPTURE_BUFFER *CaptureBuffer,
48 ULONG MessageLength,
49 PVOID *CaptureData
50 );
51
52 VOID
53 NTAPI
54 CsrCaptureMessageBuffer(
55 struct _CSR_CAPTURE_BUFFER *CaptureBuffer,
56 PVOID MessageString,
57 ULONG StringLength,
58 PVOID *CapturedData
59 );
60
61 NTSTATUS
62 NTAPI
63 CsrClientConnectToServer(
64 PWSTR ObjectDirectory,
65 ULONG ServerId,
66 PVOID ConnectionInfo,
67 PULONG ConnectionInfoSize,
68 PBOOLEAN ServerToServerCall
69 );
70
71 NTSTATUS
72 NTAPI
73 CsrClientCallServer(
74 struct _CSR_API_MESSAGE *Request,
75 struct _CSR_CAPTURE_BUFFER *CaptureBuffer OPTIONAL,
76 ULONG ApiNumber,
77 ULONG RequestLength
78 );
79
80 NTSTATUS
81 NTAPI
82 CsrIdentifyAlertableThread(
83 VOID
84 );
85
86 VOID
87 NTAPI
88 CsrFreeCaptureBuffer(
89 struct _CSR_CAPTURE_BUFFER *CaptureBuffer
90 );
91
92 HANDLE
93 NTAPI
94 CsrGetProcessId(
95 VOID
96 );
97
98 NTSTATUS
99 NTAPI
100 CsrNewThread(VOID);
101
102 NTSTATUS
103 NTAPI
104 CsrSetPriorityClass(
105 HANDLE Process,
106 PULONG PriorityClass
107 );
108
109 VOID
110 NTAPI
111 CsrProbeForRead(
112 IN PVOID Address,
113 IN ULONG Length,
114 IN ULONG Alignment
115 );
116
117 VOID
118 NTAPI
119 CsrProbeForWrite(
120 IN PVOID Address,
121 IN ULONG Length,
122 IN ULONG Alignment
123 );
124
125 //
126 // Debug Functions
127 //
128 NTSYSAPI
129 VOID
130 NTAPI
131 DbgBreakPointWithStatus(
132 IN ULONG Status
133 );
134
135 NTSTATUS
136 NTAPI
137 DbgUiConnectToDbg(
138 VOID
139 );
140
141 NTSTATUS
142 NTAPI
143 DbgUiContinue(
144 IN PCLIENT_ID ClientId,
145 IN NTSTATUS ContinueStatus
146 );
147
148 NTSTATUS
149 NTAPI
150 DbgUiDebugActiveProcess(
151 IN HANDLE Process
152 );
153
154 NTSTATUS
155 NTAPI
156 DbgUiStopDebugging(
157 IN HANDLE Process
158 );
159
160 NTSYSAPI
161 NTSTATUS
162 NTAPI
163 DbgUiWaitStateChange(
164 IN PDBGUI_WAIT_STATE_CHANGE DbgUiWaitStateCange,
165 IN PLARGE_INTEGER TimeOut
166 );
167
168 NTSTATUS
169 NTAPI
170 DbgUiConvertStateChangeStructure(
171 IN PDBGUI_WAIT_STATE_CHANGE WaitStateChange,
172 IN PVOID DebugEvent
173 );
174
175 VOID
176 NTAPI
177 DbgUiRemoteBreakin(
178 VOID
179 );
180
181 NTSTATUS
182 NTAPI
183 DbgUiIssueRemoteBreakin(
184 IN HANDLE Process
185 );
186
187 HANDLE
188 NTAPI
189 DbgUiGetThreadDebugObject(
190 VOID
191 );
192
193 //
194 // Loader Functions
195 //
196
197 NTSTATUS
198 NTAPI
199 LdrAddRefDll(
200 IN ULONG Flags,
201 IN PVOID BaseAddress
202 );
203
204 NTSTATUS
205 NTAPI
206 LdrDisableThreadCalloutsForDll(
207 IN PVOID BaseAddress
208 );
209
210 NTSTATUS
211 NTAPI
212 LdrGetDllHandle(
213 IN PWSTR DllPath OPTIONAL,
214 IN PULONG DllCharacteristics,
215 IN PUNICODE_STRING DllName,
216 OUT PVOID *DllHandle
217 );
218
219 NTSTATUS
220 NTAPI
221 LdrFindEntryForAddress(
222 IN PVOID Address,
223 OUT PLDR_DATA_TABLE_ENTRY *Module
224 );
225
226 NTSTATUS
227 NTAPI
228 LdrGetProcedureAddress(
229 IN PVOID BaseAddress,
230 IN PANSI_STRING Name,
231 IN ULONG Ordinal,
232 OUT PVOID *ProcedureAddress
233 );
234
235 VOID
236 NTAPI
237 LdrInitializeThunk(
238 ULONG Unknown1,
239 ULONG Unknown2,
240 ULONG Unknown3,
241 ULONG Unknown4
242 );
243
244 NTSTATUS
245 NTAPI
246 LdrLoadDll(
247 IN PWSTR SearchPath OPTIONAL,
248 IN PULONG LoadFlags OPTIONAL,
249 IN PUNICODE_STRING Name,
250 OUT PVOID *BaseAddress OPTIONAL
251 );
252
253 PIMAGE_BASE_RELOCATION
254 NTAPI
255 LdrProcessRelocationBlock(
256 IN ULONG_PTR Address,
257 IN ULONG Count,
258 IN PUSHORT TypeOffset,
259 IN LONG_PTR Delta
260 );
261
262 NTSTATUS
263 NTAPI
264 LdrQueryImageFileExecutionOptions(
265 IN PUNICODE_STRING SubKey,
266 IN PCWSTR ValueName,
267 IN ULONG ValueSize,
268 OUT PVOID Buffer,
269 IN ULONG BufferSize,
270 OUT PULONG RetunedLength OPTIONAL
271 );
272
273 NTSTATUS
274 NTAPI
275 LdrQueryProcessModuleInformation(
276 IN PRTL_PROCESS_MODULES ModuleInformation OPTIONAL,
277 IN ULONG Size OPTIONAL,
278 OUT PULONG ReturnedSize
279 );
280
281 NTSTATUS
282 NTAPI
283 LdrShutdownProcess(
284 VOID
285 );
286
287 NTSTATUS
288 NTAPI
289 LdrShutdownThread(
290 VOID
291 );
292
293 NTSTATUS
294 NTAPI
295 LdrUnloadDll(
296 IN PVOID BaseAddress
297 );
298
299 typedef VOID (NTAPI *PLDR_CALLBACK)(PVOID CallbackContext, PVOID Name);
300 NTSTATUS
301 NTAPI
302 LdrVerifyImageMatchesChecksum(
303 IN HANDLE FileHandle,
304 IN PLDR_CALLBACK Callback,
305 IN PVOID CallbackContext,
306 OUT PUSHORT ImageCharacterstics
307 );
308
309 #endif