1 /* Version definitions */ 2 #undef NTDDI_VERSION 3 #define NTDDI_VERSION NTDDI_WIN8 4 #undef _WIN32_WINNT 5 #define _WIN32_WINNT _WIN32_WINNT_WIN8 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 /* KTHREAD */ 15 C_ASSERT_FIELD(KTHREAD, 0x000, DISPATCHER_HEADER, Header) 16 C_ASSERT_FIELD(KTHREAD, 0x010, PVOID, SListFaultAddress) 17 C_ASSERT_FIELD(KTHREAD, 0x018, ULONG64, QuantumTarget) 18 C_ASSERT_FIELD(KTHREAD, 0x020, PVOID, InitialStack) 19 C_ASSERT_FIELD(KTHREAD, 0x024, PVOID, StackLimit) 20 C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, StackBase) 21 C_ASSERT_FIELD(KTHREAD, 0x02C, ULONG, ThreadLock) 22 C_ASSERT_FIELD(KTHREAD, 0x030, ULONG64, CycleTime) 23 C_ASSERT_FIELD(KTHREAD, 0x038, ULONG, HighCycleTime) 24 C_ASSERT_FIELD(KTHREAD, 0x03C, PVOID, ServiceTable) 25 C_ASSERT_FIELD(KTHREAD, 0x040, ULONG, CurrentRunTime) 26 C_ASSERT_FIELD(KTHREAD, 0x044, ULONG, ExpectedRunTime) 27 C_ASSERT_FIELD(KTHREAD, 0x048, PVOID, KernelStack) 28 C_ASSERT_FIELD(KTHREAD, 0x04C, PXSAVE_FORMAT, StateSaveArea) 29 C_ASSERT_FIELD(KTHREAD, 0x050, struct _KSCHEDULING_GROUP*, SchedulingGroup) 30 C_ASSERT_FIELD(KTHREAD, 0x054, KWAIT_STATUS_REGISTER, WaitRegister) 31 C_ASSERT_FIELD(KTHREAD, 0x055, UCHAR, Running) 32 C_ASSERT_FIELD(KTHREAD, 0x056, UCHAR[2], Alerted) 33 C_ASSERT_FIELD(KTHREAD, 0x058, LONG, MiscFlags) 34 C_ASSERT_FIELD(KTHREAD, 0x05C, LONG, ThreadFlags) 35 C_ASSERT_FIELD(KTHREAD, 0x060, ULONG, Spare0) 36 C_ASSERT_FIELD(KTHREAD, 0x064, ULONG, SystemCallNumber) 37 C_ASSERT_FIELD(KTHREAD, 0x068, PVOID, FirstArgument) 38 C_ASSERT_FIELD(KTHREAD, 0x06C, PKTRAP_FRAME, TrapFrame) 39 C_ASSERT_FIELD(KTHREAD, 0x070, KAPC_STATE, ApcState) 40 C_ASSERT_FIELD(KTHREAD, 0x087, CHAR, Priority) 41 C_ASSERT_FIELD(KTHREAD, 0x088, ULONG, UserIdealProcessor) 42 C_ASSERT_FIELD(KTHREAD, 0x08C, ULONG, ContextSwitches) 43 C_ASSERT_FIELD(KTHREAD, 0x090, UCHAR, State) 44 C_ASSERT_FIELD(KTHREAD, 0x091, CHAR, NpxState) 45 C_ASSERT_FIELD(KTHREAD, 0x092, UCHAR, WaitIrql) 46 C_ASSERT_FIELD(KTHREAD, 0x093, CHAR, WaitMode) 47 C_ASSERT_FIELD(KTHREAD, 0x094, LONG, WaitStatus) 48 C_ASSERT_FIELD(KTHREAD, 0x098, PKWAIT_BLOCK, WaitBlockList) 49 C_ASSERT_FIELD(KTHREAD, 0x09C, LIST_ENTRY, WaitListEntry) 50 C_ASSERT_FIELD(KTHREAD, 0x09C, SINGLE_LIST_ENTRY, SwapListEntry) 51 C_ASSERT_FIELD(KTHREAD, 0x0A4, PKQUEUE, Queue) 52 C_ASSERT_FIELD(KTHREAD, 0x0A8, PVOID, Teb) 53 C_ASSERT_FIELD(KTHREAD, 0x0B0, ULONG64, RelativeTimerBias) 54 C_ASSERT_FIELD(KTHREAD, 0x0B8, KTIMER, Timer) 55 C_ASSERT_FIELD(KTHREAD, 0x0E0, KWAIT_BLOCK[4], WaitBlock) 56 C_ASSERT_FIELD(KTHREAD, 0x0F4, PKTHREAD_COUNTERS, ThreadCounters) 57 C_ASSERT_FIELD(KTHREAD, 0x10C, PXSTATE_SAVE, XStateSave) 58 C_ASSERT_FIELD(KTHREAD, 0x124, PVOID, Win32Thread) 59 C_ASSERT_FIELD(KTHREAD, 0x138, ULONG, WaitTime) 60 C_ASSERT_FIELD(KTHREAD, 0x13C, SHORT, KernelApcDisable) 61 C_ASSERT_FIELD(KTHREAD, 0x13E, SHORT, SpecialApcDisable) 62 C_ASSERT_FIELD(KTHREAD, 0x13C, ULONG, CombinedApcDisable) 63 C_ASSERT_FIELD(KTHREAD, 0x140, LIST_ENTRY, QueueListEntry) 64 C_ASSERT_FIELD(KTHREAD, 0x148, ULONG, NextProcessor) 65 C_ASSERT_FIELD(KTHREAD, 0x14C, ULONG, DeferredProcessor) 66 C_ASSERT_FIELD(KTHREAD, 0x150, PKPROCESS, Process) 67 C_ASSERT_FIELD(KTHREAD, 0x154, GROUP_AFFINITY, UserAffinity) 68 C_ASSERT_FIELD(KTHREAD, 0x15A, CHAR, PreviousMode) 69 C_ASSERT_FIELD(KTHREAD, 0x15B, CHAR, BasePriority) 70 C_ASSERT_FIELD(KTHREAD, 0x15C, CHAR, PriorityDecrement) 71 C_ASSERT_FIELD(KTHREAD, 0x15D, UCHAR, Preempted) 72 C_ASSERT_FIELD(KTHREAD, 0x15E, UCHAR, AdjustReason) 73 C_ASSERT_FIELD(KTHREAD, 0x15F, CHAR, AdjustIncrement) 74 C_ASSERT_FIELD(KTHREAD, 0x160, GROUP_AFFINITY, Affinity) 75 C_ASSERT_FIELD(KTHREAD, 0x166, UCHAR, ApcStateIndex) 76 C_ASSERT_FIELD(KTHREAD, 0x167, UCHAR, WaitBlockCount) 77 C_ASSERT_FIELD(KTHREAD, 0x168, ULONG, IdealProcessor) 78 C_ASSERT_FIELD(KTHREAD, 0x174, KAPC_STATE, SavedApcState) 79 C_ASSERT_FIELD(KTHREAD, 0x18B, UCHAR, WaitReason) 80 C_ASSERT_FIELD(KTHREAD, 0x18C, CHAR, SuspendCount) 81 C_ASSERT_FIELD(KTHREAD, 0x18D, CHAR, Saturation) 82 C_ASSERT_FIELD(KTHREAD, 0x18E, USHORT, SListFaultCount) 83 C_ASSERT_FIELD(KTHREAD, 0x190, KAPC, SchedulerApc) 84 C_ASSERT_FIELD(KTHREAD, 0x191, UCHAR, ResourceIndex) 85 C_ASSERT_FIELD(KTHREAD, 0x193, UCHAR, QuantumReset) 86 C_ASSERT_FIELD(KTHREAD, 0x194, ULONG, KernelTime) 87 C_ASSERT_FIELD(KTHREAD, 0x1B4, PKPRCB, WaitPrcb) 88 C_ASSERT_FIELD(KTHREAD, 0x1B8, PVOID, LegoData) 89 C_ASSERT_FIELD(KTHREAD, 0x1BF, UCHAR, CallbackNestingLevel) 90 C_ASSERT_FIELD(KTHREAD, 0x1C0, ULONG, UserTime) 91 C_ASSERT_FIELD(KTHREAD, 0x1C4, KEVENT, SuspendEvent) 92 C_ASSERT_FIELD(KTHREAD, 0x1D4, LIST_ENTRY, ThreadListEntry) 93 C_ASSERT_FIELD(KTHREAD, 0x1DC, LIST_ENTRY, MutantListHead) 94