Process Hacker
ntkeapi.h
Go to the documentation of this file.
1 #ifndef _NTKEAPI_H
2 #define _NTKEAPI_H
3 
4 #if (PHNT_MODE != PHNT_MODE_KERNEL)
5 #define LOW_PRIORITY 0 // Lowest thread priority level
6 #define LOW_REALTIME_PRIORITY 16 // Lowest realtime priority level
7 #define HIGH_PRIORITY 31 // Highest thread priority level
8 #define MAXIMUM_PRIORITY 32 // Number of thread priority levels
9 #endif
10 
11 typedef enum _KTHREAD_STATE
12 {
25 
26 // private
27 typedef enum _KHETERO_CPU_POLICY
28 {
41 
42 #if (PHNT_MODE != PHNT_MODE_KERNEL)
43 
44 typedef enum _KWAIT_REASON
45 {
46  Executive,
47  FreePage,
48  PageIn,
49  PoolAllocation,
50  DelayExecution,
51  Suspended,
52  UserRequest,
53  WrExecutive,
54  WrFreePage,
55  WrPageIn,
56  WrPoolAllocation,
57  WrDelayExecution,
58  WrSuspended,
59  WrUserRequest,
60  WrEventPair,
61  WrQueue,
62  WrLpcReceive,
63  WrLpcReply,
64  WrVirtualMemory,
65  WrPageOut,
66  WrRendezvous,
67  WrKeyedEvent,
68  WrTerminated,
69  WrProcessInSwap,
70  WrCpuRateControl,
71  WrCalloutStack,
72  WrKernel,
73  WrResource,
74  WrPushLock,
75  WrMutex,
76  WrQuantumEnd,
77  WrDispatchInt,
78  WrPreempted,
79  WrYieldExecution,
80  WrFastMutex,
81  WrGuardedMutex,
82  WrRundown,
83  WrAlertByThreadId,
84  WrDeferredPreempt,
85  MaximumWaitReason
86 } KWAIT_REASON, *PKWAIT_REASON;
87 
88 typedef enum _KPROFILE_SOURCE
89 {
90  ProfileTime,
91  ProfileAlignmentFixup,
92  ProfileTotalIssues,
93  ProfilePipelineDry,
94  ProfileLoadInstructions,
95  ProfilePipelineFrozen,
96  ProfileBranchInstructions,
97  ProfileTotalNonissues,
98  ProfileDcacheMisses,
99  ProfileIcacheMisses,
100  ProfileCacheMisses,
101  ProfileBranchMispredictions,
102  ProfileStoreInstructions,
103  ProfileFpInstructions,
104  ProfileIntegerInstructions,
105  Profile2Issue,
106  Profile3Issue,
107  Profile4Issue,
108  ProfileSpecialInstructions,
109  ProfileTotalCycles,
110  ProfileIcacheIssues,
111  ProfileDcacheAccesses,
112  ProfileMemoryBarrierCycles,
113  ProfileLoadLinkedIssues,
114  ProfileMaximum
115 } KPROFILE_SOURCE;
116 
117 #endif
118 
119 #if (PHNT_MODE != PHNT_MODE_KERNEL)
120 
121 NTSYSCALLAPI
122 NTSTATUS
123 NTAPI
124 NtCallbackReturn(
125  _In_reads_bytes_opt_(OutputLength) PVOID OutputBuffer,
126  _In_ ULONG OutputLength,
127  _In_ NTSTATUS Status
128  );
129 
130 #if (PHNT_VERSION >= PHNT_VISTA)
131 NTSYSCALLAPI
132 VOID
133 NTAPI
134 NtFlushProcessWriteBuffers(
135  VOID
136  );
137 #endif
138 
139 NTSYSCALLAPI
140 NTSTATUS
141 NTAPI
142 NtQueryDebugFilterState(
143  _In_ ULONG ComponentId,
144  _In_ ULONG Level
145  );
146 
147 NTSYSCALLAPI
148 NTSTATUS
149 NTAPI
150 NtSetDebugFilterState(
151  _In_ ULONG ComponentId,
152  _In_ ULONG Level,
153  _In_ BOOLEAN State
154  );
155 
156 NTSYSCALLAPI
157 NTSTATUS
158 NTAPI
159 NtYieldExecution(
160  VOID
161  );
162 
163 #endif
164 
165 #endif