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