ReactOS  0.4.15-dev-4603-gb922b6d
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 #include <pshpack1.h>
824 typedef struct _KNODE
825 {
832  struct _flags {
834  UCHAR Fill : 7;
835  } Flags;
839 } KNODE, *PKNODE;
840 #include <poppack.h>
841 
842 //
843 // Structure for Get/SetContext APC
844 //
845 typedef struct _GETSETCONTEXT
846 {
852 
853 //
854 // Kernel Profile Object
855 //
856 typedef struct _KPROFILE
857 {
870 } KPROFILE, *PKPROFILE;
871 
872 //
873 // Kernel Interrupt Object
874 //
875 typedef struct _KINTERRUPT
876 {
881 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
884 #endif
898 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
900 #endif
903 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
905 #endif
906 #ifdef _M_AMD64
907  PKTRAP_FRAME TrapFrame;
908  PVOID Reserved;
909 #endif
911 } KINTERRUPT;
912 
913 //
914 // Kernel Event Pair Object
915 //
916 typedef struct _KEVENT_PAIR
917 {
923 
924 //
925 // Kernel No Execute Options
926 //
927 typedef struct _KEXECUTE_OPTIONS
928 {
937 
938 #if (NTDDI_VERSION >= NTDDI_WIN7)
940 {
942  struct
943  {
951  };
953 
954 typedef struct _COUNTER_READING
955 {
961 
962 typedef struct _KTHREAD_COUNTERS
963 {
965  struct _THREAD_PERFORMANCE_DATA* UserData;
972 #endif
973 
975 #if (NTDDI_VERSION >= NTDDI_WIN8)
976 typedef struct _RTL_RB_TREE
977 {
981 #endif
982 
983 #if (NTDDI_VERSION >= NTDDI_WINBLUE)
985 {
986  union
987  {
988  struct
989  {
990 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 6.4.9841.0
992 #else
993  ULONG_PTR Waiting : 1;
994 #endif
996  ULONG_PTR Reserved : (8 * sizeof(PVOID)) - 3; // previously Spare
998  };
1000  };
1001  union
1002  {
1004  struct
1005  {
1007 #ifdef _WIN64
1008  ULONG SessionPad;
1009 #endif
1010  };
1011  };
1013 
1014 typedef struct _KLOCK_ENTRY
1015 {
1016  union
1017  {
1020  };
1021 #if (NTDDI_VERSION >= NTDDI_WIN10)
1022  union
1023  {
1025  struct
1026  {
1028  union
1029  {
1031  struct
1032  {
1035  };
1036  };
1037  union
1038  {
1041  };
1042  union
1043  {
1045  struct
1046  {
1049  UCHAR IoQoSWaiter : 1; // since TH2
1051  };
1052  };
1053  };
1054  struct
1055  {
1058  };
1059  };
1060 #ifdef _WIN64
1061  ULONG SpareFlags;
1062 #endif
1063 #else
1064  union
1065  {
1066  PVOID ThreadUnsafe;
1067  struct
1068  {
1069  volatile UCHAR HeadNodeByte;
1070  UCHAR Reserved1[2];
1071  volatile UCHAR AcquiredByte;
1072  };
1073  };
1074 #endif
1075 
1076  union
1077  {
1080  struct
1081  {
1082 #if (NTDDI_VERSION >= NTDDI_WIN10)
1084 #else
1085  volatile UCHAR WaitingAndBusyByte;
1086 #endif
1087  UCHAR Reserved[sizeof(PVOID) - 2];
1089  union
1090  {
1092  struct
1093  {
1095 #ifdef _WIN64
1096  ULONG SessionPad;
1097 #endif
1098  };
1099  };
1100  };
1101  };
1102  union
1103  {
1104  struct
1105  {
1108  };
1110  };
1112  union
1113  {
1114 #if _WIN64
1115  ULONG AllBoosts : 17;
1116 #else
1118 #endif
1119  struct
1120  {
1121  struct
1122  {
1125  };
1126  struct
1127  {
1131  };
1132  };
1133  };
1134 #if _WIN64
1135  ULONG SparePad;
1136 #endif
1138 
1139 #endif
1140 
1141 //
1142 // Kernel Thread (KTHREAD)
1143 //
1144 #if (NTDDI_VERSION < NTDDI_WIN8)
1145 
1146 typedef struct _KTHREAD
1147 {
1149 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1151 #ifndef _WIN64 // [
1153 #endif // ]
1155 #else // ][
1157 #endif // ]
1159  ULONG_PTR StackLimit; // FIXME: PVOID
1162 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1164  BOOLEAN Running;
1165  BOOLEAN Alerted[2];
1166  union
1167  {
1168  struct
1169  {
1170  ULONG KernelStackResident:1;
1173  ULONG WaitNext:1;
1175  ULONG Alertable:1;
1176  ULONG GdiFlushActive:1;
1182  ULONG TimerActive:1;
1183  ULONG Reserved:19;
1184  };
1185  LONG MiscFlags;
1186  };
1187 #endif // ]
1188  union
1189  {
1191  struct
1192  {
1193  UCHAR ApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1];
1194 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1195  SCHAR Priority;
1196 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1197  /* On x86, the following members "fall out" of the union */
1198  volatile ULONG NextProcessor;
1199  volatile ULONG DeferredProcessor;
1200 #else // ][
1201  /* On x86, the following members "fall out" of the union */
1202  volatile USHORT NextProcessor;
1203  volatile USHORT DeferredProcessor;
1204 #endif // ]
1205 #else // ][
1207  /* On x86, the following members "fall out" of the union */
1208  volatile UCHAR NextProcessor;
1209  volatile UCHAR DeferredProcessor;
1212 #endif // ]
1213  };
1214  };
1215  KSPIN_LOCK ApcQueueLock;
1216 #ifndef _M_AMD64 // [
1218  volatile UCHAR State;
1219  UCHAR NpxState;
1220  KIRQL WaitIrql;
1222 #endif // ]
1224 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1226 #else // ][
1227  union
1228  {
1231  };
1232 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1233  union
1234  {
1235  struct
1236  {
1237  ULONG KernelStackResident:1;
1240  ULONG WaitNext:1;
1242  ULONG Alertable:1;
1243  ULONG GdiFlushActive:1;
1244  ULONG Reserved:25;
1245  };
1246  LONG MiscFlags;
1247  };
1248 #else // ][
1250  BOOLEAN WaitNext;
1251 #endif // ]
1252  UCHAR WaitReason;
1253 #if (NTDDI_VERSION < NTDDI_LONGHORN)
1254  SCHAR Priority;
1256 #endif // ]
1257  volatile UCHAR SwapBusy;
1259 #endif // ]
1260  union
1261  {
1264  };
1265  PKQUEUE Queue;
1266 #ifndef _M_AMD64 // [
1267  ULONG WaitTime;
1268  union
1269  {
1270  struct
1271  {
1274  };
1276  };
1277 #endif // ]
1278  struct _TEB *Teb;
1279 
1280 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1281  KTIMER Timer;
1282 #else // ][
1283  union
1284  {
1285  KTIMER Timer;
1286  struct
1287  {
1288  UCHAR TimerFill[FIELD_OFFSET(KTIMER, Period) + sizeof(LONG)];
1289 #if !defined(_WIN64) // [
1290  };
1291  };
1292 #endif // ]
1293 #endif // ]
1294  union
1295  {
1296  struct
1297  {
1298  ULONG AutoAlignment:1;
1299  ULONG DisableBoost:1;
1300 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1301  ULONG EtwStackTraceApc1Inserted:1;
1302  ULONG EtwStackTraceApc2Inserted:1;
1303  ULONG CycleChargePending:1;
1304  ULONG CalloutActive:1;
1305  ULONG ApcQueueable:1;
1307  ULONG GuiThread:1;
1308  ULONG ReservedFlags:23;
1309 #else // ][
1310  LONG ReservedFlags:30;
1311 #endif // ]
1312  };
1313  LONG ThreadFlags;
1314  };
1315 #if defined(_WIN64) && (NTDDI_VERSION < NTDDI_WIN7) // [
1316  };
1317  };
1318 #endif // ]
1319 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1320 #if defined(_WIN64) // [
1321  ULONG Spare0;
1322 #else // ][
1324 #endif // ]
1325 #endif // ]
1326  union
1327  {
1329 #if (NTDDI_VERSION < NTDDI_WIN7) // [
1330  struct
1331  {
1332  UCHAR WaitBlockFill0[FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 32bit = 23, 64bit = 43
1333 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1334  UCHAR IdealProcessor;
1335 #else // ][
1336  BOOLEAN SystemAffinityActive;
1337 #endif // ]
1338  };
1339  struct
1340  {
1341  UCHAR WaitBlockFill1[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 47 / 91
1343  };
1344  struct
1345  {
1346  UCHAR WaitBlockFill2[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 71 / 139
1347  UCHAR ResourceIndex;
1348  };
1349  struct
1350  {
1351  UCHAR WaitBlockFill3[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareByte)]; // 95 / 187
1352  UCHAR LargeStack;
1353  };
1354 #endif // ]
1355 #ifdef _WIN64 // [
1356  struct
1357  {
1358  UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1359  ULONG ContextSwitches;
1360  };
1361  struct
1362  {
1363  UCHAR WaitBlockFill5[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1364  UCHAR State;
1365  UCHAR NpxState;
1366  UCHAR WaitIrql;
1367  CHAR WaitMode;
1368  };
1369  struct
1370  {
1371  UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1372  ULONG WaitTime;
1373  };
1374 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1375  struct
1376  {
1377  UCHAR WaitBlockFill7[168];
1378  PVOID TebMappedLowVa;
1379  struct _UMS_CONTROL_BLOCK* Ucb;
1380  };
1381 #endif // ]
1382  struct
1383  {
1384 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1385  UCHAR WaitBlockFill8[188];
1386 #else // ][
1387  UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)];
1388 #endif // ]
1389  union
1390  {
1391  struct
1392  {
1393  SHORT KernelApcDisable;
1394  SHORT SpecialApcDisable;
1395  };
1396  ULONG CombinedApcDisable;
1397  };
1398  };
1399 #endif // ]
1400  };
1401  LIST_ENTRY QueueListEntry;
1402  PKTRAP_FRAME TrapFrame;
1403 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1404  PVOID FirstArgument;
1405  union
1406  {
1407  PVOID CallbackStack;
1408  ULONG_PTR CallbackDepth;
1409  };
1410 #else // ][
1411  PVOID CallbackStack;
1412 #endif // ]
1413 #if (NTDDI_VERSION < NTDDI_LONGHORN) || ((NTDDI_VERSION < NTDDI_WIN7) && !defined(_WIN64)) // [
1415 #endif // ]
1416 #if (NTDDI_VERSION < NTDDI_LONGHORN) && defined(_WIN64) // [
1417  ULONG KernelLimit;
1418 #endif // ]
1419  UCHAR ApcStateIndex;
1420 #if (NTDDI_VERSION < NTDDI_LONGHORN) // [
1421  UCHAR IdealProcessor;
1422  BOOLEAN Preempted;
1423  BOOLEAN ProcessReadyQueue;
1424 #ifdef _WIN64 // [
1425  PVOID Win32kTable;
1426  ULONG Win32kLimit;
1427 #endif // ]
1428  BOOLEAN KernelStackResident;
1429 #endif // ]
1430  SCHAR BasePriority;
1431  SCHAR PriorityDecrement;
1432 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1433  BOOLEAN Preempted;
1434  UCHAR AdjustReason;
1435  CHAR AdjustIncrement;
1436 #if (NTDDI_VERSION >= NTDDI_WIN7)
1438 #else
1439  UCHAR Spare01;
1440 #endif
1441 #endif // ]
1442  CHAR Saturation;
1443 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1444  ULONG SystemCallNumber;
1445 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1446  ULONG FreezeCount;
1447 #else // ][
1448  ULONG Spare02;
1449 #endif // ]
1450 #endif // ]
1451 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1452  GROUP_AFFINITY UserAffinity;
1453  struct _KPROCESS *Process;
1455  ULONG IdealProcessor;
1456  ULONG UserIdealProcessor;
1457 #else // ][
1458  KAFFINITY UserAffinity;
1459  struct _KPROCESS *Process;
1461 #endif // ]
1462  PKAPC_STATE ApcStatePointer[2];
1463  union
1464  {
1465  KAPC_STATE SavedApcState;
1466  struct
1467  {
1468  UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1];
1469 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1470  UCHAR WaitReason;
1471 #else // ][
1472  CCHAR FreezeCount;
1473 #endif // ]
1474 #ifndef _WIN64 // [
1475  };
1476  };
1477 #endif // ]
1478  CCHAR SuspendCount;
1479 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1480  CCHAR Spare1;
1481 #else // ][
1482  UCHAR UserIdealProcessor;
1483 #endif // ]
1484 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1485 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1486  UCHAR Spare03;
1487 #else // ][
1488  UCHAR CalloutActive;
1489 #endif // ]
1490 #ifdef _WIN64 // [
1491  UCHAR CodePatchInProgress;
1492  };
1493  };
1494 #endif // ]
1495 #if defined(_M_IX86) // [
1496 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1497  UCHAR OtherPlatformFill;
1498 #else // ][
1499  UCHAR Iopl;
1500 #endif // ]
1501 #endif // ]
1502  PVOID Win32Thread;
1503  PVOID StackBase;
1504  union
1505  {
1506  KAPC SuspendApc;
1507  struct
1508  {
1509  UCHAR SuspendApcFill0[1];
1510 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1511  UCHAR ResourceIndex;
1512 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1513  CHAR Spare04;
1514 #else // ][
1515  SCHAR Quantum;
1516 #endif // ]
1517  };
1518  struct
1519  {
1520  UCHAR SuspendApcFill1[3];
1522  };
1523  struct
1524  {
1525  UCHAR SuspendApcFill2[4];
1526  ULONG KernelTime;
1527  };
1528  struct
1529  {
1530  UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)];
1531 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
1532  PKPRCB WaitPrcb;
1533 #else
1534  PVOID TlsArray;
1535 #endif
1536  };
1537  struct
1538  {
1539  UCHAR SuspendApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]; // 40 / 72
1540  PVOID LegoData;
1541  };
1542  struct
1543  {
1544  UCHAR SuspendApcFill5[FIELD_OFFSET(KAPC, Inserted) + 1]; // 47 / 83
1545 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1546  UCHAR LargeStack;
1547 #else // ][
1548  UCHAR PowerState;
1549 #endif // ]
1550 #ifdef _WIN64 // [
1551  ULONG UserTime;
1552 #endif // ]
1553  };
1554  };
1555 #ifndef _WIN64 // [
1556  ULONG UserTime;
1557 #endif // ]
1558  union
1559  {
1560  KSEMAPHORE SuspendSemaphore;
1561  struct
1562  {
1563  UCHAR SuspendSemaphorefill[FIELD_OFFSET(KSEMAPHORE, Limit) + 4]; // 20 / 28
1564 #ifdef _WIN64 // [
1565  ULONG SListFaultCount;
1566 #endif // ]
1567  };
1568  };
1569 #ifndef _WIN64 // [
1570  ULONG SListFaultCount;
1571 #endif // ]
1572  LIST_ENTRY ThreadListEntry;
1573 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
1574  LIST_ENTRY MutantListHead;
1575 #endif // ]
1576  PVOID SListFaultAddress;
1577 #ifdef _M_AMD64 // [
1578  LONG64 ReadOperationCount;
1579  LONG64 WriteOperationCount;
1580  LONG64 OtherOperationCount;
1581  LONG64 ReadTransferCount;
1582  LONG64 WriteTransferCount;
1583  LONG64 OtherTransferCount;
1584 #endif // ]
1585 #if (NTDDI_VERSION >= NTDDI_WIN7) // [
1586  PKTHREAD_COUNTERS ThreadCounters;
1587  PXSTATE_SAVE XStateSave;
1588 #elif (NTDDI_VERSION >= NTDDI_LONGHORN) // ][
1589  PVOID MdlForLockedTeb;
1590 #endif // ]
1591 } KTHREAD;
1592 
1593 #else // not (NTDDI_VERSION < NTDDI_WIN8)
1594 
1595 #if defined(_WIN64) && (NTDDI_VERSION < 0x06032580) // since WIN 8.1 Update1 6.3.9600.16384
1596 #define NUMBER_OF_LOCK_ENTRIES 5
1597 #else
1598 #define NUMBER_OF_LOCK_ENTRIES 6
1599 #endif
1600 
1601 typedef struct _KTHREAD
1602 {
1607  volatile VOID *StackLimit;
1610  volatile ULONG64 CycleTime;
1611 #ifndef _WIN64
1614 #endif
1619  struct _KSCHEDULING_GROUP* SchedulingGroup;
1623 
1624  union
1625  {
1626  struct
1627  {
1628 #if (NTDDI_VERSION < NTDDI_WIN10)
1629  ULONG KernelStackResident : 1;
1630 #else
1632 #endif
1634 #if (NTDDI_VERSION < NTDDI_WIN10TH2)
1636 #endif
1641 #if (NTDDI_VERSION < NTDDI_WIN81)
1642  ULONG CodePatchInProgress : 1;
1643 #endif
1658  };
1660  };
1661 
1662  union
1663  {
1664  struct
1665  {
1680 #if (NTDDI_VERSION >= 0x060324D7) // since 6.3.9431.0
1681  ULONG TerminationApcRequest : 1;
1682 #endif
1683 #if (NTDDI_VERSION >= 0x06032580) // since 6.3.9600.16384
1684  ULONG AutoBoostEntriesExhausted : 1;
1685 #endif
1686 #if (NTDDI_VERSION >= 0x06032580) // since 6.3.9600.17031
1687  ULONG KernelStackResident : 1;
1688 #endif
1689 #if (NTDDI_VERSION >= NTDDI_WIN10)
1693 #endif
1695 #if (NTDDI_VERSION < NTDDI_WIN10)
1696  ULONG ReservedFlags : 10;
1697 #endif
1698  };
1700  };
1701 
1702 #if (NTDDI_VERSION >= NTDDI_WIN10)
1703  volatile UCHAR Tag;
1708 #else
1709  ULONG Spare0;
1710 #endif
1712 #ifdef _WIN64
1713  ULONG Spare1; // Win 10: Spare10
1714 #endif
1717 
1718  union
1719  {
1721  struct
1722  {
1723  UCHAR ApcStateFill[RTL_SIZEOF_THROUGH_FIELD(KAPC_STATE, UserApcPending)]; // 32bit: 23/0x17, 64bit: 43/0x2B
1726  };
1727  };
1728 
1729 #ifndef _WIN64
1731  volatile UCHAR State;
1732 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10074.0
1734 #else
1735  CHAR NpxState;
1736 #endif
1739 #endif
1740 
1743  union
1744  {
1747  };
1750 #if (NTDDI_VERSION >= NTDDI_WIN8 /* 0x060223F0 */) // since 6.2.9200.16384
1752 #endif
1754 
1755  union
1756  {
1758 #ifdef _WIN64
1759  struct
1760  {
1761  UCHAR WaitBlockFill4[FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 20/0x14
1763  };
1764  struct
1765  {
1766  UCHAR WaitBlockFill5[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 68/0x44
1767  UCHAR State;
1768 #if (NTDDI_VERSION >= NTDDI_WIN10)
1769  CHAR Spare13;
1770 #else
1771  CHAR NpxState;
1772 #endif
1773  UCHAR WaitIrql;
1774  CHAR WaitMode;
1775  };
1776  struct
1777  {
1778  UCHAR WaitBlockFill6[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 116/0x74
1779  ULONG WaitTime;
1780  };
1781  struct
1782  {
1783  UCHAR WaitBlockFill7[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SpareLong)]; // 32bit: -, 64bit: 164/0xA4
1784  union
1785  {
1786  struct
1787  {
1790  };
1792  };
1793  };
1794 #endif
1795  struct
1796  {
1797  UCHAR WaitBlockFill8[FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 20/0x14, 64bit: 40/0x28
1799  };
1800  struct
1801  {
1802  UCHAR WaitBlockFill9[1 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 44/0x2C, 64bit: 88/0x58
1804  };
1805  struct
1806  {
1807  UCHAR WaitBlockFill10[2 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]; // 32bit: 68/0x44, 64bit: 136/0x88
1809  };
1810  struct
1811  {
1812  UCHAR WaitBlockFill11[3 * sizeof(KWAIT_BLOCK) + FIELD_OFFSET(KWAIT_BLOCK, Object)]; // 32bit: 88/0x58, 64bit: 176/0xB0
1813 #ifdef _WIN64
1814  struct _UMS_CONTROL_BLOCK* Ucb;
1815  struct _KUMS_CONTEXT_HEADER* Uch;
1816 #else
1818  union
1819  {
1820  struct
1821  {
1824  };
1826  };
1827 #endif
1828  };
1829  };
1830 
1831 #ifdef _WIN64
1832  PVOID TebMappedLowVa;
1833 #endif
1835 #if (NTDDI_VERSION >= 0x060223F0) // since 6.2.9200.16384
1836  union
1837  {
1839  struct
1840  {
1841  ULONG NextProcessorNumber : 31;
1842  ULONG SharedReadyQueue : 1;
1843  };
1844  };
1845  LONG QueuePriority;
1846 #else
1849 #endif
1851 
1852  union
1853  {
1855  struct
1856  {
1857  UCHAR UserAffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]; // 32bit: 6/0x6, 64bit: 10/0x0A
1860  union
1861  {
1863  struct
1864  {
1867  };
1868  };
1872  };
1873  };
1874 
1875 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1877 #endif
1878  union
1879  {
1881  struct
1882  {
1883  UCHAR AffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]; // 32bit: 6/0x6, 64bit: 10/0x0A
1887  };
1888  };
1889 
1890 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1891 #ifdef _WIN64
1892  ULONG64 NpxState;
1893 #else
1895 #endif
1896 #else
1897  PKAPC_STATE ApcStatePointer[2];
1898 #endif
1899 
1900  union
1901  {
1903  struct
1904  {
1905  UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending) + 1]; // 32bit: 23/0x17, 64bit: 43/0x2B
1910  };
1911  };
1912 
1913  union
1914  {
1916  struct
1917  {
1918  UCHAR SchedulerApcFill0[FIELD_OFFSET(KAPC, SpareByte0)]; // 32bit: 1/0x01, 64bit: 1/0x01
1920  };
1921  struct
1922  {
1923  UCHAR SchedulerApcFill1[FIELD_OFFSET(KAPC, SpareByte1)]; // 32bit: 3/0x03, 64bit: 3/0x03
1925  };
1926  struct
1927  {
1928  UCHAR SchedulerApcFill2[FIELD_OFFSET(KAPC, SpareLong0)]; // 32bit: 4/0x04, 64bit: 4/0x04
1930  };
1931  struct
1932  {
1933  UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)]; // 32 bit:, 64 bit: 64/0x40
1935  };
1936  struct
1937  {
1938  UCHAR SchedulerApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]; // 32 bit:, 64 bit: 72/0x48
1940  };
1941  struct
1942  {
1943  UCHAR SchedulerApcFill5[FIELD_OFFSET(KAPC, Inserted) + 1]; // 32 bit:, 64 bit: 83/0x53
1946  };
1947  };
1948 
1952 
1953 #if (NTDDI_VERSION >= NTDDI_WIN10)
1957 #if _WIN64
1958  ULONG SecureThreadCookie;
1959 #endif
1960 #elif (NTDDI_VERSION >= NTDDI_WINBLUE) // 6.3.9431.0
1961  SINGLE_LIST_ENTRY LockEntriesFreeList;
1962 #endif
1963 
1964 #if (NTDDI_VERSION >= NTDDI_WINBLUE /* 0x06032580 */) // since 6.3.9600.16384
1971  #if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
1973  #endif
1974 
1975  #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10240.16384
1977  #else
1978  volatile SHORT AbReferenceCount;
1979  #endif
1980  #if (NTDDI_VERSION >= 0x06040000) // since 6.4.9841.0
1981  UCHAR AbOrphanedEntrySummary;
1982  UCHAR AbOwnedEntryCount;
1983  #else
1986  #endif
1988  union
1989  {
1991  struct
1992  {
1995  };
1996  };
1997 #endif
1998 
1999 #if _WIN64
2000  LONG64 ReadOperationCount;
2001  LONG64 WriteOperationCount;
2002  LONG64 OtherOperationCount;
2003  LONG64 ReadTransferCount;
2004  LONG64 WriteTransferCount;
2005  LONG64 OtherTransferCount;
2006 #endif
2007 #if (NTDDI_VERSION >= NTDDI_WIN10) // since 10.0.10041.0
2008  struct _KSCB *QueuedScb;
2009 #ifndef _WIN64
2011 #endif
2012 #endif
2013 } KTHREAD;
2014 
2015 #endif
2016 
2017 
2018 #define ASSERT_THREAD(object) \
2019  ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == ThreadObject))
2020 
2021 //
2022 // Kernel Process (KPROCESS)
2023 //
2024 typedef struct _KPROCESS
2025 {
2028 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
2031 #else
2033 #endif
2034 #if defined(_M_IX86)
2035  KGDTENTRY LdtDescriptor;
2036  KIDTENTRY Int21Descriptor;
2037 #endif
2039 #if defined(_M_IX86)
2040  UCHAR Iopl;
2041  UCHAR Unused;
2042 #endif
2052  union
2053  {
2054  struct
2055  {
2060  };
2062  };
2070  union
2071  {
2074  };
2077 #if (NTDDI_VERSION >= NTDDI_LONGHORN) // [
2079 #endif // ]
2080 } KPROCESS;
2081 
2082 #define ASSERT_PROCESS(object) \
2083  ASSERT((((object)->Header.Type & KOBJECT_TYPE_MASK) == ProcessObject))
2084 
2085 //
2086 // System Service Table Descriptor
2087 //
2089 {
2093 #if defined(_IA64_)
2094  LONG TableBaseGpOffset;
2095 #endif
2098 
2099 #if (NTDDI_VERSION >= NTDDI_WIN8)
2100 //
2101 // Entropy Timing State
2102 //
2104 {
2111 
2112 //
2113 // Constants from ks386.inc, ksamd64.inc and ksarm.h
2114 //
2115 #define KENTROPY_TIMING_INTERRUPTS_PER_BUFFER 0x400
2116 #define KENTROPY_TIMING_BUFFER_MASK 0x7ff
2117 #define KENTROPY_TIMING_ANALYSIS 0x0
2118 
2119 #endif /* (NTDDI_VERSION >= NTDDI_WIN8) */
2120 
2121 //
2122 // Exported Loader Parameter Block
2123 //
2125 
2126 //
2127 // Exported Hardware Data
2128 //
2136 
2137 //
2138 // Exported System Service Descriptor Tables
2139 //
2142 
2143 #endif // !NTOS_MODE_USER
2144 
2145 #endif // _KETYPES_H
ULONG LargePageMinimum
Definition: ketypes.h:1167
BOOLEAN Started
Definition: ketypes.h:869
ULONG ServiceCount
Definition: ketypes.h:901
_KWAIT_REASON
Definition: ketypes.h:402
CSHORT Type
Definition: ketypes.h:858
UCHAR SuspendApcFill3[FIELD_OFFSET(KAPC, SystemArgument1)]
Definition: ketypes.h:1933
PVOID StackBase
Definition: ketypes.h:183
SCHAR QuantumReset
Definition: ketypes.h:2064
LONG ThreadFlags
Definition: ketypes.h:1699
ULONG LowPart
Definition: ketypes.h:917
CONTEXT FiberContext
Definition: ketypes.h:186
struct _KTIMER_TABLE KTIMER_TABLE
LONG AbCompletedIoQoSBoostCount
Definition: ketypes.h:1972
ULONG NtMinorVersion
Definition: ketypes.h:1172
PVOID Buffer
Definition: ketypes.h:865
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1166
ULONG ExAcqResSharedWaitForExclusiveAttempts
Definition: ketypes.h:767
ULONG FreezeCount
Definition: ketypes.h:1679
#define IN
Definition: typedefs.h:39
ULONG_PTR Unused0
Definition: ketypes.h:2030
ULONG SharedDataFlags
Definition: ketypes.h:1204
_VDMSERVICECLASS
Definition: ketypes.h:503
ULONG AutoBoostActive
Definition: ketypes.h:1631
UCHAR Spare1
Definition: ketypes.h:1050
enum _KPROCESS_STATE * PKPROCESS_STATE
BOOLEAN Connected
Definition: ketypes.h:894
KAFFINITY Affinity
Definition: ketypes.h:867
KSPIN_LOCK Lock
Definition: ketypes.h:716
USHORT UserModeGlobalLogger[16]
Definition: ketypes.h:1240
ULONG EtwStackTraceApcInserted
Definition: ketypes.h:1694
USHORT AllBoosts
Definition: ketypes.h:1117
ULONG UserIdealProcessor
Definition: ketypes.h:1725
KAPC_STATE
Definition: ketypes.h:1285
ULONG TimerActive
Definition: ketypes.h:1648
struct _KENTROPY_TIMING_STATE KENTROPY_TIMING_STATE
LONG DisableBoost
Definition: ketypes.h:2057
USHORT Spare20
Definition: ketypes.h:1956
_KPROCESS_STATE
Definition: ketypes.h:491
ULONG ExTryToAcqExclusiveAttempts
Definition: ketypes.h:776
UCHAR AbWaitEntryCount
Definition: ketypes.h:1955
PVOID RangeBase
Definition: ketypes.h:862
struct _KDPC_DATA KDPC_DATA
RTL_RB_TREE WaiterTree
Definition: ketypes.h:1107
KSPIN_LOCK SpinLock
Definition: ketypes.h:886
ULONG Reserved2[7]
Definition: ketypes.h:1168
CONTEXT Context
Definition: ketypes.h:850
enum _KAPC_ENVIRONMENT KAPC_ENVIRONMENT
ULONG EnableStackSwap
Definition: ketypes.h:1671
_ALTERNATIVE_ARCHITECTURE_TYPE
Definition: ketypes.h:889
ULONG AlertedByThreadId
Definition: ketypes.h:1669
volatile LONG AbCompletedIoBoostCount
Definition: ketypes.h:1970
KTIMER_TABLE_ENTRY TimerEntries[256]
Definition: ketypes.h:725
ULONG_PTR DirectoryTableBase
Definition: ketypes.h:2029
enum _KOBJECTS KOBJECTS
UCHAR State
Definition: ketypes.h:2065
SHORT SpecialApcDisable
Definition: ketypes.h:1823
USHORT IoNormalPriorityWaiterCount
Definition: ketypes.h:1129
UCHAR AcquiredBit
Definition: ketypes.h:1040
Definition: ntbasedef.h:628
ULONG ForegroundLossTime
Definition: ketypes.h:1987
ULONG CombinedApcDisable
Definition: ketypes.h:1825
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:1024
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:1644
SCHAR BasePriority
Definition: ketypes.h:2063
KAPC_STATE SavedApcState
Definition: ketypes.h:1902
LONG ProcessFlags
Definition: ketypes.h:2061
ULONG ExSetResOwnerPointerSharedOld
Definition: ketypes.h:775
ULONG ExAcqResExclusiveAttempts
Definition: ketypes.h:750
PVOID ServiceTable
Definition: ketypes.h:1613
UCHAR UnusualBoost
Definition: ketypes.h:1866
PVOID StackLimit
Definition: ketypes.h:184
_KOBJECTS
Definition: ketypes.h:437
UCHAR SchedulerApcFill2[FIELD_OFFSET(KAPC, SpareLong0)]
Definition: ketypes.h:1928
struct _KTHREAD_COUNTERS * ThreadCounters
Definition: ketypes.h:1798
UCHAR SchedulerApcFill5[FIELD_OFFSET(KAPC, Inserted)+1]
Definition: ketypes.h:1943
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
CSHORT Size
Definition: ketypes.h:919
ULONG ProcessDetachActive
Definition: ketypes.h:1650
PKSERVICE_ROUTINE MessageServiceRoutine
Definition: ketypes.h:882
USHORT IopmOffset
Definition: ketypes.h:2038
PVOID SListFaultAddress
Definition: ketypes.h:1604
Definition: ketypes.h:984
struct _KTIMER_TABLE_ENTRY * PKTIMER_TABLE_ENTRY
LONGLONG ConsoleSessionForegroundProcessId
Definition: ketypes.h:1235
ULONG Spare15
Definition: ketypes.h:1894
ULONG CommitFailTerminateRequest
Definition: ketypes.h:1690
union _KWAIT_STATUS_REGISTER KWAIT_STATUS_REGISTER
ULONGLONG TestRetInstruction
Definition: ketypes.h:1220
SCHAR Priority
Definition: ketypes.h:1724
ULONG MaxStackTraceDepth
Definition: ketypes.h:1164
UCHAR AcquiredByte
Definition: ketypes.h:1039
_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:1655
ULONG64 Total
Definition: ketypes.h:959
UCHAR Removable
Definition: ketypes.h:833
struct _KDPC_LIST KDPC_LIST
ULONG CryptoExponent
Definition: ketypes.h:1165
CHAR Saturation
Definition: ketypes.h:1908
BOOLEAN Alerted[MaximumMode]
Definition: ketypes.h:1622
_In_ LARGE_INTEGER _In_ ULONG Period
Definition: kefuncs.h:1326
PKTRAP_FRAME TrapFrame
Definition: ketypes.h:1716
ULONG QuantumDonation
Definition: ketypes.h:1670
ULONG_PTR InTree
Definition: ketypes.h:997
ULONG SystemThread
Definition: ketypes.h:1649
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:1742
ULONG Reserved
Definition: ketypes.h:1657
CSHORT Type
Definition: ketypes.h:877
USHORT IoQoSBoost
Definition: ketypes.h:1128
ULONG UserAffinitySet
Definition: ketypes.h:1668
ULONG DeferPreemption
Definition: ketypes.h:1675
Definition: ketypes.h:1014
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:1850
#define NUMBER_OF_LOCK_ENTRIES
Definition: ketypes.h:1598
struct _KEVENT_PAIR * PKEVENT_PAIR
ULONG ProcessReadyQueue
Definition: ketypes.h:1637
ULONG_PTR Busy
Definition: ketypes.h:995
struct _KEVENT_PAIR KEVENT_PAIR
ULONG NTSYSAPI KiDmaIoCoherency
Definition: cpu.c:27
struct _SINGLE_LIST_ENTRY * PfnDeferredList
Definition: ketypes.h:838
KLOCK_ENTRY_LOCK_STATE LockState
Definition: ketypes.h:1078
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:893
UCHAR ExecuteDisable
Definition: ketypes.h:929
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:976
SINGLE_LIST_ENTRY FreeListEntry
Definition: ketypes.h:1019
ULONG64 HardwareCounters
Definition: ketypes.h:969
ULONG_PTR DpcLock
Definition: ketypes.h:794
ULONG ExAcqResSharedWaits
Definition: ketypes.h:759
ULONG UmsDirectedSwitchEnable
Definition: ketypes.h:1647
_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:897
enum _KPROCESS_STATE KPROCESS_STATE
volatile ULONG HighCycleTime
Definition: ketypes.h:1612
KSERVICE_ROUTINE * PKSERVICE_ROUTINE
Definition: ketypes.h:500
ULONG ExplicitIdealProcessor
Definition: ketypes.h:1678
ULONG ExAcqResSharedAcquiresExclusive
Definition: ketypes.h:756
Definition: ketypes.h:713
_TIMER_TYPE
PKPRCB WaitPrcb
Definition: ketypes.h:1934
uint32_t ULONG_PTR
Definition: typedefs.h:65
PVOID LockState
Definition: ketypes.h:999
ULONG NextProcessor
Definition: ketypes.h:1847
BOOLEAN SafeBootMode
Definition: ketypes.h:1190
LONG ReservedFlags
Definition: ketypes.h:2059
SLIST_HEADER DeadStackList
Definition: ketypes.h:826
ULONG AutoAlignment
Definition: ketypes.h:1666
PVOID FiberData
Definition: ketypes.h:181
BOOLEAN NTSYSAPI KiEnableTimerWatchdog
Definition: timerobj.c:20
UCHAR IoQoSWaiter
Definition: ketypes.h:1049
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:861
ULONG ExecutiveResourceReleaseSharedCount
Definition: ketypes.h:748
UCHAR PriorityFloorCounts[16]
Definition: ketypes.h:1968
ULONG AllFlags
Definition: ketypes.h:1057
enum _NT_PRODUCT_TYPE * PNT_PRODUCT_TYPE
ULONG ExBoostSharedOwners
Definition: ketypes.h:779
RTL_BALANCED_NODE TreeNode
Definition: ketypes.h:1018
VOID(NTAPI * PKSYSTEM_ROUTINE)(PKSTART_ROUTINE StartRoutine, PVOID StartContext)
Definition: ketypes.h:677
struct _GETSETCONTEXT GETSETCONTEXT
PXSTATE_SAVE XStateSave
Definition: ketypes.h:1803
SINGLE_LIST_ENTRY ForegroundDpcStackListEntry
Definition: ketypes.h:1993
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
LONG MiscFlags
Definition: ketypes.h:1659
ULONG NtMajorVersion
Definition: ketypes.h:1171
SHORT KernelApcDisable
Definition: ketypes.h:1822
KPROFILE_SOURCE Source
Definition: ketypes.h:868
UCHAR CallbackNestingLevel
Definition: ketypes.h:1944
ULONG ImageFileExecutionOptions
Definition: ketypes.h:1246
ULONG TickCount
Definition: ketypes.h:887
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:979
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:2073
NT_PRODUCT_TYPE NtProductType
Definition: ketypes.h:1169
KDPC_LIST DpcList
Definition: ketypes.h:790
UCHAR SystemHeteroCpuPolicy
Definition: ketypes.h:1704
KAPC_STATE ApcState
Definition: ketypes.h:1720
short SHORT
Definition: pedump.c:59
UCHAR EntryOffset
Definition: ketypes.h:1027
ULONG SystemAffinityActive
Definition: ketypes.h:1639
struct _KTHREAD_COUNTERS * PKTHREAD_COUNTERS
PVOID FirstArgument
Definition: ketypes.h:1715
ULONG SessionId
Definition: ketypes.h:1094
BOOLEAN KdDebuggerEnabled
Definition: ketypes.h:1181
ULONG_PTR EntryLock
Definition: ketypes.h:1111
KEVENT Event
Definition: ketypes.h:848
ULONG WaitNext
Definition: ketypes.h:1638
ULONG ExAcqResSharedAcquiresShared
Definition: ketypes.h:757
ULONG TickCountMultiplier
Definition: ketypes.h:1157
ULONG ExAcqResSharedWaitForExclusiveAcquiresSharedRecursive
Definition: ketypes.h:770
ULONG64 CycleTimeBias
Definition: ketypes.h:968
UCHAR ImageDispatchEnable
Definition: ketypes.h:934
volatile UCHAR CrossThreadReleasableAndBusyByte
Definition: ketypes.h:1083
UCHAR UserHeteroCpuPolicy
Definition: ketypes.h:1705
ULONG ApcInterruptRequest
Definition: ketypes.h:1645
unsigned char BOOLEAN
LIST_ENTRY ProfileListEntry
Definition: ketypes.h:860
ULONG64 WaitReasonBitMap
Definition: ketypes.h:964
ULONG StackCount
Definition: ketypes.h:2075
enum _KPROFILE_SOURCE KPROFILE_SOURCE
PVOID RangeLimit
Definition: ketypes.h:863
enum _KINTERRUPT_MODE KINTERRUPT_MODE
ULONG TickCountLowDeprecated
Definition: ketypes.h:1156
SINGLE_LIST_ENTRY ListHead
Definition: ketypes.h:730
USHORT IoQoSWaiterCount
Definition: ketypes.h:1130
enum _VDMSERVICECLASS VDMSERVICECLASS
#define _In_
Definition: ms_sal.h:308
struct _KLOCK_ENTRY_LOCK_STATE * PKLOCK_ENTRY_LOCK_STATE
USHORT IoBoost
Definition: ketypes.h:1124
LIST_ENTRY QueueListEntry
Definition: ketypes.h:1834
LIST_ENTRY ProcessListEntry
Definition: ketypes.h:2076
_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:1807
PVOID KernelStack
Definition: ketypes.h:1617
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:849
void * PVOID
Definition: retypes.h:9
PVOID FlsData
Definition: ketypes.h:190
CHAR CpuPriorityKey
Definition: ketypes.h:1109
KTIMER Timer
Definition: ketypes.h:1753
ULONG DispatchCount
Definition: ketypes.h:902
LIST_ENTRY ThreadListHead
Definition: ketypes.h:2049
enum _KTHREAD_STATE KTHREAD_STATE
ULONG_PTR Reserved
Definition: ketypes.h:996
ULONG ScbReadyQueue
Definition: ketypes.h:1652
UCHAR DisableThunkEmulation
Definition: ketypes.h:931
LONG DisableQuantum
Definition: ketypes.h:2058
struct _KSYSTEM_TIME KSYSTEM_TIME
ULONG DpcCount
Definition: ketypes.h:800
CCHAR Number
Definition: ketypes.h:895
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:1906
CHAR BasePriority
Definition: ketypes.h:1859
ULARGE_INTEGER Time
Definition: ketypes.h:719
ULONG SessionId
Definition: ketypes.h:1006
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:1706
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:1667
ULONG Alertable
Definition: ketypes.h:1640
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
ULONG64 NpxState
Definition: ketypes.h:2010
SINGLE_LIST_ENTRY PropagateBoostsEntry
Definition: ketypes.h:1966
LIST_ENTRY InterruptListEntry
Definition: ketypes.h:879
volatile INT_PTR WaitStatus
Definition: ketypes.h:1741
int64_t LONGLONG
Definition: typedefs.h:68
struct _FIBER * PFIBER
KAFFINITY Affinity
Definition: ketypes.h:2051
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:1123
struct _KLOCK_ENTRY KLOCK_ENTRY
LIST_ENTRY Entry
Definition: ketypes.h:718
ULONG64 Start
Definition: ketypes.h:958
KIRQL Irql
Definition: ketypes.h:891
ULONG TebFlags
Definition: ketypes.h:192
ULONG KernelTime
Definition: ketypes.h:1929
VOID(NTAPI * PKRUNDOWN_ROUTINE)(IN struct _KAPC *Apc)
Definition: ketypes.h:690
ULONGLONG Rsvd1
Definition: ketypes.h:904
struct _THREAD_PERFORMANCE_DATA * UserData
Definition: ketypes.h:965
LONG High1Time
Definition: ketypes.h:918
UCHAR HeadNodeBit
Definition: ketypes.h:1047
UCHAR WaitingBit
Definition: ketypes.h:1033
ULONG MmShiftedColor
Definition: ketypes.h:836
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:1915
SINGLE_LIST_ENTRY SwapListEntry
Definition: ketypes.h:2047
UCHAR CrossThreadFlags
Definition: ketypes.h:1044
char CCHAR
Definition: typedefs.h:51
UCHAR Spare0
Definition: ketypes.h:1707
ULONG ExAcqResExclusiveNotAcquires
Definition: ketypes.h:754
uint64_t ULONGLONG
Definition: typedefs.h:67
UCHAR IoPriorityBit
Definition: ketypes.h:1048
SINGLE_LIST_ENTRY SwapListEntry
Definition: ketypes.h:1746
struct _KUSER_SHARED_DATA KUSER_SHARED_DATA
UCHAR Visited
Definition: ketypes.h:2069
BOOLEAN ShareVector
Definition: ketypes.h:896
ULONG DbgElevationEnabled
Definition: ketypes.h:1207
ULONG ExpectedRunTime
Definition: ketypes.h:1616
volatile VOID * StackLimit
Definition: ketypes.h:1607
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:883
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:1967
PKQUEUE Queue
Definition: ketypes.h:1748
KINTERRUPT_POLARITY Polarity
Definition: ketypes.h:899
ULONG64 QuantumTarget
Definition: ketypes.h:1605
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
Definition: ntbasedef.h:672
UCHAR WaitBlockFill8[FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]
Definition: ketypes.h:1797
ULONG ExReInitializeResourceCount
Definition: ketypes.h:743
struct _KSCHEDULING_GROUP * SchedulingGroup
Definition: ketypes.h:1619
PVOID LockUnsafe
Definition: ketypes.h:1079
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
struct _PP_LOOKASIDE_LIST * PPP_LOOKASIDE_LIST
ULONG ChargeOnlyGroup
Definition: ketypes.h:1674
UCHAR ForegroundBoost
Definition: ketypes.h:1865
struct _FIBER FIBER
LIST_ENTRY WaitListEntry
Definition: ketypes.h:1745
UCHAR AffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]
Definition: ketypes.h:1883
KEVENT SuspendEvent
Definition: ketypes.h:1949
UCHAR AdjustReason
Definition: ketypes.h:1870
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:2078
UCHAR AbEntrySummary
Definition: ketypes.h:1954
ULONG QuantumEndMigrate
Definition: ketypes.h:1646
enum _KINTERRUPT_POLARITY KINTERRUPT_POLARITY
unsigned __int64 ULONG64
Definition: imports.h:198
enum _TIMER_TYPE TIMER_TYPE
ULONG DisableStackCheck
Definition: ketypes.h:1656
ULONG ContextSwitches
Definition: ketypes.h:967
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _KTHREAD_COUNTERS KTHREAD_COUNTERS
ULONG Vector
Definition: ketypes.h:890
ULONG ExBoostExclusiveOwner
Definition: ketypes.h:778
COUNTER_READING HwCounter[16]
Definition: ketypes.h:970
PKSERVICE_ROUTINE ServiceRoutine
Definition: ketypes.h:880
UCHAR AbFreeEntryCount
Definition: ketypes.h:1984
UCHAR ThreadSeed
Definition: ketypes.h:2066
ULONG ExecutiveResourceConvertsCount
Definition: ketypes.h:749
_EVENT_TYPE
CSHORT Size
Definition: ketypes.h:859
PVOID NormalContext
Definition: ketypes.h:550
Definition: ketypes.h:687
UCHAR IdealNode
Definition: ketypes.h:2068
ULONG64 RelativeTimerBias
Definition: ketypes.h:1751
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:920
ULONG IdealProcessor
Definition: ketypes.h:1886
ULONG ExAcqResSharedWaitForExclusiveAcquiresExclusive
Definition: ketypes.h:768
ULONG_PTR InGlobalForegroundList
Definition: ketypes.h:1994
UCHAR SchedulerApcFill4[FIELD_OFFSET(KAPC, SystemArgument2)]
Definition: ketypes.h:1938
Definition: ketypes.h:535
LIST_ENTRY ReadyListHead
Definition: ketypes.h:2046
_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:1677
struct _GETSETCONTEXT * PGETSETCONTEXT
UCHAR ApcStateFill[RTL_SIZEOF_THROUGH_FIELD(KAPC_STATE, UserApcPending)]
Definition: ketypes.h:1723
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:829
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
ULONG IpiSendRequestRoutineCount
Definition: ketypes.h:740
ULONG PriorityFloorSummary
Definition: ketypes.h:1969
KSPIN_LOCK ProcessLock
Definition: ketypes.h:2050
ULONG ExAcqResSharedStarveExclusiveAcquiresSharedRecursive
Definition: ketypes.h:764
ULONG CurrentRunTime
Definition: ketypes.h:1615
struct _KTIMER_TABLE * PKTIMER_TABLE
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
CSHORT Type
Definition: ketypes.h:918
UCHAR QuantumReset
Definition: ketypes.h:1924
ULONG ExAcqResExclusiveAcquiresExclusive
Definition: ketypes.h:751
PKSPIN_LOCK ActualLock
Definition: ketypes.h:888
PVOID StackBase
Definition: ketypes.h:1608
ULONG DispatchCode[DISPATCH_LENGTH]
Definition: ketypes.h:910
UCHAR SavedApcStateFill[FIELD_OFFSET(KAPC_STATE, UserApcPending)+1]
Definition: ketypes.h:1905
ULONG NTSYSAPI KeMinimumIncrement
Definition: clock.c:21
LONG High2Time
Definition: ketypes.h:919
ULONG QueueDeferPreemption
Definition: ketypes.h:1676
Definition: compat.h:694
ULONG DbgVirtEnabled
Definition: ketypes.h:1208
volatile ULONG DpcQueueDepth
Definition: ketypes.h:798
PVOID SessionState
Definition: ketypes.h:1003
ULONG ExTryToAcqExclusiveAcquires
Definition: ketypes.h:777
ULONG DbgInstallerDetectEnabled
Definition: ketypes.h:1209
KLOCK_ENTRY LockEntries[NUMBER_OF_LOCK_ENTRIES]
Definition: ketypes.h:1965
ULONG SpinLockContentionCount
Definition: ketypes.h:737
CHAR PreviousMode
Definition: ketypes.h:1858
UCHAR SchedulerApcFill1[FIELD_OFFSET(KAPC, SpareByte1)]
Definition: ketypes.h:1923
WCHAR NtSystemRoot[260]
Definition: ketypes.h:1163
ULONG_PTR Segment
Definition: ketypes.h:866
_NT_PRODUCT_TYPE
struct _GENERAL_LOOKASIDE * P
Definition: ketypes.h:811
UCHAR ThreadLocalFlags
Definition: ketypes.h:1030
RTL_RB_TREE OwnerTree
Definition: ketypes.h:1106
ULONG CalloutActive
Definition: ketypes.h:1651
unsigned short USHORT
Definition: pedump.c:61
struct _SYNCH_COUNTERS * PSYNCH_COUNTERS
volatile ULONG64 TickCountQuad
Definition: ketypes.h:1226
CHAR PriorityDecrement
Definition: ketypes.h:1862
CHAR SuspendCount
Definition: ketypes.h:1907
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR Fill
Definition: ketypes.h:834
_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:1056
volatile KAFFINITY ActiveProcessors
Definition: ketypes.h:2043
volatile ULONG64 CycleTime
Definition: ketypes.h:1610
UCHAR Spare0
Definition: ketypes.h:1034
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
LIST_ENTRY ProfileListHead
Definition: ketypes.h:2027
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
ULONG SpinLockAcquireCount
Definition: ketypes.h:736
UCHAR WaitBlockCount
Definition: ketypes.h:1885
#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:1871
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:1733
KIRQL SynchronizeIrql
Definition: ketypes.h:892
UCHAR SchedulerApcFill0[FIELD_OFFSET(KAPC, SpareByte0)]
Definition: ketypes.h:1918
ULONG KernelTime
Definition: ketypes.h:2044
LIST_ENTRY ThreadListEntry
Definition: ketypes.h:1950
XSAVE_FORMAT
Definition: ketypes.h:951
ULONG ReservedStackInUse
Definition: ketypes.h:1654
struct _KSCB * QueuedScb
Definition: ketypes.h:2008
ULONG LastSystemRITEventTickCount
Definition: ketypes.h:1188
PVOID Teb
Definition: ketypes.h:1749
UCHAR ExecuteEnable
Definition: ketypes.h:930
ULONG BucketShift
Definition: ketypes.h:864
enum _KTHREAD_STATE * PKTHREAD_STATE
ULONG UserTime
Definition: ketypes.h:1945
struct _KSERVICE_TABLE_DESCRIPTOR KSERVICE_TABLE_DESCRIPTOR
struct _KENTROPY_TIMING_STATE * PKENTROPY_TIMING_STATE
KEXECUTE_OPTIONS Flags
Definition: ketypes.h:2072
struct _COUNTER_READING COUNTER_READING
UCHAR ResourceIndex
Definition: ketypes.h:1919
DISPATCHER_HEADER Header
Definition: ketypes.h:1603
#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:991
enum _KWAIT_REASON KWAIT_REASON
_ADJUST_REASON
Definition: ketypes.h:470
LIST_ENTRY GlobalForegroundListEntry
Definition: ketypes.h:1990
PVOID LegoData
Definition: ketypes.h:1939
UCHAR UserAffinityFill[FIELD_OFFSET(GROUP_AFFINITY, Reserved)]
Definition: ketypes.h:1857
BOOLEAN Running
Definition: ketypes.h:1621
PVOID SessionState
Definition: ketypes.h:1091
XSAVE_FORMAT * StateSaveArea
Definition: ketypes.h:1618
#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:1731
PVOID Win32Thread
Definition: ketypes.h:1808
UCHAR InTreeByte
Definition: ketypes.h:1088
GROUP_AFFINITY Affinity
Definition: ketypes.h:1880
CSHORT Size
Definition: ketypes.h:878
_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:1730
SHORT SListFaultCount
Definition: ketypes.h:1909
PRTL_BALANCED_NODE Root
Definition: ketypes.h:978
_In_ PLARGE_INTEGER _In_opt_ PTIMER_APC_ROUTINE _In_opt_ PVOID TimerContext
Definition: zwfuncs.h:428
ULONG DeferredProcessor
Definition: ketypes.h:1848
uint32_t * PULONG_PTR
Definition: typedefs.h:65
UCHAR PowerState
Definition: ketypes.h:2067
UCHAR NodeNumber
Definition: ketypes.h:831
UCHAR Preempted
Definition: ketypes.h:1869
struct _KEXECUTE_OPTIONS * PKEXECUTE_OPTIONS
ULONG WaitTime
Definition: ketypes.h:1817
volatile UCHAR Tag
Definition: ketypes.h:1703
ULONG ReadyTransition
Definition: ketypes.h:1633
ULONG IpiSendSoftwareInterruptCount
Definition: ketypes.h:741
ULONG DisableQuantum
Definition: ketypes.h:1673
UCHAR ApcStateIndex
Definition: ketypes.h:1884
SLIST_HEADER PfnDereferenceSListHead
Definition: ketypes.h:827
struct _KDPC_LIST * PKDPC_LIST
struct _KWAIT_BLOCK KWAIT_BLOCK
KAFFINITY ProcessorMask
Definition: ketypes.h:828
ULONG ApcQueueable
Definition: ketypes.h:1653
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:1738
PKDPC ActiveDpc
Definition: ketypes.h:802
UCHAR Seed
Definition: ketypes.h:830
KEVENT HighEvent
Definition: ketypes.h:921
ULONG ExAcqResSharedWaitForExclusiveWaits
Definition: ketypes.h:771
enum _KPROFILE_SOURCE KPROFILE_SOURCE
enum _HARDWARE_COUNTER_TYPE Type
Definition: ketypes.h:956
UCHAR WaitBlockFill9[1 *sizeof(KWAIT_BLOCK)+FIELD_OFFSET(KWAIT_BLOCK, SparePtr)]
Definition: ketypes.h:1802
ULONG UserTime
Definition: ketypes.h:2045
LONG AutoAlignment
Definition: ketypes.h:2056
PKINTERRUPT_ROUTINE DispatchAddress
Definition: ketypes.h:889
UCHAR ExecuteDispatchEnable
Definition: ketypes.h:933
short CSHORT
Definition: umtypes.h:127
_WAIT_TYPE
PVOID InitialStack
Definition: ketypes.h:1606
ULONG DbgErrorPortPresent
Definition: ketypes.h:1206
enum _ADJUST_REASON ADJUST_REASON
struct _KPROFILE KPROFILE
ULONG_PTR AffinityVersion
Definition: ketypes.h:1876
struct _KTIMER_TABLE_ENTRY KTIMER_TABLE_ENTRY
PVOID ServiceContext
Definition: ketypes.h:885
GROUP_AFFINITY UserAffinity
Definition: ketypes.h:1854
struct _KLOCK_ENTRY * PKLOCK_ENTRY
ULONG_PTR NTSYSAPI KiBugCheckData[]
Definition: bug.c:27
struct _KNODE * PKNODE
KSPIN_LOCK ThreadLock
Definition: ketypes.h:1609
_In_ LONG _In_ LONG Limit
Definition: kefuncs.h:317
ULONG FreeCount[2]
Definition: ketypes.h:837
KWAIT_STATUS_REGISTER WaitRegister
Definition: ketypes.h:1620
ULONG GuiThread
Definition: ketypes.h:1672
ULONG ProcessStackCountDecremented
Definition: ketypes.h:1691
SERVICE_TABLE_ENTRYW ServiceTable[]
Definition: service.c:21
PVOID VdmTrapcHandler
Definition: ketypes.h:2048
ULONG SystemCallNumber
Definition: ketypes.h:1711
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:2026
volatile SHORT KeReferenceCount
Definition: ketypes.h:1976
ULONG ThreadFlagsSpare
Definition: ketypes.h:1692
LIST_ENTRY MutantListHead
Definition: ketypes.h:1951
UCHAR WaitBlockFill11[3 *sizeof(KWAIT_BLOCK)+FIELD_OFFSET(KWAIT_BLOCK, Object)]
Definition: ketypes.h:1812
ULONG ExEtwSynchTrackingNotificationsAccountedCount
Definition: ketypes.h:781
volatile ULONG DismountCount
Definition: ketypes.h:1186
KIRQL WaitIrql
Definition: ketypes.h:1737
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