1c2c66affSColin Finck /* Version definitions */ 2c2c66affSColin Finck #undef NTDDI_VERSION 3c2c66affSColin Finck #define NTDDI_VERSION NTDDI_WINBLUE 4c2c66affSColin Finck #undef _WIN32_WINNT 5c2c66affSColin Finck #define _WIN32_WINNT _WIN32_WINNT_WINBLUE 6c2c66affSColin Finck 7c2c66affSColin Finck #include <ntifs.h> 8c2c66affSColin Finck #include <ndk/ntndk.h> 9c2c66affSColin Finck 10*c22817dbSTimo Kreuzer #define C_ASSERT_FIELD(Type, Offset, MemberType, MemberName) \ 11*c22817dbSTimo Kreuzer C_ASSERT(FIELD_OFFSET(Type, MemberName) == Offset); \ 12*c22817dbSTimo Kreuzer C_ASSERT(FIELD_SIZE(Type, MemberName) == sizeof(MemberType)); 13*c22817dbSTimo Kreuzer 14*c22817dbSTimo Kreuzer C_ASSERT(sizeof(KLOCK_ENTRY_LOCK_STATE) == 0x008); 15*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x000, RTL_BALANCED_NODE, TreeNode) 16*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x00C, PVOID, ThreadUnsafe) 17*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x00D, UCHAR[2], Reserved1) 18*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x00F, UCHAR, AcquiredByte) 19*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x010, UCHAR, WaitingAndBusyByte) 20*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x011, UCHAR[2], Reserved) 21*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x013, UCHAR, InTreeByte) 22*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x014, PVOID, SessionState) 23*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x014, ULONG, SessionId) 24*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x018, RTL_RB_TREE, OwnerTree) 25*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x018, CHAR, CpuPriorityKey) 26*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x020, RTL_RB_TREE, WaiterTree) 27*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KLOCK_ENTRY, 0x028, ULONG, EntryLock) 28*c22817dbSTimo Kreuzer C_ASSERT(sizeof(KLOCK_ENTRY) == 0x030); 29c2c66affSColin Finck 30c2c66affSColin Finck /* KTHREAD */ 31c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x000, DISPATCHER_HEADER, Header) 32c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x010, PVOID, SListFaultAddress) 33*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x018, ULONG64, QuantumTarget) 34c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x020, PVOID, InitialStack) 35c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x024, PVOID, StackLimit) 36c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, StackBase) 37*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x02C, ULONG, ThreadLock) 38*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x030, ULONG64, CycleTime) 39*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x038, ULONG, HighCycleTime) 40c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x03C, PVOID, ServiceTable) 41*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x040, ULONG, CurrentRunTime) 42*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x044, ULONG, ExpectedRunTime) 43c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x048, PVOID, KernelStack) 44*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x04C, PXSAVE_FORMAT, StateSaveArea) 45*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x050, struct _KSCHEDULING_GROUP*, SchedulingGroup) 46c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x054, KWAIT_STATUS_REGISTER, WaitRegister) 47*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x055, UCHAR, Running) 48*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x056, UCHAR[2], Alerted) 49*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x058, LONG, MiscFlags) 50*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x05C, LONG, ThreadFlags) 51*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x060, ULONG, Spare0) 52*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x064, ULONG, SystemCallNumber) 53c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x068, PVOID, FirstArgument) 54*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x06C, PKTRAP_FRAME, TrapFrame) 55c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x070, KAPC_STATE, ApcState) 56c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x087, CHAR, Priority) 57*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x088, ULONG, UserIdealProcessor) 58*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x08C, ULONG, ContextSwitches) 59*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x090, UCHAR, State) 60c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x091, CHAR, NpxState) 61*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x092, UCHAR, WaitIrql) 62c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x093, CHAR, WaitMode) 63*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x094, LONG, WaitStatus) 64*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x098, PKWAIT_BLOCK, WaitBlockList) 65c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x09C, LIST_ENTRY, WaitListEntry) 66c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x09C, SINGLE_LIST_ENTRY, SwapListEntry) 67*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x0A4, PDISPATCHER_HEADER, Queue) 68c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x0A8, PVOID, Teb) 69*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x0B0, ULONG64, RelativeTimerBias) 70c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x0B8, KTIMER, Timer) 71c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x0E0, KWAIT_BLOCK[4], WaitBlock) 72*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x0F4, PKTHREAD_COUNTERS, ThreadCounters) 73*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x10C, PXSTATE_SAVE, XStateSave) 74c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x124, PVOID, Win32Thread) 75*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x138, ULONG, WaitTime) 76*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x13C, SHORT, KernelApcDisable) 77*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x13E, SHORT, SpecialApcDisable) 78*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x13C, ULONG, CombinedApcDisable) 79c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x140, LIST_ENTRY, QueueListEntry) 80*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x148, ULONG, NextProcessor) 81*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x14C, LONG, QueuePriority) 82*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x150, PKPROCESS, Process) 83c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x154, GROUP_AFFINITY, UserAffinity) 84c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x15A, CHAR, PreviousMode) 85c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x15B, CHAR, BasePriority) 86c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x15C, CHAR, PriorityDecrement) 87*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x15D, UCHAR, Preempted) 88*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x15E, UCHAR, AdjustReason) 89c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x15F, CHAR, AdjustIncrement) 90c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x160, GROUP_AFFINITY, Affinity) 91*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x166, UCHAR, ApcStateIndex) 92*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x167, UCHAR, WaitBlockCount) 93*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x168, ULONG, IdealProcessor) 94*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x16C, PKAPC_STATE[2], ApcStatePointer) 95c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x174, KAPC_STATE, SavedApcState) 96*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x18B, UCHAR, WaitReason) 97c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x18C, CHAR, SuspendCount) 98c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x18D, CHAR, Saturation) 99*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x18E, USHORT, SListFaultCount) 100c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x190, KAPC, SchedulerApc) 101*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x191, UCHAR, ResourceIndex) 102*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x193, UCHAR, QuantumReset) 103*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x194, ULONG, KernelTime) 104*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x1B4, PKPRCB, WaitPrcb) 105c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1B8, PVOID, LegoData) 106*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x1BF, UCHAR, CallbackNestingLevel) 107*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x1C0, ULONG, UserTime) 108c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1C4, KEVENT, SuspendEvent) 109c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1D4, LIST_ENTRY, ThreadListEntry) 110c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1DC, LIST_ENTRY, MutantListHead) 111c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1E4, SINGLE_LIST_ENTRY, LockEntriesFreeList) 112c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x1E8, KLOCK_ENTRY[6], LockEntries) 113c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x308, SINGLE_LIST_ENTRY, PropagateBoostsEntry) 114c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x30C, SINGLE_LIST_ENTRY, IoSelfBoostsEntry) 115*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x310, UCHAR[16], PriorityFloorCounts) 116*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x320, ULONG, PriorityFloorSummary) 117*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x324, LONG, AbCompletedIoBoostCount) 118*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x328, SHORT, AbReferenceCount) 119*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x32A, UCHAR, AbFreeEntryCount) 120*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x32B, UCHAR, AbWaitEntryCount) 121*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x32C, ULONG, ForegroundLossTime) 122c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x330, LIST_ENTRY, GlobalForegroundListEntry) 123c2c66affSColin Finck C_ASSERT_FIELD(KTHREAD, 0x330, SINGLE_LIST_ENTRY, ForegroundDpcStackListEntry) 124*c22817dbSTimo Kreuzer C_ASSERT_FIELD(KTHREAD, 0x334, ULONG, InGlobalForegroundList) 125