xref: /reactos/sdk/include/ndk/tests/win8_x64.c (revision 80774a2f)
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, 0x018, PVOID, SListFaultAddress)
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, StackBase)
21 C_ASSERT_FIELD(KTHREAD, 0x040, ULONG64, ThreadLock)
22 C_ASSERT_FIELD(KTHREAD, 0x048, ULONG64, CycleTime)
23 C_ASSERT_FIELD(KTHREAD, 0x050, ULONG, CurrentRunTime)
24 C_ASSERT_FIELD(KTHREAD, 0x054, ULONG, ExpectedRunTime)
25 C_ASSERT_FIELD(KTHREAD, 0x058, PVOID, KernelStack)
26 C_ASSERT_FIELD(KTHREAD, 0x060, PXSAVE_FORMAT, StateSaveArea)
27 C_ASSERT_FIELD(KTHREAD, 0x068, struct _KSCHEDULING_GROUP*, SchedulingGroup)
28 C_ASSERT_FIELD(KTHREAD, 0x070, KWAIT_STATUS_REGISTER, WaitRegister)
29 C_ASSERT_FIELD(KTHREAD, 0x071, BOOLEAN, Running)
30 C_ASSERT_FIELD(KTHREAD, 0x072, UINT8[2], Alerted)
31 C_ASSERT_FIELD(KTHREAD, 0x074, LONG, MiscFlags)
32 C_ASSERT_FIELD(KTHREAD, 0x078, LONG, ThreadFlags)
33 C_ASSERT_FIELD(KTHREAD, 0x07C, ULONG, Spare0)
34 C_ASSERT_FIELD(KTHREAD, 0x080, ULONG, SystemCallNumber)
35 C_ASSERT_FIELD(KTHREAD, 0x084, ULONG, Spare1)
36 C_ASSERT_FIELD(KTHREAD, 0x088, PVOID, FirstArgument)
37 C_ASSERT_FIELD(KTHREAD, 0x090, PKTRAP_FRAME, TrapFrame)
38 C_ASSERT_FIELD(KTHREAD, 0x098, KAPC_STATE, ApcState)
39 C_ASSERT_FIELD(KTHREAD, 0x0C3, CHAR, Priority)
40 C_ASSERT_FIELD(KTHREAD, 0x0C4, ULONG, UserIdealProcessor)
41 C_ASSERT_FIELD(KTHREAD, 0x0C8, LONG64, WaitStatus)
42 C_ASSERT_FIELD(KTHREAD, 0x0D0, PKWAIT_BLOCK, WaitBlockList)
43 C_ASSERT_FIELD(KTHREAD, 0x0D8, LIST_ENTRY, WaitListEntry)
44 C_ASSERT_FIELD(KTHREAD, 0x0D8, SINGLE_LIST_ENTRY, SwapListEntry)
45 C_ASSERT_FIELD(KTHREAD, 0x0E8, PKQUEUE, Queue)
46 C_ASSERT_FIELD(KTHREAD, 0x0F0, PVOID, Teb)
47 C_ASSERT_FIELD(KTHREAD, 0x0F8, ULONG64, RelativeTimerBias)
48 C_ASSERT_FIELD(KTHREAD, 0x100, KTIMER, Timer)
49 C_ASSERT_FIELD(KTHREAD, 0x140, KWAIT_BLOCK[4], WaitBlock)
50 C_ASSERT_FIELD(KTHREAD, 0x154, ULONG, ContextSwitches)
51 C_ASSERT_FIELD(KTHREAD, 0x184, UCHAR, State)
52 C_ASSERT_FIELD(KTHREAD, 0x185, CHAR, NpxState)
53 C_ASSERT_FIELD(KTHREAD, 0x186, UCHAR, WaitIrql)
54 C_ASSERT_FIELD(KTHREAD, 0x187, CHAR, WaitMode)
55 C_ASSERT_FIELD(KTHREAD, 0x1B4, ULONG, WaitTime)
56 C_ASSERT_FIELD(KTHREAD, 0x1E4, SHORT, KernelApcDisable)
57 C_ASSERT_FIELD(KTHREAD, 0x1E6, SHORT, SpecialApcDisable)
58 C_ASSERT_FIELD(KTHREAD, 0x1E4, ULONG, CombinedApcDisable)
59 C_ASSERT_FIELD(KTHREAD, 0x168, KTHREAD_COUNTERS*, ThreadCounters)
60 C_ASSERT_FIELD(KTHREAD, 0x198, PXSTATE_SAVE, XStateSave)
61 C_ASSERT_FIELD(KTHREAD, 0x1C8, PVOID, Win32Thread)
62 C_ASSERT_FIELD(KTHREAD, 0x1F0, struct _UMS_CONTROL_BLOCK*, Ucb)
63 C_ASSERT_FIELD(KTHREAD, 0x1F8, struct _KUMS_CONTEXT_HEADER*, Uch)
64 C_ASSERT_FIELD(KTHREAD, 0x200, PVOID, TebMappedLowVa)
65 C_ASSERT_FIELD(KTHREAD, 0x208, LIST_ENTRY, QueueListEntry)
66 C_ASSERT_FIELD(KTHREAD, 0x218, ULONG, NextProcessor)
67 C_ASSERT_FIELD(KTHREAD, 0x21C, ULONG, DeferredProcessor)
68 C_ASSERT_FIELD(KTHREAD, 0x220, PKPROCESS, Process)
69 C_ASSERT_FIELD(KTHREAD, 0x228, GROUP_AFFINITY, UserAffinity)
70 C_ASSERT_FIELD(KTHREAD, 0x232, CHAR, PreviousMode)
71 C_ASSERT_FIELD(KTHREAD, 0x233, CHAR, BasePriority)
72 C_ASSERT_FIELD(KTHREAD, 0x234, CHAR, PriorityDecrement)
73 C_ASSERT_FIELD(KTHREAD, 0x235, UCHAR, Preempted)
74 C_ASSERT_FIELD(KTHREAD, 0x236, UCHAR, AdjustReason)
75 C_ASSERT_FIELD(KTHREAD, 0x237, CHAR, AdjustIncrement)
76 C_ASSERT_FIELD(KTHREAD, 0x238, GROUP_AFFINITY, Affinity)
77 C_ASSERT_FIELD(KTHREAD, 0x242, UCHAR, ApcStateIndex)
78 C_ASSERT_FIELD(KTHREAD, 0x243, UCHAR, WaitBlockCount)
79 C_ASSERT_FIELD(KTHREAD, 0x244, ULONG, IdealProcessor)
80 C_ASSERT_FIELD(KTHREAD, 0x248, KAPC_STATE*[2], ApcStatePointer)
81 C_ASSERT_FIELD(KTHREAD, 0x258, KAPC_STATE, SavedApcState)
82 C_ASSERT_FIELD(KTHREAD, 0x283, UCHAR, WaitReason)
83 C_ASSERT_FIELD(KTHREAD, 0x284, CHAR, SuspendCount)
84 C_ASSERT_FIELD(KTHREAD, 0x285, CHAR, Saturation)
85 C_ASSERT_FIELD(KTHREAD, 0x286, USHORT, SListFaultCount)
86 C_ASSERT_FIELD(KTHREAD, 0x288, KAPC, SchedulerApc)
87 C_ASSERT_FIELD(KTHREAD, 0x289, UCHAR, ResourceIndex)
88 C_ASSERT_FIELD(KTHREAD, 0x28B, UCHAR, QuantumReset)
89 C_ASSERT_FIELD(KTHREAD, 0x28C, ULONG, KernelTime)
90 C_ASSERT_FIELD(KTHREAD, 0x2C8, PKPRCB, WaitPrcb)
91 C_ASSERT_FIELD(KTHREAD, 0x2D0, PVOID, LegoData)
92 C_ASSERT_FIELD(KTHREAD, 0x2DB, UCHAR, CallbackNestingLevel)
93 C_ASSERT_FIELD(KTHREAD, 0x2DC, ULONG, UserTime)
94 C_ASSERT_FIELD(KTHREAD, 0x2E0, KEVENT, SuspendEvent)
95 C_ASSERT_FIELD(KTHREAD, 0x2F8, LIST_ENTRY, ThreadListEntry)
96 C_ASSERT_FIELD(KTHREAD, 0x308, LIST_ENTRY, MutantListHead)
97 C_ASSERT_FIELD(KTHREAD, 0x318, LONG64, ReadOperationCount)
98 C_ASSERT_FIELD(KTHREAD, 0x320, LONG64, WriteOperationCount)
99 C_ASSERT_FIELD(KTHREAD, 0x328, LONG64, OtherOperationCount)
100 C_ASSERT_FIELD(KTHREAD, 0x330, LONG64, ReadTransferCount)
101 C_ASSERT_FIELD(KTHREAD, 0x338, LONG64, WriteTransferCount)
102 C_ASSERT_FIELD(KTHREAD, 0x340, LONG64, OtherTransferCount)
103