ReactOS  0.4.15-dev-5112-g22d8c0f
ketypes.h
Go to the documentation of this file.
1 /*++ NDK Version: 0098
2 
3 Copyright (c) Alex Ionescu. All rights reserved.
4 
5 Header Name:
6 
7  ketypes.h
8 
9 Abstract:
10 
11  Type definitions for the Kernel services.
12 
13 Author:
14 
15  Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16 
17 --*/
18 
19 #ifndef _KETYPES_H
20 #define _KETYPES_H
21 
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #ifndef NTOS_MODE_USER
27 #include <haltypes.h>
28 #include <potypes.h>
29 #include <ifssupp.h>
30 #endif
31 
32 //
33 // A system call ID is formatted as such:
34 // .________________________________________________________________.
35 // | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
36 // |--------------|-------------------------------------------------|
37 // | TABLE NUMBER | TABLE OFFSET |
38 // \----------------------------------------------------------------/
39 //
40 // The table number is then used as an index into the service descriptor table.
41 #define TABLE_NUMBER_BITS 1
42 #define TABLE_OFFSET_BITS 12
43 
44 //
45 // There are 2 tables (kernel and shadow, used by Win32K)
46 //
47 #define NUMBER_SERVICE_TABLES 2
48 #define NTOS_SERVICE_INDEX 0
49 #define WIN32K_SERVICE_INDEX 1
50 
51 //
52 // NB. From assembly code, the table number must be computed as an offset into
53 // the service descriptor table.
54 //
55 // Each entry into the table is 16 bytes long on 32-bit architectures, and
56 // 32 bytes long on 64-bit architectures.
57 //
58 // Thus, Table Number 1 is offset 16 (0x10) on x86, and offset 32 (0x20) on
59 // x64.
60 //
61 #ifdef _WIN64
62 #define BITS_PER_ENTRY 5 // (1 << 5) = 32 bytes
63 #else
64 #define BITS_PER_ENTRY 4 // (1 << 4) = 16 bytes
65 #endif
66 
67 //
68 // We want the table number, but leave some extra bits to we can have the offset
69 // into the descriptor table.
70 //
71 #define SERVICE_TABLE_SHIFT (12 - BITS_PER_ENTRY)
72 
73 //
74 // Now the table number (as an offset) is corrupted with part of the table offset
75 // This mask will remove the extra unwanted bits, and give us the offset into the
76 // descriptor table proper.
77 //
78 #define SERVICE_TABLE_MASK (((1 << TABLE_NUMBER_BITS) - 1) << BITS_PER_ENTRY)
79 
80 //
81 // To get the table offset (ie: the service call number), just keep the 12 bits
82 //
83 #define SERVICE_NUMBER_MASK ((1 << TABLE_OFFSET_BITS) - 1)
84 
85 //
86 // We'll often need to check if this is a graphics call. This is done by comparing
87 // the table number offset with the known Win32K table number offset.
88 // This is usually index 1, so table number offset 0x10 (x86) or 0x20 (x64)
89 //
90 #define SERVICE_TABLE_TEST (WIN32K_SERVICE_INDEX << BITS_PER_ENTRY)
91 
92 //
93 // Context Record Flags
94 //
95 #define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
96 
97 //
98 // Maximum System Descriptor Table Entries
99 //
100 #define SSDT_MAX_ENTRIES 2
101 
102 //
103 // Processor Architectures
104 //
105 #define PROCESSOR_ARCHITECTURE_INTEL 0
106 #define PROCESSOR_ARCHITECTURE_MIPS 1
107 #define PROCESSOR_ARCHITECTURE_ALPHA 2
108 #define PROCESSOR_ARCHITECTURE_PPC 3
109 #define PROCESSOR_ARCHITECTURE_SHX 4
110 #define PROCESSOR_ARCHITECTURE_ARM 5
111 #define PROCESSOR_ARCHITECTURE_IA64 6
112 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
113 #define PROCESSOR_ARCHITECTURE_MSIL 8
114 #define PROCESSOR_ARCHITECTURE_AMD64 9
115 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
116 
117 //
118 // Object Type Mask for Kernel Dispatcher Objects
119 //
120 #define KOBJECT_TYPE_MASK 0x7F
121 #define KOBJECT_LOCK_BIT 0x80
122 
123 //
124 // Dispatcher Priority increments
125 //
126 #define THREAD_ALERT_INCREMENT 2
127 
128 //
129 // Physical memory offset of KUSER_SHARED_DATA
130 //
131 #define KI_USER_SHARED_DATA_PHYSICAL 0x41000
132 
133 //
134 // Quantum values and decrements
135 //
136 #define MAX_QUANTUM 0x7F
137 #define WAIT_QUANTUM_DECREMENT 1
138 #define CLOCK_QUANTUM_DECREMENT 3
139 
140 //
141 // Kernel Feature Bits
142 //
143 #define KF_V86_VIS 0x00000001
144 #define KF_RDTSC 0x00000002
145 #define KF_CR4 0x00000004
146 #define KF_CMOV 0x00000008
147 #define KF_GLOBAL_PAGE 0x00000010
148 #define KF_LARGE_PAGE 0x00000020
149 #define KF_MTRR 0x00000040
150 #define KF_CMPXCHG8B 0x00000080
151 #define KF_MMX 0x00000100
152 #define KF_WORKING_PTE 0x00000200
153 #define KF_PAT 0x00000400
154 #define KF_FXSR 0x00000800
155 #define KF_FAST_SYSCALL 0x00001000
156 #define KF_XMMI 0x00002000
157 #define KF_3DNOW 0x00004000
158 #define KF_AMDK6MTRR 0x00008000
159 #define KF_XMMI64 0x00010000
160 #define KF_DTS 0x00020000
161 #define KF_BRANCH 0x00020000 // from ksamd64.inc
162 #define KF_SSE3 0x00080000
163 #define KF_CMPXCHG16B 0x00100000
164 #define KF_XSTATE 0x00800000 // from ks386.inc, ksamd64.inc
165 #define KF_NX_BIT 0x20000000
166 #define KF_NX_DISABLED 0x40000000
167 #define KF_NX_ENABLED 0x80000000
168 
169 #define KF_XSAVEOPT_BIT 15
170 #define KF_XSTATE_BIT 23
171 #define KF_RDWRFSGSBASE_BIT 28
172 
173 //
174 // Internal Exception Codes
175 //
176 #define KI_EXCEPTION_INTERNAL 0x10000000
177 #define KI_EXCEPTION_ACCESS_VIOLATION (KI_EXCEPTION_INTERNAL | 0x04)
178 
179 typedef struct _FIBER /* Field offsets: */
180 { /* i386 arm x64 */
181  PVOID FiberData; /* 0x000 0x000 0x000 */
182  struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;/* 0x004 0x004 0x008 */
183  PVOID StackBase; /* 0x008 0x008 0x010 */
184  PVOID StackLimit; /* 0x00C 0x00C 0x018 */
185  PVOID DeallocationStack; /* 0x010 0x010 0x020 */
186  CONTEXT FiberContext; /* 0x014 0x018 0x030 */
187 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
188  PVOID Wx86Tib; /* 0x2E0 0x1b8 0x500 */
190  PVOID FlsData; /* 0x2E8 0x1c0 0x510 */
191  ULONG GuaranteedStackBytes; /* 0x2EC 0x1c4 0x518 */
192  ULONG TebFlags; /* 0x2F0 0x1c8 0x51C */
193 #else
194  ULONG GuaranteedStackBytes; /* 0x2E0 */
195  PVOID FlsData; /* 0x2E4 */
197 #endif
198 } FIBER, *PFIBER;
199 
200 #ifndef NTOS_MODE_USER
201 //
202 // Number of dispatch codes supported by KINTERRUPT
203 //
204 #ifdef _M_AMD64
205 #define DISPATCH_LENGTH 4
206 #elif (NTDDI_VERSION >= NTDDI_LONGHORN)
207 #define DISPATCH_LENGTH 135
208 #else
209 #define DISPATCH_LENGTH 106
210 #endif
211 
212 #else // NTOS_MODE_USER
213 
214 //
215 // KPROCESSOR_MODE Type
216 //
217 typedef CCHAR KPROCESSOR_MODE;
218 
219 //
220 // Dereferencable pointer to KUSER_SHARED_DATA in User-Mode
221 //
222 #define SharedUserData ((KUSER_SHARED_DATA *)USER_SHARED_DATA)
223 
224 #ifdef _X86_
225 /* Macros for user-mode run-time checks of X86 system architecture */
226 
227 #ifndef IsNEC_98
228 #define IsNEC_98 (SharedUserData->AlternativeArchitecture == NEC98x86)
229 #endif
230 
231 #ifndef IsNotNEC_98
232 #define IsNotNEC_98 (SharedUserData->AlternativeArchitecture != NEC98x86)
233 #endif
234 
235 /* User-mode cannot override the architecture */
236 #ifndef SetNEC_98
237 #define SetNEC_98
238 #endif
239 
240 /* User-mode cannot override the architecture */
241 #ifndef SetNotNEC_98
242 #define SetNotNEC_98
243 #endif
244 
245 #else // !_X86_
246 /* Correctly define these run-time definitions for non X86 machines */
247 
248 #ifndef IsNEC_98
249 #define IsNEC_98 (FALSE)
250 #endif
251 
252 #ifndef IsNotNEC_98
253 #define IsNotNEC_98 (TRUE)
254 #endif
255 
256 #ifndef SetNEC_98
257 #define SetNEC_98
258 #endif
259 
260 #ifndef SetNotNEC_98
261 #define SetNotNEC_98
262 #endif
263 
264 #endif // _X86_
265 
266 //
267 // Maximum WOW64 Entries in KUSER_SHARED_DATA
268 //
269 #define MAX_WOW64_SHARED_ENTRIES 16
270 
271 //
272 // Maximum Processor Features supported in KUSER_SHARED_DATA
273 //
274 #define PROCESSOR_FEATURE_MAX 64
275 
276 //
277 // Event Types
278 //
279 typedef enum _EVENT_TYPE
280 {
283 } EVENT_TYPE;
284 
285 //
286 // Timer Types
287 //
288 typedef enum _TIMER_TYPE
289 {
292 } TIMER_TYPE;
293 
294 //
295 // Wait Types
296 //
297 typedef enum _WAIT_TYPE
298 {
299  WaitAll,
300  WaitAny
301 } WAIT_TYPE;
302 
303 //
304 // Processor Execution Modes
305 //
306 typedef enum _MODE
307 {
308  KernelMode,
309  UserMode,
311 } MODE;
312 
313 //
314 // Wait Reasons
315 //
316 typedef enum _KWAIT_REASON
317 {
318  Executive,
319  FreePage,
320  PageIn,
323  Suspended,
324  UserRequest,
325  WrExecutive,
326  WrFreePage,
327  WrPageIn,
330  WrSuspended,
332  WrEventPair,
333  WrQueue,
334  WrLpcReceive,
335  WrLpcReply,
337  WrPageOut,
338  WrRendezvous,
339  Spare2,
341  Spare4,
342  Spare5,
343  Spare6,
344  WrKernel,
345  WrResource,
346  WrPushLock,
347  WrMutex,
348  WrQuantumEnd,
350  WrPreempted,
353 } KWAIT_REASON;
354 
355 //
356 // Profiling Sources
357 //
358 typedef enum _KPROFILE_SOURCE
359 {
360  ProfileTime,
386 
387 //
388 // NT Product and Architecture Types
389 //
390 typedef enum _NT_PRODUCT_TYPE
391 {
392  NtProductWinNt = 1,
396 
398 {
400  NEC98x86,
403 
404 //
405 // Flags for NXSupportPolicy
406 //
407 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
408 #define NX_SUPPORT_POLICY_ALWAYSOFF 0
409 #define NX_SUPPORT_POLICY_ALWAYSON 1
410 #define NX_SUPPORT_POLICY_OPTIN 2
411 #define NX_SUPPORT_POLICY_OPTOUT 3
412 #endif
413 
414 #endif // NTOS_MODE_USER
415 
416 //
417 // Thread States
418 //
419 typedef enum _KTHREAD_STATE
420 {
429 #if (NTDDI_VERSION >= NTDDI_WS03)
431 #endif
433 
434 //
435 // Kernel Object Types
436 //
437 typedef enum _KOBJECTS
438 {
457  ApcObject = 18,
458  DpcObject = 19,
465 } KOBJECTS;
466 
467 //
468 // Adjust reasons
469 //
470 typedef enum _ADJUST_REASON
471 {
475 } ADJUST_REASON;
476 
477 //
478 // Continue Status
479 //
480 typedef enum _KCONTINUE_STATUS
481 {
487 
488 //
489 // Process States
490 //
491 typedef enum _KPROCESS_STATE
492 {
499 
500 //
501 // NtVdmControl Classes
502 //
503 typedef enum _VDMSERVICECLASS
504 {
521 
522 #ifdef NTOS_MODE_USER
523 
524 //
525 // APC Normal Routine
526 //
527 typedef VOID
529  _In_ PVOID NormalContext,
532 );
533 
534 //
535 // Timer Routine
536 //
537 typedef VOID
540  _In_ ULONG TimerLowValue,
541  _In_ LONG TimerHighValue
542 );
543 
544 //
545 // System Time Structure
546 //
547 typedef struct _KSYSTEM_TIME
548 {
549  ULONG LowPart;
550  LONG High1Time;
551  LONG High2Time;
553 
554 //
555 // Shared Kernel User Data
556 //
557 typedef struct _KUSER_SHARED_DATA
558 {
561  volatile KSYSTEM_TIME InterruptTime;
562  volatile KSYSTEM_TIME SystemTime;
563  volatile KSYSTEM_TIME TimeZoneBias;
566  WCHAR NtSystemRoot[260];
571  ULONG Reserved2[7];
579  volatile ULONG TimeSlip;
584 #if (NTDDI_VERSION >= NTDDI_WINXPSP2)
586 #endif
587  volatile ULONG ActiveConsoleId;
588  volatile ULONG DismountCount;
593  ULONG TraceLogging;
594  ULONG Fill0;
599  union {
600  volatile KSYSTEM_TIME TickCount;
601  volatile ULONG64 TickCountQuad;
602  };
603  ULONG Cookie;
604 #if (NTDDI_VERSION >= NTDDI_WS03)
607 #endif
608 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
610  ULONG HeapTracingPid[2];
611  ULONG CritSecTracingPid[2];
612  union
613  {
615  struct
616  {
621  ULONG SpareBits:28;
622  };
623  };
625  KAFFINITY ActiveProcessorAffinity;
626 #endif
628 
629 //
630 // VDM Structures
631 //
632 #include "pshpack1.h"
633 typedef struct _VdmVirtualIca
634 {
635  LONG ica_count[8];
636  LONG ica_int_line;
637  LONG ica_cpu_int;
638  USHORT ica_base;
639  USHORT ica_hipiri;
640  USHORT ica_mode;
641  UCHAR ica_master;
642  UCHAR ica_irr;
643  UCHAR ica_isr;
644  UCHAR ica_imr;
645  UCHAR ica_ssr;
646 } VDMVIRTUALICA, *PVDMVIRTUALICA;
647 #include "poppack.h"
648 
649 typedef struct _VdmIcaUserData
650 {
651  PVOID pIcaLock;
652  PVDMVIRTUALICA pIcaMaster;
653  PVDMVIRTUALICA pIcaSlave;
654  PULONG pDelayIrq;
655  PULONG pUndelayIrq;
656  PULONG pDelayIret;
657  PULONG pIretHooked;
658  PULONG pAddrIretBopTable;
659  PHANDLE phWowIdleEvent;
660  PLARGE_INTEGER pIcaTimeout;
661  PHANDLE phMainThreadSuspended;
662 } VDMICAUSERDATA, *PVDMICAUSERDATA;
663 
664 typedef struct _VDM_INITIALIZE_DATA
665 {
666  PVOID TrapcHandler;
667  PVDMICAUSERDATA IcaUserData;
668 } VDM_INITIALIZE_DATA, *PVDM_INITIALIZE_DATA;
669 
670 #else
671 
672 //
673 // System Thread Start Routine
674 //
675 typedef
676 VOID
679  PVOID StartContext
680 );
681 
682 #ifndef _NTSYSTEM_
683 typedef VOID
685  IN PVOID NormalContext OPTIONAL,
688 
689 typedef VOID
691  IN struct _KAPC *Apc);
692 
693 typedef VOID
695  IN struct _KAPC *Apc,
696  IN OUT PKNORMAL_ROUTINE *NormalRoutine OPTIONAL,
700 #endif
701 
702 //
703 // APC Environment Types
704 //
705 typedef enum _KAPC_ENVIRONMENT
706 {
712 
713 typedef struct _KTIMER_TABLE_ENTRY
714 {
715 #if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(_M_ARM) || defined(_M_AMD64)
717 #endif
721 
722 typedef struct _KTIMER_TABLE
723 {
727 
728 typedef struct _KDPC_LIST
729 {
733 
734 typedef struct _SYNCH_COUNTERS
735 {
783 
784 //
785 // PRCB DPC Data
786 //
787 typedef struct _KDPC_DATA
788 {
789 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
791 #else
792  LIST_ENTRY DpcListHead;
793 #endif
795 #if defined(_M_AMD64) || defined(_M_ARM)
796  volatile LONG DpcQueueDepth;
797 #else
799 #endif
801 #if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(_M_ARM)
803 #endif
805 
806 //
807 // Per-Processor Lookaside List
808 //
809 typedef struct _PP_LOOKASIDE_LIST
810 {
814 
815 //
816 // Architectural Types
817 //
818 #include <arch/ketypes.h>
819 
820 //
821 // Kernel Memory Node
822 //
823 typedef struct _KNODE
824 {
831  struct _flags {
833  UCHAR Fill : 7;
834  } Flags;
838 } KNODE, *PKNODE;
839 
840 //
841 // Structure for Get/SetContext APC
842 //
843 typedef struct _GETSETCONTEXT
844 {
850 
851 //
852 // Kernel Profile Object
853 //
854 typedef struct _KPROFILE
855 {
868 } KPROFILE, *PKPROFILE;
869 
870 //
871 // Kernel Interrupt Object
872 //
873 typedef struct _KINTERRUPT
874 {
879 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
882 #endif
896 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
898 #endif
901 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
903 #endif
904 #ifdef _M_AMD64
905  PKTRAP_FRAME TrapFrame;
906  PVOID Reserved;
907 #endif
909 } KINTERRUPT;
910 
911 //
912 // Kernel Event Pair Object
913 //
914 typedef struct _KEVENT_PAIR
915 {
921 
922 //
923 // Kernel No Execute Options
924 //
925 typedef struct _KEXECUTE_OPTIONS
926 {
935 
936 #if (NTDDI_VERSION >= NTDDI_WIN7)
938 {
940  struct
941  {
949  };
951 
952 typedef struct _COUNTER_READING
953 {
959 
960 typedef struct _KTHREAD_COUNTERS
961 {
963  struct _THREAD_PERFORMANCE_DATA* UserData;
970 #endif
971 
973 #if (NTDDI_VERSION >= NTDDI_WIN8)
974 typedef struct _RTL_RB_TREE
975 {
979 #endif
980 
981 #if (NTDDI_VERSION >= NTDDI_WINBLUE)
983 {
984  union
985  {
986  struct
987  {
988 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 6.4.9841.0
990 #else
991  ULONG_PTR Waiting : 1;
992 #endif
994  ULONG_PTR Reserved : (8 * sizeof(PVOID)) - 3; // previously Spare
996  };
998  };
999  union
1000  {
1002  struct
1003  {
1005 #ifdef _WIN64
1006  ULONG SessionPad;
1007 #endif
1008  };
1009  };
1011 
1012 typedef struct _KLOCK_ENTRY
1013 {
1014  union
1015  {
1018  };
1019 #if (NTDDI_VERSION >= NTDDI_WIN10)
1020  union
1021  {
1023  struct
1024  {
1026  union
1027  {
1029  struct
1030  {
1033  };
1034  };
1035  union
1036  {
1039  };
1040  union
1041  {
1043  struct
1044  {
1047  UCHAR IoQoSWaiter : 1; // since TH2
1049  };
1050  };
1051  };
1052  struct
1053  {
1056  };
1057  };
1058 #ifdef _WIN64
1059  ULONG SpareFlags;
1060 #endif
1061 #else
1062  union
1063  {
1064  PVOID ThreadUnsafe;
1065  struct
1066  {
1067  volatile UCHAR HeadNodeByte;
1068  UCHAR Reserved1[2];
1069  volatile UCHAR AcquiredByte;
1070  };
1071  };
1072 #endif
1073 
1074  union
1075  {
1078  struct
1079  {
1080 #if (NTDDI_VERSION >= NTDDI_WIN10)
1082 #else
1083  volatile UCHAR WaitingAndBusyByte;
1084 #endif
1085  UCHAR Reserved[sizeof(PVOID) - 2];
1087  union
1088  {
1090  struct
1091  {
1093 #ifdef _WIN64
1094  ULONG SessionPad;
1095 #endif
1096  };
1097  };
1098  };
1099  };
1100  union
1101  {
1102  struct
1103  {
1106  };
1108  };
1110  union
1111  {
1112 #if _WIN64
1113  ULONG AllBoosts : 17;
1114 #else
1116 #endif
1117  struct
1118  {
1119  struct
1120  {
1123  };
1124  struct
1125  {
1129  };
1130  };
1131  };
1132 #if _WIN64
1133  ULONG SparePad;
1134 #endif
1136 
1137 #endif
1138 
1139 //
1140 // Kernel Thread (KTHREAD)
1141 //
1142 #if (NTDDI_VERSION < NTDDI_WIN8)
1143 
1144 typedef struct _KTHREAD
1145 {
1147 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1149 #ifndef _WIN64 // [
1151 #endif // ]
1153 #else // ][
1155 #endif // ]
1157  ULONG_PTR StackLimit; // FIXME: PVOID
1160 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1162  BOOLEAN Running;
1163  BOOLEAN Alerted[2];
1164  union
1165  {
1166  struct
1167  {
1168  ULONG KernelStackResident:1;
1171  ULONG WaitNext:1;
1173  ULONG Alertable:1;
1174  ULONG GdiFlushActive:1;
1180  ULONG TimerActive:1;
1181  ULONG Reserved:19;
1182  };
1183  LONG MiscFlags;
1184  };
1185 #endif // ]
1186  union
1187  {
1189  struct
1190  {
1191  UCHAR ApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1];
1192 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1193  SCHAR Priority;
1194 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1195  /* On x86, the following members "fall out" of the union */
1196  volatile ULONG NextProcessor;
1197  volatile ULONG DeferredProcessor;
1198 #else // ][
1199  /* On x86, the following members "fall out" of the union */
1200  volatile USHORT NextProcessor;
1201  volatile USHORT DeferredProcessor;
1202 #endif // ]
1203 #else // ][
1205  /* On x86, the following members "fall out" of the union */
1206  volatile UCHAR NextProcessor;
1207  volatile UCHAR DeferredProcessor;
1210 #endif // ]
1211  };
1212  };
1213  KSPIN_LOCK ApcQueueLock;
1214 #if !defined(_M_AMD64) && !defined(_M_ARM64) // [
1216  volatile UCHAR State;
1217  UCHAR NpxState;
1218  KIRQL WaitIrql;
1220 #endif // ]
1222 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1224 #else // ][
1225  union
1226  {
1229  };
1230 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1231  union
1232  {
1233  struct
1234  {
1235  ULONG KernelStackResident:1;
1238  ULONG WaitNext:1;
1240  ULONG Alertable:1;
1241  ULONG GdiFlushActive:1;
1242  ULONG Reserved:25;
1243  };
1244  LONG MiscFlags;
1245  };
1246 #else // ][
1248  BOOLEAN WaitNext;
1249 #endif // ]
1250  UCHAR WaitReason;
1251 #if (NTDDI_VERSION < NTDDI_LONGHORN)
1252  SCHAR Priority;
1254 #endif // ]
1255  volatile UCHAR SwapBusy;
1257 #endif // ]
1258  union
1259  {
1262  };
1263  PKQUEUE Queue;
1264 #if !defined(_M_AMD64) && !defined(_M_ARM64) // [
1265  ULONG WaitTime;
1266  union
1267  {
1268  struct
1269  {
1272  };
1274  };
1275 #endif // ]
1276  struct _TEB *Teb;
1277 
1278 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1279  KTIMER Timer;
1280 #else // ][
1281  union
1282  {
1283  KTIMER Timer;
1284  struct
1285  {
1286  UCHAR TimerFill[FIELD_OFFSET(KTIMER, Period) + sizeof(LONG)];
1287 #if !defined(_WIN64) // [
1288  };
1289  };
1290 #endif // ]
1291 #endif // ]
1292  union
1293  {
1294  struct
1295  {
1296  ULONG AutoAlignment:1;
1297  ULONG DisableBoost:1;
1298 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1299  ULONG EtwStackTraceApc1Inserted:1;
1300  ULONG EtwStackTraceApc2Inserted:1;
1301  ULONG CycleChargePending:1;
1302  ULONG CalloutActive:1;
1303  ULONG ApcQueueable:1;
1305  ULONG GuiThread:1;
1306  ULONG ReservedFlags:23;
1307 #else // ][
1308  LONG ReservedFlags:30;
1309 #endif // ]
1310  };
1311  LONG ThreadFlags;
1312  };
1313 #if defined(_WIN64) && (NTDDI_VERSION < NTDDI_WIN7) // [
1314  };
1315  };
1316 #endif // ]
1317 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1318 #if defined(_WIN64) // [
1319  ULONG Spare0;
1320 #else // ][
1322 #endif // ]
1323 #endif // ]
1324  union
1325  {
1327 #if (NTDDI_VERSION < NTDDI_WIN7) // [
1328  struct
1329  {
1330  UCHAR WaitBlockFill0[FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 32bit = 23, 64bit = 43
1331 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1332  UCHAR IdealProcessor;
1333 #else // ][
1334  BOOLEAN SystemAffinityActive;
1335 #endif // ]
1336  };
1337  struct
1338  {
1339  UCHAR WaitBlockFill1[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 47 / 91
1341  };
1342  struct
1343  {
1344  UCHAR WaitBlockFill2[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 71 / 139
1345  UCHAR ResourceIndex;
1346  };
1347  struct
1348  {
1349  UCHAR WaitBlockFill3[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 95 / 187
1350  UCHAR LargeStack;
1351  };
1352 #endif // ]
1353 #ifdef _WIN64 // [
1354  struct
1355  {
1356  UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1357  ULONG ContextSwitches;
1358  };
1359  struct
1360  {
1361  UCHAR WaitBlockFill5[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1362  UCHAR State;
1363  UCHAR NpxState;
1364  UCHAR WaitIrql;
1365  CHAR WaitMode;
1366  };
1367  struct
1368  {
1369  UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1370  ULONG WaitTime;
1371  };
1372 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1373  struct
1374  {
1375  UCHAR WaitBlockFill7[168];
1376  PVOID TebMappedLowVa;
1377  struct _UMS_CONTROL_BLOCK* Ucb;
1378  };
1379 #endif // ]
1380  struct
1381  {
1382 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1383  UCHAR WaitBlockFill8[188];
1384 #else // ][
1385  UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1386 #endif // ]
1387  union
1388  {
1389  struct
1390  {
1391  SHORT KernelApcDisable;
1392  SHORT SpecialApcDisable;
1393  };
1394  ULONG CombinedApcDisable;
1395  };
1396  };
1397 #endif // ]
1398  };
1399  LIST_ENTRY QueueListEntry;
1400  PKTRAP_FRAME TrapFrame;
1401 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1402  PVOID FirstArgument;
1403  union
1404  {
1405  PVOID CallbackStack;
1406  ULONG_PTR CallbackDepth;
1407  };
1408 #else // ][
1409  PVOID CallbackStack;
1410 #endif // ]
1411 #if (NTDDI_VERSION < NTDDI_LONGHORN) || ((NTDDI_VERSION < NTDDI_WIN7) && !defined(_WIN64)) // [
1413 #endif // ]
1414 #if (NTDDI_VERSION < NTDDI_LONGHORN) && defined(_WIN64) // [
1415  ULONG KernelLimit;
1416 #endif // ]
1417  UCHAR ApcStateIndex;
1418 #if (NTDDI_VERSION < NTDDI_LONGHORN) // [
1419  UCHAR IdealProcessor;
1420  BOOLEAN Preempted;
1421  BOOLEAN ProcessReadyQueue;
1422 #ifdef _WIN64 // [
1423  PVOID Win32kTable;
1424  ULONG Win32kLimit;
1425 #endif // ]
1426  BOOLEAN KernelStackResident;
1427 #endif // ]
1428  SCHAR BasePriority;
1429  SCHAR PriorityDecrement;
1430 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1431  BOOLEAN Preempted;
1432  UCHAR AdjustReason;
1433  CHAR AdjustIncrement;
1434 #if (NTDDI_VERSION >= NTDDI_WIN7)
1436 #else
1437  UCHAR Spare01;
1438 #endif
1439 #endif // ]
1440  CHAR Saturation;
1441 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1442  ULONG SystemCallNumber;
1443 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1444  ULONG FreezeCount;
1445 #else // ][
1446  ULONG Spare02;
1447 #endif // ]
1448 #endif // ]
1449 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1450  GROUP_AFFINITY UserAffinity;
1451  struct _KPROCESS *Process;
1453  ULONG IdealProcessor;
1454  ULONG UserIdealProcessor;
1455 #else // ][
1456  KAFFINITY UserAffinity;
1457  struct _KPROCESS *Process;
1459 #endif // ]
1460  PKAPC_STATE ApcStatePointer[2];
1461  union
1462  {
1463  KAPC_STATE SavedApcState;
1464  struct
1465  {
1466  UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1];
1467 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1468  UCHAR WaitReason;
1469 #else // ][
1470  CCHAR FreezeCount;
1471 #endif // ]
1472 #ifndef _WIN64 // [
1473  };
1474  };
1475 #endif // ]
1476  CCHAR SuspendCount;
1477 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1478  CCHAR Spare1;
1479 #else // ][
1480  UCHAR UserIdealProcessor;
1481 #endif // ]
1482 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1483 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1484  UCHAR Spare03;
1485 #else // ][
1486  UCHAR CalloutActive;
1487 #endif // ]
1488 #ifdef _WIN64 // [
1489  UCHAR CodePatchInProgress;
1490  };
1491  };
1492 #endif // ]
1493 #if defined(_M_IX86) // [
1494 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1495  UCHAR OtherPlatformFill;
1496 #else // ][
1497  UCHAR Iopl;
1498 #endif // ]
1499 #endif // ]
1500  PVOID Win32Thread;
1501  PVOID StackBase;
1502  union
1503  {
1504  KAPC SuspendApc;
1505  struct
1506  {
1507  UCHAR SuspendApcFill0[1];
1508 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1509  UCHAR ResourceIndex;
1510 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1511  CHAR Spare04;
1512 #else // ][
1513  SCHAR Quantum;
1514 #endif // ]
1515  };
1516  struct
1517  {
1518  UCHAR SuspendApcFill1[3];
1520  };
1521  struct
1522  {
1523  UCHAR SuspendApcFill2[4];
1524  ULONG KernelTime;
1525  };
1526  struct
1527  {
1528  UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)];
1529 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
1530  PKPRCB WaitPrcb;
1531 #else
1532  PVOID TlsArray;
1533 #endif
1534  };
1535  struct
1536  {
1537  UCHAR SuspendApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]; // 40 / 72
1538  PVOID LegoData;
1539  };
1540  struct
1541  {
1542  UCHAR SuspendApcFill5[FIELD_OFFSET(KAPC, Inserted) + 1]; // 47 / 83
1543 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1544  UCHAR LargeStack;
1545 #else // ][
1546  UCHAR PowerState;
1547 #endif // ]
1548 #ifdef _WIN64 // [
1549  ULONG UserTime;
1550 #endif // ]
1551  };
1552  };
1553 #ifndef _WIN64 // [
1554  ULONG UserTime;
1555 #endif // ]
1556  union
1557  {
1558  KSEMAPHORE SuspendSemaphore;
1559  struct
1560  {
1561  UCHAR SuspendSemaphorefill[FIELD_OFFSET(KSEMAPHORE, Limit) + 4]; // 20 / 28
1562 #ifdef _WIN64 // [
1563  ULONG SListFaultCount;
1564 #endif // ]
1565  };
1566  };
1567 #ifndef _WIN64 // [
1568  ULONG SListFaultCount;
1569 #endif // ]
1570  LIST_ENTRY ThreadListEntry;
1571 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1572  LIST_ENTRY MutantListHead;
1573 #endif // ]
1574  PVOID SListFaultAddress;
1575 #ifdef _M_AMD64 // [
1576  LONG64 ReadOperationCount;
1577  LONG64 WriteOperationCount;
1578  LONG64 OtherOperationCount;
1579  LONG64 ReadTransferCount;
1580  LONG64 WriteTransferCount;
1581  LONG64 OtherTransferCount;
1582 #endif // ]
1583 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1584  PKTHREAD_COUNTERS ThreadCounters;
1585  PXSTATE_SAVE XStateSave;
1586 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1587  PVOID MdlForLockedTeb;
1588 #endif // ]
1589 } KTHREAD;
1590 
1591 #else // not (NTDDI_VERSION < NTDDI_WIN8)
1592 
1593 #if defined(_WIN64) && (NTDDI_VERSION < 0x06032580) // since WIN 8.1 Update1 6.3.9600.16384
1594 #define NUMBER_OF_LOCK_ENTRIES 5
1595 #else
1596 #define NUMBER_OF_LOCK_ENTRIES 6
1597 #endif
1598 
1599 typedef struct _KTHREAD
1600 {
1605  volatile VOID *StackLimit;
1608  volatile ULONG64 CycleTime;
1609 #ifndef _WIN64
1612 #endif
1617  struct _KSCHEDULING_GROUP* SchedulingGroup;
1621 
1622  union
1623  {
1624  struct
1625  {
1626 #if (NTDDI_VERSION < NTDDI_WIN10)
1627  ULONG KernelStackResident : 1;
1628 #else
1630 #endif
1632 #if (NTDDI_VERSION < NTDDI_WIN10TH2)
1634 #endif
1639 #if (NTDDI_VERSION < NTDDI_WIN81)
1640  ULONG CodePatchInProgress : 1;
1641 #endif
1656  };
1658  };
1659 
1660  union
1661  {
1662  struct
1663  {
1678 #if (NTDDI_VERSION >= 0x060324D7) // since 6.3.9431.0
1679  ULONG TerminationApcRequest : 1;
1680 #endif
1681 #if (NTDDI_VERSION >= 0x06032580) // since 6.3.9600.16384
1682  ULONG AutoBoostEntriesExhausted : 1;
1683 #endif
1684 #if (NTDDI_VERSION >= 0x06032580) // since 6.3.9600.17031
1685  ULONG KernelStackResident : 1;
1686 #endif
1687 #if (NTDDI_VERSION >= NTDDI_WIN10)
1691 #endif
1693 #if (NTDDI_VERSION < NTDDI_WIN10)
1694  ULONG ReservedFlags : 10;
1695 #endif
1696  };
1698  };
1699 
1700 #if (NTDDI_VERSION >= NTDDI_WIN10)
1701  volatile UCHAR Tag;
1706 #else
1707  ULONG Spare0;
1708 #endif
1710 #ifdef _WIN64
1711  ULONG Spare1; // Win 10: Spare10
1712 #endif
1715 
1716  union
1717  {
1719  struct
1720  {
1721  UCHAR ApcStateFill[RTL_SIZEOF_THROUGH_FIELD(KAPC_STATE, UserApcPending)]; // 32bit: 23/0x17, 64bit: 43/0x2B
1724  };
1725  };
1726 
1727 #ifndef _WIN64
1729  volatile UCHAR State;
1730 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10074.0
1732 #else
1733  CHAR NpxState;
1734 #endif
1737 #endif
1738 
1741  union
1742  {
1745  };
1748 #if (NTDDI_VERSION >= NTDDI_WIN8 /* 0x060223F0 */) // since 6.2.9200.16384
1750 #endif
1752 
1753  union
1754  {
1756 #ifdef _WIN64
1757  struct
1758  {
1759  UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 20/0x14
1761  };
1762  struct
1763  {
1764  UCHAR WaitBlockFill5[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 68/0x44
1765  UCHAR State;
1766 #if (NTDDI_VERSION >= NTDDI_WIN10)
1767  CHAR Spare13;
1768 #else
1769  CHAR NpxState;
1770 #endif
1771  UCHAR WaitIrql;
1772  CHAR WaitMode;
1773  };
1774  struct
1775  {
1776  UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 116/0x74
1777  ULONG WaitTime;
1778  };
1779  struct
1780  {
1781  UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 164/0xA4
1782  union
1783  {
1784  struct
1785  {
1788  };
1790  };
1791  };
1792 #endif
1793  struct
1794  {
1795  UCHAR WaitBlockFill8[FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 20/0x14, 64bit: 40/0x28
1797  };
1798  struct
1799  {
1800  UCHAR WaitBlockFill9[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 44/0x2C, 64bit: 88/0x58
1802  };
1803  struct
1804  {
1805  UCHAR WaitBlockFill10[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 68/0x44, 64bit: 136/0x88
1807  };
1808  struct
1809  {
1810  UCHAR WaitBlockFill11[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, Object)]; // 32bit: 88/0x58, 64bit: 176/0xB0
1811 #ifdef _WIN64
1812  struct _UMS_CONTROL_BLOCK* Ucb;
1813  struct _KUMS_CONTEXT_HEADER* Uch;
1814 #else
1816  union
1817  {
1818  struct
1819  {
1822  };
1824  };
1825 #endif
1826  };
1827  };
1828 
1829 #ifdef _WIN64
1830  PVOID TebMappedLowVa;
1831 #endif
1833 #if (NTDDI_VERSION >= 0x060223F0) // since 6.2.9200.16384
1834  union
1835  {
1837  struct
1838  {
1839  ULONG NextProcessorNumber : 31;
1840  ULONG SharedReadyQueue : 1;
1841  };
1842  };
1843  LONG QueuePriority;
1844 #else
1847 #endif
1849 
1850  union
1851  {
1853  struct
1854  {
1855  UCHAR UserAffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]; // 32bit: 6/0x6, 64bit: 10/0x0A
1858  union
1859  {
1861  struct
1862  {
1865  };
1866  };
1870  };
1871  };
1872 
1873 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1875 #endif
1876  union
1877  {
1879  struct
1880  {
1881  UCHAR AffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]; // 32bit: 6/0x6, 64bit: 10/0x0A
1885  };
1886  };
1887 
1888 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1889 #ifdef _WIN64
1890  ULONG64 NpxState;
1891 #else
1893 #endif
1894 #else
1895  PKAPC_STATE ApcStatePointer[2];
1896 #endif
1897 
1898  union
1899  {
1901  struct
1902  {
1903  UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1]; // 32bit: 23/0x17, 64bit: 43/0x2B
1908  };
1909  };
1910 
1911  union
1912  {
1914  struct
1915  {
1916  UCHAR SchedulerApcFill0[FIELD_OFFSET(KAPC, SpareByte0)]; // 32bit: 1/0x01, 64bit: 1/0x01
1918  };
1919  struct
1920  {
1921  UCHAR SchedulerApcFill1[FIELD_OFFSET(KAPC, SpareByte1)]; // 32bit: 3/0x03, 64bit: 3/0x03
1923  };
1924  struct
1925  {
1926  UCHAR SchedulerApcFill2[FIELD_OFFSET(KAPC, SpareLong0)]; // 32bit: 4/0x04, 64bit: 4/0x04
1928  };
1929  struct
1930  {
1931  UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)]; // 32 bit:, 64 bit: 64/0x40
1933  };
1934  struct
1935  {
1936  UCHAR SchedulerApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]; // 32 bit:, 64 bit: 72/0x48
1938  };
1939  struct
1940  {
1941  UCHAR SchedulerApcFill5[FIELD_OFFSET(KAPC, Inserted) + 1]; // 32 bit:, 64 bit: 83/0x53
1944  };
1945  };
1946 
1950 
1951 #if (NTDDI_VERSION >= NTDDI_WIN10)
1955 #if _WIN64
1956  ULONG SecureThreadCookie;
1957 #endif
1958 #elif (NTDDI_VERSION >= NTDDI_WINBLUE) // 6.3.9431.0
1959  SINGLE_LIST_ENTRY LockEntriesFreeList;
1960 #endif
1961 
1962 #if (NTDDI_VERSION >= NTDDI_WINBLUE /* 0x06032580 */) // since 6.3.9600.16384
1969  #if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
1971  #endif
1972 
1973  #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1975  #else
1976  volatile SHORT AbReferenceCount;
1977  #endif
1978  #if (NTDDI_VERSION >= 0x06040000) // since 6.4.9841.0
1979  UCHAR AbOrphanedEntrySummary;
1980  UCHAR AbOwnedEntryCount;
1981  #else
1984  #endif
1986  union
1987  {
1989  struct
1990  {
1993  };
1994  };
1995 #endif
1996 
1997 #if _WIN64
1998  LONG64 ReadOperationCount;
1999  LONG64 WriteOperationCount;
2000  LONG64 OtherOperationCount;
2001  LONG64 ReadTransferCount;
2002  LONG64 WriteTransferCount;
2003  LONG64 OtherTransferCount;
2004 #endif
2005 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10041.0
2006  struct _KSCB *QueuedScb;
2007 #ifndef _WIN64
2009 #endif
2010 #endif
2011 } KTHREAD;
2012 
2013 #endif
2014 
2015 
2016 #define ASSERT_THREAD(object) \
2017  ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == ThreadObject))
2018 
2019 //
2020 // Kernel Process (KPROCESS)
2021 //
2022 typedef struct _KPROCESS
2023 {
2026 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
2029 #else
2031 #endif
2032 #if defined(_M_IX86)
2033  KGDTENTRY LdtDescriptor;
2034  KIDTENTRY Int21Descriptor;
2035 #endif
2037 #if defined(_M_IX86)
2038  UCHAR Iopl;
2039  UCHAR Unused;
2040 #endif
2050  union
2051  {
2052  struct
2053  {
2058  };
2060  };
2068  union
2069  {
2072  };
2075 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
2077 #endif // ]
2078 } KPROCESS;
2079 
2080 #define ASSERT_PROCESS(object) \
2081  ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == ProcessObject))
2082 
2083 //
2084 // System Service Table Descriptor
2085 //
2087 {
2091 #if defined(_IA64_)
2092  LONG TableBaseGpOffset;
2093 #endif
2096 
2097 #if (NTDDI_VERSION >= NTDDI_WIN8)
2098 //
2099 // Entropy Timing State
2100 //
2102 {
2109 
2110 //
2111 // Constants from ks386.inc, ksamd64.inc and ksarm.h
2112 //
2113 #define KENTROPY_TIMING_INTERRUPTS_PER_BUFFER 0x400
2114 #define KENTROPY_TIMING_BUFFER_MASK 0x7ff
2115 #define KENTROPY_TIMING_ANALYSIS 0x0
2116 
2117 #endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
2118 
2119 //
2120 // Exported Loader Parameter Block
2121 //
2123 
2124 //
2125 // Exported Hardware Data
2126 //
2134 
2135 //
2136 // Exported System Service Descriptor Tables
2137 //
2140 
2141 #endif // !NTOS_MODE_USER
2142 
2143 #endif // _KETYPES_H
ULONG LargePageMinimum
Definition: ketypes.h:1167
BOOLEAN Started
Definition: ketypes.h:867
ULONG ServiceCount
Definition: ketypes.h:899
_KWAIT_REASON
Definition: ketypes.h:402
CSHORT Type
Definition: ketypes.h:856
UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)]
Definition: ketypes.h:1931
PVOID StackBase
Definition: ketypes.h:183
SCHAR QuantumReset
Definition: ketypes.h:2062
LONG ThreadFlags
Definition: ketypes.h:1697
ULONG LowPart
Definition: ketypes.h:917
CONTEXT FiberContext
Definition: ketypes.h:186
struct _KTIMER_TABLE KTIMER_TABLE
LONG AbCompletedIoQoSBoostCount
Definition: ketypes.h:1970
ULONG NtMinorVersion
Definition: ketypes.h:1172
PVOID Buffer
Definition: ketypes.h:863
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1166
ULONG ExAcqResSharedWaitForExclusiveAttempts
Definition: ketypes.h:767
ULONG FreezeCount
Definition: ketypes.h:1677
#define IN
Definition: typedefs.h:39
ULONG_PTR Unused0
Definition: ketypes.h:2028
ULONG SharedDataFlags
Definition: ketypes.h:1204
_VDMSERVICECLASS
Definition: ketypes.h:503
ULONG AutoBoostActive
Definition: ketypes.h:1629
UCHAR Spare1
Definition: ketypes.h:1048
enum _KPROCESS_STATE * PKPROCESS_STATE
BOOLEAN Connected
Definition: ketypes.h:892
KAFFINITY Affinity
Definition: ketypes.h:865
KSPIN_LOCK Lock
Definition: ketypes.h:716
USHORT UserModeGlobalLogger[16]
Definition: ketypes.h:1240
ULONG EtwStackTraceApcInserted
Definition: ketypes.h:1692
USHORT AllBoosts
Definition: ketypes.h:1115
ULONG UserIdealProcessor
Definition: ketypes.h:1723
KAPC_STATE
Definition: ketypes.h:1285
ULONG TimerActive
Definition: ketypes.h:1646
struct _KENTROPY_TIMING_STATE KENTROPY_TIMING_STATE
LONG DisableBoost
Definition: ketypes.h:2055
USHORT Spare20
Definition: ketypes.h:1954
_KPROCESS_STATE
Definition: ketypes.h:491
ULONG ExTryToAcqExclusiveAttempts
Definition: ketypes.h:776
UCHAR AbWaitEntryCount
Definition: ketypes.h:1953
PVOID RangeBase
Definition: ketypes.h:860
struct _KDPC_DATA KDPC_DATA
RTL_RB_TREE WaiterTree
Definition: ketypes.h:1105
KSPIN_LOCK SpinLock
Definition: ketypes.h:884
ULONG Reserved2[7]
Definition: ketypes.h:1168
CONTEXT Context
Definition: ketypes.h:848
enum _KAPC_ENVIRONMENT KAPC_ENVIRONMENT
ULONG EnableStackSwap
Definition: ketypes.h:1669
_ALTERNATIVE_ARCHITECTURE_TYPE
Definition: ketypes.h:889
ULONG AlertedByThreadId
Definition: ketypes.h:1667
volatile LONG AbCompletedIoBoostCount
Definition: ketypes.h:1968
KTIMER_TABLE_ENTRY TimerEntries[256]
Definition: ketypes.h:725
ULONG_PTR DirectoryTableBase
Definition: ketypes.h:2027
enum _KOBJECTS KOBJECTS
UCHAR State
Definition: ketypes.h:2063
SHORT SpecialApcDisable
Definition: ketypes.h:1821
USHORT IoNormalPriorityWaiterCount
Definition: ketypes.h:1127
UCHAR AcquiredBit
Definition: ketypes.h:1038
Definition: ntbasedef.h:628
ULONG ForegroundLossTime
Definition: ketypes.h:1985
ULONG CombinedApcDisable
Definition: ketypes.h:1823
struct _EXCEPTION_REGISTRATION_RECORD * ExceptionList
Definition: ketypes.h:182
_In_ ULONG _In_opt_ POBJECT_ATTRIBUTES _In_opt_ HANDLE _Out_opt_ PCLIENT_ID _In_ PKSTART_ROUTINE StartRoutine
Definition: psfuncs.h:87
ULONG EntryFlags
Definition: ketypes.h:1022
SINGLE_LIST_ENTRY * LastEntry
Definition: ketypes.h:731
ULONG ExSetResOwnerPointerExclusive
Definition: ketypes.h:773
LARGE_INTEGER SystemExpirationDate
Definition: ketypes.h:1179
ULONG UserStackWalkActive
Definition: ketypes.h:1642
SCHAR BasePriority
Definition: ketypes.h:2061
KAPC_STATE SavedApcState
Definition: ketypes.h:1900
LONG ProcessFlags
Definition: ketypes.h:2059
ULONG ExSetResOwnerPointerSharedOld
Definition: ketypes.h:775
ULONG ExAcqResExclusiveAttempts
Definition: ketypes.h:750
PVOID ServiceTable
Definition: ketypes.h:1611
UCHAR UnusualBoost
Definition: ketypes.h:1864
PVOID StackLimit
Definition: ketypes.h:184
_KOBJECTS
Definition: ketypes.h:437
UCHAR SchedulerApcFill2[FIELD_OFFSET(KAPC, SpareLong0)]
Definition: ketypes.h:1926
struct _KTHREAD_COUNTERS * ThreadCounters
Definition: ketypes.h:1796
UCHAR SchedulerApcFill5[FIELD_OFFSET(KAPC, Inserted)+1]
Definition: ketypes.h:1941
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
CSHORT Size
Definition: ketypes.h:917
ULONG ProcessDetachActive
Definition: ketypes.h:1648
PKSERVICE_ROUTINE MessageServiceRoutine
Definition: ketypes.h:880
USHORT IopmOffset
Definition: ketypes.h:2036
PVOID SListFaultAddress
Definition: ketypes.h:1602
Definition: ketypes.h:982
struct _KTIMER_TABLE_ENTRY * PKTIMER_TABLE_ENTRY
LONGLONG ConsoleSessionForegroundProcessId
Definition: ketypes.h:1235
ULONG Spare15
Definition: ketypes.h:1892
ULONG CommitFailTerminateRequest
Definition: ketypes.h:1688
union _KWAIT_STATUS_REGISTER KWAIT_STATUS_REGISTER
ULONGLONG TestRetInstruction
Definition: ketypes.h:1220
SCHAR Priority
Definition: ketypes.h:1722
ULONG MaxStackTraceDepth
Definition: ketypes.h:1164
UCHAR AcquiredByte
Definition: ketypes.h:1037
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
enum _KCONTINUE_STATUS KCONTINUE_STATUS
struct _KUSER_SHARED_DATA * PKUSER_SHARED_DATA
ULONG UmsPerformingSyscall
Definition: ketypes.h:1653
ULONG64 Total
Definition: ketypes.h:957
UCHAR Removable
Definition: ketypes.h:832
struct _KDPC_LIST KDPC_LIST
ULONG CryptoExponent
Definition: ketypes.h:1165
CHAR Saturation
Definition: ketypes.h:1906
BOOLEAN Alerted[MaximumMode]
Definition: ketypes.h:1620
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1326
PKTRAP_FRAME TrapFrame
Definition: ketypes.h:1714
ULONG QuantumDonation
Definition: ketypes.h:1668
ULONG_PTR InTree
Definition: ketypes.h:995
ULONG SystemThread
Definition: ketypes.h:1647
struct _KEXECUTE_OPTIONS KEXECUTE_OPTIONS
ULONG ExEtwSynchTrackingNotificationsCount
Definition: ketypes.h:780
ULONG IpiSendRequestBroadcastCount
Definition: ketypes.h:739
ULONG ExAcqResSharedAttempts
Definition: ketypes.h:755
KSPIN_LOCK * PKSPIN_LOCK
Definition: env_spec_w32.h:73
volatile ULONG TimeSlip
Definition: ketypes.h:1176
PKWAIT_BLOCK WaitBlockList
Definition: ketypes.h:1740
ULONG Reserved
Definition: ketypes.h:1655
CSHORT Type
Definition: ketypes.h:875
USHORT IoQoSBoost
Definition: ketypes.h:1126
ULONG UserAffinitySet
Definition: ketypes.h:1666
ULONG DeferPreemption
Definition: ketypes.h:1673
ULONG_PTR FreeCount[2]
Definition: ketypes.h:836
Definition: ketypes.h:1012
int32_t INT_PTR
Definition: typedefs.h:64
_HARDWARE_COUNTER_TYPE
Definition: pstypes.h:123
#define SSDT_MAX_ENTRIES
Definition: ketypes.h:100
PKPROCESS Process
Definition: ketypes.h:1848
#define NUMBER_OF_LOCK_ENTRIES
Definition: ketypes.h:1596
struct _KEVENT_PAIR * PKEVENT_PAIR
ULONG ProcessReadyQueue
Definition: ketypes.h:1635
ULONG_PTR Busy
Definition: ketypes.h:993
struct _KEVENT_PAIR KEVENT_PAIR
ULONG NTSYSAPI KiDmaIoCoherency
Definition: cpu.c:27
struct _SINGLE_LIST_ENTRY * PfnDeferredList
Definition: ketypes.h:837
KLOCK_ENTRY_LOCK_STATE LockState
Definition: ketypes.h:1076
ULONG NTSYSAPI KeIcacheFlushCount
Definition: cpu.c:19
volatile KSYSTEM_TIME InterruptTime
Definition: ketypes.h:1158
#define NTSYSAPI
Definition: ntoskrnl.h:12
ULONG ExAcqResExclusiveAcquiresExclusiveRecursive
Definition: ketypes.h:752
BOOLEAN FloatingSave
Definition: ketypes.h:891
UCHAR ExecuteDisable
Definition: ketypes.h:927
ULONG ExAcqResSharedStarveExclusiveAttempts
Definition: ketypes.h:761
ULONG ExAcqResSharedStarveExclusiveWaits
Definition: ketypes.h:765
struct _SYNCH_COUNTERS SYNCH_COUNTERS
ULONG SystemCallReturn
Definition: ketypes.h:1222
FIXME: should move to rtltypes.h, but we can't include it here.
Definition: ketypes.h:974
SINGLE_LIST_ENTRY FreeListEntry
Definition: ketypes.h:1017
ULONG64 HardwareCounters
Definition: ketypes.h:967
ULONG_PTR DpcLock
Definition: ketypes.h:794
ULONG ExAcqResSharedWaits
Definition: ketypes.h:759
ULONG UmsDirectedSwitchEnable
Definition: ketypes.h:1645
_KPROFILE_SOURCE
Definition: winternl.h:2122
ULONG ExAcqResSharedStarveExclusiveAcquiresExclusive
Definition: ketypes.h:762
PKTIMER TimerExpiry[64]
Definition: ketypes.h:724
struct _KDPC_DATA * PKDPC_DATA
KINTERRUPT_MODE Mode
Definition: ketypes.h:895
enum _KPROCESS_STATE KPROCESS_STATE
volatile ULONG HighCycleTime
Definition: ketypes.h:1610
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:500
ULONG ExplicitIdealProcessor
Definition: ketypes.h:1676
ULONG ExAcqResSharedAcquiresExclusive
Definition: ketypes.h:756
Definition: ketypes.h:713
_TIMER_TYPE
PKPRCB WaitPrcb
Definition: ketypes.h:1932
uint32_t ULONG_PTR
Definition: typedefs.h:65
PVOID LockState
Definition: ketypes.h:997
ULONG NextProcessor
Definition: ketypes.h:1845
BOOLEAN SafeBootMode
Definition: ketypes.h:1190
LONG ReservedFlags
Definition: ketypes.h:2057
SLIST_HEADER DeadStackList
Definition: ketypes.h:825
ULONG AutoAlignment
Definition: ketypes.h:1664
PVOID FiberData
Definition: ketypes.h:181
BOOLEAN NTSYSAPI KiEnableTimerWatchdog
Definition: timerobj.c:20
UCHAR IoQoSWaiter
Definition: ketypes.h:1047
struct _RTL_RB_TREE * PRTL_RB_TREE
struct _COUNTER_READING * PCOUNTER_READING
UCHAR KIRQL
Definition: env_spec_w32.h:591
struct _KPROCESS * Process
Definition: ketypes.h:859
ULONG ExecutiveResourceReleaseSharedCount
Definition: ketypes.h:748
UCHAR PriorityFloorCounts[16]
Definition: ketypes.h:1966
ULONG AllFlags
Definition: ketypes.h:1055
enum _NT_PRODUCT_TYPE * PNT_PRODUCT_TYPE
ULONG ExBoostSharedOwners
Definition: ketypes.h:779
RTL_BALANCED_NODE TreeNode
Definition: ketypes.h:1016
VOID(NTAPI * PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine, PVOID StartContext)
Definition: ketypes.h:677
struct _GETSETCONTEXT GETSETCONTEXT
PXSTATE_SAVE XStateSave
Definition: ketypes.h:1801
SINGLE_LIST_ENTRY ForegroundDpcStackListEntry
Definition: ketypes.h:1991
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
LONG MiscFlags
Definition: ketypes.h:1657
ULONG NtMajorVersion
Definition: ketypes.h:1171
SHORT KernelApcDisable
Definition: ketypes.h:1820
KPROFILE_SOURCE Source
Definition: ketypes.h:866
UCHAR CallbackNestingLevel
Definition: ketypes.h:1942
ULONG ImageFileExecutionOptions
Definition: ketypes.h:1246
ULONG TickCount
Definition: ketypes.h:885
KSTART_ROUTINE * PKSTART_ROUTINE
Definition: ketypes.h:487
volatile KSYSTEM_TIME SystemTime
Definition: ketypes.h:1159
ULONG ExAcqResSharedWaitForExclusiveAcquiresShared
Definition: ketypes.h:769
PRTL_BALANCED_NODE Min
Definition: ketypes.h:977
ULONG ExAcqResSharedStarveExclusiveAcquiresShared
Definition: ketypes.h:763
ULONG ExAcqResSharedStarveExclusiveNotAcquires
Definition: ketypes.h:766
ULONG ExAcqResSharedNotAcquires
Definition: ketypes.h:760
long LONG
Definition: pedump.c:60
ULONG ExSetResOwnerPointerSharedNew
Definition: ketypes.h:774
UCHAR ExecuteOptions
Definition: ketypes.h:2071
NT_PRODUCT_TYPE NtProductType
Definition: ketypes.h:1169
KDPC_LIST DpcList
Definition: ketypes.h:790
UCHAR SystemHeteroCpuPolicy
Definition: ketypes.h:1702
KAPC_STATE ApcState
Definition: ketypes.h:1718
short SHORT
Definition: pedump.c:59
UCHAR EntryOffset
Definition: ketypes.h:1025
ULONG SystemAffinityActive
Definition: ketypes.h:1637
struct _KTHREAD_COUNTERS * PKTHREAD_COUNTERS
PVOID FirstArgument
Definition: ketypes.h:1713
ULONG SessionId
Definition: ketypes.h:1092
BOOLEAN KdDebuggerEnabled
Definition: ketypes.h:1181
ULONG_PTR EntryLock
Definition: ketypes.h:1109
KEVENT Event
Definition: ketypes.h:846
ULONG WaitNext
Definition: ketypes.h:1636
ULONG ExAcqResSharedAcquiresShared
Definition: ketypes.h:757
ULONG TickCountMultiplier
Definition: ketypes.h:1157
ULONG ExAcqResSharedWaitForExclusiveAcquiresSharedRecursive
Definition: ketypes.h:770
ULONG64 CycleTimeBias
Definition: ketypes.h:966
UCHAR ImageDispatchEnable
Definition: ketypes.h:932
volatile UCHAR CrossThreadReleasableAndBusyByte
Definition: ketypes.h:1081
UCHAR UserHeteroCpuPolicy
Definition: ketypes.h:1703
ULONG ApcInterruptRequest
Definition: ketypes.h:1643
unsigned char BOOLEAN
LIST_ENTRY ProfileListEntry
Definition: ketypes.h:858
ULONG64 WaitReasonBitMap
Definition: ketypes.h:962
ULONG StackCount
Definition: ketypes.h:2073
enum _KPROFILE_SOURCE KPROFILE_SOURCE
PVOID RangeLimit
Definition: ketypes.h:861
enum _KINTERRUPT_MODE KINTERRUPT_MODE
ULONG TickCountLowDeprecated
Definition: ketypes.h:1156
SINGLE_LIST_ENTRY ListHead
Definition: ketypes.h:730
USHORT IoQoSWaiterCount
Definition: ketypes.h:1128
enum _VDMSERVICECLASS VDMSERVICECLASS
#define _In_
Definition: ms_sal.h:308
struct _KLOCK_ENTRY_LOCK_STATE * PKLOCK_ENTRY_LOCK_STATE
USHORT IoBoost
Definition: ketypes.h:1122
LIST_ENTRY QueueListEntry
Definition: ketypes.h:1832
LIST_ENTRY ProcessListEntry
Definition: ketypes.h:2074
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
VOID(NTAPI * PKKERNEL_ROUTINE)(IN struct _KAPC *Apc, IN OUT PKNORMAL_ROUTINE *NormalRoutine OPTIONAL, IN OUT PVOID *NormalContext OPTIONAL, IN OUT PVOID *SystemArgument1 OPTIONAL, IN OUT PVOID *SystemArgument2 OPTIONAL)
Definition: ketypes.h:694
Definition: bufpool.h:45
UCHAR WaitBlockFill10[2 *sizeof(KWAIT_BLOCK)+FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]
Definition: ketypes.h:1805
PVOID KernelStack
Definition: ketypes.h:1615
USHORT ImageNumberHigh
Definition: ketypes.h:1162
PVOID DeallocationStack
Definition: ketypes.h:185
struct DECLSPEC_ALIGN(16) _M128A
Definition: ketypes.h:922
KPROCESSOR_MODE Mode
Definition: ketypes.h:847
void * PVOID
Definition: retypes.h:9
PVOID FlsData
Definition: ketypes.h:190
CHAR CpuPriorityKey
Definition: ketypes.h:1107
KTIMER Timer
Definition: ketypes.h:1751
ULONG DispatchCount
Definition: ketypes.h:900
LIST_ENTRY ThreadListHead
Definition: ketypes.h:2047
enum _KTHREAD_STATE KTHREAD_STATE
ULONG_PTR Reserved
Definition: ketypes.h:994
ULONG ScbReadyQueue
Definition: ketypes.h:1650
UCHAR DisableThunkEmulation
Definition: ketypes.h:929
LONG DisableQuantum
Definition: ketypes.h:2056
struct _KSYSTEM_TIME KSYSTEM_TIME
ULONG DpcCount
Definition: ketypes.h:800
CCHAR Number
Definition: ketypes.h:893
struct _LOADER_PARAMETER_BLOCK NTSYSAPI * KeLoaderBlock
Definition: krnlinit.c:29
#define MAX_WOW64_SHARED_ENTRIES
Definition: ketypes.h:1143
struct _KSYSTEM_TIME * PKSYSTEM_TIME
UCHAR WaitReason
Definition: ketypes.h:1904
CHAR BasePriority
Definition: ketypes.h:1857
ULARGE_INTEGER Time
Definition: ketypes.h:719
ULONG SessionId
Definition: ketypes.h:1004
ULONG ExecutiveResourceAcquiresCount
Definition: ketypes.h:745
enum _EVENT_TYPE EVENT_TYPE
ULONG ExDeleteResourceCount
Definition: ketypes.h:744
USHORT ImageNumberLow
Definition: ketypes.h:1161
union _KWAIT_STATUS_REGISTER * PKWAIT_STATUS_REGISTER
_Out_ PULONG UserTime
Definition: kefuncs.h:773
UCHAR ExplicitSystemHeteroCpuPolicy
Definition: ketypes.h:1704
struct _KNODE::_flags Flags
struct _KLOCK_ENTRY_LOCK_STATE KLOCK_ENTRY_LOCK_STATE
volatile KSYSTEM_TIME TickCount
Definition: ketypes.h:1225
VOID(NTAPI * PKINTERRUPT_ROUTINE)(VOID)
Definition: ketypes.h:490
ULONG DisableBoost
Definition: ketypes.h:1665
ULONG Alertable
Definition: ketypes.h:1638
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
ULONG64 NpxState
Definition: ketypes.h:2008
SINGLE_LIST_ENTRY PropagateBoostsEntry
Definition: ketypes.h:1964
LIST_ENTRY InterruptListEntry
Definition: ketypes.h:877
volatile INT_PTR WaitStatus
Definition: ketypes.h:1739
int64_t LONGLONG
Definition: typedefs.h:68
struct _FIBER * PFIBER
KAFFINITY Affinity
Definition: ketypes.h:2049
int64_t LONG64
Definition: typedefs.h:68
struct _KPROCESS KPROCESS
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
VOID(NTAPI * PTIMER_APC_ROUTINE)(_In_ PVOID TimerContext, _In_ ULONG TimerLowValue, _In_ LONG TimerHighValue)
Definition: ketypes.h:1098
ULONG NTSYSAPI KeMaximumIncrement
Definition: clock.c:20
USHORT CpuBoostsBitmap
Definition: ketypes.h:1121
struct _KLOCK_ENTRY KLOCK_ENTRY
LIST_ENTRY Entry
Definition: ketypes.h:718
ULONG64 Start
Definition: ketypes.h:956
KIRQL Irql
Definition: ketypes.h:889
ULONG TebFlags
Definition: ketypes.h:192
ULONG KernelTime
Definition: ketypes.h:1927
VOID(NTAPI * PKRUNDOWN_ROUTINE)(IN struct _KAPC *Apc)
Definition: ketypes.h:690
ULONGLONG Rsvd1
Definition: ketypes.h:902
struct _THREAD_PERFORMANCE_DATA * UserData
Definition: ketypes.h:963
LONG High1Time
Definition: ketypes.h:918
UCHAR HeadNodeBit
Definition: ketypes.h:1045
UCHAR WaitingBit
Definition: ketypes.h:1031
ULONG MmShiftedColor
Definition: ketypes.h:835
enum _MODE MODE
#define PROCESSOR_FEATURE_MAX
__wchar_t WCHAR
Definition: xmlstorage.h:180
ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture
Definition: ketypes.h:1177
KAPC SchedulerApc
Definition: ketypes.h:1913
SINGLE_LIST_ENTRY SwapListEntry
Definition: ketypes.h:2045
UCHAR CrossThreadFlags
Definition: ketypes.h:1042
char CCHAR
Definition: typedefs.h:51
UCHAR Spare0
Definition: ketypes.h:1705
ULONG ExAcqResExclusiveNotAcquires
Definition: ketypes.h:754
uint64_t ULONGLONG
Definition: typedefs.h:67
UCHAR IoPriorityBit
Definition: ketypes.h:1046
SINGLE_LIST_ENTRY SwapListEntry
Definition: ketypes.h:1744
struct _KUSER_SHARED_DATA KUSER_SHARED_DATA
UCHAR Visited
Definition: ketypes.h:2067
BOOLEAN ShareVector
Definition: ketypes.h:894
ULONG DbgElevationEnabled
Definition: ketypes.h:1207
ULONG ExpectedRunTime
Definition: ketypes.h:1614
volatile VOID * StackLimit
Definition: ketypes.h:1605
signed char SCHAR
Definition: sqltypes.h:14
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
ULONG MessageIndex
Definition: ketypes.h:881
enum _WAIT_TYPE WAIT_TYPE
struct _RTL_RB_TREE RTL_RB_TREE
FIXME: should move to rtltypes.h, but we can't include it here.
SINGLE_LIST_ENTRY IoSelfBoostsEntry
Definition: ketypes.h:1965
PKQUEUE Queue
Definition: ketypes.h:1746
KINTERRUPT_POLARITY Polarity
Definition: ketypes.h:897
ULONG64 QuantumTarget
Definition: ketypes.h:1603
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
Definition: ntbasedef.h:672
UCHAR WaitBlockFill8[FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]
Definition: ketypes.h:1795
ULONG ExReInitializeResourceCount
Definition: ketypes.h:743
struct _KSCHEDULING_GROUP * SchedulingGroup
Definition: ketypes.h:1617
PVOID LockUnsafe
Definition: ketypes.h:1077
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
struct _PP_LOOKASIDE_LIST * PPP_LOOKASIDE_LIST
ULONG ChargeOnlyGroup
Definition: ketypes.h:1672
UCHAR ForegroundBoost
Definition: ketypes.h:1863
struct _FIBER FIBER
LIST_ENTRY WaitListEntry
Definition: ketypes.h:1743
UCHAR AffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]
Definition: ketypes.h:1881
KEVENT SuspendEvent
Definition: ketypes.h:1947
UCHAR AdjustReason
Definition: ketypes.h:1868
struct _GENERAL_LOOKASIDE * L
Definition: ketypes.h:812
ULONG GuaranteedStackBytes
Definition: ketypes.h:191
ULONG NumberOfPhysicalPages
Definition: ketypes.h:1189
ULONGLONG CycleTime
Definition: ketypes.h:2076
UCHAR AbEntrySummary
Definition: ketypes.h:1952
ULONG QuantumEndMigrate
Definition: ketypes.h:1644
enum _KINTERRUPT_POLARITY KINTERRUPT_POLARITY
unsigned __int64 ULONG64
Definition: imports.h:198
enum _TIMER_TYPE TIMER_TYPE
ULONG DisableStackCheck
Definition: ketypes.h:1654
ULONG ContextSwitches
Definition: ketypes.h:965
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _KTHREAD_COUNTERS KTHREAD_COUNTERS
ULONG Vector
Definition: ketypes.h:888
ULONG ExBoostExclusiveOwner
Definition: ketypes.h:778
COUNTER_READING HwCounter[16]
Definition: ketypes.h:968
PKSERVICE_ROUTINE ServiceRoutine
Definition: ketypes.h:878
UCHAR AbFreeEntryCount
Definition: ketypes.h:1982
UCHAR ThreadSeed
Definition: ketypes.h:2064
ULONG ExecutiveResourceConvertsCount
Definition: ketypes.h:749
_EVENT_TYPE
CSHORT Size
Definition: ketypes.h:857
PVOID NormalContext
Definition: ketypes.h:550
Definition: ketypes.h:687
UCHAR IdealNode
Definition: ketypes.h:2066
ULONG64 RelativeTimerBias
Definition: ketypes.h:1749
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
#define VOID
Definition: acefi.h:82
ULONG ExecutiveResourceContentionsCount
Definition: ketypes.h:746
Definition: ketypes.h:422
KEVENT LowEvent
Definition: ketypes.h:918
ULONG IdealProcessor
Definition: ketypes.h:1884
ULONG ExAcqResSharedWaitForExclusiveAcquiresExclusive
Definition: ketypes.h:768
ULONG_PTR InGlobalForegroundList
Definition: ketypes.h:1992
UCHAR SchedulerApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]
Definition: ketypes.h:1936
Definition: ketypes.h:535
LIST_ENTRY ReadyListHead
Definition: ketypes.h:2044
_MODE
Definition: ketypes.h:10
_KAPC_ENVIRONMENT
Definition: ketypes.h:705
Definition: typedefs.h:119
ULONG SpinLockSpinCount
Definition: ketypes.h:738
ULONG ForceDeferSchedule
Definition: ketypes.h:1675
struct _GETSETCONTEXT * PGETSETCONTEXT
UCHAR ApcStateFill[RTL_SIZEOF_THROUGH_FIELD(KAPC_STATE, UserApcPending)]
Definition: ketypes.h:1721
struct _KTHREAD KTHREAD
volatile ULONG ActiveConsoleId
Definition: ketypes.h:1185
volatile KSYSTEM_TIME TimeZoneBias
Definition: ketypes.h:1160
ULONG ExAcqResSharedAcquiresSharedRecursive
Definition: ketypes.h:758
UCHAR Color
Definition: ketypes.h:828
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
ULONG IpiSendRequestRoutineCount
Definition: ketypes.h:740
ULONG PriorityFloorSummary
Definition: ketypes.h:1967
KSPIN_LOCK ProcessLock
Definition: ketypes.h:2048
ULONG ExAcqResSharedStarveExclusiveAcquiresSharedRecursive
Definition: ketypes.h:764
ULONG CurrentRunTime
Definition: ketypes.h:1613
struct _KTIMER_TABLE * PKTIMER_TABLE
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
CSHORT Type
Definition: ketypes.h:916
UCHAR QuantumReset
Definition: ketypes.h:1922
ULONG ExAcqResExclusiveAcquiresExclusive
Definition: ketypes.h:751
PKSPIN_LOCK ActualLock
Definition: ketypes.h:886
PVOID StackBase
Definition: ketypes.h:1606
ULONG DispatchCode[DISPATCH_LENGTH]
Definition: ketypes.h:908
UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending)+1]
Definition: ketypes.h:1903
ULONG NTSYSAPI KeMinimumIncrement
Definition: clock.c:21
LONG High2Time
Definition: ketypes.h:919
ULONG QueueDeferPreemption
Definition: ketypes.h:1674
Definition: compat.h:694
ULONG DbgVirtEnabled
Definition: ketypes.h:1208
volatile ULONG DpcQueueDepth
Definition: ketypes.h:798
PVOID SessionState
Definition: ketypes.h:1001
ULONG ExTryToAcqExclusiveAcquires
Definition: ketypes.h:777
ULONG DbgInstallerDetectEnabled
Definition: ketypes.h:1209
KLOCK_ENTRY LockEntries[NUMBER_OF_LOCK_ENTRIES]
Definition: ketypes.h:1963
ULONG SpinLockContentionCount
Definition: ketypes.h:737
CHAR PreviousMode
Definition: ketypes.h:1856
UCHAR SchedulerApcFill1[FIELD_OFFSET(KAPC, SpareByte1)]
Definition: ketypes.h:1921
WCHAR NtSystemRoot[260]
Definition: ketypes.h:1163
ULONG_PTR Segment
Definition: ketypes.h:864
_NT_PRODUCT_TYPE
struct _GENERAL_LOOKASIDE * P
Definition: ketypes.h:811
UCHAR ThreadLocalFlags
Definition: ketypes.h:1028
RTL_RB_TREE OwnerTree
Definition: ketypes.h:1104
ULONG CalloutActive
Definition: ketypes.h:1649
unsigned short USHORT
Definition: pedump.c:61
struct _SYNCH_COUNTERS * PSYNCH_COUNTERS
volatile ULONG64 TickCountQuad
Definition: ketypes.h:1226
CHAR PriorityDecrement
Definition: ketypes.h:1860
CHAR SuspendCount
Definition: ketypes.h:1905
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR Fill
Definition: ketypes.h:833
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ WDF_DEVICE_POWER_STATE PowerState
Definition: wdfdevice.h:3032
ULONG ExAcqResExclusiveWaits
Definition: ketypes.h:753
enum _ALTERNATIVE_ARCHITECTURE_TYPE ALTERNATIVE_ARCHITECTURE_TYPE
struct _KPROFILE * PKPROFILE
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
ULONG StaticState
Definition: ketypes.h:1054
volatile KAFFINITY ActiveProcessors
Definition: ketypes.h:2041
volatile ULONG64 CycleTime
Definition: ketypes.h:1608
UCHAR Spare0
Definition: ketypes.h:1032
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
LIST_ENTRY ProfileListHead
Definition: ketypes.h:2025
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
ULONG SpinLockAcquireCount
Definition: ketypes.h:736
UCHAR WaitBlockCount
Definition: ketypes.h:1883
#define OPTIONAL
Definition: typedefs.h:41
unsigned int * PULONG
Definition: retypes.h:1
ULONGLONG SystemCallPad[3]
Definition: ketypes.h:1223
CHAR AdjustIncrement
Definition: ketypes.h:1869
UCHAR NXSupportPolicy
Definition: ketypes.h:1183
ULONG ExInitializeResourceCount
Definition: ketypes.h:742
PVOID Wx86Tib
Definition: ketypes.h:188
Definition: bcd.h:201
CHAR Spare12
Definition: ketypes.h:1731
KIRQL SynchronizeIrql
Definition: ketypes.h:890
UCHAR SchedulerApcFill0[FIELD_OFFSET(KAPC, SpareByte0)]
Definition: ketypes.h:1916
ULONG KernelTime
Definition: ketypes.h:2042
LIST_ENTRY ThreadListEntry
Definition: ketypes.h:1948
XSAVE_FORMAT
Definition: ketypes.h:951
ULONG ReservedStackInUse
Definition: ketypes.h:1652
struct _KSCB * QueuedScb
Definition: ketypes.h:2006
ULONG LastSystemRITEventTickCount
Definition: ketypes.h:1188
PVOID Teb
Definition: ketypes.h:1747
UCHAR ExecuteEnable
Definition: ketypes.h:928
ULONG BucketShift
Definition: ketypes.h:862
enum _KTHREAD_STATE * PKTHREAD_STATE
ULONG UserTime
Definition: ketypes.h:1943
struct _KSERVICE_TABLE_DESCRIPTOR KSERVICE_TABLE_DESCRIPTOR
struct _KENTROPY_TIMING_STATE * PKENTROPY_TIMING_STATE
KEXECUTE_OPTIONS Flags
Definition: ketypes.h:2070
struct _COUNTER_READING COUNTER_READING
UCHAR ResourceIndex
Definition: ketypes.h:1917
DISPATCHER_HEADER Header
Definition: ketypes.h:1601
#define DISPATCH_LENGTH
Definition: ketypes.h:207
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
ULONG_PTR CrossThreadReleasable
Definition: ketypes.h:989
enum _KWAIT_REASON KWAIT_REASON
_ADJUST_REASON
Definition: ketypes.h:470
LIST_ENTRY GlobalForegroundListEntry
Definition: ketypes.h:1988
PVOID LegoData
Definition: ketypes.h:1937
UCHAR UserAffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]
Definition: ketypes.h:1855
BOOLEAN Running
Definition: ketypes.h:1619
PVOID SessionState
Definition: ketypes.h:1089
XSAVE_FORMAT * StateSaveArea
Definition: ketypes.h:1616
#define OUT
Definition: typedefs.h:40
KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTable[SSDT_MAX_ENTRIES]
Definition: procobj.c:23
enum _NT_PRODUCT_TYPE NT_PRODUCT_TYPE
volatile UCHAR State
Definition: ketypes.h:1729
PVOID Win32Thread
Definition: ketypes.h:1806
UCHAR InTreeByte
Definition: ketypes.h:1086
GROUP_AFFINITY Affinity
Definition: ketypes.h:1878
CSHORT Size
Definition: ketypes.h:876
_KTHREAD_STATE
Definition: ketypes.h:419
struct _KINTERRUPT KINTERRUPT
unsigned int ULONG
Definition: retypes.h:1
ULONG NTSYSAPI KeDcacheFlushCount
Definition: cpu.c:20
ULONG ContextSwitches
Definition: ketypes.h:1728
SHORT SListFaultCount
Definition: ketypes.h:1907
PRTL_BALANCED_NODE Root
Definition: ketypes.h:976
_In_ PLARGE_INTEGER _In_opt_ PTIMER_APC_ROUTINE _In_opt_ PVOID TimerContext
Definition: zwfuncs.h:428
ULONG DeferredProcessor
Definition: ketypes.h:1846
uint32_t * PULONG_PTR
Definition: typedefs.h:65
UCHAR PowerState
Definition: ketypes.h:2065
UCHAR NodeNumber
Definition: ketypes.h:830
UCHAR Preempted
Definition: ketypes.h:1867
struct _KEXECUTE_OPTIONS * PKEXECUTE_OPTIONS
ULONG WaitTime
Definition: ketypes.h:1815
volatile UCHAR Tag
Definition: ketypes.h:1701
ULONG ReadyTransition
Definition: ketypes.h:1631
ULONG IpiSendSoftwareInterruptCount
Definition: ketypes.h:741
ULONG DisableQuantum
Definition: ketypes.h:1671
UCHAR ApcStateIndex
Definition: ketypes.h:1882
SLIST_HEADER PfnDereferenceSListHead
Definition: ketypes.h:826
struct _KDPC_LIST * PKDPC_LIST
struct _KWAIT_BLOCK KWAIT_BLOCK
KAFFINITY ProcessorMask
Definition: ketypes.h:827
ULONG ApcQueueable
Definition: ketypes.h:1651
VOID(NTAPI * PKNORMAL_ROUTINE)(IN PVOID NormalContext OPTIONAL, IN PVOID SystemArgument1 OPTIONAL, IN PVOID SystemArgument2 OPTIONAL)
Definition: ketypes.h:684
KPROCESSOR_MODE WaitMode
Definition: ketypes.h:1736
PKDPC ActiveDpc
Definition: ketypes.h:802
UCHAR Seed
Definition: ketypes.h:829
KEVENT HighEvent
Definition: ketypes.h:919
ULONG ExAcqResSharedWaitForExclusiveWaits
Definition: ketypes.h:771
enum _KPROFILE_SOURCE KPROFILE_SOURCE
enum _HARDWARE_COUNTER_TYPE Type
Definition: ketypes.h:954
UCHAR WaitBlockFill9[1 *sizeof(KWAIT_BLOCK)+FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]
Definition: ketypes.h:1800
ULONG UserTime
Definition: ketypes.h:2043
LONG AutoAlignment
Definition: ketypes.h:2054
PKINTERRUPT_ROUTINE DispatchAddress
Definition: ketypes.h:887
UCHAR ExecuteDispatchEnable
Definition: ketypes.h:931
short CSHORT
Definition: umtypes.h:127
_WAIT_TYPE
PVOID InitialStack
Definition: ketypes.h:1604
ULONG DbgErrorPortPresent
Definition: ketypes.h:1206
enum _ADJUST_REASON ADJUST_REASON
struct _KPROFILE KPROFILE
ULONG_PTR AffinityVersion
Definition: ketypes.h:1874
struct _KTIMER_TABLE_ENTRY KTIMER_TABLE_ENTRY
PVOID ServiceContext
Definition: ketypes.h:883
GROUP_AFFINITY UserAffinity
Definition: ketypes.h:1852
struct _KLOCK_ENTRY * PKLOCK_ENTRY
ULONG_PTR NTSYSAPI KiBugCheckData[]
Definition: bug.c:27
struct _KNODE * PKNODE
KSPIN_LOCK ThreadLock
Definition: ketypes.h:1607
_In_ LONG _In_ LONG Limit
Definition: kefuncs.h:317
KWAIT_STATUS_REGISTER WaitRegister
Definition: ketypes.h:1618
ULONG GuiThread
Definition: ketypes.h:1670
ULONG ProcessStackCountDecremented
Definition: ketypes.h:1689
SERVICE_TABLE_ENTRYW ServiceTable[]
Definition: service.c:21
PVOID VdmTrapcHandler
Definition: ketypes.h:2046
ULONG SystemCallNumber
Definition: ketypes.h:1709
ULONG ExAcqResSharedWaitForExclusiveNotAcquires
Definition: ketypes.h:772
ULONG ExecutiveResourceReleaseExclusiveCount
Definition: ketypes.h:747
struct _ACTIVATION_CONTEXT_STACK * ActivationContextStackPointer
Definition: ketypes.h:189
* PKAPC_STATE
Definition: ketypes.h:1285
ULONG ComPlusPackage
Definition: ketypes.h:1187
#define THREAD_WAIT_OBJECTS
Definition: ketypes.h:480
BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX]
Definition: ketypes.h:1173
struct _KSERVICE_TABLE_DESCRIPTOR * PKSERVICE_TABLE_DESCRIPTOR
_KCONTINUE_STATUS
Definition: ketypes.h:480
DISPATCHER_HEADER Header
Definition: ketypes.h:2024
volatile SHORT KeReferenceCount
Definition: ketypes.h:1974
ULONG ThreadFlagsSpare
Definition: ketypes.h:1690
LIST_ENTRY MutantListHead
Definition: ketypes.h:1949
UCHAR WaitBlockFill11[3 *sizeof(KWAIT_BLOCK)+FIELD_OFFSET(KWAIT_BLOCK, Object)]
Definition: ketypes.h:1810
ULONG ExEtwSynchTrackingNotificationsAccountedCount
Definition: ketypes.h:781
volatile ULONG DismountCount
Definition: ketypes.h:1186
KIRQL WaitIrql
Definition: ketypes.h:1735
BOOLEAN ProductTypeIsValid
Definition: ketypes.h:1170
ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES]
Definition: ketypes.h:1236
struct _KNODE KNODE
struct _PP_LOOKASIDE_LIST PP_LOOKASIDE_LIST
KSERVICE_TABLE_DESCRIPTOR NTSYSAPI KeServiceDescriptorTableShadow[SSDT_MAX_ENTRIES]
Definition: procobj.c:24