xref: /reactos/sdk/include/ndk/tests/win81_x64.c (revision cdf90707)
1 /* Version definitions */
2 #undef NTDDI_VERSION
3 #define NTDDI_VERSION NTDDI_WINBLUE
4 #undef _WIN32_WINNT
5 #define _WIN32_WINNT _WIN32_WINNT_WINBLUE
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, CHAR, 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, PDISPATCHER_HEADER, 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, PKTHREAD_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, LONG, QueuePriority)
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, SINGLE_LIST_ENTRY, LockEntriesFreeList)
98 #if (NTDDI_VERSION < 0x06032580)
99 C_ASSERT_FIELD(KTHREAD, 0x320, KLOCK_ENTRY[5], LockEntries)
100 C_ASSERT_FIELD(KTHREAD, 0x500, SINGLE_LIST_ENTRY, PropagateBoostsEntry)
101 C_ASSERT_FIELD(KTHREAD, 0x508, SINGLE_LIST_ENTRY, IoSelfBoostsEntry)
102 C_ASSERT_FIELD(KTHREAD, 0x510, UINT8[16], PriorityFloorCounts)
103 C_ASSERT_FIELD(KTHREAD, 0x520, ULONG, PriorityFloorSummary)
104 C_ASSERT_FIELD(KTHREAD, 0x524, LONG, AbCompletedIoBoostCount)
105 C_ASSERT_FIELD(KTHREAD, 0x528, SHORT, AbReferenceCount)
106 C_ASSERT_FIELD(KTHREAD, 0x52A, UCHAR, AbFreeEntryCount)
107 C_ASSERT_FIELD(KTHREAD, 0x52B, UCHAR, AbWaitEntryCount)
108 C_ASSERT_FIELD(KTHREAD, 0x52C, ULONG, ForegroundLossTime)
109 C_ASSERT_FIELD(KTHREAD, 0x530, LIST_ENTRY, GlobalForegroundListEntry)
110 C_ASSERT_FIELD(KTHREAD, 0x530, SINGLE_LIST_ENTRY, ForegroundDpcStackListEntry)
111 C_ASSERT_FIELD(KTHREAD, 0x538, ULONG64, InGlobalForegroundList)
112 C_ASSERT_FIELD(KTHREAD, 0x540, LONG64, ReadOperationCount)
113 C_ASSERT_FIELD(KTHREAD, 0x548, LONG64, WriteOperationCount)
114 C_ASSERT_FIELD(KTHREAD, 0x550, LONG64, OtherOperationCount)
115 C_ASSERT_FIELD(KTHREAD, 0x558, LONG64, ReadTransferCount)
116 C_ASSERT_FIELD(KTHREAD, 0x560, LONG64, WriteTransferCount)
117 C_ASSERT_FIELD(KTHREAD, 0x568, LONG64, OtherTransferCount)
118 #else
119 C_ASSERT_FIELD(KTHREAD, 0x320, KLOCK_ENTRY[6], LockEntries)
120 C_ASSERT_FIELD(KTHREAD, 0x560, SINGLE_LIST_ENTRY, PropagateBoostsEntry)
121 C_ASSERT_FIELD(KTHREAD, 0x568, SINGLE_LIST_ENTRY, IoSelfBoostsEntry)
122 C_ASSERT_FIELD(KTHREAD, 0x570, UINT8[16], PriorityFloorCounts)
123 C_ASSERT_FIELD(KTHREAD, 0x580, ULONG, PriorityFloorSummary)
124 C_ASSERT_FIELD(KTHREAD, 0x584, LONG, AbCompletedIoBoostCount)
125 C_ASSERT_FIELD(KTHREAD, 0x588, SHORT, AbReferenceCount)
126 C_ASSERT_FIELD(KTHREAD, 0x58A, UCHAR, AbFreeEntryCount)
127 C_ASSERT_FIELD(KTHREAD, 0x58B, UCHAR, AbWaitEntryCount)
128 C_ASSERT_FIELD(KTHREAD, 0x58C, ULONG, ForegroundLossTime)
129 C_ASSERT_FIELD(KTHREAD, 0x590, LIST_ENTRY, GlobalForegroundListEntry)
130 C_ASSERT_FIELD(KTHREAD, 0x590, SINGLE_LIST_ENTRY, ForegroundDpcStackListEntry)
131 C_ASSERT_FIELD(KTHREAD, 0x598, ULONG64, InGlobalForegroundList)
132 C_ASSERT_FIELD(KTHREAD, 0x5A0, LONG64, ReadOperationCount)
133 C_ASSERT_FIELD(KTHREAD, 0x5A8, LONG64, WriteOperationCount)
134 C_ASSERT_FIELD(KTHREAD, 0x5B0, LONG64, OtherOperationCount)
135 C_ASSERT_FIELD(KTHREAD, 0x5B8, LONG64, ReadTransferCount)
136 C_ASSERT_FIELD(KTHREAD, 0x5C0, LONG64, WriteTransferCount)
137 C_ASSERT_FIELD(KTHREAD, 0x5C8, LONG64, OtherTransferCount)
138 #endif
139