1 /* Version definitions */ 2 #undef NTDDI_VERSION 3 #define NTDDI_VERSION NTDDI_WIN10 4 #undef _WIN32_WINNT 5 #define _WIN32_WINNT _WIN32_WINNT_WIN10 6 7 #include <ntifs.h> 8 #include <ndk/ntndk.h> 9 10 #define C_ASSERT_FIELD(Type, Offset, MemberType, MemberName) C_ASSERT(FIELD_OFFSET(Type, MemberName) == Offset); 11 12 /* KTHREAD */ 13 C_ASSERT_FIELD(KTHREAD, 0x000, DISPATCHER_HEADER, Header) 14 C_ASSERT_FIELD(KTHREAD, 0x018, PVOID, SListFaultAddress) 15 C_ASSERT_FIELD(KTHREAD, 0x020, UINT64, QuantumTarget) 16 C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, InitialStack) 17 C_ASSERT_FIELD(KTHREAD, 0x030, PVOID, StackLimit) 18 C_ASSERT_FIELD(KTHREAD, 0x038, PVOID, StackBase) 19 C_ASSERT_FIELD(KTHREAD, 0x040, UINT64, ThreadLock) 20 C_ASSERT_FIELD(KTHREAD, 0x048, UINT64, CycleTime) 21 C_ASSERT_FIELD(KTHREAD, 0x050, ULONG32, CurrentRunTime) 22 C_ASSERT_FIELD(KTHREAD, 0x054, ULONG32, ExpectedRunTime) 23 C_ASSERT_FIELD(KTHREAD, 0x058, PVOID, KernelStack) 24 C_ASSERT_FIELD(KTHREAD, 0x060, XSAVE_FORMAT*, StateSaveArea) 25 C_ASSERT_FIELD(KTHREAD, 0x068, KSCHEDULING_GROUP*, SchedulingGroup) 26 C_ASSERT_FIELD(KTHREAD, 0x070, KWAIT_STATUS_REGISTER, WaitRegister) 27 C_ASSERT_FIELD(KTHREAD, 0x071, UINT8, Running) 28 C_ASSERT_FIELD(KTHREAD, 0x072, UINT8[2], Alerted) 29 C_ASSERT_FIELD(KTHREAD, 0x074, LONG32, MiscFlags) 30 C_ASSERT_FIELD(KTHREAD, 0x078, LONG32, ThreadFlags) 31 C_ASSERT_FIELD(KTHREAD, 0x07C, UINT8, Tag) 32 C_ASSERT_FIELD(KTHREAD, 0x07D, UINT8, SystemHeteroCpuPolicy) 33 C_ASSERT_FIELD(KTHREAD, 0x080, ULONG32, SystemCallNumber) 34 C_ASSERT_FIELD(KTHREAD, 0x088, PVOID, FirstArgument) 35 C_ASSERT_FIELD(KTHREAD, 0x090, KTRAP_FRAME*, TrapFrame) 36 C_ASSERT_FIELD(KTHREAD, 0x098, KAPC_STATE, ApcState) 37 C_ASSERT_FIELD(KTHREAD, 0x0C3, CHAR, Priority) 38 C_ASSERT_FIELD(KTHREAD, 0x0C4, ULONG32, UserIdealProcessor) 39 C_ASSERT_FIELD(KTHREAD, 0x0C8, INT64, WaitStatus) 40 C_ASSERT_FIELD(KTHREAD, 0x0D0, KWAIT_BLOCK*, WaitBlockList) 41 C_ASSERT_FIELD(KTHREAD, 0x0D8, LIST_ENTRY, WaitListEntry) 42 C_ASSERT_FIELD(KTHREAD, 0x0D8, SINGLE_LIST_ENTRY, SwapListEntry) 43 C_ASSERT_FIELD(KTHREAD, 0x0E8, DISPATCHER_HEADER*, Queue) 44 C_ASSERT_FIELD(KTHREAD, 0x0F0, PVOID, Teb) 45 C_ASSERT_FIELD(KTHREAD, 0x0F8, UINT64, RelativeTimerBias) 46 C_ASSERT_FIELD(KTHREAD, 0x100, KTIMER, Timer) 47 C_ASSERT_FIELD(KTHREAD, 0x140, KWAIT_BLOCK[4], WaitBlock) 48 C_ASSERT_FIELD(KTHREAD, 0x154, ULONG32, ContextSwitches) 49 C_ASSERT_FIELD(KTHREAD, 0x184, UINT8, State) 50 C_ASSERT_FIELD(KTHREAD, 0x185, CHAR, Spare13) 51 C_ASSERT_FIELD(KTHREAD, 0x186, UINT8, WaitIrql) 52 C_ASSERT_FIELD(KTHREAD, 0x187, CHAR, WaitMode) 53 C_ASSERT_FIELD(KTHREAD, 0x1B4, ULONG32, WaitTime) 54 C_ASSERT_FIELD(KTHREAD, 0x1E4, INT16, KernelApcDisable) 55 C_ASSERT_FIELD(KTHREAD, 0x1E6, INT16, SpecialApcDisable) 56 C_ASSERT_FIELD(KTHREAD, 0x1E4, ULONG32, CombinedApcDisable) 57 C_ASSERT_FIELD(KTHREAD, 0x168, KTHREAD_COUNTERS*, ThreadCounters) 58 C_ASSERT_FIELD(KTHREAD, 0x198, XSTATE_SAVE*, XStateSave) 59 C_ASSERT_FIELD(KTHREAD, 0x1C8, PVOID, Win32Thread) 60 C_ASSERT_FIELD(KTHREAD, 0x1F0, UMS_CONTROL_BLOCK*, Ucb) 61 C_ASSERT_FIELD(KTHREAD, 0x1F8, KUMS_CONTEXT_HEADER*, Uch) 62 C_ASSERT_FIELD(KTHREAD, 0x200, PVOID, TebMappedLowVa) 63 C_ASSERT_FIELD(KTHREAD, 0x208, LIST_ENTRY, QueueListEntry) 64 C_ASSERT_FIELD(KTHREAD, 0x218, ULONG32, NextProcessor) 65 C_ASSERT_FIELD(KTHREAD, 0x21C, LONG32, QueuePriority) 66 C_ASSERT_FIELD(KTHREAD, 0x220, KPROCESS*, Process) 67 C_ASSERT_FIELD(KTHREAD, 0x228, GROUP_AFFINITY, UserAffinity) 68 C_ASSERT_FIELD(KTHREAD, 0x232, CHAR, PreviousMode) 69 C_ASSERT_FIELD(KTHREAD, 0x233, CHAR, BasePriority) 70 C_ASSERT_FIELD(KTHREAD, 0x234, CHAR, PriorityDecrement) 71 C_ASSERT_FIELD(KTHREAD, 0x235, UINT8, Preempted) 72 C_ASSERT_FIELD(KTHREAD, 0x236, UINT8, AdjustReason) 73 C_ASSERT_FIELD(KTHREAD, 0x237, CHAR, AdjustIncrement) 74 C_ASSERT_FIELD(KTHREAD, 0x238, UINT64, AffinityVersion) 75 C_ASSERT_FIELD(KTHREAD, 0x240, GROUP_AFFINITY, Affinity) 76 C_ASSERT_FIELD(KTHREAD, 0x24A, UINT8, ApcStateIndex) 77 C_ASSERT_FIELD(KTHREAD, 0x24B, UINT8, WaitBlockCount) 78 C_ASSERT_FIELD(KTHREAD, 0x24C, ULONG32, IdealProcessor) 79 C_ASSERT_FIELD(KTHREAD, 0x250, UINT64, NpxState) 80 C_ASSERT_FIELD(KTHREAD, 0x258, KAPC_STATE, SavedApcState) 81 C_ASSERT_FIELD(KTHREAD, 0x283, UINT8, WaitReason) 82 C_ASSERT_FIELD(KTHREAD, 0x284, CHAR, SuspendCount) 83 C_ASSERT_FIELD(KTHREAD, 0x285, CHAR, Saturation) 84 C_ASSERT_FIELD(KTHREAD, 0x286, UINT16, SListFaultCount) 85 C_ASSERT_FIELD(KTHREAD, 0x288, KAPC, SchedulerApc) 86 C_ASSERT_FIELD(KTHREAD, 0x289, UINT8, ResourceIndex) 87 C_ASSERT_FIELD(KTHREAD, 0x28B, UINT8, QuantumReset) 88 C_ASSERT_FIELD(KTHREAD, 0x28C, ULONG32, KernelTime) 89 C_ASSERT_FIELD(KTHREAD, 0x2C8, KPRCB*, WaitPrcb) 90 C_ASSERT_FIELD(KTHREAD, 0x2D0, PVOID, LegoData) 91 C_ASSERT_FIELD(KTHREAD, 0x2DB, UINT8, CallbackNestingLevel) 92 C_ASSERT_FIELD(KTHREAD, 0x2DC, ULONG32, UserTime) 93 C_ASSERT_FIELD(KTHREAD, 0x2E0, KEVENT, SuspendEvent) 94 C_ASSERT_FIELD(KTHREAD, 0x2F8, LIST_ENTRY, ThreadListEntry) 95 C_ASSERT_FIELD(KTHREAD, 0x308, LIST_ENTRY, MutantListHead) 96 C_ASSERT_FIELD(KTHREAD, 0x318, UINT8, AbEntrySummary) 97 C_ASSERT_FIELD(KTHREAD, 0x319, UINT8, AbWaitEntryCount) 98 C_ASSERT_FIELD(KTHREAD, 0x31A, UINT16, Spare20) 99 C_ASSERT_FIELD(KTHREAD, 0x31C, ULONG32, SecureThreadCookie) 100 C_ASSERT_FIELD(KTHREAD, 0x320, KLOCK_ENTRY[6], LockEntries) 101 C_ASSERT_FIELD(KTHREAD, 0x560, SINGLE_LIST_ENTRY, PropagateBoostsEntry) 102 C_ASSERT_FIELD(KTHREAD, 0x568, SINGLE_LIST_ENTRY, IoSelfBoostsEntry) 103 C_ASSERT_FIELD(KTHREAD, 0x570, UINT8[16], PriorityFloorCounts) 104 C_ASSERT_FIELD(KTHREAD, 0x580, ULONG32, PriorityFloorSummary) 105 C_ASSERT_FIELD(KTHREAD, 0x584, LONG32, AbCompletedIoBoostCount) 106 C_ASSERT_FIELD(KTHREAD, 0x588, INT16, KeReferenceCount) 107 C_ASSERT_FIELD(KTHREAD, 0x58A, UINT8, AbOrphanedEntrySummary) 108 C_ASSERT_FIELD(KTHREAD, 0x58B, UINT8, AbOwnedEntryCount) 109 C_ASSERT_FIELD(KTHREAD, 0x58C, ULONG32, ForegroundLossTime) 110 C_ASSERT_FIELD(KTHREAD, 0x590, LIST_ENTRY, GlobalForegroundListEntry) 111 C_ASSERT_FIELD(KTHREAD, 0x590, SINGLE_LIST_ENTRY, ForegroundDpcStackListEntry) 112 C_ASSERT_FIELD(KTHREAD, 0x598, UINT64, InGlobalForegroundList) 113 C_ASSERT_FIELD(KTHREAD, 0x5A0, INT64, ReadOperationCount) 114 C_ASSERT_FIELD(KTHREAD, 0x5A8, INT64, WriteOperationCount) 115 C_ASSERT_FIELD(KTHREAD, 0x5B0, INT64, OtherOperationCount) 116 C_ASSERT_FIELD(KTHREAD, 0x5B8, INT64, ReadTransferCount) 117 C_ASSERT_FIELD(KTHREAD, 0x5C0, INT64, WriteTransferCount) 118 C_ASSERT_FIELD(KTHREAD, 0x5C8, INT64, OtherTransferCount) 119 C_ASSERT_FIELD(KTHREAD, 0x5D0, KSCB*, QueuedScb) 120