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