1 /* Version definitions */ 2 #undef NTDDI_VERSION 3 #define NTDDI_VERSION NTDDI_VISTA 4 #undef _WIN32_WINNT 5 #define _WIN32_WINNT _WIN32_WINNT_VISTA 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, ULONG64, CycleTime) 17 C_ASSERT_FIELD(KTHREAD, 0x018, ULONG, HighCycleTime) 18 C_ASSERT_FIELD(KTHREAD, 0x020, ULONG64, QuantumTarget) 19 C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, InitialStack) 20 C_ASSERT_FIELD(KTHREAD, 0x02C, PVOID, StackLimit) 21 C_ASSERT_FIELD(KTHREAD, 0x030, PVOID, KernelStack) 22 C_ASSERT_FIELD(KTHREAD, 0x034, ULONG, ThreadLock) 23 C_ASSERT_FIELD(KTHREAD, 0x038, KAPC_STATE, ApcState) 24 C_ASSERT_FIELD(KTHREAD, 0x038, UCHAR[23], ApcStateFill) 25 C_ASSERT_FIELD(KTHREAD, 0x04F, CHAR, Priority) 26 C_ASSERT_FIELD(KTHREAD, 0x050, USHORT, NextProcessor) 27 C_ASSERT_FIELD(KTHREAD, 0x052, USHORT, DeferredProcessor) 28 C_ASSERT_FIELD(KTHREAD, 0x054, ULONG, ApcQueueLock) 29 C_ASSERT_FIELD(KTHREAD, 0x058, ULONG, ContextSwitches) 30 C_ASSERT_FIELD(KTHREAD, 0x05C, UCHAR, State) 31 C_ASSERT_FIELD(KTHREAD, 0x05D, UCHAR, NpxState) 32 C_ASSERT_FIELD(KTHREAD, 0x05E, UCHAR, WaitIrql) 33 C_ASSERT_FIELD(KTHREAD, 0x05F, CHAR, WaitMode) 34 C_ASSERT_FIELD(KTHREAD, 0x060, LONG, WaitStatus) 35 C_ASSERT_FIELD(KTHREAD, 0x064, PKWAIT_BLOCK, WaitBlockList) 36 C_ASSERT_FIELD(KTHREAD, 0x064, PKGATE, GateObject) 37 C_ASSERT_FIELD(KTHREAD, 0x068, LONG, MiscFlags) 38 C_ASSERT_FIELD(KTHREAD, 0x06C, UCHAR, WaitReason) 39 C_ASSERT_FIELD(KTHREAD, 0x06D, UCHAR, SwapBusy) 40 C_ASSERT_FIELD(KTHREAD, 0x06E, UCHAR[2], Alerted) 41 C_ASSERT_FIELD(KTHREAD, 0x070, LIST_ENTRY, WaitListEntry) 42 C_ASSERT_FIELD(KTHREAD, 0x070, SINGLE_LIST_ENTRY, SwapListEntry) 43 C_ASSERT_FIELD(KTHREAD, 0x078, PKQUEUE, Queue) 44 C_ASSERT_FIELD(KTHREAD, 0x07C, ULONG, WaitTime) 45 C_ASSERT_FIELD(KTHREAD, 0x080, SHORT, KernelApcDisable) 46 C_ASSERT_FIELD(KTHREAD, 0x082, SHORT, SpecialApcDisable) 47 C_ASSERT_FIELD(KTHREAD, 0x080, ULONG, CombinedApcDisable) 48 C_ASSERT_FIELD(KTHREAD, 0x084, PVOID, Teb) 49 C_ASSERT_FIELD(KTHREAD, 0x088, KTIMER, Timer) 50 C_ASSERT_FIELD(KTHREAD, 0x088, UCHAR[40], TimerFill) 51 C_ASSERT_FIELD(KTHREAD, 0x0B0, LONG, ThreadFlags) 52 C_ASSERT_FIELD(KTHREAD, 0x0B8, KWAIT_BLOCK[4], WaitBlock) 53 C_ASSERT_FIELD(KTHREAD, 0x0B8, UCHAR[23], WaitBlockFill0) 54 C_ASSERT_FIELD(KTHREAD, 0x0CF, UCHAR, IdealProcessor) 55 C_ASSERT_FIELD(KTHREAD, 0x0B8, UCHAR[47], WaitBlockFill1) 56 C_ASSERT_FIELD(KTHREAD, 0x0E7, CHAR, PreviousMode) 57 C_ASSERT_FIELD(KTHREAD, 0x0B8, UCHAR[71], WaitBlockFill2) 58 C_ASSERT_FIELD(KTHREAD, 0x0FF, UCHAR, ResourceIndex) 59 C_ASSERT_FIELD(KTHREAD, 0x0B8, UCHAR[95], WaitBlockFill3) 60 C_ASSERT_FIELD(KTHREAD, 0x117, UCHAR, LargeStack) 61 C_ASSERT_FIELD(KTHREAD, 0x118, LIST_ENTRY, QueueListEntry) 62 C_ASSERT_FIELD(KTHREAD, 0x120, PKTRAP_FRAME, TrapFrame) 63 C_ASSERT_FIELD(KTHREAD, 0x124, PVOID, FirstArgument) 64 C_ASSERT_FIELD(KTHREAD, 0x128, PVOID, CallbackStack) 65 C_ASSERT_FIELD(KTHREAD, 0x128, ULONG, CallbackDepth) 66 C_ASSERT_FIELD(KTHREAD, 0x12C, PVOID, ServiceTable) 67 C_ASSERT_FIELD(KTHREAD, 0x130, UCHAR, ApcStateIndex) 68 C_ASSERT_FIELD(KTHREAD, 0x131, CHAR, BasePriority) 69 C_ASSERT_FIELD(KTHREAD, 0x132, CHAR, PriorityDecrement) 70 C_ASSERT_FIELD(KTHREAD, 0x133, UCHAR, Preempted) 71 C_ASSERT_FIELD(KTHREAD, 0x134, UCHAR, AdjustReason) 72 C_ASSERT_FIELD(KTHREAD, 0x135, CHAR, AdjustIncrement) 73 C_ASSERT_FIELD(KTHREAD, 0x136, UCHAR, Spare01) 74 C_ASSERT_FIELD(KTHREAD, 0x137, CHAR, Saturation) 75 C_ASSERT_FIELD(KTHREAD, 0x138, ULONG, SystemCallNumber) 76 C_ASSERT_FIELD(KTHREAD, 0x13C, ULONG, Spare02) 77 C_ASSERT_FIELD(KTHREAD, 0x140, ULONG, UserAffinity) 78 C_ASSERT_FIELD(KTHREAD, 0x144, PKPROCESS, Process) 79 C_ASSERT_FIELD(KTHREAD, 0x148, ULONG, Affinity) 80 C_ASSERT_FIELD(KTHREAD, 0x14C, PKAPC_STATE[2], ApcStatePointer) 81 C_ASSERT_FIELD(KTHREAD, 0x154, KAPC_STATE, SavedApcState) 82 C_ASSERT_FIELD(KTHREAD, 0x154, UCHAR[23], SavedApcStateFill) 83 C_ASSERT_FIELD(KTHREAD, 0x16B, CHAR, FreezeCount) 84 C_ASSERT_FIELD(KTHREAD, 0x16C, CHAR, SuspendCount) 85 C_ASSERT_FIELD(KTHREAD, 0x16D, UCHAR, UserIdealProcessor) 86 C_ASSERT_FIELD(KTHREAD, 0x16E, UCHAR, Spare03) 87 C_ASSERT_FIELD(KTHREAD, 0x16F, UCHAR, OtherPlatformFill) 88 C_ASSERT_FIELD(KTHREAD, 0x170, PVOID, Win32Thread) 89 C_ASSERT_FIELD(KTHREAD, 0x174, PVOID, StackBase) 90 C_ASSERT_FIELD(KTHREAD, 0x178, KAPC, SuspendApc) 91 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR, SuspendApcFill0) 92 C_ASSERT_FIELD(KTHREAD, 0x179, CHAR, Spare04) 93 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR[3], SuspendApcFill1) 94 C_ASSERT_FIELD(KTHREAD, 0x17B, UCHAR, QuantumReset) 95 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR[4], SuspendApcFill2) 96 C_ASSERT_FIELD(KTHREAD, 0x17C, ULONG, KernelTime) 97 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR[36], SuspendApcFill3) 98 C_ASSERT_FIELD(KTHREAD, 0x19C, PKPRCB, WaitPrcb) 99 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR[40], SuspendApcFill4) 100 C_ASSERT_FIELD(KTHREAD, 0x1A0, PVOID, LegoData) 101 C_ASSERT_FIELD(KTHREAD, 0x178, UCHAR[47], SuspendApcFill5) 102 C_ASSERT_FIELD(KTHREAD, 0x1A7, UCHAR, PowerState) 103 C_ASSERT_FIELD(KTHREAD, 0x1A8, ULONG, UserTime) 104 C_ASSERT_FIELD(KTHREAD, 0x1AC, KSEMAPHORE, SuspendSemaphore) 105 C_ASSERT_FIELD(KTHREAD, 0x1AC, UCHAR[20], SuspendSemaphorefill) 106 C_ASSERT_FIELD(KTHREAD, 0x1C0, ULONG, SListFaultCount) 107 C_ASSERT_FIELD(KTHREAD, 0x1C4, LIST_ENTRY, ThreadListEntry) 108 C_ASSERT_FIELD(KTHREAD, 0x1CC, LIST_ENTRY, MutantListHead) 109 C_ASSERT_FIELD(KTHREAD, 0x1D4, PVOID, SListFaultAddress) 110 C_ASSERT_FIELD(KTHREAD, 0x1D8, PVOID, MdlForLockedTeb) 111