1 use winapi
::shared
::ntdef
::{BOOLEAN, NTSTATUS, PVOID, ULONG}
;
2 pub const LOW_PRIORITY
: u32 = 0;
3 pub const LOW_REALTIME_PRIORITY
: u32 = 16;
4 pub const HIGH_PRIORITY
: u32 = 31;
5 pub const MAXIMUM_PRIORITY
: u32 = 32;
6 ENUM
!{enum KTHREAD_STATE
{
16 WaitingForProcessInSwap
= 9,
17 MaximumThreadState
= 10,
19 pub type PKTHREAD_STATE
= *mut KTHREAD_STATE
;
20 ENUM
!{enum KHETERO_CPU_POLICY
{
21 KHeteroCpuPolicyAll
= 0,
22 KHeteroCpuPolicyLarge
= 1,
23 KHeteroCpuPolicyLargeOrIdle
= 2,
24 KHeteroCpuPolicySmall
= 3,
25 KHeteroCpuPolicySmallOrIdle
= 4,
26 KHeteroCpuPolicyDynamic
= 5,
27 KHeteroCpuPolicyStaticMax
= 6,
28 KHeteroCpuPolicyBiasedSmall
= 7,
29 KHeteroCpuPolicyBiasedLarge
= 8,
30 KHeteroCpuPolicyDefault
= 9,
31 KHeteroCpuPolicyMax
= 10,
33 pub type PKHETERO_CPU_POLICY
= *mut KHETERO_CPU_POLICY
;
34 ENUM
!{enum KWAIT_REASON
{
45 WrPoolAllocation
= 10,
46 WrDelayExecution
= 11,
59 WrCpuRateControl
= 24,
68 WrYieldExecution
= 33,
72 WrAlertByThreadId
= 37,
73 WrDeferredPreempt
= 38,
74 MaximumWaitReason
= 39,
76 pub type PKWAIT_REASON
= *mut KWAIT_REASON
;
77 ENUM
!{enum KPROFILE_SOURCE
{
79 ProfileAlignmentFixup
= 1,
80 ProfileTotalIssues
= 2,
81 ProfilePipelineDry
= 3,
82 ProfileLoadInstructions
= 4,
83 ProfilePipelineFrozen
= 5,
84 ProfileBranchInstructions
= 6,
85 ProfileTotalNonissues
= 7,
86 ProfileDcacheMisses
= 8,
87 ProfileIcacheMisses
= 9,
88 ProfileCacheMisses
= 10,
89 ProfileBranchMispredictions
= 11,
90 ProfileStoreInstructions
= 12,
91 ProfileFpInstructions
= 13,
92 ProfileIntegerInstructions
= 14,
96 ProfileSpecialInstructions
= 18,
97 ProfileTotalCycles
= 19,
98 ProfileIcacheIssues
= 20,
99 ProfileDcacheAccesses
= 21,
100 ProfileMemoryBarrierCycles
= 22,
101 ProfileLoadLinkedIssues
= 23,
104 EXTERN
!{extern "system" {
110 fn NtFlushProcessWriteBuffers();
111 fn NtQueryDebugFilterState(
115 fn NtSetDebugFilterState(
120 fn NtYieldExecution() -> NTSTATUS
;