- Add some more misc. public definitions and fix exfuncs.h so that it can be included...
[reactos.git] / reactos / include / ndk / exfuncs.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 exfuncs.h
8
9 Abstract:
10
11 Function definitions for the Executive.
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _EXFUNCS_H
20 #define _EXFUNCS_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <pstypes.h>
27 #include <extypes.h>
28
29 //
30 // Don't include WMI headers just for one define
31 //
32 typedef struct _EVENT_TRACE_HEADER *PEVENT_TRACE_HEADER;
33
34 #ifndef NTOS_MODE_USER
35 //
36 // Fast Mutex functions
37 //
38 VOID
39 FASTCALL
40 ExEnterCriticalRegionAndAcquireFastMutexUnsafe(PFAST_MUTEX FastMutex);
41
42 VOID
43 FASTCALL
44 ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(PFAST_MUTEX FastMutex);
45 #endif
46
47 //
48 // Native Calls
49 //
50 NTSTATUS
51 NTAPI
52 NtAddAtom(
53 IN PWSTR AtomName,
54 IN ULONG AtomNameLength,
55 IN OUT PRTL_ATOM Atom
56 );
57
58 NTSTATUS
59 NTAPI
60 NtCancelTimer(
61 IN HANDLE TimerHandle,
62 OUT PBOOLEAN CurrentState OPTIONAL
63 );
64
65 NTSTATUS
66 NTAPI
67 NtClearEvent(
68 IN HANDLE EventHandle
69 );
70
71 NTSTATUS
72 NTAPI
73 NtCreateEvent(
74 OUT PHANDLE EventHandle,
75 IN ACCESS_MASK DesiredAccess,
76 IN POBJECT_ATTRIBUTES ObjectAttributes,
77 IN EVENT_TYPE EventType,
78 IN BOOLEAN InitialState
79 );
80
81 NTSTATUS
82 NTAPI
83 NtCreateEventPair(
84 OUT PHANDLE EventPairHandle,
85 IN ACCESS_MASK DesiredAccess,
86 IN POBJECT_ATTRIBUTES ObjectAttributes
87 );
88
89 NTSTATUS
90 NTAPI
91 NtCreateMutant(
92 OUT PHANDLE MutantHandle,
93 IN ACCESS_MASK DesiredAccess,
94 IN POBJECT_ATTRIBUTES ObjectAttributes,
95 IN BOOLEAN InitialOwner
96 );
97
98 NTSTATUS
99 NTAPI
100 NtCreateSemaphore(
101 OUT PHANDLE SemaphoreHandle,
102 IN ACCESS_MASK DesiredAccess,
103 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
104 IN LONG InitialCount,
105 IN LONG MaximumCount
106 );
107
108 NTSTATUS
109 NTAPI
110 NtCreateTimer(
111 OUT PHANDLE TimerHandle,
112 IN ACCESS_MASK DesiredAccess,
113 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
114 IN TIMER_TYPE TimerType
115 );
116
117 NTSTATUS
118 NTAPI
119 NtDeleteAtom(
120 IN RTL_ATOM Atom
121 );
122
123 NTSTATUS
124 NTAPI
125 NtDisplayString(
126 IN PUNICODE_STRING DisplayString
127 );
128
129 NTSTATUS
130 NTAPI
131 NtFindAtom(
132 IN PWSTR AtomName,
133 IN ULONG AtomNameLength,
134 OUT PRTL_ATOM Atom OPTIONAL
135 );
136
137 NTSTATUS
138 NTAPI
139 NtOpenEvent(
140 OUT PHANDLE EventHandle,
141 IN ACCESS_MASK DesiredAccess,
142 IN POBJECT_ATTRIBUTES ObjectAttributes
143 );
144
145 NTSTATUS
146 NTAPI
147 NtOpenEventPair(
148 OUT PHANDLE EventPairHandle,
149 IN ACCESS_MASK DesiredAccess,
150 IN POBJECT_ATTRIBUTES ObjectAttributes
151 );
152
153 NTSTATUS
154 NTAPI
155 NtOpenMutant(
156 OUT PHANDLE MutantHandle,
157 IN ACCESS_MASK DesiredAccess,
158 IN POBJECT_ATTRIBUTES ObjectAttributes
159 );
160
161 NTSTATUS
162 NTAPI
163 NtOpenSemaphore(
164 OUT PHANDLE SemaphoreHandle,
165 IN ACCESS_MASK DesiredAcces,
166 IN POBJECT_ATTRIBUTES ObjectAttributes
167 );
168
169 NTSTATUS
170 NTAPI
171 NtOpenTimer(
172 OUT PHANDLE TimerHandle,
173 IN ACCESS_MASK DesiredAccess,
174 IN POBJECT_ATTRIBUTES ObjectAttributes
175 );
176
177 NTSTATUS
178 NTAPI
179 NtPulseEvent(
180 IN HANDLE EventHandle,
181 IN PLONG PulseCount OPTIONAL
182 );
183
184 NTSTATUS
185 NTAPI
186 NtQueryDefaultLocale(
187 IN BOOLEAN UserProfile,
188 OUT PLCID DefaultLocaleId
189 );
190
191 NTSTATUS
192 NTAPI
193 NtQueryDefaultUILanguage(
194 PLANGID LanguageId
195 );
196
197 NTSTATUS
198 NTAPI
199 NtQueryEvent(
200 IN HANDLE EventHandle,
201 IN EVENT_INFORMATION_CLASS EventInformationClass,
202 OUT PVOID EventInformation,
203 IN ULONG EventInformationLength,
204 OUT PULONG ReturnLength
205 );
206
207 NTSTATUS
208 NTAPI
209 NtQueryInformationAtom(
210 IN RTL_ATOM Atom,
211 IN ATOM_INFORMATION_CLASS AtomInformationClass,
212 OUT PVOID AtomInformation,
213 IN ULONG AtomInformationLength,
214 OUT PULONG ReturnLength OPTIONAL
215 );
216
217 NTSTATUS
218 NTAPI
219 NtQueryInstallUILanguage(
220 PLANGID LanguageId
221 );
222
223 NTSTATUS
224 NTAPI
225 NtQueryMutant(
226 IN HANDLE MutantHandle,
227 IN MUTANT_INFORMATION_CLASS MutantInformationClass,
228 OUT PVOID MutantInformation,
229 IN ULONG Length,
230 OUT PULONG ResultLength
231 );
232
233 NTSTATUS
234 NTAPI
235 NtQuerySemaphore(
236 IN HANDLE SemaphoreHandle,
237 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
238 OUT PVOID SemaphoreInformation,
239 IN ULONG Length,
240 OUT PULONG ReturnLength
241 );
242
243 NTSTATUS
244 NTAPI
245 NtQuerySystemEnvironmentValue(
246 IN PUNICODE_STRING Name,
247 OUT PWSTR Value,
248 ULONG Length,
249 PULONG ReturnLength
250 );
251
252 NTSTATUS
253 NTAPI
254 NtQuerySystemInformation(
255 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
256 OUT PVOID SystemInformation,
257 IN ULONG Length,
258 OUT PULONG ResultLength
259 );
260
261 NTSTATUS
262 NTAPI
263 NtQueryTimer(
264 IN HANDLE TimerHandle,
265 IN TIMER_INFORMATION_CLASS TimerInformationClass,
266 OUT PVOID TimerInformation,
267 IN ULONG Length,
268 OUT PULONG ResultLength
269 );
270
271 NTSTATUS
272 NTAPI
273 NtRaiseHardError(
274 IN NTSTATUS ErrorStatus,
275 IN ULONG NumberOfParameters,
276 IN ULONG UnicodeStringParameterMask,
277 IN PULONG_PTR Parameters,
278 IN ULONG ValidResponseOptions,
279 OUT PULONG Response
280 );
281
282 NTSTATUS
283 NTAPI
284 NtReleaseMutant(
285 IN HANDLE MutantHandle,
286 IN PLONG ReleaseCount OPTIONAL
287 );
288
289 NTSTATUS
290 NTAPI
291 NtReleaseSemaphore(
292 IN HANDLE SemaphoreHandle,
293 IN LONG ReleaseCount,
294 OUT PLONG PreviousCount
295 );
296
297 NTSTATUS
298 NTAPI
299 NtResetEvent(
300 IN HANDLE EventHandle,
301 OUT PLONG NumberOfWaitingThreads OPTIONAL
302 );
303
304 NTSTATUS
305 NTAPI
306 NtSetDefaultLocale(
307 IN BOOLEAN UserProfile,
308 IN LCID DefaultLocaleId
309 );
310
311 NTSTATUS
312 NTAPI
313 NtSetDefaultUILanguage(
314 LANGID LanguageId
315 );
316
317 NTSTATUS
318 NTAPI
319 NtSetDefaultHardErrorPort(
320 IN HANDLE PortHandle
321 );
322
323 NTSTATUS
324 NTAPI
325 NtSetEvent(
326 IN HANDLE EventHandle,
327 OUT PLONG PreviousState OPTIONAL
328 );
329
330 NTSTATUS
331 NTAPI
332 NtSetHighEventPair(
333 IN HANDLE EventPairHandle
334 );
335
336 NTSTATUS
337 NTAPI
338 NtSetHighWaitLowEventPair(
339 IN HANDLE EventPairHandle
340 );
341
342 NTSTATUS
343 NTAPI
344 NtSetLowEventPair(
345 HANDLE EventPair
346 );
347
348 NTSTATUS
349 NTAPI
350 NtSetLowWaitHighEventPair(
351 HANDLE EventPair
352 );
353
354 NTSTATUS
355 NTAPI
356 NtSetSystemEnvironmentValue(
357 IN PUNICODE_STRING VariableName,
358 IN PUNICODE_STRING Value
359 );
360
361 NTSTATUS
362 NTAPI
363 NtSetSystemInformation(
364 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
365 IN PVOID SystemInformation,
366 IN ULONG SystemInformationLength
367 );
368
369 NTSTATUS
370 NTAPI
371 NtSetTimer(
372 IN HANDLE TimerHandle,
373 IN PLARGE_INTEGER DueTime,
374 IN PTIMER_APC_ROUTINE TimerApcRoutine,
375 IN PVOID TimerContext,
376 IN BOOLEAN WakeTimer,
377 IN LONG Period OPTIONAL,
378 OUT PBOOLEAN PreviousState OPTIONAL
379 );
380
381 NTSTATUS
382 NTAPI
383 NtSetUuidSeed(
384 IN PUCHAR UuidSeed
385 );
386
387 NTSTATUS
388 NTAPI
389 NtShutdownSystem(
390 IN SHUTDOWN_ACTION Action
391 );
392
393 NTSTATUS
394 NTAPI
395 NtWaitHighEventPair(
396 IN HANDLE EventPairHandle
397 );
398
399 NTSTATUS
400 NTAPI
401 NtWaitLowEventPair(
402 IN HANDLE EventPairHandle
403 );
404
405 NTSTATUS
406 NTAPI
407 NtTraceEvent(
408 IN ULONG TraceHandle,
409 IN ULONG Flags,
410 IN ULONG TraceHeaderLength,
411 IN PEVENT_TRACE_HEADER TraceHeader
412 );
413
414 NTSTATUS
415 NTAPI
416 ZwAddAtom(
417 IN PWSTR AtomName,
418 IN ULONG AtomNameLength,
419 IN OUT PRTL_ATOM Atom
420 );
421
422 #ifdef NTOS_MODE_USER
423 NTSTATUS
424 NTAPI
425 ZwCancelTimer(
426 IN HANDLE TimerHandle,
427 OUT PBOOLEAN CurrentState OPTIONAL
428 );
429 #endif
430
431 NTSTATUS
432 NTAPI
433 ZwClearEvent(
434 IN HANDLE EventHandle
435 );
436
437 NTSTATUS
438 NTAPI
439 ZwCreateEvent(
440 OUT PHANDLE EventHandle,
441 IN ACCESS_MASK DesiredAccess,
442 IN POBJECT_ATTRIBUTES ObjectAttributes,
443 IN EVENT_TYPE EventType,
444 IN BOOLEAN InitialState
445 );
446
447 NTSTATUS
448 NTAPI
449 ZwCreateEventPair(
450 OUT PHANDLE EventPairHandle,
451 IN ACCESS_MASK DesiredAccess,
452 IN POBJECT_ATTRIBUTES ObjectAttributes
453 );
454
455 NTSTATUS
456 NTAPI
457 ZwCreateMutant(
458 OUT PHANDLE MutantHandle,
459 IN ACCESS_MASK DesiredAccess,
460 IN POBJECT_ATTRIBUTES ObjectAttributes,
461 IN BOOLEAN InitialOwner
462 );
463
464 NTSTATUS
465 NTAPI
466 ZwCreateSemaphore(
467 OUT PHANDLE SemaphoreHandle,
468 IN ACCESS_MASK DesiredAccess,
469 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
470 IN LONG InitialCount,
471 IN LONG MaximumCount
472 );
473
474 #ifdef NTOS_MODE_USER
475 NTSTATUS
476 NTAPI
477 ZwCreateTimer(
478 OUT PHANDLE TimerHandle,
479 IN ACCESS_MASK DesiredAccess,
480 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
481 IN TIMER_TYPE TimerType
482 );
483 #endif
484
485 NTSTATUS
486 NTAPI
487 ZwDeleteAtom(
488 IN RTL_ATOM Atom
489 );
490
491 NTSTATUS
492 NTAPI
493 ZwDisplayString(
494 IN PUNICODE_STRING DisplayString
495 );
496
497 NTSTATUS
498 NTAPI
499 ZwFindAtom(
500 IN PWSTR AtomName,
501 IN ULONG AtomNameLength,
502 OUT PRTL_ATOM Atom OPTIONAL
503 );
504
505 NTSTATUS
506 NTAPI
507 ZwOpenEvent(
508 OUT PHANDLE EventHandle,
509 IN ACCESS_MASK DesiredAccess,
510 IN POBJECT_ATTRIBUTES ObjectAttributes
511 );
512
513 NTSTATUS
514 NTAPI
515 ZwOpenEventPair(
516 OUT PHANDLE EventPairHandle,
517 IN ACCESS_MASK DesiredAccess,
518 IN POBJECT_ATTRIBUTES ObjectAttributes
519 );
520
521 NTSTATUS
522 NTAPI
523 ZwOpenMutant(
524 OUT PHANDLE MutantHandle,
525 IN ACCESS_MASK DesiredAccess,
526 IN POBJECT_ATTRIBUTES ObjectAttributes
527 );
528
529 NTSTATUS
530 NTAPI
531 ZwOpenSemaphore(
532 OUT PHANDLE SemaphoreHandle,
533 IN ACCESS_MASK DesiredAcces,
534 IN POBJECT_ATTRIBUTES ObjectAttributes
535 );
536
537 #ifdef NTOS_MODE_USER
538 NTSTATUS
539 NTAPI
540 ZwOpenTimer(
541 OUT PHANDLE TimerHandle,
542 IN ACCESS_MASK DesiredAccess,
543 IN POBJECT_ATTRIBUTES ObjectAttributes
544 );
545 #endif
546
547 NTSTATUS
548 NTAPI
549 ZwPulseEvent(
550 IN HANDLE EventHandle,
551 IN PLONG PulseCount OPTIONAL
552 );
553
554 NTSTATUS
555 NTAPI
556 ZwQueryDefaultLocale(
557 IN BOOLEAN UserProfile,
558 OUT PLCID DefaultLocaleId
559 );
560
561 NTSTATUS
562 NTAPI
563 ZwQueryDefaultUILanguage(
564 PLANGID LanguageId
565 );
566
567 NTSTATUS
568 NTAPI
569 ZwQueryEvent(
570 IN HANDLE EventHandle,
571 IN EVENT_INFORMATION_CLASS EventInformationClass,
572 OUT PVOID EventInformation,
573 IN ULONG EventInformationLength,
574 OUT PULONG ReturnLength
575 );
576
577 NTSTATUS
578 NTAPI
579 ZwQueryInformationAtom(
580 IN RTL_ATOM Atom,
581 IN ATOM_INFORMATION_CLASS AtomInformationClass,
582 OUT PVOID AtomInformation,
583 IN ULONG AtomInformationLength,
584 OUT PULONG ReturnLength OPTIONAL
585 );
586
587 NTSTATUS
588 NTAPI
589 ZwQueryInstallUILanguage(
590 PLANGID LanguageId
591 );
592
593 NTSTATUS
594 NTAPI
595 ZwQueryMutant(
596 IN HANDLE MutantHandle,
597 IN MUTANT_INFORMATION_CLASS MutantInformationClass,
598 OUT PVOID MutantInformation,
599 IN ULONG Length,
600 OUT PULONG ResultLength
601 );
602
603 NTSTATUS
604 NTAPI
605 ZwQuerySemaphore(
606 IN HANDLE SemaphoreHandle,
607 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
608 OUT PVOID SemaphoreInformation,
609 IN ULONG Length,
610 OUT PULONG ReturnLength
611 );
612
613 NTSTATUS
614 NTAPI
615 ZwQuerySystemEnvironmentValue(
616 IN PUNICODE_STRING Name,
617 OUT PWSTR Value,
618 ULONG Length,
619 PULONG ReturnLength
620 );
621
622 NTSTATUS
623 NTAPI
624 ZwQuerySystemInformation(
625 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
626 OUT PVOID SystemInformation,
627 IN ULONG Length,
628 OUT PULONG ResultLength
629 );
630
631 NTSTATUS
632 NTAPI
633 ZwQueryTimer(
634 IN HANDLE TimerHandle,
635 IN TIMER_INFORMATION_CLASS TimerInformationClass,
636 OUT PVOID TimerInformation,
637 IN ULONG Length,
638 OUT PULONG ResultLength
639 );
640
641 NTSTATUS
642 NTAPI
643 ZwRaiseHardError(
644 IN NTSTATUS ErrorStatus,
645 IN ULONG NumberOfParameters,
646 IN ULONG UnicodeStringParameterMask,
647 IN PULONG_PTR Parameters,
648 IN ULONG ValidResponseOptions,
649 OUT PULONG Response
650 );
651
652 NTSTATUS
653 NTAPI
654 ZwReleaseMutant(
655 IN HANDLE MutantHandle,
656 IN PLONG ReleaseCount OPTIONAL
657 );
658
659 NTSTATUS
660 NTAPI
661 ZwReleaseSemaphore(
662 IN HANDLE SemaphoreHandle,
663 IN LONG ReleaseCount,
664 OUT PLONG PreviousCount
665 );
666
667 NTSTATUS
668 NTAPI
669 ZwResetEvent(
670 IN HANDLE EventHandle,
671 OUT PLONG NumberOfWaitingThreads OPTIONAL
672 );
673
674 NTSTATUS
675 NTAPI
676 ZwSetDefaultLocale(
677 IN BOOLEAN UserProfile,
678 IN LCID DefaultLocaleId
679 );
680
681 NTSTATUS
682 NTAPI
683 ZwSetDefaultUILanguage(
684 LANGID LanguageId
685 );
686
687 NTSTATUS
688 NTAPI
689 ZwSetDefaultHardErrorPort(
690 IN HANDLE PortHandle
691 );
692
693 NTSTATUS
694 NTAPI
695 ZwSetEvent(
696 IN HANDLE EventHandle,
697 OUT PLONG PreviousState OPTIONAL
698 );
699
700 NTSTATUS
701 NTAPI
702 ZwSetHighEventPair(
703 IN HANDLE EventPairHandle
704 );
705
706 NTSTATUS
707 NTAPI
708 ZwSetHighWaitLowEventPair(
709 IN HANDLE EventPairHandle
710 );
711
712 NTSTATUS
713 NTAPI
714 ZwSetLowEventPair(
715 HANDLE EventPair
716 );
717
718 NTSTATUS
719 NTAPI
720 ZwSetLowWaitHighEventPair(
721 HANDLE EventPair
722 );
723
724 NTSTATUS
725 NTAPI
726 ZwSetSystemEnvironmentValue(
727 IN PUNICODE_STRING VariableName,
728 IN PUNICODE_STRING Value
729 );
730
731 NTSTATUS
732 NTAPI
733 ZwSetSystemInformation(
734 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
735 IN PVOID SystemInformation,
736 IN ULONG SystemInformationLength
737 );
738
739 #ifdef NTOS_MODE_USER
740 NTSTATUS
741 NTAPI
742 ZwSetTimer(
743 IN HANDLE TimerHandle,
744 IN PLARGE_INTEGER DueTime,
745 IN PTIMER_APC_ROUTINE TimerApcRoutine,
746 IN PVOID TimerContext,
747 IN BOOLEAN WakeTimer,
748 IN LONG Period OPTIONAL,
749 OUT PBOOLEAN PreviousState OPTIONAL
750 );
751 #endif
752
753 NTSTATUS
754 NTAPI
755 ZwSetUuidSeed(
756 IN PUCHAR UuidSeed
757 );
758
759 NTSTATUS
760 NTAPI
761 ZwShutdownSystem(
762 IN SHUTDOWN_ACTION Action
763 );
764
765 NTSTATUS
766 NTAPI
767 ZwWaitHighEventPair(
768 IN HANDLE EventPairHandle
769 );
770
771 NTSTATUS
772 NTAPI
773 ZwWaitLowEventPair(
774 IN HANDLE EventPairHandle
775 );
776
777 NTSTATUS
778 NTAPI
779 ZwTraceEvent(
780 IN ULONG TraceHandle,
781 IN ULONG Flags,
782 IN ULONG TraceHeaderLength,
783 IN PEVENT_TRACE_HEADER TraceHeader
784 );
785 #endif