xref: /reactos/sdk/include/ndk/tests/winvista_x64.c (revision 40462c92)
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, 0x018, ULONG64, CycleTime)
17 C_ASSERT_FIELD(KTHREAD, 0x020, ULONG64, QuantumTarget)
18 C_ASSERT_FIELD(KTHREAD, 0x028, PVOID, InitialStack)
19 C_ASSERT_FIELD(KTHREAD, 0x030, PVOID, StackLimit)
20 C_ASSERT_FIELD(KTHREAD, 0x038, PVOID, KernelStack)
21 C_ASSERT_FIELD(KTHREAD, 0x040, ULONG64, ThreadLock)
22 C_ASSERT_FIELD(KTHREAD, 0x048, KAPC_STATE, ApcState)
23 C_ASSERT_FIELD(KTHREAD, 0x048, UCHAR[43], ApcStateFill)
24 C_ASSERT_FIELD(KTHREAD, 0x073, CHAR, Priority)
25 C_ASSERT_FIELD(KTHREAD, 0x074, USHORT, NextProcessor)
26 C_ASSERT_FIELD(KTHREAD, 0x076, USHORT, DeferredProcessor)
27 C_ASSERT_FIELD(KTHREAD, 0x078, ULONG64, ApcQueueLock)
28 C_ASSERT_FIELD(KTHREAD, 0x080, LONG64, WaitStatus)
29 C_ASSERT_FIELD(KTHREAD, 0x088, PKWAIT_BLOCK, WaitBlockList)
30 C_ASSERT_FIELD(KTHREAD, 0x088, PKGATE, GateObject)
31 C_ASSERT_FIELD(KTHREAD, 0x090, LONG, MiscFlags)
32 C_ASSERT_FIELD(KTHREAD, 0x094, UCHAR, WaitReason)
33 C_ASSERT_FIELD(KTHREAD, 0x095, UCHAR, SwapBusy)
34 C_ASSERT_FIELD(KTHREAD, 0x096, UCHAR[2], Alerted)
35 C_ASSERT_FIELD(KTHREAD, 0x098, LIST_ENTRY, WaitListEntry)
36 C_ASSERT_FIELD(KTHREAD, 0x098, SINGLE_LIST_ENTRY, SwapListEntry)
37 C_ASSERT_FIELD(KTHREAD, 0x0A8, PKQUEUE, Queue)
38 C_ASSERT_FIELD(KTHREAD, 0x0B0, PVOID, Teb)
39 C_ASSERT_FIELD(KTHREAD, 0x0B8, KTIMER, Timer)
40 C_ASSERT_FIELD(KTHREAD, 0x0B8, UCHAR[60], TimerFill)
41 C_ASSERT_FIELD(KTHREAD, 0x0F4, LONG, ThreadFlags)
42 C_ASSERT_FIELD(KTHREAD, 0x0F8, KWAIT_BLOCK[4], WaitBlock)
43 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[43], WaitBlockFill0)
44 C_ASSERT_FIELD(KTHREAD, 0x123, UCHAR, IdealProcessor)
45 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[91], WaitBlockFill1)
46 C_ASSERT_FIELD(KTHREAD, 0x153, CHAR, PreviousMode)
47 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[139], WaitBlockFill2)
48 C_ASSERT_FIELD(KTHREAD, 0x183, UCHAR, ResourceIndex)
49 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[187], WaitBlockFill3)
50 C_ASSERT_FIELD(KTHREAD, 0x1B3, UCHAR, LargeStack)
51 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[44], WaitBlockFill4)
52 C_ASSERT_FIELD(KTHREAD, 0x124, ULONG, ContextSwitches)
53 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[92], WaitBlockFill5)
54 C_ASSERT_FIELD(KTHREAD, 0x154, UCHAR, State)
55 C_ASSERT_FIELD(KTHREAD, 0x155, UCHAR, NpxState)
56 C_ASSERT_FIELD(KTHREAD, 0x156, UCHAR, WaitIrql)
57 C_ASSERT_FIELD(KTHREAD, 0x157, CHAR, WaitMode)
58 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[140], WaitBlockFill6)
59 C_ASSERT_FIELD(KTHREAD, 0x184, ULONG, WaitTime)
60 C_ASSERT_FIELD(KTHREAD, 0x0F8, UCHAR[188], WaitBlockFill7)
61 C_ASSERT_FIELD(KTHREAD, 0x1B4, SHORT, KernelApcDisable)
62 C_ASSERT_FIELD(KTHREAD, 0x1B6, SHORT, SpecialApcDisable)
63 C_ASSERT_FIELD(KTHREAD, 0x1B4, ULONG, CombinedApcDisable)
64 C_ASSERT_FIELD(KTHREAD, 0x1B8, LIST_ENTRY, QueueListEntry)
65 C_ASSERT_FIELD(KTHREAD, 0x1C8, PKTRAP_FRAME, TrapFrame)
66 C_ASSERT_FIELD(KTHREAD, 0x1D0, PVOID, FirstArgument)
67 C_ASSERT_FIELD(KTHREAD, 0x1D8, PVOID, CallbackStack)
68 C_ASSERT_FIELD(KTHREAD, 0x1D8, ULONG64, CallbackDepth)
69 C_ASSERT_FIELD(KTHREAD, 0x1E0, UCHAR, ApcStateIndex)
70 C_ASSERT_FIELD(KTHREAD, 0x1E1, CHAR, BasePriority)
71 C_ASSERT_FIELD(KTHREAD, 0x1E2, CHAR, PriorityDecrement)
72 C_ASSERT_FIELD(KTHREAD, 0x1E3, UCHAR, Preempted)
73 C_ASSERT_FIELD(KTHREAD, 0x1E4, UCHAR, AdjustReason)
74 C_ASSERT_FIELD(KTHREAD, 0x1E5, CHAR, AdjustIncrement)
75 C_ASSERT_FIELD(KTHREAD, 0x1E6, UCHAR, Spare01)
76 C_ASSERT_FIELD(KTHREAD, 0x1E7, CHAR, Saturation)
77 C_ASSERT_FIELD(KTHREAD, 0x1E8, ULONG, SystemCallNumber)
78 C_ASSERT_FIELD(KTHREAD, 0x1EC, ULONG, Spare02)
79 C_ASSERT_FIELD(KTHREAD, 0x1F0, ULONG64, UserAffinity)
80 C_ASSERT_FIELD(KTHREAD, 0x1F8, PKPROCESS, Process)
81 C_ASSERT_FIELD(KTHREAD, 0x200, ULONG64, Affinity)
82 C_ASSERT_FIELD(KTHREAD, 0x208, PKAPC_STATE[2], ApcStatePointer)
83 C_ASSERT_FIELD(KTHREAD, 0x218, KAPC_STATE, SavedApcState)
84 C_ASSERT_FIELD(KTHREAD, 0x218, UCHAR[43], SavedApcStateFill)
85 C_ASSERT_FIELD(KTHREAD, 0x243, CHAR, FreezeCount)
86 C_ASSERT_FIELD(KTHREAD, 0x244, CHAR, SuspendCount)
87 C_ASSERT_FIELD(KTHREAD, 0x245, UCHAR, UserIdealProcessor)
88 C_ASSERT_FIELD(KTHREAD, 0x246, UCHAR, Spare03)
89 C_ASSERT_FIELD(KTHREAD, 0x247, UCHAR, CodePatchInProgress)
90 C_ASSERT_FIELD(KTHREAD, 0x248, PVOID, Win32Thread)
91 C_ASSERT_FIELD(KTHREAD, 0x250, PVOID, StackBase)
92 C_ASSERT_FIELD(KTHREAD, 0x258, KAPC, SuspendApc)
93 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR, SuspendApcFill0)
94 C_ASSERT_FIELD(KTHREAD, 0x259, CHAR, Spare04)
95 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR[3], SuspendApcFill1)
96 C_ASSERT_FIELD(KTHREAD, 0x25B, UCHAR, QuantumReset)
97 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR[4], SuspendApcFill2)
98 C_ASSERT_FIELD(KTHREAD, 0x25C, ULONG, KernelTime)
99 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR[64], SuspendApcFill3)
100 C_ASSERT_FIELD(KTHREAD, 0x298, PKPRCB, WaitPrcb)
101 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR[72], SuspendApcFill4)
102 C_ASSERT_FIELD(KTHREAD, 0x2A0, PVOID, LegoData)
103 C_ASSERT_FIELD(KTHREAD, 0x258, UCHAR[83], SuspendApcFill5)
104 C_ASSERT_FIELD(KTHREAD, 0x2AB, UCHAR, PowerState)
105 C_ASSERT_FIELD(KTHREAD, 0x2AC, ULONG, UserTime)
106 C_ASSERT_FIELD(KTHREAD, 0x2B0, KSEMAPHORE, SuspendSemaphore)
107 C_ASSERT_FIELD(KTHREAD, 0x2B0, UCHAR[28], SuspendSemaphorefill)
108 C_ASSERT_FIELD(KTHREAD, 0x2CC, ULONG, SListFaultCount)
109 C_ASSERT_FIELD(KTHREAD, 0x2D0, LIST_ENTRY, ThreadListEntry)
110 C_ASSERT_FIELD(KTHREAD, 0x2E0, LIST_ENTRY, MutantListHead)
111 C_ASSERT_FIELD(KTHREAD, 0x2F0, PVOID, SListFaultAddress)
112 C_ASSERT_FIELD(KTHREAD, 0x2F8, LONG64, ReadOperationCount)
113 C_ASSERT_FIELD(KTHREAD, 0x300, LONG64, WriteOperationCount)
114 C_ASSERT_FIELD(KTHREAD, 0x308, LONG64, OtherOperationCount)
115 C_ASSERT_FIELD(KTHREAD, 0x310, LONG64, ReadTransferCount)
116 C_ASSERT_FIELD(KTHREAD, 0x318, LONG64, WriteTransferCount)
117 C_ASSERT_FIELD(KTHREAD, 0x320, LONG64, OtherTransferCount)
118 C_ASSERT_FIELD(KTHREAD, 0x328, PVOID, MdlForLockedTeb)
119