- NDK 0.98, now with versionned headers. Too many changes to list, see the TinyKRNL...
[reactos.git] / reactos / include / ndk / psfuncs.h
1 /*++ NDK Version: 0098
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 (alexi@tinykrnl.org) - Updated - 27-Feb-2006
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 PWIN32_CALLOUTS_FPNS 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 NTSYSCALLAPI
106 NTSTATUS
107 NTAPI
108 NtAlertResumeThread(
109 IN HANDLE ThreadHandle,
110 OUT PULONG SuspendCount
111 );
112
113 NTSYSCALLAPI
114 NTSTATUS
115 NTAPI
116 NtAlertThread(
117 IN HANDLE ThreadHandle
118 );
119
120 NTSYSCALLAPI
121 NTSTATUS
122 NTAPI
123 NtAssignProcessToJobObject(
124 HANDLE JobHandle,
125 HANDLE ProcessHandle
126 );
127
128 NTSYSCALLAPI
129 NTSTATUS
130 NTAPI
131 NtCreateJobObject(
132 PHANDLE JobHandle,
133 ACCESS_MASK DesiredAccess,
134 POBJECT_ATTRIBUTES ObjectAttributes
135 );
136
137 NTSYSCALLAPI
138 NTSTATUS
139 NTAPI
140 NtCreateProcess(
141 OUT PHANDLE ProcessHandle,
142 IN ACCESS_MASK DesiredAccess,
143 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
144 IN HANDLE ParentProcess,
145 IN BOOLEAN InheritObjectTable,
146 IN HANDLE SectionHandle OPTIONAL,
147 IN HANDLE DebugPort OPTIONAL,
148 IN HANDLE ExceptionPort OPTIONAL
149 );
150
151 NTSYSCALLAPI
152 NTSTATUS
153 NTAPI
154 NtCreateThread(
155 OUT PHANDLE ThreadHandle,
156 IN ACCESS_MASK DesiredAccess,
157 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
158 IN HANDLE ProcessHandle,
159 OUT PCLIENT_ID ClientId,
160 IN PCONTEXT ThreadContext,
161 IN PINITIAL_TEB UserStack,
162 IN BOOLEAN CreateSuspended
163 );
164
165 NTSYSCALLAPI
166 NTSTATUS
167 NTAPI
168 NtImpersonateThread(
169 IN HANDLE ThreadHandle,
170 IN HANDLE ThreadToImpersonate,
171 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
172 );
173
174 NTSYSCALLAPI
175 NTSTATUS
176 NTAPI
177 NtIsProcessInJob(
178 IN HANDLE ProcessHandle,
179 IN HANDLE JobHandle OPTIONAL
180 );
181
182 NTSYSCALLAPI
183 NTSTATUS
184 NTAPI
185 NtOpenProcess(
186 OUT PHANDLE ProcessHandle,
187 IN ACCESS_MASK DesiredAccess,
188 IN POBJECT_ATTRIBUTES ObjectAttributes,
189 IN PCLIENT_ID ClientId
190 );
191
192 NTSYSCALLAPI
193 NTSTATUS
194 NTAPI
195 NtOpenThread(
196 OUT PHANDLE ThreadHandle,
197 IN ACCESS_MASK DesiredAccess,
198 IN POBJECT_ATTRIBUTES ObjectAttributes,
199 IN PCLIENT_ID ClientId
200 );
201
202 NTSYSCALLAPI
203 NTSTATUS
204 NTAPI
205 NtOpenThreadToken(
206 IN HANDLE ThreadHandle,
207 IN ACCESS_MASK DesiredAccess,
208 IN BOOLEAN OpenAsSelf,
209 OUT PHANDLE TokenHandle
210 );
211
212 NTSYSCALLAPI
213 NTSTATUS
214 NTAPI
215 NtOpenThreadTokenEx(
216 IN HANDLE ThreadHandle,
217 IN ACCESS_MASK DesiredAccess,
218 IN BOOLEAN OpenAsSelf,
219 IN ULONG HandleAttributes,
220 OUT PHANDLE TokenHandle
221 );
222
223 NTSYSCALLAPI
224 NTSTATUS
225 NTAPI
226 NtQueryInformationJobObject(
227 HANDLE JobHandle,
228 JOBOBJECTINFOCLASS JobInformationClass,
229 PVOID JobInformation,
230 ULONG JobInformationLength,
231 PULONG ReturnLength
232 );
233
234 #ifndef _NTDDK_
235 NTSYSCALLAPI
236 NTSTATUS
237 NTAPI
238 NtQueryInformationProcess(
239 IN HANDLE ProcessHandle,
240 IN PROCESSINFOCLASS ProcessInformationClass,
241 OUT PVOID ProcessInformation,
242 IN ULONG ProcessInformationLength,
243 OUT PULONG ReturnLength OPTIONAL
244 );
245 #endif
246
247 NTSYSCALLAPI
248 NTSTATUS
249 NTAPI
250 NtQueryInformationThread(
251 IN HANDLE ThreadHandle,
252 IN THREADINFOCLASS ThreadInformationClass,
253 OUT PVOID ThreadInformation,
254 IN ULONG ThreadInformationLength,
255 OUT PULONG ReturnLength
256 );
257
258 NTSYSCALLAPI
259 NTSTATUS
260 NTAPI
261 NtRegisterThreadTerminatePort(
262 HANDLE TerminationPort
263 );
264
265 NTSYSCALLAPI
266 NTSTATUS
267 NTAPI
268 NtResumeThread(
269 IN HANDLE ThreadHandle,
270 OUT PULONG SuspendCount
271 );
272
273 NTSYSCALLAPI
274 NTSTATUS
275 NTAPI
276 NtResumeProcess(
277 IN HANDLE ProcessHandle
278 );
279
280 NTSYSCALLAPI
281 NTSTATUS
282 NTAPI
283 NtSetInformationJobObject(
284 HANDLE JobHandle,
285 JOBOBJECTINFOCLASS JobInformationClass,
286 PVOID JobInformation,
287 ULONG JobInformationLength
288 );
289
290 NTSYSCALLAPI
291 NTSTATUS
292 NTAPI
293 NtSetInformationProcess(
294 IN HANDLE ProcessHandle,
295 IN PROCESSINFOCLASS ProcessInformationClass,
296 IN PVOID ProcessInformation,
297 IN ULONG ProcessInformationLength
298 );
299
300 NTSYSCALLAPI
301 NTSYSCALLAPI
302 NTSTATUS
303 NTAPI
304 NtSetInformationThread(
305 IN HANDLE ThreadHandle,
306 IN THREADINFOCLASS ThreadInformationClass,
307 IN PVOID ThreadInformation,
308 IN ULONG ThreadInformationLength
309 );
310
311 NTSYSCALLAPI
312 NTSTATUS
313 NTAPI
314 NtSuspendProcess(
315 IN HANDLE ProcessHandle
316 );
317
318 NTSYSCALLAPI
319 NTSTATUS
320 NTAPI
321 NtSuspendThread(
322 IN HANDLE ThreadHandle,
323 IN PULONG PreviousSuspendCount
324 );
325
326 NTSYSCALLAPI
327 NTSTATUS
328 NTAPI
329 NtTerminateProcess(
330 IN HANDLE ProcessHandle,
331 IN NTSTATUS ExitStatus
332 );
333
334 NTSYSCALLAPI
335 NTSTATUS
336 NTAPI
337 NtTerminateThread(
338 IN HANDLE ThreadHandle,
339 IN NTSTATUS ExitStatus
340 );
341
342 NTSYSCALLAPI
343 NTSTATUS
344 NTAPI
345 NtTerminateJobObject(
346 HANDLE JobHandle,
347 NTSTATUS ExitStatus
348 );
349
350 NTSYSAPI
351 NTSTATUS
352 NTAPI
353 ZwAlertResumeThread(
354 IN HANDLE ThreadHandle,
355 OUT PULONG SuspendCount
356 );
357
358 NTSYSAPI
359 NTSTATUS
360 NTAPI
361 ZwAlertThread(
362 IN HANDLE ThreadHandle
363 );
364
365 NTSYSAPI
366 NTSTATUS
367 NTAPI
368 ZwAssignProcessToJobObject(
369 HANDLE JobHandle,
370 HANDLE ProcessHandle
371 );
372
373 NTSYSAPI
374 NTSTATUS
375 NTAPI
376 ZwCreateJobObject(
377 PHANDLE JobHandle,
378 ACCESS_MASK DesiredAccess,
379 POBJECT_ATTRIBUTES ObjectAttributes
380 );
381
382 NTSYSAPI
383 NTSTATUS
384 NTAPI
385 ZwCreateProcess(
386 OUT PHANDLE ProcessHandle,
387 IN ACCESS_MASK DesiredAccess,
388 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
389 IN HANDLE ParentProcess,
390 IN BOOLEAN InheritObjectTable,
391 IN HANDLE SectionHandle OPTIONAL,
392 IN HANDLE DebugPort OPTIONAL,
393 IN HANDLE ExceptionPort OPTIONAL
394 );
395
396 NTSYSAPI
397 NTSTATUS
398 NTAPI
399 ZwCreateThread(
400 OUT PHANDLE ThreadHandle,
401 IN ACCESS_MASK DesiredAccess,
402 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
403 IN HANDLE ProcessHandle,
404 OUT PCLIENT_ID ClientId,
405 IN PCONTEXT ThreadContext,
406 IN PINITIAL_TEB UserStack,
407 IN BOOLEAN CreateSuspended
408 );
409
410 NTSYSAPI
411 NTSTATUS
412 NTAPI
413 ZwImpersonateThread(
414 IN HANDLE ThreadHandle,
415 IN HANDLE ThreadToImpersonate,
416 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
417 );
418
419 NTSYSAPI
420 NTSTATUS
421 NTAPI
422 ZwIsProcessInJob(
423 IN HANDLE ProcessHandle,
424 IN HANDLE JobHandle OPTIONAL
425 );
426
427 NTSYSAPI
428 NTSTATUS
429 NTAPI
430 ZwOpenProcess(
431 OUT PHANDLE ProcessHandle,
432 IN ACCESS_MASK DesiredAccess,
433 IN POBJECT_ATTRIBUTES ObjectAttributes,
434 IN PCLIENT_ID ClientId
435 );
436
437 NTSYSAPI
438 NTSTATUS
439 NTAPI
440 ZwOpenThread(
441 OUT PHANDLE ThreadHandle,
442 IN ACCESS_MASK DesiredAccess,
443 IN POBJECT_ATTRIBUTES ObjectAttributes,
444 IN PCLIENT_ID ClientId
445 );
446
447 NTSYSAPI
448 NTSTATUS
449 NTAPI
450 ZwOpenThreadToken(
451 IN HANDLE ThreadHandle,
452 IN ACCESS_MASK DesiredAccess,
453 IN BOOLEAN OpenAsSelf,
454 OUT PHANDLE TokenHandle
455 );
456
457 NTSYSAPI
458 NTSTATUS
459 NTAPI
460 ZwOpenThreadTokenEx(
461 IN HANDLE ThreadHandle,
462 IN ACCESS_MASK DesiredAccess,
463 IN BOOLEAN OpenAsSelf,
464 IN ULONG HandleAttributes,
465 OUT PHANDLE TokenHandle
466 );
467
468 NTSYSAPI
469 NTSTATUS
470 NTAPI
471 ZwQueryInformationJobObject(
472 HANDLE JobHandle,
473 JOBOBJECTINFOCLASS JobInformationClass,
474 PVOID JobInformation,
475 ULONG JobInformationLength,
476 PULONG ReturnLength
477 );
478
479 #ifndef _NTDDK_
480 NTSYSAPI
481 NTSTATUS
482 NTAPI
483 ZwQueryInformationProcess(
484 IN HANDLE ProcessHandle,
485 IN PROCESSINFOCLASS ProcessInformationClass,
486 OUT PVOID ProcessInformation,
487 IN ULONG ProcessInformationLength,
488 OUT PULONG ReturnLength OPTIONAL
489 );
490 #endif
491
492 NTSYSAPI
493 NTSTATUS
494 NTAPI
495 ZwQueryInformationThread(
496 IN HANDLE ThreadHandle,
497 IN THREADINFOCLASS ThreadInformationClass,
498 OUT PVOID ThreadInformation,
499 IN ULONG ThreadInformationLength,
500 OUT PULONG ReturnLength
501 );
502
503 NTSYSAPI
504 NTSTATUS
505 NTAPI
506 ZwRegisterThreadTerminatePort(
507 HANDLE TerminationPort
508 );
509
510 NTSYSAPI
511 NTSTATUS
512 NTAPI
513 ZwResumeThread(
514 IN HANDLE ThreadHandle,
515 OUT PULONG SuspendCount
516 );
517
518 NTSYSAPI
519 NTSTATUS
520 NTAPI
521 ZwResumeProcess(
522 IN HANDLE ProcessHandle
523 );
524
525 NTSYSAPI
526 NTSTATUS
527 NTAPI
528 ZwSetInformationJobObject(
529 HANDLE JobHandle,
530 JOBOBJECTINFOCLASS JobInformationClass,
531 PVOID JobInformation,
532 ULONG JobInformationLength
533 );
534
535 NTSYSAPI
536 NTSTATUS
537 NTAPI
538 ZwSetInformationProcess(
539 IN HANDLE ProcessHandle,
540 IN PROCESSINFOCLASS ProcessInformationClass,
541 IN PVOID ProcessInformation,
542 IN ULONG ProcessInformationLength
543 );
544
545 NTSYSAPI
546 NTSTATUS
547 NTAPI
548 ZwSetInformationThread(
549 IN HANDLE ThreadHandle,
550 IN THREADINFOCLASS ThreadInformationClass,
551 IN PVOID ThreadInformation,
552 IN ULONG ThreadInformationLength
553 );
554
555 NTSYSAPI
556 NTSTATUS
557 NTAPI
558 ZwSuspendProcess(
559 IN HANDLE ProcessHandle
560 );
561
562 NTSYSAPI
563 NTSTATUS
564 NTAPI
565 ZwSuspendThread(
566 IN HANDLE ThreadHandle,
567 IN PULONG PreviousSuspendCount
568 );
569
570 NTSYSAPI
571 NTSTATUS
572 NTAPI
573 ZwTerminateProcess(
574 IN HANDLE ProcessHandle,
575 IN NTSTATUS ExitStatus
576 );
577
578 NTSYSAPI
579 NTSTATUS
580 NTAPI
581 ZwTerminateThread(
582 IN HANDLE ThreadHandle,
583 IN NTSTATUS ExitStatus
584 );
585
586 NTSYSAPI
587 NTSTATUS
588 NTAPI
589 ZwTerminateJobObject(
590 HANDLE JobHandle,
591 NTSTATUS ExitStatus
592 );
593
594 #endif