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