OLD | NEW |
| (Empty) |
1 /* | |
2 * $Id: ntextapi.h 1142 2011-10-05 18:45:49Z g.rodola $ | |
3 * | |
4 * Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. | |
5 * Use of this source code is governed by a BSD-style license that can be | |
6 * found in the LICENSE file. | |
7 * | |
8 */ | |
9 | |
10 typedef enum _KTHREAD_STATE | |
11 { | |
12 Initialized, | |
13 Ready, | |
14 Running, | |
15 Standby, | |
16 Terminated, | |
17 Waiting, | |
18 Transition, | |
19 DeferredReady, | |
20 GateWait, | |
21 MaximumThreadState | |
22 } KTHREAD_STATE, *PKTHREAD_STATE; | |
23 | |
24 typedef enum _KWAIT_REASON | |
25 { | |
26 Executive = 0, | |
27 FreePage = 1, | |
28 PageIn = 2, | |
29 PoolAllocation = 3, | |
30 DelayExecution = 4, | |
31 Suspended = 5, | |
32 UserRequest = 6, | |
33 WrExecutive = 7, | |
34 WrFreePage = 8, | |
35 WrPageIn = 9, | |
36 WrPoolAllocation = 10, | |
37 WrDelayExecution = 11, | |
38 WrSuspended = 12, | |
39 WrUserRequest = 13, | |
40 WrEventPair = 14, | |
41 WrQueue = 15, | |
42 WrLpcReceive = 16, | |
43 WrLpcReply = 17, | |
44 WrVirtualMemory = 18, | |
45 WrPageOut = 19, | |
46 WrRendezvous = 20, | |
47 Spare2 = 21, | |
48 Spare3 = 22, | |
49 Spare4 = 23, | |
50 Spare5 = 24, | |
51 WrCalloutStack = 25, | |
52 WrKernel = 26, | |
53 WrResource = 27, | |
54 WrPushLock = 28, | |
55 WrMutex = 29, | |
56 WrQuantumEnd = 30, | |
57 WrDispatchInt = 31, | |
58 WrPreempted = 32, | |
59 WrYieldExecution = 33, | |
60 WrFastMutex = 34, | |
61 WrGuardedMutex = 35, | |
62 WrRundown = 36, | |
63 MaximumWaitReason = 37 | |
64 } KWAIT_REASON, *PKWAIT_REASON; | |
65 | |
66 | |
67 typedef struct _CLIENT_ID | |
68 { | |
69 HANDLE UniqueProcess; | |
70 HANDLE UniqueThread; | |
71 } CLIENT_ID, *PCLIENT_ID; | |
72 | |
73 | |
74 typedef struct _UNICODE_STRING { | |
75 USHORT Length; | |
76 USHORT MaximumLength; | |
77 PWSTR Buffer; | |
78 } UNICODE_STRING, *PUNICODE_STRING; | |
79 | |
80 | |
81 typedef struct _SYSTEM_TIMEOFDAY_INFORMATION | |
82 { | |
83 LARGE_INTEGER BootTime; | |
84 LARGE_INTEGER CurrentTime; | |
85 LARGE_INTEGER TimeZoneBias; | |
86 ULONG TimeZoneId; | |
87 ULONG Reserved; | |
88 ULONGLONG BootTimeBias; | |
89 ULONGLONG SleepTimeBias; | |
90 } SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; | |
91 | |
92 typedef struct _SYSTEM_THREAD_INFORMATION | |
93 { | |
94 LARGE_INTEGER KernelTime; | |
95 LARGE_INTEGER UserTime; | |
96 LARGE_INTEGER CreateTime; | |
97 ULONG WaitTime; | |
98 PVOID StartAddress; | |
99 CLIENT_ID ClientId; | |
100 LONG Priority; | |
101 LONG BasePriority; | |
102 ULONG ContextSwitches; | |
103 ULONG ThreadState; | |
104 KWAIT_REASON WaitReason; | |
105 } SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; | |
106 | |
107 typedef struct _TEB *PTEB; | |
108 | |
109 // private | |
110 typedef struct _SYSTEM_EXTENDED_THREAD_INFORMATION | |
111 { | |
112 SYSTEM_THREAD_INFORMATION ThreadInfo; | |
113 PVOID StackBase; | |
114 PVOID StackLimit; | |
115 PVOID Win32StartAddress; | |
116 PTEB TebBase; | |
117 ULONG_PTR Reserved2; | |
118 ULONG_PTR Reserved3; | |
119 ULONG_PTR Reserved4; | |
120 } SYSTEM_EXTENDED_THREAD_INFORMATION, *PSYSTEM_EXTENDED_THREAD_INFORMATION; | |
121 | |
122 typedef struct _SYSTEM_PROCESS_INFORMATION | |
123 { | |
124 ULONG NextEntryOffset; | |
125 ULONG NumberOfThreads; | |
126 LARGE_INTEGER SpareLi1; | |
127 LARGE_INTEGER SpareLi2; | |
128 LARGE_INTEGER SpareLi3; | |
129 LARGE_INTEGER CreateTime; | |
130 LARGE_INTEGER UserTime; | |
131 LARGE_INTEGER KernelTime; | |
132 UNICODE_STRING ImageName; | |
133 LONG BasePriority; | |
134 HANDLE UniqueProcessId; | |
135 HANDLE InheritedFromUniqueProcessId; | |
136 ULONG HandleCount; | |
137 ULONG SessionId; | |
138 ULONG_PTR PageDirectoryBase; | |
139 SIZE_T PeakVirtualSize; | |
140 SIZE_T VirtualSize; | |
141 ULONG PageFaultCount; | |
142 SIZE_T PeakWorkingSetSize; | |
143 SIZE_T WorkingSetSize; | |
144 SIZE_T QuotaPeakPagedPoolUsage; | |
145 SIZE_T QuotaPagedPoolUsage; | |
146 SIZE_T QuotaPeakNonPagedPoolUsage; | |
147 SIZE_T QuotaNonPagedPoolUsage; | |
148 SIZE_T PagefileUsage; | |
149 SIZE_T PeakPagefileUsage; | |
150 SIZE_T PrivatePageCount; | |
151 LARGE_INTEGER ReadOperationCount; | |
152 LARGE_INTEGER WriteOperationCount; | |
153 LARGE_INTEGER OtherOperationCount; | |
154 LARGE_INTEGER ReadTransferCount; | |
155 LARGE_INTEGER WriteTransferCount; | |
156 LARGE_INTEGER OtherTransferCount; | |
157 SYSTEM_THREAD_INFORMATION Threads[1]; | |
158 } SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; | |
159 | |
160 | |
161 // structures and enums from winternl.h (not available under mingw) | |
162 typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { | |
163 LARGE_INTEGER IdleTime; | |
164 LARGE_INTEGER KernelTime; | |
165 LARGE_INTEGER UserTime; | |
166 LARGE_INTEGER Reserved1[2]; | |
167 ULONG Reserved2; | |
168 } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFOR
MATION; | |
169 | |
170 | |
171 typedef enum _SYSTEM_INFORMATION_CLASS { | |
172 SystemBasicInformation = 0, | |
173 SystemPerformanceInformation = 2, | |
174 SystemTimeOfDayInformation = 3, | |
175 SystemProcessInformation = 5, | |
176 SystemProcessorPerformanceInformation = 8, | |
177 SystemInterruptInformation = 23, | |
178 SystemExceptionInformation = 33, | |
179 SystemRegistryQuotaInformation = 37, | |
180 SystemLookasideInformation = 45 | |
181 } SYSTEM_INFORMATION_CLASS; | |
182 | |
183 | |
OLD | NEW |