- Fix ETHREAD/PROCESS typos and add a function to psfuncs.h
[reactos.git] / reactos / include / ndk / psfuncs.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 psfuncs.h
8
9 Abstract:
10
11 Function definitions for the Process Manager
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _PSFUNCS_H
20 #define _PSFUNCS_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <pstypes.h>
27
28 #ifndef NTOS_MODE_USER
29
30 //
31 // Win32K Process/Thread Functions
32 //
33 struct _W32THREAD*
34 NTAPI
35 PsGetWin32Thread(
36 VOID
37 );
38
39 struct _W32PROCESS*
40 NTAPI
41 PsGetWin32Process(
42 VOID
43 );
44
45 PVOID
46 NTAPI
47 PsGetProcessWin32Process(
48 PEPROCESS Process
49 );
50
51 VOID
52 NTAPI
53 PsSetProcessWin32Process(
54 PEPROCESS Process,
55 PVOID Win32Process
56 );
57
58 VOID
59 NTAPI
60 PsSetThreadWin32Thread(
61 PETHREAD Thread,
62 PVOID Win32Thread
63 );
64
65 PVOID
66 NTAPI
67 PsGetThreadWin32Thread(
68 PETHREAD Thread
69 );
70
71 VOID
72 NTAPI
73 PsEstablishWin32Callouts(
74 PW32_CALLOUT_DATA CalloutData
75 );
76
77 VOID
78 NTAPI
79 PsReturnProcessNonPagedPoolQuota(
80 IN PEPROCESS Process,
81 IN ULONG_PTR Amount
82 );
83
84 //
85 // Process Impersonation Functions
86 //
87 VOID
88 NTAPI
89 PsRevertThreadToSelf(
90 IN PETHREAD Thread
91 );
92
93 //
94 // Misc. Functions
95 //
96 HANDLE
97 NTAPI
98 PsGetProcessId(PEPROCESS Process);
99
100 #endif
101
102 //
103 // Native Calls
104 //
105 NTSTATUS
106 NTAPI
107 NtAlertResumeThread(
108 IN HANDLE ThreadHandle,
109 OUT PULONG SuspendCount
110 );
111
112 NTSTATUS
113 NTAPI
114 NtAlertThread(
115 IN HANDLE ThreadHandle
116 );
117
118 NTSTATUS
119 NTAPI
120 NtAssignProcessToJobObject(
121 HANDLE JobHandle,
122 HANDLE ProcessHandle
123 );
124
125 NTSTATUS
126 NTAPI
127 NtCreateJobObject(
128 PHANDLE JobHandle,
129 ACCESS_MASK DesiredAccess,
130 POBJECT_ATTRIBUTES ObjectAttributes
131 );
132
133 NTSTATUS
134 NTAPI
135 NtCreateProcess(
136 OUT PHANDLE ProcessHandle,
137 IN ACCESS_MASK DesiredAccess,
138 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
139 IN HANDLE ParentProcess,
140 IN BOOLEAN InheritObjectTable,
141 IN HANDLE SectionHandle OPTIONAL,
142 IN HANDLE DebugPort OPTIONAL,
143 IN HANDLE ExceptionPort OPTIONAL
144 );
145
146 NTSTATUS
147 NTAPI
148 NtCreateThread(
149 OUT PHANDLE ThreadHandle,
150 IN ACCESS_MASK DesiredAccess,
151 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
152 IN HANDLE ProcessHandle,
153 OUT PCLIENT_ID ClientId,
154 IN PCONTEXT ThreadContext,
155 IN PINITIAL_TEB UserStack,
156 IN BOOLEAN CreateSuspended
157 );
158
159 NTSTATUS
160 NTAPI
161 NtImpersonateThread(
162 IN HANDLE ThreadHandle,
163 IN HANDLE ThreadToImpersonate,
164 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
165 );
166
167 NTSTATUS
168 NTAPI
169 NtIsProcessInJob(
170 IN HANDLE ProcessHandle,
171 IN HANDLE JobHandle OPTIONAL
172 );
173
174 NTSYSCALLAPI
175 NTSTATUS
176 NTAPI
177 NtOpenProcess(
178 OUT PHANDLE ProcessHandle,
179 IN ACCESS_MASK DesiredAccess,
180 IN POBJECT_ATTRIBUTES ObjectAttributes,
181 IN PCLIENT_ID ClientId
182 );
183
184 NTSTATUS
185 NTAPI
186 NtOpenThread(
187 OUT PHANDLE ThreadHandle,
188 IN ACCESS_MASK DesiredAccess,
189 IN POBJECT_ATTRIBUTES ObjectAttributes,
190 IN PCLIENT_ID ClientId
191 );
192
193 NTSYSCALLAPI
194 NTSTATUS
195 NTAPI
196 NtOpenThreadToken(
197 IN HANDLE ThreadHandle,
198 IN ACCESS_MASK DesiredAccess,
199 IN BOOLEAN OpenAsSelf,
200 OUT PHANDLE TokenHandle
201 );
202
203 NTSYSCALLAPI
204 NTSTATUS
205 NTAPI
206 NtOpenThreadTokenEx(
207 IN HANDLE ThreadHandle,
208 IN ACCESS_MASK DesiredAccess,
209 IN BOOLEAN OpenAsSelf,
210 IN ULONG HandleAttributes,
211 OUT PHANDLE TokenHandle
212 );
213
214 NTSTATUS
215 NTAPI
216 NtQueryInformationJobObject(
217 HANDLE JobHandle,
218 JOBOBJECTINFOCLASS JobInformationClass,
219 PVOID JobInformation,
220 ULONG JobInformationLength,
221 PULONG ReturnLength
222 );
223
224 #ifndef _NTDDK_
225 NTSTATUS
226 NTAPI
227 NtQueryInformationProcess(
228 IN HANDLE ProcessHandle,
229 IN PROCESSINFOCLASS ProcessInformationClass,
230 OUT PVOID ProcessInformation,
231 IN ULONG ProcessInformationLength,
232 OUT PULONG ReturnLength OPTIONAL
233 );
234 #endif
235
236 NTSTATUS
237 NTAPI
238 NtQueryInformationThread(
239 IN HANDLE ThreadHandle,
240 IN THREADINFOCLASS ThreadInformationClass,
241 OUT PVOID ThreadInformation,
242 IN ULONG ThreadInformationLength,
243 OUT PULONG ReturnLength
244 );
245
246 NTSTATUS
247 NTAPI
248 NtRegisterThreadTerminatePort(
249 HANDLE TerminationPort
250 );
251
252 NTSTATUS
253 NTAPI
254 NtResumeThread(
255 IN HANDLE ThreadHandle,
256 OUT PULONG SuspendCount
257 );
258
259 NTSTATUS
260 NTAPI
261 NtResumeProcess(
262 IN HANDLE ProcessHandle
263 );
264
265 NTSTATUS
266 NTAPI
267 NtSetInformationJobObject(
268 HANDLE JobHandle,
269 JOBOBJECTINFOCLASS JobInformationClass,
270 PVOID JobInformation,
271 ULONG JobInformationLength
272 );
273
274 NTSTATUS
275 NTAPI
276 NtSetInformationProcess(
277 IN HANDLE ProcessHandle,
278 IN PROCESSINFOCLASS ProcessInformationClass,
279 IN PVOID ProcessInformation,
280 IN ULONG ProcessInformationLength
281 );
282
283 NTSYSCALLAPI
284 NTSTATUS
285 NTAPI
286 NtSetInformationThread(
287 IN HANDLE ThreadHandle,
288 IN THREADINFOCLASS ThreadInformationClass,
289 IN PVOID ThreadInformation,
290 IN ULONG ThreadInformationLength
291 );
292
293 NTSTATUS
294 NTAPI
295 NtSuspendProcess(
296 IN HANDLE ProcessHandle
297 );
298
299 NTSTATUS
300 NTAPI
301 NtSuspendThread(
302 IN HANDLE ThreadHandle,
303 IN PULONG PreviousSuspendCount
304 );
305
306 NTSTATUS
307 NTAPI
308 NtTerminateProcess(
309 IN HANDLE ProcessHandle,
310 IN NTSTATUS ExitStatus
311 );
312
313 NTSTATUS
314 NTAPI
315 NtTerminateThread(
316 IN HANDLE ThreadHandle,
317 IN NTSTATUS ExitStatus
318 );
319
320 NTSTATUS
321 NTAPI
322 NtTerminateJobObject(
323 HANDLE JobHandle,
324 NTSTATUS ExitStatus
325 );
326
327 NTSTATUS
328 NTAPI
329 ZwAlertResumeThread(
330 IN HANDLE ThreadHandle,
331 OUT PULONG SuspendCount
332 );
333
334 NTSTATUS
335 NTAPI
336 ZwAlertThread(
337 IN HANDLE ThreadHandle
338 );
339
340 NTSTATUS
341 NTAPI
342 ZwAssignProcessToJobObject(
343 HANDLE JobHandle,
344 HANDLE ProcessHandle
345 );
346
347 NTSTATUS
348 NTAPI
349 ZwCreateJobObject(
350 PHANDLE JobHandle,
351 ACCESS_MASK DesiredAccess,
352 POBJECT_ATTRIBUTES ObjectAttributes
353 );
354
355 NTSTATUS
356 NTAPI
357 ZwCreateProcess(
358 OUT PHANDLE ProcessHandle,
359 IN ACCESS_MASK DesiredAccess,
360 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
361 IN HANDLE ParentProcess,
362 IN BOOLEAN InheritObjectTable,
363 IN HANDLE SectionHandle OPTIONAL,
364 IN HANDLE DebugPort OPTIONAL,
365 IN HANDLE ExceptionPort OPTIONAL
366 );
367
368 NTSTATUS
369 NTAPI
370 ZwCreateThread(
371 OUT PHANDLE ThreadHandle,
372 IN ACCESS_MASK DesiredAccess,
373 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
374 IN HANDLE ProcessHandle,
375 OUT PCLIENT_ID ClientId,
376 IN PCONTEXT ThreadContext,
377 IN PINITIAL_TEB UserStack,
378 IN BOOLEAN CreateSuspended
379 );
380
381 NTSTATUS
382 NTAPI
383 ZwImpersonateThread(
384 IN HANDLE ThreadHandle,
385 IN HANDLE ThreadToImpersonate,
386 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
387 );
388
389 NTSTATUS
390 NTAPI
391 ZwIsProcessInJob(
392 IN HANDLE ProcessHandle,
393 IN HANDLE JobHandle OPTIONAL
394 );
395
396 NTSYSCALLAPI
397 NTSTATUS
398 NTAPI
399 ZwOpenProcess(
400 OUT PHANDLE ProcessHandle,
401 IN ACCESS_MASK DesiredAccess,
402 IN POBJECT_ATTRIBUTES ObjectAttributes,
403 IN PCLIENT_ID ClientId
404 );
405
406 NTSTATUS
407 NTAPI
408 ZwOpenThread(
409 OUT PHANDLE ThreadHandle,
410 IN ACCESS_MASK DesiredAccess,
411 IN POBJECT_ATTRIBUTES ObjectAttributes,
412 IN PCLIENT_ID ClientId
413 );
414
415 NTSYSCALLAPI
416 NTSTATUS
417 NTAPI
418 ZwOpenThreadToken(
419 IN HANDLE ThreadHandle,
420 IN ACCESS_MASK DesiredAccess,
421 IN BOOLEAN OpenAsSelf,
422 OUT PHANDLE TokenHandle
423 );
424
425 NTSYSCALLAPI
426 NTSTATUS
427 NTAPI
428 ZwOpenThreadTokenEx(
429 IN HANDLE ThreadHandle,
430 IN ACCESS_MASK DesiredAccess,
431 IN BOOLEAN OpenAsSelf,
432 IN ULONG HandleAttributes,
433 OUT PHANDLE TokenHandle
434 );
435
436 NTSTATUS
437 NTAPI
438 ZwQueryInformationJobObject(
439 HANDLE JobHandle,
440 JOBOBJECTINFOCLASS JobInformationClass,
441 PVOID JobInformation,
442 ULONG JobInformationLength,
443 PULONG ReturnLength
444 );
445
446 #ifndef _NTDDK_
447 NTSTATUS
448 NTAPI
449 ZwQueryInformationProcess(
450 IN HANDLE ProcessHandle,
451 IN PROCESSINFOCLASS ProcessInformationClass,
452 OUT PVOID ProcessInformation,
453 IN ULONG ProcessInformationLength,
454 OUT PULONG ReturnLength OPTIONAL
455 );
456 #endif
457
458 NTSTATUS
459 NTAPI
460 ZwQueryInformationThread(
461 IN HANDLE ThreadHandle,
462 IN THREADINFOCLASS ThreadInformationClass,
463 OUT PVOID ThreadInformation,
464 IN ULONG ThreadInformationLength,
465 OUT PULONG ReturnLength
466 );
467
468 NTSTATUS
469 NTAPI
470 ZwRegisterThreadTerminatePort(
471 HANDLE TerminationPort
472 );
473
474 NTSTATUS
475 NTAPI
476 ZwResumeThread(
477 IN HANDLE ThreadHandle,
478 OUT PULONG SuspendCount
479 );
480
481 NTSTATUS
482 NTAPI
483 ZwResumeProcess(
484 IN HANDLE ProcessHandle
485 );
486
487 NTSTATUS
488 NTAPI
489 ZwSetInformationJobObject(
490 HANDLE JobHandle,
491 JOBOBJECTINFOCLASS JobInformationClass,
492 PVOID JobInformation,
493 ULONG JobInformationLength
494 );
495
496 NTSTATUS
497 NTAPI
498 ZwSetInformationProcess(
499 IN HANDLE ProcessHandle,
500 IN PROCESSINFOCLASS ProcessInformationClass,
501 IN PVOID ProcessInformation,
502 IN ULONG ProcessInformationLength
503 );
504
505 NTSYSCALLAPI
506 NTSTATUS
507 NTAPI
508 ZwSetInformationThread(
509 IN HANDLE ThreadHandle,
510 IN THREADINFOCLASS ThreadInformationClass,
511 IN PVOID ThreadInformation,
512 IN ULONG ThreadInformationLength
513 );
514
515 NTSTATUS
516 NTAPI
517 ZwSuspendProcess(
518 IN HANDLE ProcessHandle
519 );
520
521 NTSTATUS
522 NTAPI
523 ZwSuspendThread(
524 IN HANDLE ThreadHandle,
525 IN PULONG PreviousSuspendCount
526 );
527
528 NTSTATUS
529 NTAPI
530 ZwTerminateProcess(
531 IN HANDLE ProcessHandle,
532 IN NTSTATUS ExitStatus
533 );
534
535 NTSTATUS
536 NTAPI
537 ZwTerminateThread(
538 IN HANDLE ThreadHandle,
539 IN NTSTATUS ExitStatus
540 );
541
542 NTSTATUS
543 NTAPI
544 ZwTerminateJobObject(
545 HANDLE JobHandle,
546 NTSTATUS ExitStatus
547 );
548
549 #endif