040daf78c554f49c2020addc333a08f592f170be
[reactos.git] / include / xdk / kefuncs.h
1 /******************************************************************************
2 * Kernel Functions *
3 ******************************************************************************/
4 $if (_NTDDK_)
5 NTKERNELAPI
6 VOID
7 FASTCALL
8 KeInvalidateRangeAllCaches(
9 IN PVOID BaseAddress,
10 IN ULONG Length);
11 $endif
12
13 $if (_WDMDDK_)
14 NTKERNELAPI
15 VOID
16 NTAPI
17 KeInitializeEvent(
18 OUT PRKEVENT Event,
19 IN EVENT_TYPE Type,
20 IN BOOLEAN State);
21
22 NTKERNELAPI
23 VOID
24 NTAPI
25 KeClearEvent(
26 IN OUT PRKEVENT Event);
27 $endif
28
29 #if (NTDDI_VERSION >= NTDDI_WIN2K)
30
31 $if (_NTDDK_)
32
33 NTKERNELAPI
34 VOID
35 NTAPI
36 KeSetImportanceDpc(
37 IN OUT PRKDPC Dpc,
38 IN KDPC_IMPORTANCE Importance);
39
40 NTKERNELAPI
41 LONG
42 NTAPI
43 KePulseEvent(
44 IN OUT PRKEVENT Event,
45 IN KPRIORITY Increment,
46 IN BOOLEAN Wait);
47
48 NTKERNELAPI
49 LONG
50 NTAPI
51 KeSetBasePriorityThread(
52 IN OUT PRKTHREAD Thread,
53 IN LONG Increment);
54
55 NTKERNELAPI
56 VOID
57 NTAPI
58 KeEnterCriticalRegion(VOID);
59
60 NTKERNELAPI
61 VOID
62 NTAPI
63 KeLeaveCriticalRegion(VOID);
64
65 NTKERNELAPI
66 DECLSPEC_NORETURN
67 VOID
68 NTAPI
69 KeBugCheck(
70 IN ULONG BugCheckCode);
71
72 $endif
73
74 $if (_WDMDDK_)
75
76 #if defined(_NTDDK_) || defined(_NTIFS_)
77 NTKERNELAPI
78 VOID
79 NTAPI
80 ProbeForRead(
81 IN CONST VOID *Address, /* CONST is added */
82 IN SIZE_T Length,
83 IN ULONG Alignment);
84 #endif /* defined(_NTDDK_) || defined(_NTIFS_) */
85
86 NTKERNELAPI
87 VOID
88 NTAPI
89 ProbeForWrite(
90 IN PVOID Address,
91 IN SIZE_T Length,
92 IN ULONG Alignment);
93
94 $endif
95
96 #if defined(SINGLE_GROUP_LEGACY_API)
97
98 $if (_WDMDDK_)
99 NTKERNELAPI
100 VOID
101 NTAPI
102 KeRevertToUserAffinityThread(VOID);
103
104 NTKERNELAPI
105 VOID
106 NTAPI
107 KeSetSystemAffinityThread(
108 IN KAFFINITY Affinity);
109
110 NTKERNELAPI
111 VOID
112 NTAPI
113 KeSetTargetProcessorDpc(
114 IN OUT PRKDPC Dpc,
115 IN CCHAR Number);
116
117 NTKERNELAPI
118 KAFFINITY
119 NTAPI
120 KeQueryActiveProcessors(VOID);
121 $endif
122
123 $if (_NTDDK_)
124 NTKERNELAPI
125 VOID
126 NTAPI
127 KeSetTargetProcessorDpc(
128 IN OUT PRKDPC Dpc,
129 IN CCHAR Number);
130
131 NTKERNELAPI
132 KAFFINITY
133 NTAPI
134 KeQueryActiveProcessors(VOID);
135 $endif
136
137 #endif /* defined(SINGLE_GROUP_LEGACY_API) */
138
139 $if (_WDMDDK_)
140 #if !defined(_M_AMD64)
141
142 NTKERNELAPI
143 ULONGLONG
144 NTAPI
145 KeQueryInterruptTime(VOID);
146
147 NTKERNELAPI
148 VOID
149 NTAPI
150 KeQuerySystemTime(
151 OUT PLARGE_INTEGER CurrentTime);
152
153 #endif /* !_M_AMD64 */
154
155 #if defined(_X86_) && (defined(_WDM_INCLUDED_) || defined(WIN9X_COMPAT_SPINLOCK))
156 NTKERNELAPI
157 VOID
158 NTAPI
159 KeInitializeSpinLock(
160 IN PKSPIN_LOCK SpinLock);
161 #else
162 FORCEINLINE
163 VOID
164 KeInitializeSpinLock(IN PKSPIN_LOCK SpinLock)
165 {
166 /* Clear the lock */
167 *SpinLock = 0;
168 }
169 #endif
170
171 NTKERNELAPI
172 DECLSPEC_NORETURN
173 VOID
174 NTAPI
175 KeBugCheckEx(
176 IN ULONG BugCheckCode,
177 IN ULONG_PTR BugCheckParameter1,
178 IN ULONG_PTR BugCheckParameter2,
179 IN ULONG_PTR BugCheckParameter3,
180 IN ULONG_PTR BugCheckParameter4);
181
182 NTKERNELAPI
183 BOOLEAN
184 NTAPI
185 KeCancelTimer(
186 IN OUT PKTIMER);
187
188 NTKERNELAPI
189 NTSTATUS
190 NTAPI
191 KeDelayExecutionThread(
192 IN KPROCESSOR_MODE WaitMode,
193 IN BOOLEAN Alertable,
194 IN PLARGE_INTEGER Interval);
195
196 NTKERNELAPI
197 BOOLEAN
198 NTAPI
199 KeDeregisterBugCheckCallback(
200 IN OUT PKBUGCHECK_CALLBACK_RECORD CallbackRecord);
201
202 NTKERNELAPI
203 VOID
204 NTAPI
205 KeEnterCriticalRegion(VOID);
206
207 NTKERNELAPI
208 VOID
209 NTAPI
210 KeInitializeDeviceQueue(
211 OUT PKDEVICE_QUEUE DeviceQueue);
212
213 NTKERNELAPI
214 VOID
215 NTAPI
216 KeInitializeDpc(
217 OUT PRKDPC Dpc,
218 IN PKDEFERRED_ROUTINE DeferredRoutine,
219 IN PVOID DeferredContext OPTIONAL);
220
221 NTKERNELAPI
222 VOID
223 NTAPI
224 KeInitializeMutex(
225 OUT PRKMUTEX Mutex,
226 IN ULONG Level);
227
228 NTKERNELAPI
229 VOID
230 NTAPI
231 KeInitializeSemaphore(
232 OUT PRKSEMAPHORE Semaphore,
233 IN LONG Count,
234 IN LONG Limit);
235
236 NTKERNELAPI
237 VOID
238 NTAPI
239 KeInitializeTimer(
240 OUT PKTIMER Timer);
241
242 NTKERNELAPI
243 VOID
244 NTAPI
245 KeInitializeTimerEx(
246 OUT PKTIMER Timer,
247 IN TIMER_TYPE Type);
248
249 NTKERNELAPI
250 BOOLEAN
251 NTAPI
252 KeInsertByKeyDeviceQueue(
253 IN OUT PKDEVICE_QUEUE DeviceQueue,
254 IN OUT PKDEVICE_QUEUE_ENTRY DeviceQueueEntry,
255 IN ULONG SortKey);
256
257 NTKERNELAPI
258 BOOLEAN
259 NTAPI
260 KeInsertDeviceQueue(
261 IN OUT PKDEVICE_QUEUE DeviceQueue,
262 IN OUT PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
263
264 NTKERNELAPI
265 BOOLEAN
266 NTAPI
267 KeInsertQueueDpc(
268 IN OUT PRKDPC Dpc,
269 IN PVOID SystemArgument1 OPTIONAL,
270 IN PVOID SystemArgument2 OPTIONAL);
271
272 NTKERNELAPI
273 VOID
274 NTAPI
275 KeLeaveCriticalRegion(VOID);
276
277 NTHALAPI
278 LARGE_INTEGER
279 NTAPI
280 KeQueryPerformanceCounter(
281 OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL);
282
283 NTKERNELAPI
284 KPRIORITY
285 NTAPI
286 KeQueryPriorityThread(
287 IN PRKTHREAD Thread);
288
289 NTKERNELAPI
290 ULONG
291 NTAPI
292 KeQueryTimeIncrement(VOID);
293
294 NTKERNELAPI
295 LONG
296 NTAPI
297 KeReadStateEvent(
298 IN PRKEVENT Event);
299
300 NTKERNELAPI
301 LONG
302 NTAPI
303 KeReadStateMutex(
304 IN PRKMUTEX Mutex);
305
306 NTKERNELAPI
307 LONG
308 NTAPI
309 KeReadStateSemaphore(
310 IN PRKSEMAPHORE Semaphore);
311
312 NTKERNELAPI
313 BOOLEAN
314 NTAPI
315 KeReadStateTimer(
316 IN PKTIMER Timer);
317
318 NTKERNELAPI
319 BOOLEAN
320 NTAPI
321 KeRegisterBugCheckCallback(
322 OUT PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
323 IN PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine,
324 IN PVOID Buffer,
325 IN ULONG Length,
326 IN PUCHAR Component);
327
328 NTKERNELAPI
329 LONG
330 NTAPI
331 KeReleaseMutex(
332 IN OUT PRKMUTEX Mutex,
333 IN BOOLEAN Wait);
334
335 NTKERNELAPI
336 LONG
337 NTAPI
338 KeReleaseSemaphore(
339 IN OUT PRKSEMAPHORE Semaphore,
340 IN KPRIORITY Increment,
341 IN LONG Adjustment,
342 IN BOOLEAN Wait);
343
344 NTKERNELAPI
345 PKDEVICE_QUEUE_ENTRY
346 NTAPI
347 KeRemoveByKeyDeviceQueue(
348 IN OUT PKDEVICE_QUEUE DeviceQueue,
349 IN ULONG SortKey);
350
351 NTKERNELAPI
352 PKDEVICE_QUEUE_ENTRY
353 NTAPI
354 KeRemoveDeviceQueue(
355 IN OUT PKDEVICE_QUEUE DeviceQueue);
356
357 NTKERNELAPI
358 BOOLEAN
359 NTAPI
360 KeRemoveEntryDeviceQueue(
361 IN OUT PKDEVICE_QUEUE DeviceQueue,
362 IN OUT PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
363
364 NTKERNELAPI
365 BOOLEAN
366 NTAPI
367 KeRemoveQueueDpc(
368 IN OUT PRKDPC Dpc);
369
370 NTKERNELAPI
371 LONG
372 NTAPI
373 KeResetEvent(
374 IN OUT PRKEVENT Event);
375
376 NTKERNELAPI
377 LONG
378 NTAPI
379 KeSetEvent(
380 IN OUT PRKEVENT Event,
381 IN KPRIORITY Increment,
382 IN BOOLEAN Wait);
383
384 NTKERNELAPI
385 VOID
386 NTAPI
387 KeSetImportanceDpc(
388 IN OUT PRKDPC Dpc,
389 IN KDPC_IMPORTANCE Importance);
390
391 NTKERNELAPI
392 KPRIORITY
393 NTAPI
394 KeSetPriorityThread(
395 IN OUT PKTHREAD Thread,
396 IN KPRIORITY Priority);
397
398 NTKERNELAPI
399 BOOLEAN
400 NTAPI
401 KeSetTimer(
402 IN OUT PKTIMER Timer,
403 IN LARGE_INTEGER DueTime,
404 IN PKDPC Dpc OPTIONAL);
405
406 NTKERNELAPI
407 BOOLEAN
408 NTAPI
409 KeSetTimerEx(
410 IN OUT PKTIMER Timer,
411 IN LARGE_INTEGER DueTime,
412 IN LONG Period OPTIONAL,
413 IN PKDPC Dpc OPTIONAL);
414
415 NTHALAPI
416 VOID
417 NTAPI
418 KeStallExecutionProcessor(
419 IN ULONG MicroSeconds);
420
421 NTKERNELAPI
422 BOOLEAN
423 NTAPI
424 KeSynchronizeExecution(
425 IN OUT PKINTERRUPT Interrupt,
426 IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
427 IN PVOID SynchronizeContext OPTIONAL);
428
429 NTKERNELAPI
430 NTSTATUS
431 NTAPI
432 KeWaitForMultipleObjects(
433 IN ULONG Count,
434 IN PVOID Object[],
435 IN WAIT_TYPE WaitType,
436 IN KWAIT_REASON WaitReason,
437 IN KPROCESSOR_MODE WaitMode,
438 IN BOOLEAN Alertable,
439 IN PLARGE_INTEGER Timeout OPTIONAL,
440 OUT PKWAIT_BLOCK WaitBlockArray OPTIONAL);
441
442 #define KeWaitForMutexObject KeWaitForSingleObject
443
444 NTKERNELAPI
445 NTSTATUS
446 NTAPI
447 KeWaitForSingleObject(
448 IN PVOID Object,
449 IN KWAIT_REASON WaitReason,
450 IN KPROCESSOR_MODE WaitMode,
451 IN BOOLEAN Alertable,
452 IN PLARGE_INTEGER Timeout OPTIONAL);
453 $endif
454
455 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
456
457 #if (NTDDI_VERSION >= NTDDI_WINXP)
458 $if (_NTDDK_)
459 NTKERNELAPI
460 BOOLEAN
461 NTAPI
462 KeAreApcsDisabled(VOID);
463 $endif
464
465 $if (_WDMDDK_)
466 _DECL_HAL_KE_IMPORT
467 VOID
468 FASTCALL
469 KeAcquireInStackQueuedSpinLock(
470 IN OUT PKSPIN_LOCK SpinLock,
471 OUT PKLOCK_QUEUE_HANDLE LockHandle);
472
473 NTKERNELAPI
474 VOID
475 FASTCALL
476 KeAcquireInStackQueuedSpinLockAtDpcLevel(
477 IN OUT PKSPIN_LOCK SpinLock,
478 OUT PKLOCK_QUEUE_HANDLE LockHandle);
479
480 NTKERNELAPI
481 KIRQL
482 NTAPI
483 KeAcquireInterruptSpinLock(
484 IN OUT PKINTERRUPT Interrupt);
485
486 NTKERNELAPI
487 BOOLEAN
488 NTAPI
489 KeAreApcsDisabled(VOID);
490
491 NTKERNELAPI
492 ULONG
493 NTAPI
494 KeGetRecommendedSharedDataAlignment(VOID);
495
496 NTKERNELAPI
497 ULONG
498 NTAPI
499 KeQueryRuntimeThread(
500 IN PKTHREAD Thread,
501 OUT PULONG UserTime);
502
503 NTKERNELAPI
504 VOID
505 FASTCALL
506 KeReleaseInStackQueuedSpinLockFromDpcLevel(
507 IN PKLOCK_QUEUE_HANDLE LockHandle);
508
509 NTKERNELAPI
510 VOID
511 NTAPI
512 KeReleaseInterruptSpinLock(
513 IN OUT PKINTERRUPT Interrupt,
514 IN KIRQL OldIrql);
515
516 NTKERNELAPI
517 PKDEVICE_QUEUE_ENTRY
518 NTAPI
519 KeRemoveByKeyDeviceQueueIfBusy(
520 IN OUT PKDEVICE_QUEUE DeviceQueue,
521 IN ULONG SortKey);
522
523 _DECL_HAL_KE_IMPORT
524 VOID
525 FASTCALL
526 KeReleaseInStackQueuedSpinLock(
527 IN PKLOCK_QUEUE_HANDLE LockHandle);
528 $endif
529
530 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
531
532 $if (_WDMDDK_)
533 #if (NTDDI_VERSION >= NTDDI_WINXPSP1)
534
535 NTKERNELAPI
536 BOOLEAN
537 NTAPI
538 KeDeregisterBugCheckReasonCallback(
539 IN OUT PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord);
540
541 NTKERNELAPI
542 BOOLEAN
543 NTAPI
544 KeRegisterBugCheckReasonCallback(
545 OUT PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord,
546 IN PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine,
547 IN KBUGCHECK_CALLBACK_REASON Reason,
548 IN PUCHAR Component);
549
550 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP1) */
551
552 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
553 NTKERNELAPI
554 VOID
555 NTAPI
556 KeFlushQueuedDpcs(VOID);
557 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP2) */
558 $endif
559
560 #if (NTDDI_VERSION >= NTDDI_WS03)
561 $if (_NTDDK_)
562 NTKERNELAPI
563 BOOLEAN
564 NTAPI
565 KeInvalidateAllCaches(VOID);
566 $endif
567
568 $if (_WDMDDK_)
569 NTKERNELAPI
570 PVOID
571 NTAPI
572 KeRegisterNmiCallback(
573 IN PNMI_CALLBACK CallbackRoutine,
574 IN PVOID Context OPTIONAL);
575
576 NTKERNELAPI
577 NTSTATUS
578 NTAPI
579 KeDeregisterNmiCallback(
580 IN PVOID Handle);
581
582 NTKERNELAPI
583 VOID
584 NTAPI
585 KeInitializeThreadedDpc(
586 OUT PRKDPC Dpc,
587 IN PKDEFERRED_ROUTINE DeferredRoutine,
588 IN PVOID DeferredContext OPTIONAL);
589
590 NTKERNELAPI
591 ULONG_PTR
592 NTAPI
593 KeIpiGenericCall(
594 IN PKIPI_BROADCAST_WORKER BroadcastFunction,
595 IN ULONG_PTR Context);
596
597 NTKERNELAPI
598 KIRQL
599 FASTCALL
600 KeAcquireSpinLockForDpc(
601 IN OUT PKSPIN_LOCK SpinLock);
602
603 NTKERNELAPI
604 VOID
605 FASTCALL
606 KeReleaseSpinLockForDpc(
607 IN OUT PKSPIN_LOCK SpinLock,
608 IN KIRQL OldIrql);
609
610 NTKERNELAPI
611 BOOLEAN
612 FASTCALL
613 KeTestSpinLock(
614 IN PKSPIN_LOCK SpinLock);
615 $endif
616
617 #endif /* (NTDDI_VERSION >= NTDDI_WS03) */
618
619 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
620 $if (_NTDDK_)
621 NTKERNELAPI
622 NTSTATUS
623 NTAPI
624 KeExpandKernelStackAndCallout(
625 IN PEXPAND_STACK_CALLOUT Callout,
626 IN PVOID Parameter OPTIONAL,
627 IN SIZE_T Size);
628
629 NTKERNELAPI
630 VOID
631 NTAPI
632 KeEnterGuardedRegion(VOID);
633
634 NTKERNELAPI
635 VOID
636 NTAPI
637 KeLeaveGuardedRegion(VOID);
638 $endif
639
640 $if (_WDMDDK_)
641 NTKERNELAPI
642 BOOLEAN
643 FASTCALL
644 KeTryToAcquireSpinLockAtDpcLevel(
645 IN OUT PKSPIN_LOCK SpinLock);
646
647 NTKERNELAPI
648 BOOLEAN
649 NTAPI
650 KeAreAllApcsDisabled(VOID);
651
652 NTKERNELAPI
653 VOID
654 FASTCALL
655 KeAcquireGuardedMutex(
656 IN OUT PKGUARDED_MUTEX GuardedMutex);
657
658 NTKERNELAPI
659 VOID
660 FASTCALL
661 KeAcquireGuardedMutexUnsafe(
662 IN OUT PKGUARDED_MUTEX GuardedMutex);
663
664 NTKERNELAPI
665 VOID
666 NTAPI
667 KeEnterGuardedRegion(VOID);
668
669 NTKERNELAPI
670 VOID
671 NTAPI
672 KeLeaveGuardedRegion(VOID);
673
674 NTKERNELAPI
675 VOID
676 FASTCALL
677 KeInitializeGuardedMutex(
678 OUT PKGUARDED_MUTEX GuardedMutex);
679
680 NTKERNELAPI
681 VOID
682 FASTCALL
683 KeReleaseGuardedMutexUnsafe(
684 IN OUT PKGUARDED_MUTEX GuardedMutex);
685
686 NTKERNELAPI
687 VOID
688 FASTCALL
689 KeReleaseGuardedMutex(
690 IN OUT PKGUARDED_MUTEX GuardedMutex);
691
692 NTKERNELAPI
693 BOOLEAN
694 FASTCALL
695 KeTryToAcquireGuardedMutex(
696 IN OUT PKGUARDED_MUTEX GuardedMutex);
697 $endif
698
699 #endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
700
701 #if (NTDDI_VERSION >= NTDDI_VISTA)
702 $if (_WDMDDK_)
703 NTKERNELAPI
704 VOID
705 FASTCALL
706 KeAcquireInStackQueuedSpinLockForDpc(
707 IN OUT PKSPIN_LOCK SpinLock,
708 OUT PKLOCK_QUEUE_HANDLE LockHandle);
709
710 NTKERNELAPI
711 VOID
712 FASTCALL
713 KeReleaseInStackQueuedSpinLockForDpc(
714 IN PKLOCK_QUEUE_HANDLE LockHandle);
715
716 NTKERNELAPI
717 NTSTATUS
718 NTAPI
719 KeQueryDpcWatchdogInformation(
720 OUT PKDPC_WATCHDOG_INFORMATION WatchdogInformation);
721 $endif
722
723 #if defined(SINGLE_GROUP_LEGACY_API)
724 $if (_NTDDK_)
725 NTKERNELAPI
726 ULONG
727 NTAPI
728 KeQueryActiveProcessorCount(
729 OUT PKAFFINITY ActiveProcessors OPTIONAL);
730
731 NTKERNELAPI
732 ULONG
733 NTAPI
734 KeQueryMaximumProcessorCount(VOID);
735 $endif
736
737 $if (_WDMDDK_)
738 NTKERNELAPI
739 KAFFINITY
740 NTAPI
741 KeSetSystemAffinityThreadEx(
742 IN KAFFINITY Affinity);
743
744 NTKERNELAPI
745 VOID
746 NTAPI
747 KeRevertToUserAffinityThreadEx(
748 IN KAFFINITY Affinity);
749
750 NTKERNELAPI
751 ULONG
752 NTAPI
753 KeQueryActiveProcessorCount(
754 OUT PKAFFINITY ActiveProcessors OPTIONAL);
755
756 NTKERNELAPI
757 ULONG
758 NTAPI
759 KeQueryMaximumProcessorCount(VOID);
760 $endif
761 #endif
762
763 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
764
765 $if (_WDMDDK_)
766 #if (NTDDI_VERSION >= NTDDI_WS08)
767
768 PVOID
769 KeRegisterProcessorChangeCallback(
770 IN PPROCESSOR_CALLBACK_FUNCTION CallbackFunction,
771 IN PVOID CallbackContext OPTIONAL,
772 IN ULONG Flags);
773
774 VOID
775 KeDeregisterProcessorChangeCallback(
776 IN PVOID CallbackHandle);
777
778 #endif /* (NTDDI_VERSION >= NTDDI_WS08) */
779 $endif
780
781 #if (NTDDI_VERSION >= NTDDI_WIN7)
782
783 $if (_NTDDK_)
784 NTKERNELAPI
785 ULONG
786 NTAPI
787 KeQueryActiveProcessorCountEx(
788 IN USHORT GroupNumber);
789
790 NTKERNELAPI
791 ULONG
792 NTAPI
793 KeQueryMaximumProcessorCountEx(
794 IN USHORT GroupNumber);
795
796 NTKERNELAPI
797 USHORT
798 NTAPI
799 KeQueryActiveGroupCount(VOID);
800
801 NTKERNELAPI
802 USHORT
803 NTAPI
804 KeQueryMaximumGroupCount(VOID);
805
806 NTKERNELAPI
807 KAFFINITY
808 NTAPI
809 KeQueryGroupAffinity(
810 IN USHORT GroupNumber);
811
812 NTKERNELAPI
813 ULONG
814 NTAPI
815 KeGetCurrentProcessorNumberEx(
816 OUT PPROCESSOR_NUMBER ProcNumber OPTIONAL);
817
818 NTKERNELAPI
819 VOID
820 NTAPI
821 KeQueryNodeActiveAffinity(
822 IN USHORT NodeNumber,
823 OUT PGROUP_AFFINITY Affinity OPTIONAL,
824 OUT PUSHORT Count OPTIONAL);
825
826 NTKERNELAPI
827 USHORT
828 NTAPI
829 KeQueryNodeMaximumProcessorCount(
830 IN USHORT NodeNumber);
831
832 NTKERNELAPI
833 USHORT
834 NTAPI
835 KeQueryHighestNodeNumber(VOID);
836
837 NTKERNELAPI
838 USHORT
839 NTAPI
840 KeGetCurrentNodeNumber(VOID);
841
842 NTKERNELAPI
843 NTSTATUS
844 NTAPI
845 KeQueryLogicalProcessorRelationship(
846 IN PPROCESSOR_NUMBER ProcessorNumber OPTIONAL,
847 IN LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType,
848 OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information OPTIONAL,
849 IN OUT PULONG Length);
850
851 NTKERNELAPI
852 NTSTATUS
853 NTAPI
854 KeSetHardwareCounterConfiguration(
855 IN PHARDWARE_COUNTER CounterArray,
856 IN ULONG Count);
857
858 NTKERNELAPI
859 NTSTATUS
860 NTAPI
861 KeQueryHardwareCounterConfiguration(
862 OUT PHARDWARE_COUNTER CounterArray,
863 IN ULONG MaximumCount,
864 OUT PULONG Count);
865 $endif
866
867 $if (_WDMDDK_)
868 ULONG64
869 NTAPI
870 KeQueryTotalCycleTimeProcess(
871 IN OUT PKPROCESS Process,
872 OUT PULONG64 CycleTimeStamp);
873
874 ULONG64
875 NTAPI
876 KeQueryTotalCycleTimeThread(
877 IN OUT PKTHREAD Thread,
878 OUT PULONG64 CycleTimeStamp);
879
880 NTKERNELAPI
881 NTSTATUS
882 NTAPI
883 KeSetTargetProcessorDpcEx(
884 IN OUT PKDPC Dpc,
885 IN PPROCESSOR_NUMBER ProcNumber);
886
887 NTKERNELAPI
888 VOID
889 NTAPI
890 KeSetSystemGroupAffinityThread(
891 IN PGROUP_AFFINITY Affinity,
892 OUT PGROUP_AFFINITY PreviousAffinity OPTIONAL);
893
894 NTKERNELAPI
895 VOID
896 NTAPI
897 KeRevertToUserGroupAffinityThread(
898 IN PGROUP_AFFINITY PreviousAffinity);
899
900 NTKERNELAPI
901 BOOLEAN
902 NTAPI
903 KeSetCoalescableTimer(
904 IN OUT PKTIMER Timer,
905 IN LARGE_INTEGER DueTime,
906 IN ULONG Period,
907 IN ULONG TolerableDelay,
908 IN PKDPC Dpc OPTIONAL);
909
910 NTKERNELAPI
911 ULONGLONG
912 NTAPI
913 KeQueryUnbiasedInterruptTime(VOID);
914
915 NTKERNELAPI
916 ULONG
917 NTAPI
918 KeQueryActiveProcessorCountEx(
919 IN USHORT GroupNumber);
920
921 NTKERNELAPI
922 ULONG
923 NTAPI
924 KeQueryMaximumProcessorCountEx(
925 IN USHORT GroupNumber);
926
927 NTKERNELAPI
928 USHORT
929 NTAPI
930 KeQueryActiveGroupCount(VOID);
931
932 NTKERNELAPI
933 USHORT
934 NTAPI
935 KeQueryMaximumGroupCount(VOID);
936
937 NTKERNELAPI
938 KAFFINITY
939 NTAPI
940 KeQueryGroupAffinity(
941 IN USHORT GroupNumber);
942
943 NTKERNELAPI
944 ULONG
945 NTAPI
946 KeGetCurrentProcessorNumberEx(
947 OUT PPROCESSOR_NUMBER ProcNumber OPTIONAL);
948
949 NTKERNELAPI
950 VOID
951 NTAPI
952 KeQueryNodeActiveAffinity(
953 IN USHORT NodeNumber,
954 OUT PGROUP_AFFINITY Affinity OPTIONAL,
955 OUT PUSHORT Count OPTIONAL);
956
957 NTKERNELAPI
958 USHORT
959 NTAPI
960 KeQueryNodeMaximumProcessorCount(
961 IN USHORT NodeNumber);
962
963 NTKERNELAPI
964 USHORT
965 NTAPI
966 KeQueryHighestNodeNumber(VOID);
967
968 NTKERNELAPI
969 USHORT
970 NTAPI
971 KeGetCurrentNodeNumber(VOID);
972
973 NTKERNELAPI
974 NTSTATUS
975 NTAPI
976 KeQueryLogicalProcessorRelationship(
977 IN PPROCESSOR_NUMBER ProcessorNumber OPTIONAL,
978 IN LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType,
979 OUT PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information OPTIONAL,
980 IN OUT PULONG Length);
981
982 NTKERNELAPI
983 NTSTATUS
984 NTAPI
985 KeSaveExtendedProcessorState(
986 IN ULONG64 Mask,
987 OUT PXSTATE_SAVE XStateSave);
988
989 NTKERNELAPI
990 VOID
991 NTAPI
992 KeRestoreExtendedProcessorState(
993 IN PXSTATE_SAVE XStateSave);
994
995 NTSTATUS
996 NTAPI
997 KeGetProcessorNumberFromIndex(
998 IN ULONG ProcIndex,
999 OUT PPROCESSOR_NUMBER ProcNumber);
1000
1001 ULONG
1002 NTAPI
1003 KeGetProcessorIndexFromNumber(
1004 IN PPROCESSOR_NUMBER ProcNumber);
1005 $endif
1006
1007 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
1008
1009 $if (_WDMDDK_)
1010 #if !defined(_IA64_)
1011 NTHALAPI
1012 VOID
1013 NTAPI
1014 KeFlushWriteBuffer(VOID);
1015 #endif
1016
1017 /* VOID
1018 * KeInitializeCallbackRecord(
1019 * IN PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
1020 */
1021 #define KeInitializeCallbackRecord(CallbackRecord) \
1022 CallbackRecord->State = BufferEmpty;
1023
1024 #if DBG
1025
1026 #if (NTDDI_VERSION >= NTDDI_VISTA)
1027 #define PAGED_ASSERT( exp ) NT_ASSERT( exp )
1028 #else
1029 #define PAGED_ASSERT( exp ) ASSERT( exp )
1030 #endif
1031
1032 #define PAGED_CODE() { \
1033 if (KeGetCurrentIrql() > APC_LEVEL) { \
1034 KdPrint( ("NTDDK: Pageable code called at IRQL > APC_LEVEL (%d)\n", KeGetCurrentIrql() )); \
1035 PAGED_ASSERT(FALSE); \
1036 } \
1037 }
1038
1039 #else
1040
1041 #define PAGED_CODE()
1042
1043 #endif /* DBG */
1044
1045 #define PAGED_CODE_LOCKED() NOP_FUNCTION;
1046 $endif
1047