xref: /reactos/sdk/include/ndk/tests/win7_x86.c (revision 3c774903)
1 /* Version definitions */
2 #undef NTDDI_VERSION
3 #define NTDDI_VERSION NTDDI_WIN7
4 #undef _WIN32_WINNT
5 #define _WIN32_WINNT _WIN32_WINNT_WIN7
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, KWAIT_STATUS_REGISTER, WaitRegister)
24 C_ASSERT_FIELD(KTHREAD, 0x039, UCHAR, Running)
25 C_ASSERT_FIELD(KTHREAD, 0x03A, UCHAR[2], Alerted)
26 C_ASSERT_FIELD(KTHREAD, 0x03C, LONG, MiscFlags)
27 C_ASSERT_FIELD(KTHREAD, 0x040, KAPC_STATE, ApcState)
28 C_ASSERT_FIELD(KTHREAD, 0x040, UCHAR[23], ApcStateFill)
29 C_ASSERT_FIELD(KTHREAD, 0x057, CHAR, Priority)
30 C_ASSERT_FIELD(KTHREAD, 0x058, ULONG, NextProcessor)
31 C_ASSERT_FIELD(KTHREAD, 0x05C, ULONG, DeferredProcessor)
32 C_ASSERT_FIELD(KTHREAD, 0x060, ULONG, ApcQueueLock)
33 C_ASSERT_FIELD(KTHREAD, 0x064, ULONG, ContextSwitches)
34 C_ASSERT_FIELD(KTHREAD, 0x068, UCHAR, State)
35 C_ASSERT_FIELD(KTHREAD, 0x069, CHAR, NpxState)
36 C_ASSERT_FIELD(KTHREAD, 0x06A, UCHAR, WaitIrql)
37 C_ASSERT_FIELD(KTHREAD, 0x06B, CHAR, WaitMode)
38 C_ASSERT_FIELD(KTHREAD, 0x06C, LONG, WaitStatus)
39 C_ASSERT_FIELD(KTHREAD, 0x070, PKWAIT_BLOCK, WaitBlockList)
40 C_ASSERT_FIELD(KTHREAD, 0x074, LIST_ENTRY, WaitListEntry)
41 C_ASSERT_FIELD(KTHREAD, 0x074, SINGLE_LIST_ENTRY, SwapListEntry)
42 C_ASSERT_FIELD(KTHREAD, 0x07C, PKQUEUE, Queue)
43 C_ASSERT_FIELD(KTHREAD, 0x080, ULONG, WaitTime)
44 C_ASSERT_FIELD(KTHREAD, 0x084, SHORT, KernelApcDisable)
45 C_ASSERT_FIELD(KTHREAD, 0x086, SHORT, SpecialApcDisable)
46 C_ASSERT_FIELD(KTHREAD, 0x084, ULONG, CombinedApcDisable)
47 C_ASSERT_FIELD(KTHREAD, 0x088, PVOID, Teb)
48 C_ASSERT_FIELD(KTHREAD, 0x090, KTIMER, Timer)
49 C_ASSERT_FIELD(KTHREAD, 0x0B8, LONG, ThreadFlags)
50 C_ASSERT_FIELD(KTHREAD, 0x0BC, PVOID, ServiceTable)
51 C_ASSERT_FIELD(KTHREAD, 0x0C0, KWAIT_BLOCK[4], WaitBlock)
52 C_ASSERT_FIELD(KTHREAD, 0x120, LIST_ENTRY, QueueListEntry)
53 C_ASSERT_FIELD(KTHREAD, 0x128, PKTRAP_FRAME, TrapFrame)
54 C_ASSERT_FIELD(KTHREAD, 0x12C, PVOID, FirstArgument)
55 C_ASSERT_FIELD(KTHREAD, 0x130, PVOID, CallbackStack)
56 C_ASSERT_FIELD(KTHREAD, 0x130, ULONG, CallbackDepth)
57 C_ASSERT_FIELD(KTHREAD, 0x134, UCHAR, ApcStateIndex)
58 C_ASSERT_FIELD(KTHREAD, 0x135, CHAR, BasePriority)
59 C_ASSERT_FIELD(KTHREAD, 0x136, CHAR, PriorityDecrement)
60 C_ASSERT_FIELD(KTHREAD, 0x137, UCHAR, Preempted)
61 C_ASSERT_FIELD(KTHREAD, 0x138, UCHAR, AdjustReason)
62 C_ASSERT_FIELD(KTHREAD, 0x139, CHAR, AdjustIncrement)
63 C_ASSERT_FIELD(KTHREAD, 0x13A, CHAR, PreviousMode)
64 C_ASSERT_FIELD(KTHREAD, 0x13B, CHAR, Saturation)
65 C_ASSERT_FIELD(KTHREAD, 0x13C, ULONG, SystemCallNumber)
66 C_ASSERT_FIELD(KTHREAD, 0x140, ULONG, FreezeCount)
67 C_ASSERT_FIELD(KTHREAD, 0x144, GROUP_AFFINITY, UserAffinity)
68 C_ASSERT_FIELD(KTHREAD, 0x150, PKPROCESS, Process)
69 C_ASSERT_FIELD(KTHREAD, 0x154, GROUP_AFFINITY, Affinity)
70 C_ASSERT_FIELD(KTHREAD, 0x160, ULONG, IdealProcessor)
71 C_ASSERT_FIELD(KTHREAD, 0x164, ULONG, UserIdealProcessor)
72 C_ASSERT_FIELD(KTHREAD, 0x168, PKAPC_STATE[2], ApcStatePointer)
73 C_ASSERT_FIELD(KTHREAD, 0x170, KAPC_STATE, SavedApcState)
74 C_ASSERT_FIELD(KTHREAD, 0x170, UCHAR[23], SavedApcStateFill)
75 C_ASSERT_FIELD(KTHREAD, 0x187, UCHAR, WaitReason)
76 C_ASSERT_FIELD(KTHREAD, 0x188, CHAR, SuspendCount)
77 C_ASSERT_FIELD(KTHREAD, 0x189, CHAR, Spare1)
78 C_ASSERT_FIELD(KTHREAD, 0x18A, UCHAR, OtherPlatformFill)
79 C_ASSERT_FIELD(KTHREAD, 0x18C, PVOID, Win32Thread)
80 C_ASSERT_FIELD(KTHREAD, 0x190, PVOID, StackBase)
81 C_ASSERT_FIELD(KTHREAD, 0x194, KAPC, SuspendApc)
82 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR, SuspendApcFill0)
83 C_ASSERT_FIELD(KTHREAD, 0x195, UCHAR, ResourceIndex)
84 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR[3], SuspendApcFill1)
85 C_ASSERT_FIELD(KTHREAD, 0x197, UCHAR, QuantumReset)
86 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR[4], SuspendApcFill2)
87 C_ASSERT_FIELD(KTHREAD, 0x198, ULONG, KernelTime)
88 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR[36], SuspendApcFill3)
89 C_ASSERT_FIELD(KTHREAD, 0x1B8, PKPRCB, WaitPrcb)
90 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR[40], SuspendApcFill4)
91 C_ASSERT_FIELD(KTHREAD, 0x1BC, PVOID, LegoData)
92 C_ASSERT_FIELD(KTHREAD, 0x194, UCHAR[47], SuspendApcFill5)
93 C_ASSERT_FIELD(KTHREAD, 0x1C3, UCHAR, LargeStack)
94 C_ASSERT_FIELD(KTHREAD, 0x1C4, ULONG, UserTime)
95 C_ASSERT_FIELD(KTHREAD, 0x1C8, KSEMAPHORE, SuspendSemaphore)
96 C_ASSERT_FIELD(KTHREAD, 0x1C8, UCHAR[20], SuspendSemaphorefill)
97 C_ASSERT_FIELD(KTHREAD, 0x1DC, ULONG, SListFaultCount)
98 C_ASSERT_FIELD(KTHREAD, 0x1E0, LIST_ENTRY, ThreadListEntry)
99 C_ASSERT_FIELD(KTHREAD, 0x1E8, LIST_ENTRY, MutantListHead)
100 C_ASSERT_FIELD(KTHREAD, 0x1F0, PVOID, SListFaultAddress)
101 C_ASSERT_FIELD(KTHREAD, 0x1F4, KTHREAD_COUNTERS*, ThreadCounters)
102 C_ASSERT_FIELD(KTHREAD, 0x1F8, XSTATE_SAVE*, XStateSave)
103