1 /* File generated automatically from tools/winapi/tests.dat; do not edit! */
2 /* This file can be copied, modified and distributed without restriction. */
3 
4 /*
5  * Unit tests for data structure packing
6  */
7 
8 #define WINE_NOWINSOCK
9 
10 #include "ntdll_test.h"
11 
12 #include "wine/test.h"
13 
14 /***********************************************************************
15  * Compatibility macros
16  */
17 
18 #define DWORD_PTR UINT_PTR
19 #define LONG_PTR INT_PTR
20 #define ULONG_PTR UINT_PTR
21 
22 /***********************************************************************
23  * Windows API extension
24  */
25 
26 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
27 # define _TYPE_ALIGNMENT(type) __alignof(type)
28 #elif defined(__GNUC__)
29 # define _TYPE_ALIGNMENT(type) __alignof__(type)
30 #else
31 /*
32  * FIXME: May not be possible without a compiler extension
33  *        (if type is not just a name that is, otherwise the normal
34  *         TYPE_ALIGNMENT can be used)
35  */
36 #endif
37 
38 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
39 #pragma warning(disable:4116)
40 #endif
41 
42 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
43 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
44 #endif
45 
46 /***********************************************************************
47  * Test helper macros
48  */
49 
50 #define TEST_TYPE_SIZE(type, size)             C_ASSERT(sizeof(type) == size);
51 
52 #ifdef TYPE_ALIGNMENT
53 # define TEST_TYPE_ALIGN(type, align)          C_ASSERT(TYPE_ALIGNMENT(type) == align);
54 #else
55 # define TEST_TYPE_ALIGN(type, align)
56 #endif
57 
58 #ifdef _TYPE_ALIGNMENT
59 # define TEST_TARGET_ALIGN(type, align)        C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
60 # define TEST_FIELD_ALIGN(type, field, align)  C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
61 #else
62 # define TEST_TARGET_ALIGN(type, align)
63 # define TEST_FIELD_ALIGN(type, field, align)
64 #endif
65 
66 #define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
67 
68 #define TEST_TARGET_SIZE(type, size)            TEST_TYPE_SIZE(*(type)0, size)
69 #define TEST_FIELD_SIZE(type, field, size)      TEST_TYPE_SIZE((((type*)0)->field), size)
70 #define TEST_TYPE_SIGNED(type)                  C_ASSERT((type) -1 < 0);
71 #define TEST_TYPE_UNSIGNED(type)                C_ASSERT((type) -1 > 0);
72 
73 
74 #ifdef _WIN64
75 
76 static void test_pack_DWORD32(void)
77 {
78     /* DWORD32 */
79     TEST_TYPE_SIZE   (DWORD32, 4)
80     TEST_TYPE_ALIGN  (DWORD32, 4)
81     TEST_TYPE_UNSIGNED(DWORD32)
82 }
83 
84 static void test_pack_DWORD64(void)
85 {
86     /* DWORD64 */
87     TEST_TYPE_SIZE   (DWORD64, 8)
88     TEST_TYPE_ALIGN  (DWORD64, 8)
89     TEST_TYPE_UNSIGNED(DWORD64)
90 }
91 
92 static void test_pack_DWORD_PTR(void)
93 {
94     /* DWORD_PTR */
95     TEST_TYPE_SIZE   (DWORD_PTR, 8)
96     TEST_TYPE_ALIGN  (DWORD_PTR, 8)
97 }
98 
99 static void test_pack_HALF_PTR(void)
100 {
101     /* HALF_PTR */
102     TEST_TYPE_SIZE   (HALF_PTR, 4)
103     TEST_TYPE_ALIGN  (HALF_PTR, 4)
104     TEST_TYPE_SIGNED(HALF_PTR)
105 }
106 
107 static void test_pack_INT16(void)
108 {
109     /* INT16 */
110     TEST_TYPE_SIZE   (INT16, 2)
111     TEST_TYPE_ALIGN  (INT16, 2)
112     TEST_TYPE_SIGNED(INT16)
113 }
114 
115 static void test_pack_INT32(void)
116 {
117     /* INT32 */
118     TEST_TYPE_SIZE   (INT32, 4)
119     TEST_TYPE_ALIGN  (INT32, 4)
120     TEST_TYPE_SIGNED(INT32)
121 }
122 
123 static void test_pack_INT64(void)
124 {
125     /* INT64 */
126     TEST_TYPE_SIZE   (INT64, 8)
127     TEST_TYPE_ALIGN  (INT64, 8)
128     TEST_TYPE_SIGNED(INT64)
129 }
130 
131 static void test_pack_INT8(void)
132 {
133     /* INT8 */
134     TEST_TYPE_SIZE   (INT8, 1)
135     TEST_TYPE_ALIGN  (INT8, 1)
136     TEST_TYPE_SIGNED(INT8)
137 }
138 
139 static void test_pack_INT_PTR(void)
140 {
141     /* INT_PTR */
142     TEST_TYPE_SIZE   (INT_PTR, 8)
143     TEST_TYPE_ALIGN  (INT_PTR, 8)
144     TEST_TYPE_SIGNED(INT_PTR)
145 }
146 
147 static void test_pack_LONG32(void)
148 {
149     /* LONG32 */
150     TEST_TYPE_SIZE   (LONG32, 4)
151     TEST_TYPE_ALIGN  (LONG32, 4)
152     TEST_TYPE_SIGNED(LONG32)
153 }
154 
155 static void test_pack_LONG64(void)
156 {
157     /* LONG64 */
158     TEST_TYPE_SIZE   (LONG64, 8)
159     TEST_TYPE_ALIGN  (LONG64, 8)
160     TEST_TYPE_SIGNED(LONG64)
161 }
162 
163 static void test_pack_LONG_PTR(void)
164 {
165     /* LONG_PTR */
166     TEST_TYPE_SIZE   (LONG_PTR, 8)
167     TEST_TYPE_ALIGN  (LONG_PTR, 8)
168     TEST_TYPE_SIGNED(LONG_PTR)
169 }
170 
171 static void test_pack_SIZE_T(void)
172 {
173     /* SIZE_T */
174     TEST_TYPE_SIZE   (SIZE_T, 8)
175     TEST_TYPE_ALIGN  (SIZE_T, 8)
176 }
177 
178 static void test_pack_SSIZE_T(void)
179 {
180     /* SSIZE_T */
181     TEST_TYPE_SIZE   (SSIZE_T, 8)
182     TEST_TYPE_ALIGN  (SSIZE_T, 8)
183 }
184 
185 static void test_pack_UHALF_PTR(void)
186 {
187     /* UHALF_PTR */
188     TEST_TYPE_SIZE   (UHALF_PTR, 4)
189     TEST_TYPE_ALIGN  (UHALF_PTR, 4)
190     TEST_TYPE_UNSIGNED(UHALF_PTR)
191 }
192 
193 static void test_pack_UINT16(void)
194 {
195     /* UINT16 */
196     TEST_TYPE_SIZE   (UINT16, 2)
197     TEST_TYPE_ALIGN  (UINT16, 2)
198     TEST_TYPE_UNSIGNED(UINT16)
199 }
200 
201 static void test_pack_UINT32(void)
202 {
203     /* UINT32 */
204     TEST_TYPE_SIZE   (UINT32, 4)
205     TEST_TYPE_ALIGN  (UINT32, 4)
206     TEST_TYPE_UNSIGNED(UINT32)
207 }
208 
209 static void test_pack_UINT64(void)
210 {
211     /* UINT64 */
212     TEST_TYPE_SIZE   (UINT64, 8)
213     TEST_TYPE_ALIGN  (UINT64, 8)
214     TEST_TYPE_UNSIGNED(UINT64)
215 }
216 
217 static void test_pack_UINT8(void)
218 {
219     /* UINT8 */
220     TEST_TYPE_SIZE   (UINT8, 1)
221     TEST_TYPE_ALIGN  (UINT8, 1)
222     TEST_TYPE_UNSIGNED(UINT8)
223 }
224 
225 static void test_pack_UINT_PTR(void)
226 {
227     /* UINT_PTR */
228     TEST_TYPE_SIZE   (UINT_PTR, 8)
229     TEST_TYPE_ALIGN  (UINT_PTR, 8)
230     TEST_TYPE_UNSIGNED(UINT_PTR)
231 }
232 
233 static void test_pack_ULONG32(void)
234 {
235     /* ULONG32 */
236     TEST_TYPE_SIZE   (ULONG32, 4)
237     TEST_TYPE_ALIGN  (ULONG32, 4)
238     TEST_TYPE_UNSIGNED(ULONG32)
239 }
240 
241 static void test_pack_ULONG64(void)
242 {
243     /* ULONG64 */
244     TEST_TYPE_SIZE   (ULONG64, 8)
245     TEST_TYPE_ALIGN  (ULONG64, 8)
246     TEST_TYPE_UNSIGNED(ULONG64)
247 }
248 
249 static void test_pack_ULONG_PTR(void)
250 {
251     /* ULONG_PTR */
252     TEST_TYPE_SIZE   (ULONG_PTR, 8)
253     TEST_TYPE_ALIGN  (ULONG_PTR, 8)
254     TEST_TYPE_UNSIGNED(ULONG_PTR)
255 }
256 
257 static void test_pack_ACCESS_ALLOWED_ACE(void)
258 {
259     /* ACCESS_ALLOWED_ACE */
260     TEST_TYPE_SIZE   (ACCESS_ALLOWED_ACE, 12)
261     TEST_TYPE_ALIGN  (ACCESS_ALLOWED_ACE, 4)
262     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, Header, 4)
263     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Header, 2)
264     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Header, 0)
265     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, Mask, 4)
266     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Mask, 4)
267     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Mask, 4)
268     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, SidStart, 4)
269     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
270     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart, 8)
271 }
272 
273 static void test_pack_ACCESS_DENIED_ACE(void)
274 {
275     /* ACCESS_DENIED_ACE */
276     TEST_TYPE_SIZE   (ACCESS_DENIED_ACE, 12)
277     TEST_TYPE_ALIGN  (ACCESS_DENIED_ACE, 4)
278     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, Header, 4)
279     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Header, 2)
280     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Header, 0)
281     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, Mask, 4)
282     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Mask, 4)
283     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Mask, 4)
284     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, SidStart, 4)
285     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
286     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart, 8)
287 }
288 
289 static void test_pack_ACCESS_MASK(void)
290 {
291     /* ACCESS_MASK */
292     TEST_TYPE_SIZE   (ACCESS_MASK, 4)
293     TEST_TYPE_ALIGN  (ACCESS_MASK, 4)
294     TEST_TYPE_UNSIGNED(ACCESS_MASK)
295 }
296 
297 static void test_pack_ACE_HEADER(void)
298 {
299     /* ACE_HEADER */
300     TEST_TYPE_SIZE   (ACE_HEADER, 4)
301     TEST_TYPE_ALIGN  (ACE_HEADER, 2)
302     TEST_FIELD_SIZE  (ACE_HEADER, AceType, 1)
303     TEST_FIELD_ALIGN (ACE_HEADER, AceType, 1)
304     TEST_FIELD_OFFSET(ACE_HEADER, AceType, 0)
305     TEST_FIELD_SIZE  (ACE_HEADER, AceFlags, 1)
306     TEST_FIELD_ALIGN (ACE_HEADER, AceFlags, 1)
307     TEST_FIELD_OFFSET(ACE_HEADER, AceFlags, 1)
308     TEST_FIELD_SIZE  (ACE_HEADER, AceSize, 2)
309     TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
310     TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
311 }
312 
313 static void test_pack_ACL(void)
314 {
315     /* ACL */
316     TEST_TYPE_SIZE   (ACL, 8)
317     TEST_TYPE_ALIGN  (ACL, 2)
318     TEST_FIELD_SIZE  (ACL, AclRevision, 1)
319     TEST_FIELD_ALIGN (ACL, AclRevision, 1)
320     TEST_FIELD_OFFSET(ACL, AclRevision, 0)
321     TEST_FIELD_SIZE  (ACL, Sbz1, 1)
322     TEST_FIELD_ALIGN (ACL, Sbz1, 1)
323     TEST_FIELD_OFFSET(ACL, Sbz1, 1)
324     TEST_FIELD_SIZE  (ACL, AclSize, 2)
325     TEST_FIELD_ALIGN (ACL, AclSize, 2)
326     TEST_FIELD_OFFSET(ACL, AclSize, 2)
327     TEST_FIELD_SIZE  (ACL, AceCount, 2)
328     TEST_FIELD_ALIGN (ACL, AceCount, 2)
329     TEST_FIELD_OFFSET(ACL, AceCount, 4)
330     TEST_FIELD_SIZE  (ACL, Sbz2, 2)
331     TEST_FIELD_ALIGN (ACL, Sbz2, 2)
332     TEST_FIELD_OFFSET(ACL, Sbz2, 6)
333 }
334 
335 static void test_pack_ACL_REVISION_INFORMATION(void)
336 {
337     /* ACL_REVISION_INFORMATION */
338     TEST_TYPE_SIZE   (ACL_REVISION_INFORMATION, 4)
339     TEST_TYPE_ALIGN  (ACL_REVISION_INFORMATION, 4)
340     TEST_FIELD_SIZE  (ACL_REVISION_INFORMATION, AclRevision, 4)
341     TEST_FIELD_ALIGN (ACL_REVISION_INFORMATION, AclRevision, 4)
342     TEST_FIELD_OFFSET(ACL_REVISION_INFORMATION, AclRevision, 0)
343 }
344 
345 static void test_pack_ACL_SIZE_INFORMATION(void)
346 {
347     /* ACL_SIZE_INFORMATION */
348     TEST_TYPE_SIZE   (ACL_SIZE_INFORMATION, 12)
349     TEST_TYPE_ALIGN  (ACL_SIZE_INFORMATION, 4)
350     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AceCount, 4)
351     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4)
352     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AceCount, 0)
353     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
354     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
355     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
356     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AclBytesFree, 4)
357     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
358     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
359 }
360 
361 static void test_pack_BOOLEAN(void)
362 {
363     /* BOOLEAN */
364     TEST_TYPE_SIZE   (BOOLEAN, 1)
365     TEST_TYPE_ALIGN  (BOOLEAN, 1)
366     TEST_TYPE_UNSIGNED(BOOLEAN)
367 }
368 
369 static void test_pack_CCHAR(void)
370 {
371     /* CCHAR */
372     TEST_TYPE_SIZE   (CCHAR, 1)
373     TEST_TYPE_ALIGN  (CCHAR, 1)
374 }
375 
376 static void test_pack_CHAR(void)
377 {
378     /* CHAR */
379     TEST_TYPE_SIZE   (CHAR, 1)
380     TEST_TYPE_ALIGN  (CHAR, 1)
381 }
382 
383 static void test_pack_DWORDLONG(void)
384 {
385     /* DWORDLONG */
386     TEST_TYPE_SIZE   (DWORDLONG, 8)
387     TEST_TYPE_ALIGN  (DWORDLONG, 8)
388     TEST_TYPE_UNSIGNED(DWORDLONG)
389 }
390 
391 static void test_pack_EXCEPTION_POINTERS(void)
392 {
393     /* EXCEPTION_POINTERS */
394     TEST_TYPE_SIZE   (EXCEPTION_POINTERS, 16)
395     TEST_TYPE_ALIGN  (EXCEPTION_POINTERS, 8)
396     TEST_FIELD_SIZE  (EXCEPTION_POINTERS, ExceptionRecord, 8)
397     TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 8)
398     TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
399     TEST_FIELD_SIZE  (EXCEPTION_POINTERS, ContextRecord, 8)
400     TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ContextRecord, 8)
401     TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ContextRecord, 8)
402 }
403 
404 static void test_pack_EXCEPTION_RECORD(void)
405 {
406     /* EXCEPTION_RECORD */
407     TEST_TYPE_SIZE   (EXCEPTION_RECORD, 152)
408     TEST_TYPE_ALIGN  (EXCEPTION_RECORD, 8)
409     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionCode, 4)
410     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionCode, 4)
411     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionCode, 0)
412     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionFlags, 4)
413     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
414     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
415     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionRecord, 8)
416     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 8)
417     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
418     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionAddress, 8)
419     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 8)
420     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 16)
421     TEST_FIELD_SIZE  (EXCEPTION_RECORD, NumberParameters, 4)
422     TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
423     TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 24)
424     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionInformation, 120)
425     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 8)
426     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 32)
427 }
428 
429 static void test_pack_EXECUTION_STATE(void)
430 {
431     /* EXECUTION_STATE */
432     TEST_TYPE_SIZE   (EXECUTION_STATE, 4)
433     TEST_TYPE_ALIGN  (EXECUTION_STATE, 4)
434     TEST_TYPE_UNSIGNED(EXECUTION_STATE)
435 }
436 
437 static void test_pack_FPO_DATA(void)
438 {
439     /* FPO_DATA */
440     TEST_TYPE_SIZE   (FPO_DATA, 16)
441     TEST_TYPE_ALIGN  (FPO_DATA, 4)
442     TEST_FIELD_SIZE  (FPO_DATA, ulOffStart, 4)
443     TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
444     TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
445     TEST_FIELD_SIZE  (FPO_DATA, cbProcSize, 4)
446     TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
447     TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
448     TEST_FIELD_SIZE  (FPO_DATA, cdwLocals, 4)
449     TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
450     TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
451     TEST_FIELD_SIZE  (FPO_DATA, cdwParams, 2)
452     TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
453     TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
454 }
455 
456 static void test_pack_GENERIC_MAPPING(void)
457 {
458     /* GENERIC_MAPPING */
459     TEST_TYPE_SIZE   (GENERIC_MAPPING, 16)
460     TEST_TYPE_ALIGN  (GENERIC_MAPPING, 4)
461     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericRead, 4)
462     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
463     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
464     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericWrite, 4)
465     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
466     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
467     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericExecute, 4)
468     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
469     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
470     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericAll, 4)
471     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
472     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
473 }
474 
475 static void test_pack_HANDLE(void)
476 {
477     /* HANDLE */
478     TEST_TYPE_SIZE   (HANDLE, 8)
479     TEST_TYPE_ALIGN  (HANDLE, 8)
480 }
481 
482 static void test_pack_HRESULT(void)
483 {
484     /* HRESULT */
485     TEST_TYPE_SIZE   (HRESULT, 4)
486     TEST_TYPE_ALIGN  (HRESULT, 4)
487 }
488 
489 static void test_pack_IMAGE_ARCHIVE_MEMBER_HEADER(void)
490 {
491     /* IMAGE_ARCHIVE_MEMBER_HEADER */
492     TEST_TYPE_SIZE   (IMAGE_ARCHIVE_MEMBER_HEADER, 60)
493     TEST_TYPE_ALIGN  (IMAGE_ARCHIVE_MEMBER_HEADER, 1)
494     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 16)
495     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 1)
496     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Name, 0)
497     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 12)
498     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 1)
499     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Date, 16)
500     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 6)
501     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 1)
502     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 28)
503     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 6)
504     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 1)
505     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 34)
506     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 8)
507     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 1)
508     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 40)
509     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 10)
510     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 1)
511     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Size, 48)
512     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 2)
513     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 1)
514     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 58)
515 }
516 
517 static void test_pack_IMAGE_AUX_SYMBOL(void)
518 {
519     /* IMAGE_AUX_SYMBOL (pack 2) */
520 }
521 
522 static void test_pack_IMAGE_BASE_RELOCATION(void)
523 {
524     /* IMAGE_BASE_RELOCATION */
525     TEST_TYPE_SIZE   (IMAGE_BASE_RELOCATION, 8)
526     TEST_TYPE_ALIGN  (IMAGE_BASE_RELOCATION, 4)
527     TEST_FIELD_SIZE  (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
528     TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
529     TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, VirtualAddress, 0)
530     TEST_FIELD_SIZE  (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
531     TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
532     TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
533 }
534 
535 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
536 {
537     /* IMAGE_BOUND_FORWARDER_REF */
538     TEST_TYPE_SIZE   (IMAGE_BOUND_FORWARDER_REF, 8)
539     TEST_TYPE_ALIGN  (IMAGE_BOUND_FORWARDER_REF, 4)
540     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
541     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
542     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 0)
543     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
544     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
545     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
546     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
547     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
548     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, Reserved, 6)
549 }
550 
551 static void test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR(void)
552 {
553     /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
554     TEST_TYPE_SIZE   (IMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
555     TEST_TYPE_ALIGN  (IMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
556     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
557     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
558     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 0)
559     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
560     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
561     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 4)
562     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
563     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
564     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
565 }
566 
567 static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void)
568 {
569     /* IMAGE_COFF_SYMBOLS_HEADER */
570     TEST_TYPE_SIZE   (IMAGE_COFF_SYMBOLS_HEADER, 32)
571     TEST_TYPE_ALIGN  (IMAGE_COFF_SYMBOLS_HEADER, 4)
572     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
573     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
574     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0)
575     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
576     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
577     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
578     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
579     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
580     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
581     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
582     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
583     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
584     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
585     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
586     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
587     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
588     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
589     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
590     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
591     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
592     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
593     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
594     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
595     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
596 }
597 
598 static void test_pack_IMAGE_DATA_DIRECTORY(void)
599 {
600     /* IMAGE_DATA_DIRECTORY */
601     TEST_TYPE_SIZE   (IMAGE_DATA_DIRECTORY, 8)
602     TEST_TYPE_ALIGN  (IMAGE_DATA_DIRECTORY, 4)
603     TEST_FIELD_SIZE  (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
604     TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
605     TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, VirtualAddress, 0)
606     TEST_FIELD_SIZE  (IMAGE_DATA_DIRECTORY, Size, 4)
607     TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, Size, 4)
608     TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, Size, 4)
609 }
610 
611 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
612 {
613     /* IMAGE_DEBUG_DIRECTORY */
614     TEST_TYPE_SIZE   (IMAGE_DEBUG_DIRECTORY, 28)
615     TEST_TYPE_ALIGN  (IMAGE_DEBUG_DIRECTORY, 4)
616     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
617     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
618     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
619     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
620     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
621     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
622     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
623     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
624     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MajorVersion, 8)
625     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
626     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
627     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MinorVersion, 10)
628     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, Type, 4)
629     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Type, 4)
630     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Type, 12)
631     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
632     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
633     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, SizeOfData, 16)
634     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
635     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
636     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
637     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
638     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
639     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
640 }
641 
642 static void test_pack_IMAGE_DEBUG_MISC(void)
643 {
644     /* IMAGE_DEBUG_MISC */
645     TEST_TYPE_SIZE   (IMAGE_DEBUG_MISC, 16)
646     TEST_TYPE_ALIGN  (IMAGE_DEBUG_MISC, 4)
647     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, DataType, 4)
648     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, DataType, 4)
649     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, DataType, 0)
650     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Length, 4)
651     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Length, 4)
652     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Length, 4)
653     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Unicode, 1)
654     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
655     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Unicode, 8)
656     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Reserved, 3)
657     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Reserved, 1)
658     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Reserved, 9)
659     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Data, 1)
660     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Data, 1)
661     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Data, 12)
662 }
663 
664 static void test_pack_IMAGE_DOS_HEADER(void)
665 {
666     /* IMAGE_DOS_HEADER (pack 2) */
667     TEST_TYPE_SIZE   (IMAGE_DOS_HEADER, 64)
668     TEST_TYPE_ALIGN  (IMAGE_DOS_HEADER, 2)
669     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_magic, 2)
670     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_magic, 2)
671     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_magic, 0)
672     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cblp, 2)
673     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2)
674     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cblp, 2)
675     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cp, 2)
676     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cp, 2)
677     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cp, 4)
678     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_crlc, 2)
679     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2)
680     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_crlc, 6)
681     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cparhdr, 2)
682     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
683     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8)
684     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_minalloc, 2)
685     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
686     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
687     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_maxalloc, 2)
688     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
689     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
690     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ss, 2)
691     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ss, 2)
692     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ss, 14)
693     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_sp, 2)
694     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_sp, 2)
695     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_sp, 16)
696     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_csum, 2)
697     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_csum, 2)
698     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_csum, 18)
699     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ip, 2)
700     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ip, 2)
701     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ip, 20)
702     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cs, 2)
703     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cs, 2)
704     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cs, 22)
705     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_lfarlc, 2)
706     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfarlc, 2)
707     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfarlc, 24)
708     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ovno, 2)
709     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ovno, 2)
710     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ovno, 26)
711     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_res, 8)
712     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res, 2)
713     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res, 28)
714     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_oemid, 2)
715     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oemid, 2)
716     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oemid, 36)
717     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_oeminfo, 2)
718     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2)
719     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38)
720     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_res2, 20)
721     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res2, 2)
722     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res2, 40)
723     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_lfanew, 4)
724     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfanew, 2)
725     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfanew, 60)
726 }
727 
728 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
729 {
730     /* IMAGE_EXPORT_DIRECTORY */
731     TEST_TYPE_SIZE   (IMAGE_EXPORT_DIRECTORY, 40)
732     TEST_TYPE_ALIGN  (IMAGE_EXPORT_DIRECTORY, 4)
733     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
734     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
735     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0)
736     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
737     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
738     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
739     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
740     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
741     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MajorVersion, 8)
742     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
743     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
744     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MinorVersion, 10)
745     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Name, 4)
746     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Name, 4)
747     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Name, 12)
748     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Base, 4)
749     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Base, 4)
750     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Base, 16)
751     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
752     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
753     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20)
754     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
755     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
756     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24)
757     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
758     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
759     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28)
760     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
761     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
762     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32)
763     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
764     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
765     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36)
766 }
767 
768 static void test_pack_IMAGE_FILE_HEADER(void)
769 {
770     /* IMAGE_FILE_HEADER */
771     TEST_TYPE_SIZE   (IMAGE_FILE_HEADER, 20)
772     TEST_TYPE_ALIGN  (IMAGE_FILE_HEADER, 4)
773     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, Machine, 2)
774     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2)
775     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Machine, 0)
776     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, NumberOfSections, 2)
777     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2)
778     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2)
779     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, TimeDateStamp, 4)
780     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4)
781     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4)
782     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
783     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
784     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8)
785     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
786     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
787     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12)
788     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
789     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
790     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16)
791     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, Characteristics, 2)
792     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2)
793     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18)
794 }
795 
796 static void test_pack_IMAGE_FUNCTION_ENTRY(void)
797 {
798     /* IMAGE_FUNCTION_ENTRY */
799     TEST_TYPE_SIZE   (IMAGE_FUNCTION_ENTRY, 12)
800     TEST_TYPE_ALIGN  (IMAGE_FUNCTION_ENTRY, 4)
801     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
802     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
803     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0)
804     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
805     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
806     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
807     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
808     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
809     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8)
810 }
811 
812 static void test_pack_IMAGE_IMPORT_BY_NAME(void)
813 {
814     /* IMAGE_IMPORT_BY_NAME */
815     TEST_TYPE_SIZE   (IMAGE_IMPORT_BY_NAME, 4)
816     TEST_TYPE_ALIGN  (IMAGE_IMPORT_BY_NAME, 2)
817     TEST_FIELD_SIZE  (IMAGE_IMPORT_BY_NAME, Hint, 2)
818     TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Hint, 2)
819     TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Hint, 0)
820     TEST_FIELD_SIZE  (IMAGE_IMPORT_BY_NAME, Name, 1)
821     TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Name, 1)
822     TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Name, 2)
823 }
824 
825 static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
826 {
827     /* IMAGE_IMPORT_DESCRIPTOR */
828 }
829 
830 static void test_pack_IMAGE_LINENUMBER(void)
831 {
832     /* IMAGE_LINENUMBER (pack 2) */
833 }
834 
835 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void)
836 {
837     /* IMAGE_LOAD_CONFIG_DIRECTORY */
838     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY, 112)
839     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY, 8)
840 }
841 
842 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(void)
843 {
844     /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
845     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY32, 88)
846     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY32, 8)
847     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
848     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
849     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 0)
850     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
851     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
852     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
853     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
854     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
855     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 8)
856     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
857     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
858     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 10)
859     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
860     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
861     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12)
862     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
863     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
864     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 16)
865     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
866     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
867     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20)
868     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
869     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
870     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24)
871     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
872     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
873     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28)
874     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
875     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
876     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 32)
877     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
878     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
879     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 40)
880     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
881     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
882     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 44)
883     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
884     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
885     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 48)
886     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
887     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
888     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 52)
889     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
890     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
891     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 56)
892     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
893     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
894     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 58)
895     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8)
896     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8)
897     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 64)
898     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
899     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
900     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 72)
901     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
902     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
903     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 76)
904     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
905     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
906     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 80)
907 }
908 
909 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(void)
910 {
911     /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
912     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY64, 112)
913     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY64, 8)
914     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
915     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
916     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 0)
917     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
918     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
919     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
920     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
921     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
922     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 8)
923     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
924     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
925     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 10)
926     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
927     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
928     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12)
929     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
930     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
931     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 16)
932     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
933     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
934     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20)
935     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
936     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
937     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24)
938     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
939     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
940     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32)
941     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
942     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
943     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 40)
944     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
945     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
946     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48)
947     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
948     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
949     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56)
950     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
951     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
952     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 64)
953     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
954     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
955     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72)
956     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
957     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
958     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 76)
959     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
960     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
961     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 78)
962     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
963     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
964     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 80)
965     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
966     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
967     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 88)
968     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
969     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
970     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 96)
971     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
972     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
973     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 104)
974 }
975 
976 static void test_pack_IMAGE_NT_HEADERS(void)
977 {
978     /* IMAGE_NT_HEADERS */
979     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS, 264)
980     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS, 8)
981 }
982 
983 static void test_pack_IMAGE_NT_HEADERS32(void)
984 {
985     /* IMAGE_NT_HEADERS32 */
986     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS32, 248)
987     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS32, 4)
988     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, Signature, 4)
989     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, Signature, 4)
990     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, Signature, 0)
991     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, FileHeader, 20)
992     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, FileHeader, 4)
993     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, FileHeader, 4)
994     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, OptionalHeader, 224)
995     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, OptionalHeader, 4)
996     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader, 24)
997 }
998 
999 static void test_pack_IMAGE_NT_HEADERS64(void)
1000 {
1001     /* IMAGE_NT_HEADERS64 */
1002     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS64, 264)
1003     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS64, 8)
1004     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, Signature, 4)
1005     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, Signature, 4)
1006     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, Signature, 0)
1007     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, FileHeader, 20)
1008     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, FileHeader, 4)
1009     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, FileHeader, 4)
1010     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, OptionalHeader, 240)
1011     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, OptionalHeader, 8)
1012     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader, 24)
1013 }
1014 
1015 static void test_pack_IMAGE_OPTIONAL_HEADER(void)
1016 {
1017     /* IMAGE_OPTIONAL_HEADER */
1018     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER, 240)
1019     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER, 8)
1020 }
1021 
1022 static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
1023 {
1024     /* IMAGE_OPTIONAL_HEADER32 */
1025     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER32, 224)
1026     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER32, 4)
1027     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Magic, 2)
1028     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Magic, 2)
1029     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Magic, 0)
1030     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1031     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1032     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 2)
1033     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1034     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1035     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 3)
1036     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1037     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1038     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1039     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1040     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1041     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 8)
1042     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1043     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1044     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 12)
1045     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1046     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1047     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 16)
1048     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1049     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1050     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfCode, 20)
1051     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1052     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1053     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfData, 24)
1054     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
1055     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
1056     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, ImageBase, 28)
1057     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1058     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1059     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SectionAlignment, 32)
1060     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1061     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1062     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, FileAlignment, 36)
1063     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1064     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1065     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 40)
1066     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1067     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1068     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 42)
1069     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1070     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1071     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 44)
1072     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1073     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1074     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 46)
1075     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1076     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1077     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 48)
1078     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1079     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1080     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 50)
1081     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1082     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1083     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 52)
1084     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1085     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1086     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfImage, 56)
1087     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1088     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1089     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 60)
1090     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
1091     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
1092     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, CheckSum, 64)
1093     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
1094     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
1095     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Subsystem, 68)
1096     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1097     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1098     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 70)
1099     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1100     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1101     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 72)
1102     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1103     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1104     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 76)
1105     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1106     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1107     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 80)
1108     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1109     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1110     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 84)
1111     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1112     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1113     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, LoaderFlags, 88)
1114     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1115     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1116     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 92)
1117     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, DataDirectory, 128)
1118     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DataDirectory, 4)
1119     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DataDirectory, 96)
1120 }
1121 
1122 static void test_pack_IMAGE_OPTIONAL_HEADER64(void)
1123 {
1124     /* IMAGE_OPTIONAL_HEADER64 */
1125     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER64, 240)
1126     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER64, 8)
1127     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Magic, 2)
1128     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Magic, 2)
1129     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Magic, 0)
1130     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1131     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1132     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 2)
1133     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1134     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1135     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 3)
1136     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1137     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1138     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1139     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1140     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1141     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 8)
1142     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1143     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1144     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 12)
1145     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1146     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1147     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 16)
1148     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1149     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1150     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, BaseOfCode, 20)
1151     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
1152     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
1153     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, ImageBase, 24)
1154     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1155     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1156     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SectionAlignment, 32)
1157     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1158     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1159     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, FileAlignment, 36)
1160     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1161     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1162     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 40)
1163     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1164     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1165     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 42)
1166     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1167     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1168     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 44)
1169     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1170     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1171     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 46)
1172     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1173     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1174     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 48)
1175     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1176     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1177     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 50)
1178     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1179     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1180     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 52)
1181     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1182     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1183     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfImage, 56)
1184     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1185     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1186     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 60)
1187     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
1188     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
1189     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, CheckSum, 64)
1190     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
1191     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
1192     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Subsystem, 68)
1193     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1194     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1195     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 70)
1196     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1197     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1198     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 72)
1199     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1200     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1201     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 80)
1202     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1203     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1204     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 88)
1205     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1206     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1207     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 96)
1208     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1209     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1210     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, LoaderFlags, 104)
1211     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1212     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1213     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 108)
1214     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, DataDirectory, 128)
1215     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DataDirectory, 4)
1216     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DataDirectory, 112)
1217 }
1218 
1219 static void test_pack_IMAGE_OS2_HEADER(void)
1220 {
1221     /* IMAGE_OS2_HEADER (pack 2) */
1222     TEST_TYPE_SIZE   (IMAGE_OS2_HEADER, 64)
1223     TEST_TYPE_ALIGN  (IMAGE_OS2_HEADER, 2)
1224     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_magic, 2)
1225     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2)
1226     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_magic, 0)
1227     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_ver, 1)
1228     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_ver, 1)
1229     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_ver, 2)
1230     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_rev, 1)
1231     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1)
1232     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rev, 3)
1233     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_enttab, 2)
1234     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2)
1235     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4)
1236     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1237     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1238     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6)
1239     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_crc, 4)
1240     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_crc, 2)
1241     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_crc, 8)
1242     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_flags, 2)
1243     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2)
1244     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12)
1245     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_autodata, 2)
1246     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2)
1247     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14)
1248     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_heap, 2)
1249     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_heap, 2)
1250     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_heap, 16)
1251     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_stack, 2)
1252     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2)
1253     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18)
1254     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_csip, 4)
1255     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_csip, 2)
1256     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_csip, 20)
1257     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_sssp, 4)
1258     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_sssp, 2)
1259     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_sssp, 24)
1260     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cseg, 2)
1261     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cseg, 2)
1262     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cseg, 28)
1263     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cmod, 2)
1264     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmod, 2)
1265     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmod, 30)
1266     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1267     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1268     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32)
1269     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_segtab, 2)
1270     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2)
1271     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34)
1272     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1273     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1274     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36)
1275     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_restab, 2)
1276     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2)
1277     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38)
1278     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_modtab, 2)
1279     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2)
1280     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40)
1281     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_imptab, 2)
1282     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2)
1283     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42)
1284     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_nrestab, 4)
1285     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2)
1286     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44)
1287     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cmovent, 2)
1288     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2)
1289     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48)
1290     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_align, 2)
1291     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2)
1292     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50)
1293     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cres, 2)
1294     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cres, 2)
1295     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cres, 52)
1296     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_exetyp, 1)
1297     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1)
1298     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54)
1299     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1300     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1301     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55)
1302     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1303     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1304     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56)
1305     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1306     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1307     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58)
1308     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_swaparea, 2)
1309     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2)
1310     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60)
1311     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_expver, 2)
1312     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2)
1313     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62)
1314 }
1315 
1316 static void test_pack_IMAGE_RELOCATION(void)
1317 {
1318     /* IMAGE_RELOCATION (pack 2) */
1319 }
1320 
1321 static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void)
1322 {
1323     /* IMAGE_RESOURCE_DATA_ENTRY */
1324     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DATA_ENTRY, 16)
1325     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DATA_ENTRY, 4)
1326     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1327     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1328     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 0)
1329     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1330     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1331     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1332     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
1333     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
1334     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, CodePage, 8)
1335     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
1336     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
1337     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Reserved, 12)
1338 }
1339 
1340 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
1341 {
1342     /* IMAGE_RESOURCE_DIRECTORY */
1343     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIRECTORY, 16)
1344     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIRECTORY, 4)
1345     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1346     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1347     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0)
1348     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1349     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1350     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1351     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
1352     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
1353     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MajorVersion, 8)
1354     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
1355     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
1356     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MinorVersion, 10)
1357     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1358     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1359     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12)
1360     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1361     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1362     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14)
1363 }
1364 
1365 static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void)
1366 {
1367     /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
1368 }
1369 
1370 static void test_pack_IMAGE_RESOURCE_DIRECTORY_STRING(void)
1371 {
1372     /* IMAGE_RESOURCE_DIRECTORY_STRING */
1373     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIRECTORY_STRING, 4)
1374     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIRECTORY_STRING, 2)
1375     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
1376     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
1377     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, Length, 0)
1378     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
1379     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
1380     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 2)
1381 }
1382 
1383 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
1384 {
1385     /* IMAGE_RESOURCE_DIR_STRING_U */
1386     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIR_STRING_U, 4)
1387     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIR_STRING_U, 2)
1388     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
1389     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
1390     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, Length, 0)
1391     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1392     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1393     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1394 }
1395 
1396 static void test_pack_IMAGE_SECTION_HEADER(void)
1397 {
1398     /* IMAGE_SECTION_HEADER */
1399     TEST_FIELD_SIZE  (IMAGE_SECTION_HEADER, Name, 8)
1400     TEST_FIELD_ALIGN (IMAGE_SECTION_HEADER, Name, 1)
1401     TEST_FIELD_OFFSET(IMAGE_SECTION_HEADER, Name, 0)
1402 }
1403 
1404 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
1405 {
1406     /* IMAGE_SEPARATE_DEBUG_HEADER */
1407     TEST_TYPE_SIZE   (IMAGE_SEPARATE_DEBUG_HEADER, 48)
1408     TEST_TYPE_ALIGN  (IMAGE_SEPARATE_DEBUG_HEADER, 4)
1409     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
1410     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
1411     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Signature, 0)
1412     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1413     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1414     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1415     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
1416     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
1417     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Machine, 4)
1418     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1419     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1420     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 6)
1421     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1422     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1423     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 8)
1424     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
1425     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
1426     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 12)
1427     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
1428     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
1429     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 16)
1430     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
1431     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
1432     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 20)
1433     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1434     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1435     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24)
1436     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1437     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1438     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28)
1439     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1440     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1441     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32)
1442     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1443     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1444     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36)
1445     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 8)
1446     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 4)
1447     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 40)
1448 }
1449 
1450 static void test_pack_IMAGE_SYMBOL(void)
1451 {
1452     /* IMAGE_SYMBOL (pack 2) */
1453 }
1454 
1455 static void test_pack_IMAGE_THUNK_DATA(void)
1456 {
1457     /* IMAGE_THUNK_DATA */
1458 }
1459 
1460 static void test_pack_IMAGE_TLS_DIRECTORY(void)
1461 {
1462     /* IMAGE_TLS_DIRECTORY */
1463     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY, 40)
1464     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY, 8)
1465 }
1466 
1467 static void test_pack_IMAGE_TLS_DIRECTORY32(void)
1468 {
1469     /* IMAGE_TLS_DIRECTORY32 */
1470     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY32, 24)
1471     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY32, 4)
1472     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1473     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1474     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 0)
1475     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1476     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1477     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1478     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1479     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1480     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfIndex, 8)
1481     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1482     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1483     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 12)
1484     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1485     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1486     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 16)
1487     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1488     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1489     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, Characteristics, 20)
1490 }
1491 
1492 static void test_pack_IMAGE_TLS_DIRECTORY64(void)
1493 {
1494     /* IMAGE_TLS_DIRECTORY64 */
1495     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY64, 40)
1496     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY64, 8)
1497     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1498     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1499     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 0)
1500     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1501     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1502     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1503     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1504     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1505     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfIndex, 16)
1506     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1507     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1508     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 24)
1509     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1510     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1511     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 32)
1512     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1513     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1514     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, Characteristics, 36)
1515 }
1516 
1517 static void test_pack_IMAGE_VXD_HEADER(void)
1518 {
1519     /* IMAGE_VXD_HEADER (pack 2) */
1520     TEST_TYPE_SIZE   (IMAGE_VXD_HEADER, 196)
1521     TEST_TYPE_ALIGN  (IMAGE_VXD_HEADER, 2)
1522     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_magic, 2)
1523     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2)
1524     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0)
1525     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_border, 1)
1526     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1)
1527     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2)
1528     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_worder, 1)
1529     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1)
1530     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3)
1531     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_level, 4)
1532     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2)
1533     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4)
1534     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_cpu, 2)
1535     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cpu, 2)
1536     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cpu, 8)
1537     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_os, 2)
1538     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_os, 2)
1539     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_os, 10)
1540     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ver, 4)
1541     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ver, 2)
1542     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ver, 12)
1543     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_mflags, 4)
1544     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2)
1545     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16)
1546     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_mpages, 4)
1547     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2)
1548     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20)
1549     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_startobj, 4)
1550     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2)
1551     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24)
1552     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_eip, 4)
1553     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_eip, 2)
1554     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_eip, 28)
1555     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_stackobj, 4)
1556     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2)
1557     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32)
1558     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_esp, 4)
1559     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_esp, 2)
1560     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_esp, 36)
1561     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_pagesize, 4)
1562     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2)
1563     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40)
1564     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_lastpagesize, 4)
1565     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2)
1566     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44)
1567     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fixupsize, 4)
1568     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2)
1569     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48)
1570     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fixupsum, 4)
1571     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2)
1572     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52)
1573     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ldrsize, 4)
1574     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2)
1575     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56)
1576     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ldrsum, 4)
1577     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2)
1578     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60)
1579     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objtab, 4)
1580     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2)
1581     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64)
1582     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objcnt, 4)
1583     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2)
1584     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68)
1585     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objmap, 4)
1586     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2)
1587     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72)
1588     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_itermap, 4)
1589     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2)
1590     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76)
1591     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_rsrctab, 4)
1592     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2)
1593     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80)
1594     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_rsrccnt, 4)
1595     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2)
1596     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84)
1597     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_restab, 4)
1598     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2)
1599     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88)
1600     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_enttab, 4)
1601     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2)
1602     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92)
1603     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_dirtab, 4)
1604     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2)
1605     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96)
1606     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_dircnt, 4)
1607     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2)
1608     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100)
1609     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fpagetab, 4)
1610     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2)
1611     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104)
1612     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_frectab, 4)
1613     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2)
1614     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108)
1615     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impmod, 4)
1616     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2)
1617     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112)
1618     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impmodcnt, 4)
1619     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2)
1620     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116)
1621     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impproc, 4)
1622     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2)
1623     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120)
1624     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_pagesum, 4)
1625     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2)
1626     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124)
1627     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_datapage, 4)
1628     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2)
1629     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128)
1630     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_preload, 4)
1631     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2)
1632     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132)
1633     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_nrestab, 4)
1634     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2)
1635     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136)
1636     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_cbnrestab, 4)
1637     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2)
1638     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140)
1639     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_nressum, 4)
1640     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2)
1641     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144)
1642     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_autodata, 4)
1643     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2)
1644     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148)
1645     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_debuginfo, 4)
1646     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2)
1647     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152)
1648     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_debuglen, 4)
1649     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2)
1650     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156)
1651     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_instpreload, 4)
1652     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2)
1653     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160)
1654     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_instdemand, 4)
1655     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2)
1656     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164)
1657     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_heapsize, 4)
1658     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2)
1659     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168)
1660     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_res3, 12)
1661     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1)
1662     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172)
1663     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_winresoff, 4)
1664     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2)
1665     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184)
1666     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_winreslen, 4)
1667     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2)
1668     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188)
1669     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_devid, 2)
1670     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2)
1671     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192)
1672     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ddkver, 2)
1673     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2)
1674     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194)
1675 }
1676 
1677 static void test_pack_IO_COUNTERS(void)
1678 {
1679     /* IO_COUNTERS (pack 8) */
1680     TEST_TYPE_SIZE   (IO_COUNTERS, 48)
1681     TEST_TYPE_ALIGN  (IO_COUNTERS, 8)
1682     TEST_FIELD_SIZE  (IO_COUNTERS, ReadOperationCount, 8)
1683     TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8)
1684     TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0)
1685     TEST_FIELD_SIZE  (IO_COUNTERS, WriteOperationCount, 8)
1686     TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8)
1687     TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8)
1688     TEST_FIELD_SIZE  (IO_COUNTERS, OtherOperationCount, 8)
1689     TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8)
1690     TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16)
1691     TEST_FIELD_SIZE  (IO_COUNTERS, ReadTransferCount, 8)
1692     TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8)
1693     TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24)
1694     TEST_FIELD_SIZE  (IO_COUNTERS, WriteTransferCount, 8)
1695     TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8)
1696     TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32)
1697     TEST_FIELD_SIZE  (IO_COUNTERS, OtherTransferCount, 8)
1698     TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8)
1699     TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40)
1700 }
1701 
1702 static void test_pack_LANGID(void)
1703 {
1704     /* LANGID */
1705     TEST_TYPE_SIZE   (LANGID, 2)
1706     TEST_TYPE_ALIGN  (LANGID, 2)
1707     TEST_TYPE_UNSIGNED(LANGID)
1708 }
1709 
1710 static void test_pack_LARGE_INTEGER(void)
1711 {
1712     /* LARGE_INTEGER */
1713 }
1714 
1715 static void test_pack_LCID(void)
1716 {
1717     /* LCID */
1718     TEST_TYPE_SIZE   (LCID, 4)
1719     TEST_TYPE_ALIGN  (LCID, 4)
1720     TEST_TYPE_UNSIGNED(LCID)
1721 }
1722 
1723 static void test_pack_LIST_ENTRY(void)
1724 {
1725     /* LIST_ENTRY */
1726     TEST_TYPE_SIZE   (LIST_ENTRY, 16)
1727     TEST_TYPE_ALIGN  (LIST_ENTRY, 8)
1728     TEST_FIELD_SIZE  (LIST_ENTRY, Flink, 8)
1729     TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 8)
1730     TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0)
1731     TEST_FIELD_SIZE  (LIST_ENTRY, Blink, 8)
1732     TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 8)
1733     TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 8)
1734 }
1735 
1736 static void test_pack_LONG(void)
1737 {
1738     /* LONG */
1739     TEST_TYPE_SIZE   (LONG, 4)
1740     TEST_TYPE_ALIGN  (LONG, 4)
1741     TEST_TYPE_SIGNED(LONG)
1742 }
1743 
1744 static void test_pack_LONGLONG(void)
1745 {
1746     /* LONGLONG */
1747     TEST_TYPE_SIZE   (LONGLONG, 8)
1748     TEST_TYPE_ALIGN  (LONGLONG, 8)
1749     TEST_TYPE_SIGNED(LONGLONG)
1750 }
1751 
1752 static void test_pack_LUID(void)
1753 {
1754     /* LUID */
1755     TEST_TYPE_SIZE   (LUID, 8)
1756     TEST_TYPE_ALIGN  (LUID, 4)
1757     TEST_FIELD_SIZE  (LUID, LowPart, 4)
1758     TEST_FIELD_ALIGN (LUID, LowPart, 4)
1759     TEST_FIELD_OFFSET(LUID, LowPart, 0)
1760     TEST_FIELD_SIZE  (LUID, HighPart, 4)
1761     TEST_FIELD_ALIGN (LUID, HighPart, 4)
1762     TEST_FIELD_OFFSET(LUID, HighPart, 4)
1763 }
1764 
1765 static void test_pack_LUID_AND_ATTRIBUTES(void)
1766 {
1767     /* LUID_AND_ATTRIBUTES (pack 4) */
1768     TEST_TYPE_SIZE   (LUID_AND_ATTRIBUTES, 12)
1769     TEST_TYPE_ALIGN  (LUID_AND_ATTRIBUTES, 4)
1770     TEST_FIELD_SIZE  (LUID_AND_ATTRIBUTES, Luid, 8)
1771     TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Luid, 4)
1772     TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Luid, 0)
1773     TEST_FIELD_SIZE  (LUID_AND_ATTRIBUTES, Attributes, 4)
1774     TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Attributes, 4)
1775     TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Attributes, 8)
1776 }
1777 
1778 static void test_pack_MEMORY_BASIC_INFORMATION(void)
1779 {
1780     /* MEMORY_BASIC_INFORMATION */
1781     TEST_TYPE_SIZE   (MEMORY_BASIC_INFORMATION, 48)
1782     TEST_TYPE_ALIGN  (MEMORY_BASIC_INFORMATION, 8)
1783     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, BaseAddress, 8)
1784     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, BaseAddress, 8)
1785     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, BaseAddress, 0)
1786     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1787     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1788     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1789     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1790     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1791     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 16)
1792     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, RegionSize, 8)
1793     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, RegionSize, 8)
1794     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, RegionSize, 24)
1795     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, State, 4)
1796     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, State, 4)
1797     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, State, 32)
1798     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, Protect, 4)
1799     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Protect, 4)
1800     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Protect, 36)
1801     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, Type, 4)
1802     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Type, 4)
1803     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Type, 40)
1804 }
1805 
1806 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
1807 {
1808     /* MESSAGE_RESOURCE_BLOCK */
1809     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_BLOCK, 12)
1810     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_BLOCK, 4)
1811     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, LowId, 4)
1812     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, LowId, 4)
1813     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, LowId, 0)
1814     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, HighId, 4)
1815     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, HighId, 4)
1816     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, HighId, 4)
1817     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1818     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1819     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8)
1820 }
1821 
1822 static void test_pack_MESSAGE_RESOURCE_DATA(void)
1823 {
1824     /* MESSAGE_RESOURCE_DATA */
1825     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_DATA, 16)
1826     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_DATA, 4)
1827     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1828     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1829     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0)
1830     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_DATA, Blocks, 12)
1831     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, Blocks, 4)
1832     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, Blocks, 4)
1833 }
1834 
1835 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
1836 {
1837     /* MESSAGE_RESOURCE_ENTRY */
1838     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_ENTRY, 6)
1839     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_ENTRY, 2)
1840     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Length, 2)
1841     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Length, 2)
1842     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Length, 0)
1843     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Flags, 2)
1844     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Flags, 2)
1845     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Flags, 2)
1846     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Text, 1)
1847     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Text, 1)
1848     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Text, 4)
1849 }
1850 
1851 static void test_pack_NT_TIB(void)
1852 {
1853     /* NT_TIB */
1854     TEST_FIELD_SIZE  (NT_TIB, ExceptionList, 8)
1855     TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 8)
1856     TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0)
1857     TEST_FIELD_SIZE  (NT_TIB, StackBase, 8)
1858     TEST_FIELD_ALIGN (NT_TIB, StackBase, 8)
1859     TEST_FIELD_OFFSET(NT_TIB, StackBase, 8)
1860     TEST_FIELD_SIZE  (NT_TIB, StackLimit, 8)
1861     TEST_FIELD_ALIGN (NT_TIB, StackLimit, 8)
1862     TEST_FIELD_OFFSET(NT_TIB, StackLimit, 16)
1863     TEST_FIELD_SIZE  (NT_TIB, SubSystemTib, 8)
1864     TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 8)
1865     TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 24)
1866 }
1867 
1868 static void test_pack_OBJECT_TYPE_LIST(void)
1869 {
1870     /* OBJECT_TYPE_LIST */
1871     TEST_TYPE_SIZE   (OBJECT_TYPE_LIST, 16)
1872     TEST_TYPE_ALIGN  (OBJECT_TYPE_LIST, 8)
1873     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, Level, 2)
1874     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Level, 2)
1875     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Level, 0)
1876     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, Sbz, 2)
1877     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Sbz, 2)
1878     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Sbz, 2)
1879     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, ObjectType, 8)
1880     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, ObjectType, 8)
1881     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, ObjectType, 8)
1882 }
1883 
1884 static void test_pack_PACCESS_ALLOWED_ACE(void)
1885 {
1886     /* PACCESS_ALLOWED_ACE */
1887     TEST_TYPE_SIZE   (PACCESS_ALLOWED_ACE, 8)
1888     TEST_TYPE_ALIGN  (PACCESS_ALLOWED_ACE, 8)
1889     TEST_TARGET_SIZE (PACCESS_ALLOWED_ACE, 12)
1890     TEST_TARGET_ALIGN(PACCESS_ALLOWED_ACE, 4)
1891 }
1892 
1893 static void test_pack_PACCESS_DENIED_ACE(void)
1894 {
1895     /* PACCESS_DENIED_ACE */
1896     TEST_TYPE_SIZE   (PACCESS_DENIED_ACE, 8)
1897     TEST_TYPE_ALIGN  (PACCESS_DENIED_ACE, 8)
1898     TEST_TARGET_SIZE (PACCESS_DENIED_ACE, 12)
1899     TEST_TARGET_ALIGN(PACCESS_DENIED_ACE, 4)
1900 }
1901 
1902 static void test_pack_PACCESS_TOKEN(void)
1903 {
1904     /* PACCESS_TOKEN */
1905     TEST_TYPE_SIZE   (PACCESS_TOKEN, 8)
1906     TEST_TYPE_ALIGN  (PACCESS_TOKEN, 8)
1907 }
1908 
1909 static void test_pack_PACE_HEADER(void)
1910 {
1911     /* PACE_HEADER */
1912     TEST_TYPE_SIZE   (PACE_HEADER, 8)
1913     TEST_TYPE_ALIGN  (PACE_HEADER, 8)
1914     TEST_TARGET_SIZE (PACE_HEADER, 4)
1915     TEST_TARGET_ALIGN(PACE_HEADER, 2)
1916 }
1917 
1918 static void test_pack_PACL(void)
1919 {
1920     /* PACL */
1921     TEST_TYPE_SIZE   (PACL, 8)
1922     TEST_TYPE_ALIGN  (PACL, 8)
1923     TEST_TARGET_SIZE (PACL, 8)
1924     TEST_TARGET_ALIGN(PACL, 2)
1925 }
1926 
1927 static void test_pack_PACL_REVISION_INFORMATION(void)
1928 {
1929     /* PACL_REVISION_INFORMATION */
1930     TEST_TYPE_SIZE   (PACL_REVISION_INFORMATION, 8)
1931     TEST_TYPE_ALIGN  (PACL_REVISION_INFORMATION, 8)
1932     TEST_TARGET_SIZE (PACL_REVISION_INFORMATION, 4)
1933     TEST_TARGET_ALIGN(PACL_REVISION_INFORMATION, 4)
1934 }
1935 
1936 static void test_pack_PACL_SIZE_INFORMATION(void)
1937 {
1938     /* PACL_SIZE_INFORMATION */
1939     TEST_TYPE_SIZE   (PACL_SIZE_INFORMATION, 8)
1940     TEST_TYPE_ALIGN  (PACL_SIZE_INFORMATION, 8)
1941     TEST_TARGET_SIZE (PACL_SIZE_INFORMATION, 12)
1942     TEST_TARGET_ALIGN(PACL_SIZE_INFORMATION, 4)
1943 }
1944 
1945 static void test_pack_PCCH(void)
1946 {
1947     /* PCCH */
1948     TEST_TYPE_SIZE   (PCCH, 8)
1949     TEST_TYPE_ALIGN  (PCCH, 8)
1950     TEST_TARGET_SIZE (PCCH, 1)
1951     TEST_TARGET_ALIGN(PCCH, 1)
1952 }
1953 
1954 static void test_pack_PCH(void)
1955 {
1956     /* PCH */
1957     TEST_TYPE_SIZE   (PCH, 8)
1958     TEST_TYPE_ALIGN  (PCH, 8)
1959     TEST_TARGET_SIZE (PCH, 1)
1960     TEST_TARGET_ALIGN(PCH, 1)
1961 }
1962 
1963 static void test_pack_PCSTR(void)
1964 {
1965     /* PCSTR */
1966     TEST_TYPE_SIZE   (PCSTR, 8)
1967     TEST_TYPE_ALIGN  (PCSTR, 8)
1968     TEST_TARGET_SIZE (PCSTR, 1)
1969     TEST_TARGET_ALIGN(PCSTR, 1)
1970 }
1971 
1972 static void test_pack_PCWCH(void)
1973 {
1974     /* PCWCH */
1975     TEST_TYPE_SIZE   (PCWCH, 8)
1976     TEST_TYPE_ALIGN  (PCWCH, 8)
1977     TEST_TARGET_SIZE (PCWCH, 2)
1978     TEST_TARGET_ALIGN(PCWCH, 2)
1979 }
1980 
1981 static void test_pack_PCWSTR(void)
1982 {
1983     /* PCWSTR */
1984     TEST_TYPE_SIZE   (PCWSTR, 8)
1985     TEST_TYPE_ALIGN  (PCWSTR, 8)
1986     TEST_TARGET_SIZE (PCWSTR, 2)
1987     TEST_TARGET_ALIGN(PCWSTR, 2)
1988 }
1989 
1990 static void test_pack_PEXCEPTION_POINTERS(void)
1991 {
1992     /* PEXCEPTION_POINTERS */
1993     TEST_TYPE_SIZE   (PEXCEPTION_POINTERS, 8)
1994     TEST_TYPE_ALIGN  (PEXCEPTION_POINTERS, 8)
1995     TEST_TARGET_SIZE (PEXCEPTION_POINTERS, 16)
1996     TEST_TARGET_ALIGN(PEXCEPTION_POINTERS, 8)
1997 }
1998 
1999 static void test_pack_PEXCEPTION_RECORD(void)
2000 {
2001     /* PEXCEPTION_RECORD */
2002     TEST_TYPE_SIZE   (PEXCEPTION_RECORD, 8)
2003     TEST_TYPE_ALIGN  (PEXCEPTION_RECORD, 8)
2004     TEST_TARGET_SIZE (PEXCEPTION_RECORD, 152)
2005     TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 8)
2006 }
2007 
2008 static void test_pack_PFPO_DATA(void)
2009 {
2010     /* PFPO_DATA */
2011     TEST_TYPE_SIZE   (PFPO_DATA, 8)
2012     TEST_TYPE_ALIGN  (PFPO_DATA, 8)
2013     TEST_TARGET_SIZE (PFPO_DATA, 16)
2014     TEST_TARGET_ALIGN(PFPO_DATA, 4)
2015 }
2016 
2017 static void test_pack_PGENERIC_MAPPING(void)
2018 {
2019     /* PGENERIC_MAPPING */
2020     TEST_TYPE_SIZE   (PGENERIC_MAPPING, 8)
2021     TEST_TYPE_ALIGN  (PGENERIC_MAPPING, 8)
2022     TEST_TARGET_SIZE (PGENERIC_MAPPING, 16)
2023     TEST_TARGET_ALIGN(PGENERIC_MAPPING, 4)
2024 }
2025 
2026 static void test_pack_PHANDLE(void)
2027 {
2028     /* PHANDLE */
2029     TEST_TYPE_SIZE   (PHANDLE, 8)
2030     TEST_TYPE_ALIGN  (PHANDLE, 8)
2031     TEST_TARGET_SIZE (PHANDLE, 8)
2032     TEST_TARGET_ALIGN(PHANDLE, 8)
2033 }
2034 
2035 static void test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER(void)
2036 {
2037     /* PIMAGE_ARCHIVE_MEMBER_HEADER */
2038     TEST_TYPE_SIZE   (PIMAGE_ARCHIVE_MEMBER_HEADER, 8)
2039     TEST_TYPE_ALIGN  (PIMAGE_ARCHIVE_MEMBER_HEADER, 8)
2040     TEST_TARGET_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 60)
2041     TEST_TARGET_ALIGN(PIMAGE_ARCHIVE_MEMBER_HEADER, 1)
2042 }
2043 
2044 static void test_pack_PIMAGE_AUX_SYMBOL(void)
2045 {
2046     /* PIMAGE_AUX_SYMBOL */
2047     TEST_TYPE_SIZE   (PIMAGE_AUX_SYMBOL, 8)
2048     TEST_TYPE_ALIGN  (PIMAGE_AUX_SYMBOL, 8)
2049 }
2050 
2051 static void test_pack_PIMAGE_BASE_RELOCATION(void)
2052 {
2053     /* PIMAGE_BASE_RELOCATION */
2054     TEST_TYPE_SIZE   (PIMAGE_BASE_RELOCATION, 8)
2055     TEST_TYPE_ALIGN  (PIMAGE_BASE_RELOCATION, 8)
2056     TEST_TARGET_SIZE (PIMAGE_BASE_RELOCATION, 8)
2057     TEST_TARGET_ALIGN(PIMAGE_BASE_RELOCATION, 4)
2058 }
2059 
2060 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
2061 {
2062     /* PIMAGE_BOUND_FORWARDER_REF */
2063     TEST_TYPE_SIZE   (PIMAGE_BOUND_FORWARDER_REF, 8)
2064     TEST_TYPE_ALIGN  (PIMAGE_BOUND_FORWARDER_REF, 8)
2065     TEST_TARGET_SIZE (PIMAGE_BOUND_FORWARDER_REF, 8)
2066     TEST_TARGET_ALIGN(PIMAGE_BOUND_FORWARDER_REF, 4)
2067 }
2068 
2069 static void test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR(void)
2070 {
2071     /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
2072     TEST_TYPE_SIZE   (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2073     TEST_TYPE_ALIGN  (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2074     TEST_TARGET_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2075     TEST_TARGET_ALIGN(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
2076 }
2077 
2078 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
2079 {
2080     /* PIMAGE_COFF_SYMBOLS_HEADER */
2081     TEST_TYPE_SIZE   (PIMAGE_COFF_SYMBOLS_HEADER, 8)
2082     TEST_TYPE_ALIGN  (PIMAGE_COFF_SYMBOLS_HEADER, 8)
2083     TEST_TARGET_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 32)
2084     TEST_TARGET_ALIGN(PIMAGE_COFF_SYMBOLS_HEADER, 4)
2085 }
2086 
2087 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
2088 {
2089     /* PIMAGE_DATA_DIRECTORY */
2090     TEST_TYPE_SIZE   (PIMAGE_DATA_DIRECTORY, 8)
2091     TEST_TYPE_ALIGN  (PIMAGE_DATA_DIRECTORY, 8)
2092     TEST_TARGET_SIZE (PIMAGE_DATA_DIRECTORY, 8)
2093     TEST_TARGET_ALIGN(PIMAGE_DATA_DIRECTORY, 4)
2094 }
2095 
2096 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
2097 {
2098     /* PIMAGE_DEBUG_DIRECTORY */
2099     TEST_TYPE_SIZE   (PIMAGE_DEBUG_DIRECTORY, 8)
2100     TEST_TYPE_ALIGN  (PIMAGE_DEBUG_DIRECTORY, 8)
2101     TEST_TARGET_SIZE (PIMAGE_DEBUG_DIRECTORY, 28)
2102     TEST_TARGET_ALIGN(PIMAGE_DEBUG_DIRECTORY, 4)
2103 }
2104 
2105 static void test_pack_PIMAGE_DEBUG_MISC(void)
2106 {
2107     /* PIMAGE_DEBUG_MISC */
2108     TEST_TYPE_SIZE   (PIMAGE_DEBUG_MISC, 8)
2109     TEST_TYPE_ALIGN  (PIMAGE_DEBUG_MISC, 8)
2110     TEST_TARGET_SIZE (PIMAGE_DEBUG_MISC, 16)
2111     TEST_TARGET_ALIGN(PIMAGE_DEBUG_MISC, 4)
2112 }
2113 
2114 static void test_pack_PIMAGE_DOS_HEADER(void)
2115 {
2116     /* PIMAGE_DOS_HEADER */
2117     TEST_TYPE_SIZE   (PIMAGE_DOS_HEADER, 8)
2118     TEST_TYPE_ALIGN  (PIMAGE_DOS_HEADER, 8)
2119     TEST_TARGET_SIZE (PIMAGE_DOS_HEADER, 64)
2120     TEST_TARGET_ALIGN(PIMAGE_DOS_HEADER, 2)
2121 }
2122 
2123 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
2124 {
2125     /* PIMAGE_EXPORT_DIRECTORY */
2126     TEST_TYPE_SIZE   (PIMAGE_EXPORT_DIRECTORY, 8)
2127     TEST_TYPE_ALIGN  (PIMAGE_EXPORT_DIRECTORY, 8)
2128     TEST_TARGET_SIZE (PIMAGE_EXPORT_DIRECTORY, 40)
2129     TEST_TARGET_ALIGN(PIMAGE_EXPORT_DIRECTORY, 4)
2130 }
2131 
2132 static void test_pack_PIMAGE_FILE_HEADER(void)
2133 {
2134     /* PIMAGE_FILE_HEADER */
2135     TEST_TYPE_SIZE   (PIMAGE_FILE_HEADER, 8)
2136     TEST_TYPE_ALIGN  (PIMAGE_FILE_HEADER, 8)
2137     TEST_TARGET_SIZE (PIMAGE_FILE_HEADER, 20)
2138     TEST_TARGET_ALIGN(PIMAGE_FILE_HEADER, 4)
2139 }
2140 
2141 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
2142 {
2143     /* PIMAGE_FUNCTION_ENTRY */
2144     TEST_TYPE_SIZE   (PIMAGE_FUNCTION_ENTRY, 8)
2145     TEST_TYPE_ALIGN  (PIMAGE_FUNCTION_ENTRY, 8)
2146     TEST_TARGET_SIZE (PIMAGE_FUNCTION_ENTRY, 12)
2147     TEST_TARGET_ALIGN(PIMAGE_FUNCTION_ENTRY, 4)
2148 }
2149 
2150 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
2151 {
2152     /* PIMAGE_IMPORT_BY_NAME */
2153     TEST_TYPE_SIZE   (PIMAGE_IMPORT_BY_NAME, 8)
2154     TEST_TYPE_ALIGN  (PIMAGE_IMPORT_BY_NAME, 8)
2155     TEST_TARGET_SIZE (PIMAGE_IMPORT_BY_NAME, 4)
2156     TEST_TARGET_ALIGN(PIMAGE_IMPORT_BY_NAME, 2)
2157 }
2158 
2159 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
2160 {
2161     /* PIMAGE_IMPORT_DESCRIPTOR */
2162     TEST_TYPE_SIZE   (PIMAGE_IMPORT_DESCRIPTOR, 8)
2163     TEST_TYPE_ALIGN  (PIMAGE_IMPORT_DESCRIPTOR, 8)
2164 }
2165 
2166 static void test_pack_PIMAGE_LINENUMBER(void)
2167 {
2168     /* PIMAGE_LINENUMBER */
2169     TEST_TYPE_SIZE   (PIMAGE_LINENUMBER, 8)
2170     TEST_TYPE_ALIGN  (PIMAGE_LINENUMBER, 8)
2171 }
2172 
2173 static void test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY(void)
2174 {
2175     /* PIMAGE_LOAD_CONFIG_DIRECTORY */
2176     TEST_TYPE_SIZE   (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
2177     TEST_TYPE_ALIGN  (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
2178 }
2179 
2180 static void test_pack_PIMAGE_NT_HEADERS(void)
2181 {
2182     /* PIMAGE_NT_HEADERS */
2183     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS, 8)
2184     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS, 8)
2185 }
2186 
2187 static void test_pack_PIMAGE_NT_HEADERS32(void)
2188 {
2189     /* PIMAGE_NT_HEADERS32 */
2190     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS32, 8)
2191     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS32, 8)
2192     TEST_TARGET_SIZE (PIMAGE_NT_HEADERS32, 248)
2193     TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS32, 4)
2194 }
2195 
2196 static void test_pack_PIMAGE_NT_HEADERS64(void)
2197 {
2198     /* PIMAGE_NT_HEADERS64 */
2199     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS64, 8)
2200     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS64, 8)
2201     TEST_TARGET_SIZE (PIMAGE_NT_HEADERS64, 264)
2202     TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS64, 8)
2203 }
2204 
2205 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
2206 {
2207     /* PIMAGE_OPTIONAL_HEADER */
2208     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER, 8)
2209     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER, 8)
2210 }
2211 
2212 static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
2213 {
2214     /* PIMAGE_OPTIONAL_HEADER32 */
2215     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER32, 8)
2216     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER32, 8)
2217     TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER32, 224)
2218     TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER32, 4)
2219 }
2220 
2221 static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
2222 {
2223     /* PIMAGE_OPTIONAL_HEADER64 */
2224     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER64, 8)
2225     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER64, 8)
2226     TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER64, 240)
2227     TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER64, 8)
2228 }
2229 
2230 static void test_pack_PIMAGE_OS2_HEADER(void)
2231 {
2232     /* PIMAGE_OS2_HEADER */
2233     TEST_TYPE_SIZE   (PIMAGE_OS2_HEADER, 8)
2234     TEST_TYPE_ALIGN  (PIMAGE_OS2_HEADER, 8)
2235     TEST_TARGET_SIZE (PIMAGE_OS2_HEADER, 64)
2236     TEST_TARGET_ALIGN(PIMAGE_OS2_HEADER, 2)
2237 }
2238 
2239 static void test_pack_PIMAGE_RELOCATION(void)
2240 {
2241     /* PIMAGE_RELOCATION */
2242     TEST_TYPE_SIZE   (PIMAGE_RELOCATION, 8)
2243     TEST_TYPE_ALIGN  (PIMAGE_RELOCATION, 8)
2244 }
2245 
2246 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
2247 {
2248     /* PIMAGE_RESOURCE_DATA_ENTRY */
2249     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DATA_ENTRY, 8)
2250     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DATA_ENTRY, 8)
2251     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 16)
2252     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DATA_ENTRY, 4)
2253 }
2254 
2255 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
2256 {
2257     /* PIMAGE_RESOURCE_DIRECTORY */
2258     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY, 8)
2259     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY, 8)
2260     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY, 16)
2261     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY, 4)
2262 }
2263 
2264 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY(void)
2265 {
2266     /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
2267     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 8)
2268     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 8)
2269 }
2270 
2271 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING(void)
2272 {
2273     /* PIMAGE_RESOURCE_DIRECTORY_STRING */
2274     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY_STRING, 8)
2275     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY_STRING, 8)
2276     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 4)
2277     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY_STRING, 2)
2278 }
2279 
2280 static void test_pack_PIMAGE_RESOURCE_DIR_STRING_U(void)
2281 {
2282     /* PIMAGE_RESOURCE_DIR_STRING_U */
2283     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIR_STRING_U, 8)
2284     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIR_STRING_U, 8)
2285     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 4)
2286     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIR_STRING_U, 2)
2287 }
2288 
2289 static void test_pack_PIMAGE_SECTION_HEADER(void)
2290 {
2291     /* PIMAGE_SECTION_HEADER */
2292     TEST_TYPE_SIZE   (PIMAGE_SECTION_HEADER, 8)
2293     TEST_TYPE_ALIGN  (PIMAGE_SECTION_HEADER, 8)
2294 }
2295 
2296 static void test_pack_PIMAGE_SEPARATE_DEBUG_HEADER(void)
2297 {
2298     /* PIMAGE_SEPARATE_DEBUG_HEADER */
2299     TEST_TYPE_SIZE   (PIMAGE_SEPARATE_DEBUG_HEADER, 8)
2300     TEST_TYPE_ALIGN  (PIMAGE_SEPARATE_DEBUG_HEADER, 8)
2301     TEST_TARGET_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 48)
2302     TEST_TARGET_ALIGN(PIMAGE_SEPARATE_DEBUG_HEADER, 4)
2303 }
2304 
2305 static void test_pack_PIMAGE_SYMBOL(void)
2306 {
2307     /* PIMAGE_SYMBOL */
2308     TEST_TYPE_SIZE   (PIMAGE_SYMBOL, 8)
2309     TEST_TYPE_ALIGN  (PIMAGE_SYMBOL, 8)
2310 }
2311 
2312 static void test_pack_PIMAGE_THUNK_DATA(void)
2313 {
2314     /* PIMAGE_THUNK_DATA */
2315     TEST_TYPE_SIZE   (PIMAGE_THUNK_DATA, 8)
2316     TEST_TYPE_ALIGN  (PIMAGE_THUNK_DATA, 8)
2317 }
2318 
2319 static void test_pack_PIMAGE_TLS_CALLBACK(void)
2320 {
2321     /* PIMAGE_TLS_CALLBACK */
2322     TEST_TYPE_SIZE   (PIMAGE_TLS_CALLBACK, 8)
2323     TEST_TYPE_ALIGN  (PIMAGE_TLS_CALLBACK, 8)
2324 }
2325 
2326 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
2327 {
2328     /* PIMAGE_TLS_DIRECTORY */
2329     TEST_TYPE_SIZE   (PIMAGE_TLS_DIRECTORY, 8)
2330     TEST_TYPE_ALIGN  (PIMAGE_TLS_DIRECTORY, 8)
2331 }
2332 
2333 static void test_pack_PIMAGE_VXD_HEADER(void)
2334 {
2335     /* PIMAGE_VXD_HEADER */
2336     TEST_TYPE_SIZE   (PIMAGE_VXD_HEADER, 8)
2337     TEST_TYPE_ALIGN  (PIMAGE_VXD_HEADER, 8)
2338     TEST_TARGET_SIZE (PIMAGE_VXD_HEADER, 196)
2339     TEST_TARGET_ALIGN(PIMAGE_VXD_HEADER, 2)
2340 }
2341 
2342 static void test_pack_PIO_COUNTERS(void)
2343 {
2344     /* PIO_COUNTERS */
2345     TEST_TYPE_SIZE   (PIO_COUNTERS, 8)
2346     TEST_TYPE_ALIGN  (PIO_COUNTERS, 8)
2347     TEST_TARGET_SIZE (PIO_COUNTERS, 48)
2348     TEST_TARGET_ALIGN(PIO_COUNTERS, 8)
2349 }
2350 
2351 static void test_pack_PISECURITY_DESCRIPTOR(void)
2352 {
2353     /* PISECURITY_DESCRIPTOR */
2354     TEST_TYPE_SIZE   (PISECURITY_DESCRIPTOR, 8)
2355     TEST_TYPE_ALIGN  (PISECURITY_DESCRIPTOR, 8)
2356     TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR, 40)
2357     TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR, 8)
2358 }
2359 
2360 static void test_pack_PISECURITY_DESCRIPTOR_RELATIVE(void)
2361 {
2362     /* PISECURITY_DESCRIPTOR_RELATIVE */
2363     TEST_TYPE_SIZE   (PISECURITY_DESCRIPTOR_RELATIVE, 8)
2364     TEST_TYPE_ALIGN  (PISECURITY_DESCRIPTOR_RELATIVE, 8)
2365     TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 20)
2366     TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR_RELATIVE, 4)
2367 }
2368 
2369 static void test_pack_PISID(void)
2370 {
2371     /* PISID */
2372     TEST_TYPE_SIZE   (PISID, 8)
2373     TEST_TYPE_ALIGN  (PISID, 8)
2374     TEST_TARGET_SIZE (PISID, 12)
2375     TEST_TARGET_ALIGN(PISID, 4)
2376 }
2377 
2378 static void test_pack_PLARGE_INTEGER(void)
2379 {
2380     /* PLARGE_INTEGER */
2381     TEST_TYPE_SIZE   (PLARGE_INTEGER, 8)
2382     TEST_TYPE_ALIGN  (PLARGE_INTEGER, 8)
2383 }
2384 
2385 static void test_pack_PLIST_ENTRY(void)
2386 {
2387     /* PLIST_ENTRY */
2388     TEST_TYPE_SIZE   (PLIST_ENTRY, 8)
2389     TEST_TYPE_ALIGN  (PLIST_ENTRY, 8)
2390     TEST_TARGET_SIZE (PLIST_ENTRY, 16)
2391     TEST_TARGET_ALIGN(PLIST_ENTRY, 8)
2392 }
2393 
2394 static void test_pack_PLUID(void)
2395 {
2396     /* PLUID */
2397     TEST_TYPE_SIZE   (PLUID, 8)
2398     TEST_TYPE_ALIGN  (PLUID, 8)
2399     TEST_TARGET_SIZE (PLUID, 8)
2400     TEST_TARGET_ALIGN(PLUID, 4)
2401 }
2402 
2403 static void test_pack_PLUID_AND_ATTRIBUTES(void)
2404 {
2405     /* PLUID_AND_ATTRIBUTES */
2406     TEST_TYPE_SIZE   (PLUID_AND_ATTRIBUTES, 8)
2407     TEST_TYPE_ALIGN  (PLUID_AND_ATTRIBUTES, 8)
2408     TEST_TARGET_SIZE (PLUID_AND_ATTRIBUTES, 12)
2409     TEST_TARGET_ALIGN(PLUID_AND_ATTRIBUTES, 4)
2410 }
2411 
2412 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
2413 {
2414     /* PMEMORY_BASIC_INFORMATION */
2415     TEST_TYPE_SIZE   (PMEMORY_BASIC_INFORMATION, 8)
2416     TEST_TYPE_ALIGN  (PMEMORY_BASIC_INFORMATION, 8)
2417     TEST_TARGET_SIZE (PMEMORY_BASIC_INFORMATION, 48)
2418     TEST_TARGET_ALIGN(PMEMORY_BASIC_INFORMATION, 8)
2419 }
2420 
2421 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
2422 {
2423     /* PMESSAGE_RESOURCE_BLOCK */
2424     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_BLOCK, 8)
2425     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_BLOCK, 8)
2426     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_BLOCK, 12)
2427     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_BLOCK, 4)
2428 }
2429 
2430 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
2431 {
2432     /* PMESSAGE_RESOURCE_DATA */
2433     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_DATA, 8)
2434     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_DATA, 8)
2435     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_DATA, 16)
2436     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_DATA, 4)
2437 }
2438 
2439 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
2440 {
2441     /* PMESSAGE_RESOURCE_ENTRY */
2442     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_ENTRY, 8)
2443     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_ENTRY, 8)
2444     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_ENTRY, 6)
2445     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_ENTRY, 2)
2446 }
2447 
2448 static void test_pack_PNT_TIB(void)
2449 {
2450     /* PNT_TIB */
2451     TEST_TYPE_SIZE   (PNT_TIB, 8)
2452     TEST_TYPE_ALIGN  (PNT_TIB, 8)
2453 }
2454 
2455 static void test_pack_POBJECT_TYPE_LIST(void)
2456 {
2457     /* POBJECT_TYPE_LIST */
2458     TEST_TYPE_SIZE   (POBJECT_TYPE_LIST, 8)
2459     TEST_TYPE_ALIGN  (POBJECT_TYPE_LIST, 8)
2460     TEST_TARGET_SIZE (POBJECT_TYPE_LIST, 16)
2461     TEST_TARGET_ALIGN(POBJECT_TYPE_LIST, 8)
2462 }
2463 
2464 static void test_pack_PPRIVILEGE_SET(void)
2465 {
2466     /* PPRIVILEGE_SET */
2467     TEST_TYPE_SIZE   (PPRIVILEGE_SET, 8)
2468     TEST_TYPE_ALIGN  (PPRIVILEGE_SET, 8)
2469     TEST_TARGET_SIZE (PPRIVILEGE_SET, 20)
2470     TEST_TARGET_ALIGN(PPRIVILEGE_SET, 4)
2471 }
2472 
2473 static void test_pack_PRIVILEGE_SET(void)
2474 {
2475     /* PRIVILEGE_SET */
2476     TEST_TYPE_SIZE   (PRIVILEGE_SET, 20)
2477     TEST_TYPE_ALIGN  (PRIVILEGE_SET, 4)
2478     TEST_FIELD_SIZE  (PRIVILEGE_SET, PrivilegeCount, 4)
2479     TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
2480     TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
2481     TEST_FIELD_SIZE  (PRIVILEGE_SET, Control, 4)
2482     TEST_FIELD_ALIGN (PRIVILEGE_SET, Control, 4)
2483     TEST_FIELD_OFFSET(PRIVILEGE_SET, Control, 4)
2484     TEST_FIELD_SIZE  (PRIVILEGE_SET, Privilege, 12)
2485     TEST_FIELD_ALIGN (PRIVILEGE_SET, Privilege, 4)
2486     TEST_FIELD_OFFSET(PRIVILEGE_SET, Privilege, 8)
2487 }
2488 
2489 static void test_pack_PRLIST_ENTRY(void)
2490 {
2491     /* PRLIST_ENTRY */
2492     TEST_TYPE_SIZE   (PRLIST_ENTRY, 8)
2493     TEST_TYPE_ALIGN  (PRLIST_ENTRY, 8)
2494     TEST_TARGET_SIZE (PRLIST_ENTRY, 16)
2495     TEST_TARGET_ALIGN(PRLIST_ENTRY, 8)
2496 }
2497 
2498 static void test_pack_PRTL_CRITICAL_SECTION(void)
2499 {
2500     /* PRTL_CRITICAL_SECTION */
2501     TEST_TYPE_SIZE   (PRTL_CRITICAL_SECTION, 8)
2502     TEST_TYPE_ALIGN  (PRTL_CRITICAL_SECTION, 8)
2503     TEST_TARGET_SIZE (PRTL_CRITICAL_SECTION, 40)
2504     TEST_TARGET_ALIGN(PRTL_CRITICAL_SECTION, 8)
2505 }
2506 
2507 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
2508 {
2509     /* PRTL_CRITICAL_SECTION_DEBUG */
2510     TEST_TYPE_SIZE   (PRTL_CRITICAL_SECTION_DEBUG, 8)
2511     TEST_TYPE_ALIGN  (PRTL_CRITICAL_SECTION_DEBUG, 8)
2512 }
2513 
2514 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
2515 {
2516     /* PRTL_OSVERSIONINFOEXW */
2517     TEST_TYPE_SIZE   (PRTL_OSVERSIONINFOEXW, 8)
2518     TEST_TYPE_ALIGN  (PRTL_OSVERSIONINFOEXW, 8)
2519     TEST_TARGET_SIZE (PRTL_OSVERSIONINFOEXW, 284)
2520     TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOEXW, 4)
2521 }
2522 
2523 static void test_pack_PRTL_OSVERSIONINFOW(void)
2524 {
2525     /* PRTL_OSVERSIONINFOW */
2526     TEST_TYPE_SIZE   (PRTL_OSVERSIONINFOW, 8)
2527     TEST_TYPE_ALIGN  (PRTL_OSVERSIONINFOW, 8)
2528     TEST_TARGET_SIZE (PRTL_OSVERSIONINFOW, 276)
2529     TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOW, 4)
2530 }
2531 
2532 static void test_pack_PRTL_RESOURCE_DEBUG(void)
2533 {
2534     /* PRTL_RESOURCE_DEBUG */
2535     TEST_TYPE_SIZE   (PRTL_RESOURCE_DEBUG, 8)
2536     TEST_TYPE_ALIGN  (PRTL_RESOURCE_DEBUG, 8)
2537 }
2538 
2539 static void test_pack_PSECURITY_DESCRIPTOR(void)
2540 {
2541     /* PSECURITY_DESCRIPTOR */
2542     TEST_TYPE_SIZE   (PSECURITY_DESCRIPTOR, 8)
2543     TEST_TYPE_ALIGN  (PSECURITY_DESCRIPTOR, 8)
2544 }
2545 
2546 static void test_pack_PSECURITY_QUALITY_OF_SERVICE(void)
2547 {
2548     /* PSECURITY_QUALITY_OF_SERVICE */
2549     TEST_TYPE_SIZE   (PSECURITY_QUALITY_OF_SERVICE, 8)
2550     TEST_TYPE_ALIGN  (PSECURITY_QUALITY_OF_SERVICE, 8)
2551 }
2552 
2553 static void test_pack_PSID(void)
2554 {
2555     /* PSID */
2556     TEST_TYPE_SIZE   (PSID, 8)
2557     TEST_TYPE_ALIGN  (PSID, 8)
2558 }
2559 
2560 static void test_pack_PSID_IDENTIFIER_AUTHORITY(void)
2561 {
2562     /* PSID_IDENTIFIER_AUTHORITY */
2563     TEST_TYPE_SIZE   (PSID_IDENTIFIER_AUTHORITY, 8)
2564     TEST_TYPE_ALIGN  (PSID_IDENTIFIER_AUTHORITY, 8)
2565     TEST_TARGET_SIZE (PSID_IDENTIFIER_AUTHORITY, 6)
2566     TEST_TARGET_ALIGN(PSID_IDENTIFIER_AUTHORITY, 1)
2567 }
2568 
2569 static void test_pack_PSINGLE_LIST_ENTRY(void)
2570 {
2571     /* PSINGLE_LIST_ENTRY */
2572     TEST_TYPE_SIZE   (PSINGLE_LIST_ENTRY, 8)
2573     TEST_TYPE_ALIGN  (PSINGLE_LIST_ENTRY, 8)
2574     TEST_TARGET_SIZE (PSINGLE_LIST_ENTRY, 8)
2575     TEST_TARGET_ALIGN(PSINGLE_LIST_ENTRY, 8)
2576 }
2577 
2578 static void test_pack_PSTR(void)
2579 {
2580     /* PSTR */
2581     TEST_TYPE_SIZE   (PSTR, 8)
2582     TEST_TYPE_ALIGN  (PSTR, 8)
2583     TEST_TARGET_SIZE (PSTR, 1)
2584     TEST_TARGET_ALIGN(PSTR, 1)
2585 }
2586 
2587 static void test_pack_PSYSTEM_ALARM_ACE(void)
2588 {
2589     /* PSYSTEM_ALARM_ACE */
2590     TEST_TYPE_SIZE   (PSYSTEM_ALARM_ACE, 8)
2591     TEST_TYPE_ALIGN  (PSYSTEM_ALARM_ACE, 8)
2592     TEST_TARGET_SIZE (PSYSTEM_ALARM_ACE, 12)
2593     TEST_TARGET_ALIGN(PSYSTEM_ALARM_ACE, 4)
2594 }
2595 
2596 static void test_pack_PSYSTEM_AUDIT_ACE(void)
2597 {
2598     /* PSYSTEM_AUDIT_ACE */
2599     TEST_TYPE_SIZE   (PSYSTEM_AUDIT_ACE, 8)
2600     TEST_TYPE_ALIGN  (PSYSTEM_AUDIT_ACE, 8)
2601     TEST_TARGET_SIZE (PSYSTEM_AUDIT_ACE, 12)
2602     TEST_TARGET_ALIGN(PSYSTEM_AUDIT_ACE, 4)
2603 }
2604 
2605 static void test_pack_PTOKEN_GROUPS(void)
2606 {
2607     /* PTOKEN_GROUPS */
2608     TEST_TYPE_SIZE   (PTOKEN_GROUPS, 8)
2609     TEST_TYPE_ALIGN  (PTOKEN_GROUPS, 8)
2610     TEST_TARGET_SIZE (PTOKEN_GROUPS, 24)
2611     TEST_TARGET_ALIGN(PTOKEN_GROUPS, 8)
2612 }
2613 
2614 static void test_pack_PTOKEN_PRIVILEGES(void)
2615 {
2616     /* PTOKEN_PRIVILEGES */
2617     TEST_TYPE_SIZE   (PTOKEN_PRIVILEGES, 8)
2618     TEST_TYPE_ALIGN  (PTOKEN_PRIVILEGES, 8)
2619     TEST_TARGET_SIZE (PTOKEN_PRIVILEGES, 16)
2620     TEST_TARGET_ALIGN(PTOKEN_PRIVILEGES, 4)
2621 }
2622 
2623 static void test_pack_PTOKEN_USER(void)
2624 {
2625     /* PTOKEN_USER */
2626     TEST_TYPE_SIZE   (PTOKEN_USER, 8)
2627     TEST_TYPE_ALIGN  (PTOKEN_USER, 8)
2628     TEST_TARGET_SIZE (PTOKEN_USER, 16)
2629     TEST_TARGET_ALIGN(PTOKEN_USER, 8)
2630 }
2631 
2632 static void test_pack_PULARGE_INTEGER(void)
2633 {
2634     /* PULARGE_INTEGER */
2635     TEST_TYPE_SIZE   (PULARGE_INTEGER, 8)
2636     TEST_TYPE_ALIGN  (PULARGE_INTEGER, 8)
2637 }
2638 
2639 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
2640 {
2641     /* PVECTORED_EXCEPTION_HANDLER */
2642     TEST_TYPE_SIZE   (PVECTORED_EXCEPTION_HANDLER, 8)
2643     TEST_TYPE_ALIGN  (PVECTORED_EXCEPTION_HANDLER, 8)
2644 }
2645 
2646 static void test_pack_PVOID(void)
2647 {
2648     /* PVOID */
2649     TEST_TYPE_SIZE   (PVOID, 8)
2650     TEST_TYPE_ALIGN  (PVOID, 8)
2651 }
2652 
2653 static void test_pack_PWCH(void)
2654 {
2655     /* PWCH */
2656     TEST_TYPE_SIZE   (PWCH, 8)
2657     TEST_TYPE_ALIGN  (PWCH, 8)
2658     TEST_TARGET_SIZE (PWCH, 2)
2659     TEST_TARGET_ALIGN(PWCH, 2)
2660 }
2661 
2662 static void test_pack_PWSTR(void)
2663 {
2664     /* PWSTR */
2665     TEST_TYPE_SIZE   (PWSTR, 8)
2666     TEST_TYPE_ALIGN  (PWSTR, 8)
2667     TEST_TARGET_SIZE (PWSTR, 2)
2668     TEST_TARGET_ALIGN(PWSTR, 2)
2669 }
2670 
2671 static void test_pack_RTL_CRITICAL_SECTION(void)
2672 {
2673     /* RTL_CRITICAL_SECTION */
2674     TEST_TYPE_SIZE   (RTL_CRITICAL_SECTION, 40)
2675     TEST_TYPE_ALIGN  (RTL_CRITICAL_SECTION, 8)
2676     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, DebugInfo, 8)
2677     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 8)
2678     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, DebugInfo, 0)
2679     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, LockCount, 4)
2680     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockCount, 4)
2681     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockCount, 8)
2682     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, RecursionCount, 4)
2683     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4)
2684     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 12)
2685     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, OwningThread, 8)
2686     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, OwningThread, 8)
2687     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, OwningThread, 16)
2688     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2689     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2690     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 24)
2691     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, SpinCount, 8)
2692     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, SpinCount, 8)
2693     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, SpinCount, 32)
2694 }
2695 
2696 static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void)
2697 {
2698     /* RTL_CRITICAL_SECTION_DEBUG */
2699     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, Type, 2)
2700     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, Type, 2)
2701     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, Type, 0)
2702     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2703     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2704     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2705     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 8)
2706     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 8)
2707     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 8)
2708     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2709     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8)
2710     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2711     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4)
2712     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4)
2713     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, EntryCount, 32)
2714     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2715     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2716     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 36)
2717 }
2718 
2719 static void test_pack_RTL_OSVERSIONINFOEXW(void)
2720 {
2721     /* RTL_OSVERSIONINFOEXW */
2722     TEST_TYPE_SIZE   (RTL_OSVERSIONINFOEXW, 284)
2723     TEST_TYPE_ALIGN  (RTL_OSVERSIONINFOEXW, 4)
2724     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2725     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2726     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 0)
2727     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2728     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2729     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2730     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2731     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2732     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMinorVersion, 8)
2733     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2734     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2735     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwBuildNumber, 12)
2736     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2737     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2738     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwPlatformId, 16)
2739     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, szCSDVersion, 256)
2740     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, szCSDVersion, 2)
2741     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, szCSDVersion, 20)
2742     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2743     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2744     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMajor, 276)
2745     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2746     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2747     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMinor, 278)
2748     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2749     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2750     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wSuiteMask, 280)
2751     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wProductType, 1)
2752     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wProductType, 1)
2753     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wProductType, 282)
2754     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wReserved, 1)
2755     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wReserved, 1)
2756     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wReserved, 283)
2757 }
2758 
2759 static void test_pack_RTL_OSVERSIONINFOW(void)
2760 {
2761     /* RTL_OSVERSIONINFOW */
2762     TEST_TYPE_SIZE   (RTL_OSVERSIONINFOW, 276)
2763     TEST_TYPE_ALIGN  (RTL_OSVERSIONINFOW, 4)
2764     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2765     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2766     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 0)
2767     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2768     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2769     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2770     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2771     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2772     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMinorVersion, 8)
2773     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2774     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2775     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwBuildNumber, 12)
2776     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2777     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2778     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwPlatformId, 16)
2779     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, szCSDVersion, 256)
2780     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, szCSDVersion, 2)
2781     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, szCSDVersion, 20)
2782 }
2783 
2784 static void test_pack_RTL_RESOURCE_DEBUG(void)
2785 {
2786     /* RTL_RESOURCE_DEBUG */
2787     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, Type, 2)
2788     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, Type, 2)
2789     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, Type, 0)
2790     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2791     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2792     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2793     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, CriticalSection, 8)
2794     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CriticalSection, 8)
2795     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CriticalSection, 8)
2796     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2797     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ProcessLocksList, 8)
2798     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2799     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, EntryCount, 4)
2800     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, EntryCount, 4)
2801     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, EntryCount, 32)
2802     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2803     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2804     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ContentionCount, 36)
2805 }
2806 
2807 static void test_pack_SECURITY_CONTEXT_TRACKING_MODE(void)
2808 {
2809     /* SECURITY_CONTEXT_TRACKING_MODE */
2810     TEST_TYPE_SIZE   (SECURITY_CONTEXT_TRACKING_MODE, 1)
2811     TEST_TYPE_ALIGN  (SECURITY_CONTEXT_TRACKING_MODE, 1)
2812 }
2813 
2814 static void test_pack_SECURITY_DESCRIPTOR(void)
2815 {
2816     /* SECURITY_DESCRIPTOR */
2817     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR, 40)
2818     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR, 8)
2819     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Revision, 1)
2820     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Revision, 1)
2821     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Revision, 0)
2822     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Sbz1, 1)
2823     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sbz1, 1)
2824     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sbz1, 1)
2825     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Control, 2)
2826     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Control, 2)
2827     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Control, 2)
2828     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Owner, 8)
2829     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Owner, 8)
2830     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Owner, 8)
2831     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Group, 8)
2832     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Group, 8)
2833     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Group, 16)
2834     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Sacl, 8)
2835     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sacl, 8)
2836     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sacl, 24)
2837     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Dacl, 8)
2838     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Dacl, 8)
2839     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Dacl, 32)
2840 }
2841 
2842 static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void)
2843 {
2844     /* SECURITY_DESCRIPTOR_CONTROL */
2845     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR_CONTROL, 2)
2846     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR_CONTROL, 2)
2847     TEST_TYPE_UNSIGNED(SECURITY_DESCRIPTOR_CONTROL)
2848 }
2849 
2850 static void test_pack_SECURITY_DESCRIPTOR_RELATIVE(void)
2851 {
2852     /* SECURITY_DESCRIPTOR_RELATIVE */
2853     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR_RELATIVE, 20)
2854     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR_RELATIVE, 4)
2855     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1)
2856     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1)
2857     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Revision, 0)
2858     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
2859     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
2860     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
2861     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
2862     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
2863     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
2864     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
2865     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
2866     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
2867     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Group, 4)
2868     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Group, 4)
2869     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Group, 8)
2870     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4)
2871     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4)
2872     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sacl, 12)
2873     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4)
2874     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4)
2875     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Dacl, 16)
2876 }
2877 
2878 static void test_pack_SECURITY_INFORMATION(void)
2879 {
2880     /* SECURITY_INFORMATION */
2881     TEST_TYPE_SIZE   (SECURITY_INFORMATION, 4)
2882     TEST_TYPE_ALIGN  (SECURITY_INFORMATION, 4)
2883     TEST_TYPE_UNSIGNED(SECURITY_INFORMATION)
2884 }
2885 
2886 static void test_pack_SECURITY_QUALITY_OF_SERVICE(void)
2887 {
2888     /* SECURITY_QUALITY_OF_SERVICE */
2889     TEST_FIELD_SIZE  (SECURITY_QUALITY_OF_SERVICE, Length, 4)
2890     TEST_FIELD_ALIGN (SECURITY_QUALITY_OF_SERVICE, Length, 4)
2891     TEST_FIELD_OFFSET(SECURITY_QUALITY_OF_SERVICE, Length, 0)
2892 }
2893 
2894 static void test_pack_SHORT(void)
2895 {
2896     /* SHORT */
2897     TEST_TYPE_SIZE   (SHORT, 2)
2898     TEST_TYPE_ALIGN  (SHORT, 2)
2899     TEST_TYPE_SIGNED(SHORT)
2900 }
2901 
2902 static void test_pack_SID(void)
2903 {
2904     /* SID */
2905     TEST_TYPE_SIZE   (SID, 12)
2906     TEST_TYPE_ALIGN  (SID, 4)
2907     TEST_FIELD_SIZE  (SID, Revision, 1)
2908     TEST_FIELD_ALIGN (SID, Revision, 1)
2909     TEST_FIELD_OFFSET(SID, Revision, 0)
2910     TEST_FIELD_SIZE  (SID, SubAuthorityCount, 1)
2911     TEST_FIELD_ALIGN (SID, SubAuthorityCount, 1)
2912     TEST_FIELD_OFFSET(SID, SubAuthorityCount, 1)
2913     TEST_FIELD_SIZE  (SID, IdentifierAuthority, 6)
2914     TEST_FIELD_ALIGN (SID, IdentifierAuthority, 1)
2915     TEST_FIELD_OFFSET(SID, IdentifierAuthority, 2)
2916     TEST_FIELD_SIZE  (SID, SubAuthority, 4)
2917     TEST_FIELD_ALIGN (SID, SubAuthority, 4)
2918     TEST_FIELD_OFFSET(SID, SubAuthority, 8)
2919 }
2920 
2921 static void test_pack_SID_AND_ATTRIBUTES(void)
2922 {
2923     /* SID_AND_ATTRIBUTES */
2924     TEST_TYPE_SIZE   (SID_AND_ATTRIBUTES, 16)
2925     TEST_TYPE_ALIGN  (SID_AND_ATTRIBUTES, 8)
2926     TEST_FIELD_SIZE  (SID_AND_ATTRIBUTES, Sid, 8)
2927     TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Sid, 8)
2928     TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Sid, 0)
2929     TEST_FIELD_SIZE  (SID_AND_ATTRIBUTES, Attributes, 4)
2930     TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Attributes, 4)
2931     TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Attributes, 8)
2932 }
2933 
2934 static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
2935 {
2936     /* SID_IDENTIFIER_AUTHORITY */
2937     TEST_TYPE_SIZE   (SID_IDENTIFIER_AUTHORITY, 6)
2938     TEST_TYPE_ALIGN  (SID_IDENTIFIER_AUTHORITY, 1)
2939     TEST_FIELD_SIZE  (SID_IDENTIFIER_AUTHORITY, Value, 6)
2940     TEST_FIELD_ALIGN (SID_IDENTIFIER_AUTHORITY, Value, 1)
2941     TEST_FIELD_OFFSET(SID_IDENTIFIER_AUTHORITY, Value, 0)
2942 }
2943 
2944 static void test_pack_SINGLE_LIST_ENTRY(void)
2945 {
2946     /* SINGLE_LIST_ENTRY */
2947     TEST_TYPE_SIZE   (SINGLE_LIST_ENTRY, 8)
2948     TEST_TYPE_ALIGN  (SINGLE_LIST_ENTRY, 8)
2949     TEST_FIELD_SIZE  (SINGLE_LIST_ENTRY, Next, 8)
2950     TEST_FIELD_ALIGN (SINGLE_LIST_ENTRY, Next, 8)
2951     TEST_FIELD_OFFSET(SINGLE_LIST_ENTRY, Next, 0)
2952 }
2953 
2954 static void test_pack_SYSTEM_ALARM_ACE(void)
2955 {
2956     /* SYSTEM_ALARM_ACE */
2957     TEST_TYPE_SIZE   (SYSTEM_ALARM_ACE, 12)
2958     TEST_TYPE_ALIGN  (SYSTEM_ALARM_ACE, 4)
2959     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, Header, 4)
2960     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Header, 2)
2961     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Header, 0)
2962     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, Mask, 4)
2963     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Mask, 4)
2964     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Mask, 4)
2965     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, SidStart, 4)
2966     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, SidStart, 4)
2967     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart, 8)
2968 }
2969 
2970 static void test_pack_SYSTEM_AUDIT_ACE(void)
2971 {
2972     /* SYSTEM_AUDIT_ACE */
2973     TEST_TYPE_SIZE   (SYSTEM_AUDIT_ACE, 12)
2974     TEST_TYPE_ALIGN  (SYSTEM_AUDIT_ACE, 4)
2975     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, Header, 4)
2976     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Header, 2)
2977     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Header, 0)
2978     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, Mask, 4)
2979     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Mask, 4)
2980     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Mask, 4)
2981     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, SidStart, 4)
2982     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, SidStart, 4)
2983     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8)
2984 }
2985 
2986 static void test_pack_TOKEN_DEFAULT_DACL(void)
2987 {
2988     /* TOKEN_DEFAULT_DACL */
2989     TEST_TYPE_SIZE   (TOKEN_DEFAULT_DACL, 8)
2990     TEST_TYPE_ALIGN  (TOKEN_DEFAULT_DACL, 8)
2991     TEST_FIELD_SIZE  (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2992     TEST_FIELD_ALIGN (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2993     TEST_FIELD_OFFSET(TOKEN_DEFAULT_DACL, DefaultDacl, 0)
2994 }
2995 
2996 static void test_pack_TOKEN_GROUPS(void)
2997 {
2998     /* TOKEN_GROUPS */
2999     TEST_TYPE_SIZE   (TOKEN_GROUPS, 24)
3000     TEST_TYPE_ALIGN  (TOKEN_GROUPS, 8)
3001     TEST_FIELD_SIZE  (TOKEN_GROUPS, GroupCount, 4)
3002     TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4)
3003     TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0)
3004     TEST_FIELD_SIZE  (TOKEN_GROUPS, Groups, 16)
3005     TEST_FIELD_ALIGN (TOKEN_GROUPS, Groups, 8)
3006     TEST_FIELD_OFFSET(TOKEN_GROUPS, Groups, 8)
3007 }
3008 
3009 static void test_pack_TOKEN_OWNER(void)
3010 {
3011     /* TOKEN_OWNER */
3012     TEST_TYPE_SIZE   (TOKEN_OWNER, 8)
3013     TEST_TYPE_ALIGN  (TOKEN_OWNER, 8)
3014     TEST_FIELD_SIZE  (TOKEN_OWNER, Owner, 8)
3015     TEST_FIELD_ALIGN (TOKEN_OWNER, Owner, 8)
3016     TEST_FIELD_OFFSET(TOKEN_OWNER, Owner, 0)
3017 }
3018 
3019 static void test_pack_TOKEN_PRIMARY_GROUP(void)
3020 {
3021     /* TOKEN_PRIMARY_GROUP */
3022     TEST_TYPE_SIZE   (TOKEN_PRIMARY_GROUP, 8)
3023     TEST_TYPE_ALIGN  (TOKEN_PRIMARY_GROUP, 8)
3024     TEST_FIELD_SIZE  (TOKEN_PRIMARY_GROUP, PrimaryGroup, 8)
3025     TEST_FIELD_ALIGN (TOKEN_PRIMARY_GROUP, PrimaryGroup, 8)
3026     TEST_FIELD_OFFSET(TOKEN_PRIMARY_GROUP, PrimaryGroup, 0)
3027 }
3028 
3029 static void test_pack_TOKEN_PRIVILEGES(void)
3030 {
3031     /* TOKEN_PRIVILEGES */
3032     TEST_TYPE_SIZE   (TOKEN_PRIVILEGES, 16)
3033     TEST_TYPE_ALIGN  (TOKEN_PRIVILEGES, 4)
3034     TEST_FIELD_SIZE  (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3035     TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3036     TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0)
3037     TEST_FIELD_SIZE  (TOKEN_PRIVILEGES, Privileges, 12)
3038     TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, Privileges, 4)
3039     TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges, 4)
3040 }
3041 
3042 static void test_pack_TOKEN_SOURCE(void)
3043 {
3044     /* TOKEN_SOURCE */
3045     TEST_TYPE_SIZE   (TOKEN_SOURCE, 16)
3046     TEST_TYPE_ALIGN  (TOKEN_SOURCE, 4)
3047     TEST_FIELD_SIZE  (TOKEN_SOURCE, SourceName, 8)
3048     TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceName, 1)
3049     TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceName, 0)
3050     TEST_FIELD_SIZE  (TOKEN_SOURCE, SourceIdentifier, 8)
3051     TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceIdentifier, 4)
3052     TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceIdentifier, 8)
3053 }
3054 
3055 static void test_pack_TOKEN_STATISTICS(void)
3056 {
3057     /* TOKEN_STATISTICS (pack 4) */
3058     TEST_FIELD_SIZE  (TOKEN_STATISTICS, TokenId, 8)
3059     TEST_FIELD_ALIGN (TOKEN_STATISTICS, TokenId, 4)
3060     TEST_FIELD_OFFSET(TOKEN_STATISTICS, TokenId, 0)
3061     TEST_FIELD_SIZE  (TOKEN_STATISTICS, AuthenticationId, 8)
3062     TEST_FIELD_ALIGN (TOKEN_STATISTICS, AuthenticationId, 4)
3063     TEST_FIELD_OFFSET(TOKEN_STATISTICS, AuthenticationId, 8)
3064     TEST_FIELD_SIZE  (TOKEN_STATISTICS, ExpirationTime, 8)
3065     TEST_FIELD_ALIGN (TOKEN_STATISTICS, ExpirationTime, 4)
3066     TEST_FIELD_OFFSET(TOKEN_STATISTICS, ExpirationTime, 16)
3067 }
3068 
3069 static void test_pack_TOKEN_USER(void)
3070 {
3071     /* TOKEN_USER */
3072     TEST_TYPE_SIZE   (TOKEN_USER, 16)
3073     TEST_TYPE_ALIGN  (TOKEN_USER, 8)
3074     TEST_FIELD_SIZE  (TOKEN_USER, User, 16)
3075     TEST_FIELD_ALIGN (TOKEN_USER, User, 8)
3076     TEST_FIELD_OFFSET(TOKEN_USER, User, 0)
3077 }
3078 
3079 static void test_pack_ULARGE_INTEGER(void)
3080 {
3081     /* ULARGE_INTEGER */
3082 }
3083 
3084 static void test_pack_ULONGLONG(void)
3085 {
3086     /* ULONGLONG */
3087     TEST_TYPE_SIZE   (ULONGLONG, 8)
3088     TEST_TYPE_ALIGN  (ULONGLONG, 8)
3089     TEST_TYPE_UNSIGNED(ULONGLONG)
3090 }
3091 
3092 static void test_pack_WAITORTIMERCALLBACKFUNC(void)
3093 {
3094     /* WAITORTIMERCALLBACKFUNC */
3095     TEST_TYPE_SIZE   (WAITORTIMERCALLBACKFUNC, 8)
3096     TEST_TYPE_ALIGN  (WAITORTIMERCALLBACKFUNC, 8)
3097 }
3098 
3099 static void test_pack_WCHAR(void)
3100 {
3101     /* WCHAR */
3102     TEST_TYPE_SIZE   (WCHAR, 2)
3103     TEST_TYPE_ALIGN  (WCHAR, 2)
3104     TEST_TYPE_UNSIGNED(WCHAR)
3105 }
3106 
3107 static void test_pack_ATOM(void)
3108 {
3109     /* ATOM */
3110     TEST_TYPE_SIZE   (ATOM, 2)
3111     TEST_TYPE_ALIGN  (ATOM, 2)
3112     TEST_TYPE_UNSIGNED(ATOM)
3113 }
3114 
3115 static void test_pack_BOOL(void)
3116 {
3117     /* BOOL */
3118     TEST_TYPE_SIZE   (BOOL, 4)
3119     TEST_TYPE_ALIGN  (BOOL, 4)
3120     TEST_TYPE_SIGNED(BOOL)
3121 }
3122 
3123 static void test_pack_BYTE(void)
3124 {
3125     /* BYTE */
3126     TEST_TYPE_SIZE   (BYTE, 1)
3127     TEST_TYPE_ALIGN  (BYTE, 1)
3128     TEST_TYPE_UNSIGNED(BYTE)
3129 }
3130 
3131 static void test_pack_COLORREF(void)
3132 {
3133     /* COLORREF */
3134     TEST_TYPE_SIZE   (COLORREF, 4)
3135     TEST_TYPE_ALIGN  (COLORREF, 4)
3136     TEST_TYPE_UNSIGNED(COLORREF)
3137 }
3138 
3139 static void test_pack_DWORD(void)
3140 {
3141     /* DWORD */
3142     TEST_TYPE_SIZE   (DWORD, 4)
3143     TEST_TYPE_ALIGN  (DWORD, 4)
3144     TEST_TYPE_UNSIGNED(DWORD)
3145 }
3146 
3147 static void test_pack_FARPROC(void)
3148 {
3149     /* FARPROC */
3150     TEST_TYPE_SIZE   (FARPROC, 8)
3151     TEST_TYPE_ALIGN  (FARPROC, 8)
3152 }
3153 
3154 static void test_pack_FLOAT(void)
3155 {
3156     /* FLOAT */
3157     TEST_TYPE_SIZE   (FLOAT, 4)
3158     TEST_TYPE_ALIGN  (FLOAT, 4)
3159 }
3160 
3161 static void test_pack_GLOBALHANDLE(void)
3162 {
3163     /* GLOBALHANDLE */
3164     TEST_TYPE_SIZE   (GLOBALHANDLE, 8)
3165     TEST_TYPE_ALIGN  (GLOBALHANDLE, 8)
3166 }
3167 
3168 static void test_pack_HCURSOR(void)
3169 {
3170     /* HCURSOR */
3171     TEST_TYPE_SIZE   (HCURSOR, 8)
3172     TEST_TYPE_ALIGN  (HCURSOR, 8)
3173 }
3174 
3175 static void test_pack_HFILE(void)
3176 {
3177     /* HFILE */
3178     TEST_TYPE_SIZE   (HFILE, 4)
3179     TEST_TYPE_ALIGN  (HFILE, 4)
3180     TEST_TYPE_SIGNED(HFILE)
3181 }
3182 
3183 static void test_pack_HGDIOBJ(void)
3184 {
3185     /* HGDIOBJ */
3186     TEST_TYPE_SIZE   (HGDIOBJ, 8)
3187     TEST_TYPE_ALIGN  (HGDIOBJ, 8)
3188 }
3189 
3190 static void test_pack_HGLOBAL(void)
3191 {
3192     /* HGLOBAL */
3193     TEST_TYPE_SIZE   (HGLOBAL, 8)
3194     TEST_TYPE_ALIGN  (HGLOBAL, 8)
3195 }
3196 
3197 static void test_pack_HLOCAL(void)
3198 {
3199     /* HLOCAL */
3200     TEST_TYPE_SIZE   (HLOCAL, 8)
3201     TEST_TYPE_ALIGN  (HLOCAL, 8)
3202 }
3203 
3204 static void test_pack_HMODULE(void)
3205 {
3206     /* HMODULE */
3207     TEST_TYPE_SIZE   (HMODULE, 8)
3208     TEST_TYPE_ALIGN  (HMODULE, 8)
3209 }
3210 
3211 static void test_pack_INT(void)
3212 {
3213     /* INT */
3214     TEST_TYPE_SIZE   (INT, 4)
3215     TEST_TYPE_ALIGN  (INT, 4)
3216     TEST_TYPE_SIGNED(INT)
3217 }
3218 
3219 static void test_pack_LOCALHANDLE(void)
3220 {
3221     /* LOCALHANDLE */
3222     TEST_TYPE_SIZE   (LOCALHANDLE, 8)
3223     TEST_TYPE_ALIGN  (LOCALHANDLE, 8)
3224 }
3225 
3226 static void test_pack_LPARAM(void)
3227 {
3228     /* LPARAM */
3229     TEST_TYPE_SIZE   (LPARAM, 8)
3230     TEST_TYPE_ALIGN  (LPARAM, 8)
3231 }
3232 
3233 static void test_pack_LPCRECT(void)
3234 {
3235     /* LPCRECT */
3236     TEST_TYPE_SIZE   (LPCRECT, 8)
3237     TEST_TYPE_ALIGN  (LPCRECT, 8)
3238     TEST_TARGET_SIZE (LPCRECT, 16)
3239     TEST_TARGET_ALIGN(LPCRECT, 4)
3240 }
3241 
3242 static void test_pack_LPCRECTL(void)
3243 {
3244     /* LPCRECTL */
3245     TEST_TYPE_SIZE   (LPCRECTL, 8)
3246     TEST_TYPE_ALIGN  (LPCRECTL, 8)
3247     TEST_TARGET_SIZE (LPCRECTL, 16)
3248     TEST_TARGET_ALIGN(LPCRECTL, 4)
3249 }
3250 
3251 static void test_pack_LPCVOID(void)
3252 {
3253     /* LPCVOID */
3254     TEST_TYPE_SIZE   (LPCVOID, 8)
3255     TEST_TYPE_ALIGN  (LPCVOID, 8)
3256 }
3257 
3258 static void test_pack_LPPOINT(void)
3259 {
3260     /* LPPOINT */
3261     TEST_TYPE_SIZE   (LPPOINT, 8)
3262     TEST_TYPE_ALIGN  (LPPOINT, 8)
3263     TEST_TARGET_SIZE (LPPOINT, 8)
3264     TEST_TARGET_ALIGN(LPPOINT, 4)
3265 }
3266 
3267 static void test_pack_LPRECT(void)
3268 {
3269     /* LPRECT */
3270     TEST_TYPE_SIZE   (LPRECT, 8)
3271     TEST_TYPE_ALIGN  (LPRECT, 8)
3272     TEST_TARGET_SIZE (LPRECT, 16)
3273     TEST_TARGET_ALIGN(LPRECT, 4)
3274 }
3275 
3276 static void test_pack_LPRECTL(void)
3277 {
3278     /* LPRECTL */
3279     TEST_TYPE_SIZE   (LPRECTL, 8)
3280     TEST_TYPE_ALIGN  (LPRECTL, 8)
3281     TEST_TARGET_SIZE (LPRECTL, 16)
3282     TEST_TARGET_ALIGN(LPRECTL, 4)
3283 }
3284 
3285 static void test_pack_LPSIZE(void)
3286 {
3287     /* LPSIZE */
3288     TEST_TYPE_SIZE   (LPSIZE, 8)
3289     TEST_TYPE_ALIGN  (LPSIZE, 8)
3290     TEST_TARGET_SIZE (LPSIZE, 8)
3291     TEST_TARGET_ALIGN(LPSIZE, 4)
3292 }
3293 
3294 static void test_pack_LRESULT(void)
3295 {
3296     /* LRESULT */
3297     TEST_TYPE_SIZE   (LRESULT, 8)
3298     TEST_TYPE_ALIGN  (LRESULT, 8)
3299 }
3300 
3301 static void test_pack_POINT(void)
3302 {
3303     /* POINT */
3304     TEST_TYPE_SIZE   (POINT, 8)
3305     TEST_TYPE_ALIGN  (POINT, 4)
3306     TEST_FIELD_SIZE  (POINT, x, 4)
3307     TEST_FIELD_ALIGN (POINT, x, 4)
3308     TEST_FIELD_OFFSET(POINT, x, 0)
3309     TEST_FIELD_SIZE  (POINT, y, 4)
3310     TEST_FIELD_ALIGN (POINT, y, 4)
3311     TEST_FIELD_OFFSET(POINT, y, 4)
3312 }
3313 
3314 static void test_pack_POINTL(void)
3315 {
3316     /* POINTL */
3317     TEST_TYPE_SIZE   (POINTL, 8)
3318     TEST_TYPE_ALIGN  (POINTL, 4)
3319     TEST_FIELD_SIZE  (POINTL, x, 4)
3320     TEST_FIELD_ALIGN (POINTL, x, 4)
3321     TEST_FIELD_OFFSET(POINTL, x, 0)
3322     TEST_FIELD_SIZE  (POINTL, y, 4)
3323     TEST_FIELD_ALIGN (POINTL, y, 4)
3324     TEST_FIELD_OFFSET(POINTL, y, 4)
3325 }
3326 
3327 static void test_pack_PPOINT(void)
3328 {
3329     /* PPOINT */
3330     TEST_TYPE_SIZE   (PPOINT, 8)
3331     TEST_TYPE_ALIGN  (PPOINT, 8)
3332     TEST_TARGET_SIZE (PPOINT, 8)
3333     TEST_TARGET_ALIGN(PPOINT, 4)
3334 }
3335 
3336 static void test_pack_PPOINTL(void)
3337 {
3338     /* PPOINTL */
3339     TEST_TYPE_SIZE   (PPOINTL, 8)
3340     TEST_TYPE_ALIGN  (PPOINTL, 8)
3341     TEST_TARGET_SIZE (PPOINTL, 8)
3342     TEST_TARGET_ALIGN(PPOINTL, 4)
3343 }
3344 
3345 static void test_pack_PRECT(void)
3346 {
3347     /* PRECT */
3348     TEST_TYPE_SIZE   (PRECT, 8)
3349     TEST_TYPE_ALIGN  (PRECT, 8)
3350     TEST_TARGET_SIZE (PRECT, 16)
3351     TEST_TARGET_ALIGN(PRECT, 4)
3352 }
3353 
3354 static void test_pack_PRECTL(void)
3355 {
3356     /* PRECTL */
3357     TEST_TYPE_SIZE   (PRECTL, 8)
3358     TEST_TYPE_ALIGN  (PRECTL, 8)
3359     TEST_TARGET_SIZE (PRECTL, 16)
3360     TEST_TARGET_ALIGN(PRECTL, 4)
3361 }
3362 
3363 static void test_pack_PROC(void)
3364 {
3365     /* PROC */
3366     TEST_TYPE_SIZE   (PROC, 8)
3367     TEST_TYPE_ALIGN  (PROC, 8)
3368 }
3369 
3370 static void test_pack_PSIZE(void)
3371 {
3372     /* PSIZE */
3373     TEST_TYPE_SIZE   (PSIZE, 8)
3374     TEST_TYPE_ALIGN  (PSIZE, 8)
3375     TEST_TARGET_SIZE (PSIZE, 8)
3376     TEST_TARGET_ALIGN(PSIZE, 4)
3377 }
3378 
3379 static void test_pack_PSZ(void)
3380 {
3381     /* PSZ */
3382     TEST_TYPE_SIZE   (PSZ, 8)
3383     TEST_TYPE_ALIGN  (PSZ, 8)
3384 }
3385 
3386 static void test_pack_RECT(void)
3387 {
3388     /* RECT */
3389     TEST_TYPE_SIZE   (RECT, 16)
3390     TEST_TYPE_ALIGN  (RECT, 4)
3391     TEST_FIELD_SIZE  (RECT, left, 4)
3392     TEST_FIELD_ALIGN (RECT, left, 4)
3393     TEST_FIELD_OFFSET(RECT, left, 0)
3394     TEST_FIELD_SIZE  (RECT, top, 4)
3395     TEST_FIELD_ALIGN (RECT, top, 4)
3396     TEST_FIELD_OFFSET(RECT, top, 4)
3397     TEST_FIELD_SIZE  (RECT, right, 4)
3398     TEST_FIELD_ALIGN (RECT, right, 4)
3399     TEST_FIELD_OFFSET(RECT, right, 8)
3400     TEST_FIELD_SIZE  (RECT, bottom, 4)
3401     TEST_FIELD_ALIGN (RECT, bottom, 4)
3402     TEST_FIELD_OFFSET(RECT, bottom, 12)
3403 }
3404 
3405 static void test_pack_RECTL(void)
3406 {
3407     /* RECTL */
3408     TEST_TYPE_SIZE   (RECTL, 16)
3409     TEST_TYPE_ALIGN  (RECTL, 4)
3410     TEST_FIELD_SIZE  (RECTL, left, 4)
3411     TEST_FIELD_ALIGN (RECTL, left, 4)
3412     TEST_FIELD_OFFSET(RECTL, left, 0)
3413     TEST_FIELD_SIZE  (RECTL, top, 4)
3414     TEST_FIELD_ALIGN (RECTL, top, 4)
3415     TEST_FIELD_OFFSET(RECTL, top, 4)
3416     TEST_FIELD_SIZE  (RECTL, right, 4)
3417     TEST_FIELD_ALIGN (RECTL, right, 4)
3418     TEST_FIELD_OFFSET(RECTL, right, 8)
3419     TEST_FIELD_SIZE  (RECTL, bottom, 4)
3420     TEST_FIELD_ALIGN (RECTL, bottom, 4)
3421     TEST_FIELD_OFFSET(RECTL, bottom, 12)
3422 }
3423 
3424 static void test_pack_SIZE(void)
3425 {
3426     /* SIZE */
3427     TEST_TYPE_SIZE   (SIZE, 8)
3428     TEST_TYPE_ALIGN  (SIZE, 4)
3429     TEST_FIELD_SIZE  (SIZE, cx, 4)
3430     TEST_FIELD_ALIGN (SIZE, cx, 4)
3431     TEST_FIELD_OFFSET(SIZE, cx, 0)
3432     TEST_FIELD_SIZE  (SIZE, cy, 4)
3433     TEST_FIELD_ALIGN (SIZE, cy, 4)
3434     TEST_FIELD_OFFSET(SIZE, cy, 4)
3435 }
3436 
3437 static void test_pack_SIZEL(void)
3438 {
3439     /* SIZEL */
3440     TEST_TYPE_SIZE   (SIZEL, 8)
3441     TEST_TYPE_ALIGN  (SIZEL, 4)
3442 }
3443 
3444 static void test_pack_UCHAR(void)
3445 {
3446     /* UCHAR */
3447     TEST_TYPE_SIZE   (UCHAR, 1)
3448     TEST_TYPE_ALIGN  (UCHAR, 1)
3449     TEST_TYPE_UNSIGNED(UCHAR)
3450 }
3451 
3452 static void test_pack_UINT(void)
3453 {
3454     /* UINT */
3455     TEST_TYPE_SIZE   (UINT, 4)
3456     TEST_TYPE_ALIGN  (UINT, 4)
3457     TEST_TYPE_UNSIGNED(UINT)
3458 }
3459 
3460 static void test_pack_ULONG(void)
3461 {
3462     /* ULONG */
3463     TEST_TYPE_SIZE   (ULONG, 4)
3464     TEST_TYPE_ALIGN  (ULONG, 4)
3465     TEST_TYPE_UNSIGNED(ULONG)
3466 }
3467 
3468 static void test_pack_USHORT(void)
3469 {
3470     /* USHORT */
3471     TEST_TYPE_SIZE   (USHORT, 2)
3472     TEST_TYPE_ALIGN  (USHORT, 2)
3473     TEST_TYPE_UNSIGNED(USHORT)
3474 }
3475 
3476 static void test_pack_WORD(void)
3477 {
3478     /* WORD */
3479     TEST_TYPE_SIZE   (WORD, 2)
3480     TEST_TYPE_ALIGN  (WORD, 2)
3481     TEST_TYPE_UNSIGNED(WORD)
3482 }
3483 
3484 static void test_pack_WPARAM(void)
3485 {
3486     /* WPARAM */
3487     TEST_TYPE_SIZE   (WPARAM, 8)
3488     TEST_TYPE_ALIGN  (WPARAM, 8)
3489 }
3490 
3491 #else /* _WIN64 */
3492 
3493 static void test_pack_DWORD32(void)
3494 {
3495     /* DWORD32 */
3496     TEST_TYPE_SIZE   (DWORD32, 4)
3497     TEST_TYPE_ALIGN  (DWORD32, 4)
3498     TEST_TYPE_UNSIGNED(DWORD32)
3499 }
3500 
3501 static void test_pack_DWORD64(void)
3502 {
3503     /* DWORD64 */
3504     TEST_TYPE_SIZE   (DWORD64, 8)
3505     TEST_TYPE_ALIGN  (DWORD64, 8)
3506     TEST_TYPE_UNSIGNED(DWORD64)
3507 }
3508 
3509 static void test_pack_DWORD_PTR(void)
3510 {
3511     /* DWORD_PTR */
3512     TEST_TYPE_SIZE   (DWORD_PTR, 4)
3513     TEST_TYPE_ALIGN  (DWORD_PTR, 4)
3514 }
3515 
3516 static void test_pack_HALF_PTR(void)
3517 {
3518     /* HALF_PTR */
3519     TEST_TYPE_SIZE   (HALF_PTR, 2)
3520     TEST_TYPE_ALIGN  (HALF_PTR, 2)
3521     TEST_TYPE_SIGNED(HALF_PTR)
3522 }
3523 
3524 static void test_pack_INT16(void)
3525 {
3526     /* INT16 */
3527     TEST_TYPE_SIZE   (INT16, 2)
3528     TEST_TYPE_ALIGN  (INT16, 2)
3529     TEST_TYPE_SIGNED(INT16)
3530 }
3531 
3532 static void test_pack_INT32(void)
3533 {
3534     /* INT32 */
3535     TEST_TYPE_SIZE   (INT32, 4)
3536     TEST_TYPE_ALIGN  (INT32, 4)
3537     TEST_TYPE_SIGNED(INT32)
3538 }
3539 
3540 static void test_pack_INT64(void)
3541 {
3542     /* INT64 */
3543     TEST_TYPE_SIZE   (INT64, 8)
3544     TEST_TYPE_ALIGN  (INT64, 8)
3545     TEST_TYPE_SIGNED(INT64)
3546 }
3547 
3548 static void test_pack_INT8(void)
3549 {
3550     /* INT8 */
3551     TEST_TYPE_SIZE   (INT8, 1)
3552     TEST_TYPE_ALIGN  (INT8, 1)
3553     TEST_TYPE_SIGNED(INT8)
3554 }
3555 
3556 static void test_pack_INT_PTR(void)
3557 {
3558     /* INT_PTR */
3559     TEST_TYPE_SIZE   (INT_PTR, 4)
3560     TEST_TYPE_ALIGN  (INT_PTR, 4)
3561     TEST_TYPE_SIGNED(INT_PTR)
3562 }
3563 
3564 static void test_pack_LONG32(void)
3565 {
3566     /* LONG32 */
3567     TEST_TYPE_SIZE   (LONG32, 4)
3568     TEST_TYPE_ALIGN  (LONG32, 4)
3569     TEST_TYPE_SIGNED(LONG32)
3570 }
3571 
3572 static void test_pack_LONG64(void)
3573 {
3574     /* LONG64 */
3575     TEST_TYPE_SIZE   (LONG64, 8)
3576     TEST_TYPE_ALIGN  (LONG64, 8)
3577     TEST_TYPE_SIGNED(LONG64)
3578 }
3579 
3580 static void test_pack_LONG_PTR(void)
3581 {
3582     /* LONG_PTR */
3583     TEST_TYPE_SIZE   (LONG_PTR, 4)
3584     TEST_TYPE_ALIGN  (LONG_PTR, 4)
3585     TEST_TYPE_SIGNED(LONG_PTR)
3586 }
3587 
3588 static void test_pack_SIZE_T(void)
3589 {
3590     /* SIZE_T */
3591     TEST_TYPE_SIZE   (SIZE_T, 4)
3592     TEST_TYPE_ALIGN  (SIZE_T, 4)
3593 }
3594 
3595 static void test_pack_SSIZE_T(void)
3596 {
3597     /* SSIZE_T */
3598     TEST_TYPE_SIZE   (SSIZE_T, 4)
3599     TEST_TYPE_ALIGN  (SSIZE_T, 4)
3600 }
3601 
3602 static void test_pack_UHALF_PTR(void)
3603 {
3604     /* UHALF_PTR */
3605     TEST_TYPE_SIZE   (UHALF_PTR, 2)
3606     TEST_TYPE_ALIGN  (UHALF_PTR, 2)
3607     TEST_TYPE_UNSIGNED(UHALF_PTR)
3608 }
3609 
3610 static void test_pack_UINT16(void)
3611 {
3612     /* UINT16 */
3613     TEST_TYPE_SIZE   (UINT16, 2)
3614     TEST_TYPE_ALIGN  (UINT16, 2)
3615     TEST_TYPE_UNSIGNED(UINT16)
3616 }
3617 
3618 static void test_pack_UINT32(void)
3619 {
3620     /* UINT32 */
3621     TEST_TYPE_SIZE   (UINT32, 4)
3622     TEST_TYPE_ALIGN  (UINT32, 4)
3623     TEST_TYPE_UNSIGNED(UINT32)
3624 }
3625 
3626 static void test_pack_UINT64(void)
3627 {
3628     /* UINT64 */
3629     TEST_TYPE_SIZE   (UINT64, 8)
3630     TEST_TYPE_ALIGN  (UINT64, 8)
3631     TEST_TYPE_UNSIGNED(UINT64)
3632 }
3633 
3634 static void test_pack_UINT8(void)
3635 {
3636     /* UINT8 */
3637     TEST_TYPE_SIZE   (UINT8, 1)
3638     TEST_TYPE_ALIGN  (UINT8, 1)
3639     TEST_TYPE_UNSIGNED(UINT8)
3640 }
3641 
3642 static void test_pack_UINT_PTR(void)
3643 {
3644     /* UINT_PTR */
3645     TEST_TYPE_SIZE   (UINT_PTR, 4)
3646     TEST_TYPE_ALIGN  (UINT_PTR, 4)
3647     TEST_TYPE_UNSIGNED(UINT_PTR)
3648 }
3649 
3650 static void test_pack_ULONG32(void)
3651 {
3652     /* ULONG32 */
3653     TEST_TYPE_SIZE   (ULONG32, 4)
3654     TEST_TYPE_ALIGN  (ULONG32, 4)
3655     TEST_TYPE_UNSIGNED(ULONG32)
3656 }
3657 
3658 static void test_pack_ULONG64(void)
3659 {
3660     /* ULONG64 */
3661     TEST_TYPE_SIZE   (ULONG64, 8)
3662     TEST_TYPE_ALIGN  (ULONG64, 8)
3663     TEST_TYPE_UNSIGNED(ULONG64)
3664 }
3665 
3666 static void test_pack_ULONG_PTR(void)
3667 {
3668     /* ULONG_PTR */
3669     TEST_TYPE_SIZE   (ULONG_PTR, 4)
3670     TEST_TYPE_ALIGN  (ULONG_PTR, 4)
3671     TEST_TYPE_UNSIGNED(ULONG_PTR)
3672 }
3673 
3674 static void test_pack_ACCESS_ALLOWED_ACE(void)
3675 {
3676     /* ACCESS_ALLOWED_ACE */
3677     TEST_TYPE_SIZE   (ACCESS_ALLOWED_ACE, 12)
3678     TEST_TYPE_ALIGN  (ACCESS_ALLOWED_ACE, 4)
3679     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, Header, 4)
3680     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Header, 2)
3681     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Header, 0)
3682     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, Mask, 4)
3683     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Mask, 4)
3684     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Mask, 4)
3685     TEST_FIELD_SIZE  (ACCESS_ALLOWED_ACE, SidStart, 4)
3686     TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
3687     TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart, 8)
3688 }
3689 
3690 static void test_pack_ACCESS_DENIED_ACE(void)
3691 {
3692     /* ACCESS_DENIED_ACE */
3693     TEST_TYPE_SIZE   (ACCESS_DENIED_ACE, 12)
3694     TEST_TYPE_ALIGN  (ACCESS_DENIED_ACE, 4)
3695     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, Header, 4)
3696     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Header, 2)
3697     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Header, 0)
3698     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, Mask, 4)
3699     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Mask, 4)
3700     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Mask, 4)
3701     TEST_FIELD_SIZE  (ACCESS_DENIED_ACE, SidStart, 4)
3702     TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
3703     TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart, 8)
3704 }
3705 
3706 static void test_pack_ACCESS_MASK(void)
3707 {
3708     /* ACCESS_MASK */
3709     TEST_TYPE_SIZE   (ACCESS_MASK, 4)
3710     TEST_TYPE_ALIGN  (ACCESS_MASK, 4)
3711     TEST_TYPE_UNSIGNED(ACCESS_MASK)
3712 }
3713 
3714 static void test_pack_ACE_HEADER(void)
3715 {
3716     /* ACE_HEADER */
3717     TEST_TYPE_SIZE   (ACE_HEADER, 4)
3718     TEST_TYPE_ALIGN  (ACE_HEADER, 2)
3719     TEST_FIELD_SIZE  (ACE_HEADER, AceType, 1)
3720     TEST_FIELD_ALIGN (ACE_HEADER, AceType, 1)
3721     TEST_FIELD_OFFSET(ACE_HEADER, AceType, 0)
3722     TEST_FIELD_SIZE  (ACE_HEADER, AceFlags, 1)
3723     TEST_FIELD_ALIGN (ACE_HEADER, AceFlags, 1)
3724     TEST_FIELD_OFFSET(ACE_HEADER, AceFlags, 1)
3725     TEST_FIELD_SIZE  (ACE_HEADER, AceSize, 2)
3726     TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
3727     TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
3728 }
3729 
3730 static void test_pack_ACL(void)
3731 {
3732     /* ACL */
3733     TEST_TYPE_SIZE   (ACL, 8)
3734     TEST_TYPE_ALIGN  (ACL, 2)
3735     TEST_FIELD_SIZE  (ACL, AclRevision, 1)
3736     TEST_FIELD_ALIGN (ACL, AclRevision, 1)
3737     TEST_FIELD_OFFSET(ACL, AclRevision, 0)
3738     TEST_FIELD_SIZE  (ACL, Sbz1, 1)
3739     TEST_FIELD_ALIGN (ACL, Sbz1, 1)
3740     TEST_FIELD_OFFSET(ACL, Sbz1, 1)
3741     TEST_FIELD_SIZE  (ACL, AclSize, 2)
3742     TEST_FIELD_ALIGN (ACL, AclSize, 2)
3743     TEST_FIELD_OFFSET(ACL, AclSize, 2)
3744     TEST_FIELD_SIZE  (ACL, AceCount, 2)
3745     TEST_FIELD_ALIGN (ACL, AceCount, 2)
3746     TEST_FIELD_OFFSET(ACL, AceCount, 4)
3747     TEST_FIELD_SIZE  (ACL, Sbz2, 2)
3748     TEST_FIELD_ALIGN (ACL, Sbz2, 2)
3749     TEST_FIELD_OFFSET(ACL, Sbz2, 6)
3750 }
3751 
3752 static void test_pack_ACL_REVISION_INFORMATION(void)
3753 {
3754     /* ACL_REVISION_INFORMATION */
3755     TEST_TYPE_SIZE   (ACL_REVISION_INFORMATION, 4)
3756     TEST_TYPE_ALIGN  (ACL_REVISION_INFORMATION, 4)
3757     TEST_FIELD_SIZE  (ACL_REVISION_INFORMATION, AclRevision, 4)
3758     TEST_FIELD_ALIGN (ACL_REVISION_INFORMATION, AclRevision, 4)
3759     TEST_FIELD_OFFSET(ACL_REVISION_INFORMATION, AclRevision, 0)
3760 }
3761 
3762 static void test_pack_ACL_SIZE_INFORMATION(void)
3763 {
3764     /* ACL_SIZE_INFORMATION */
3765     TEST_TYPE_SIZE   (ACL_SIZE_INFORMATION, 12)
3766     TEST_TYPE_ALIGN  (ACL_SIZE_INFORMATION, 4)
3767     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AceCount, 4)
3768     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4)
3769     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AceCount, 0)
3770     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3771     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3772     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3773     TEST_FIELD_SIZE  (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3774     TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3775     TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
3776 }
3777 
3778 static void test_pack_BOOLEAN(void)
3779 {
3780     /* BOOLEAN */
3781     TEST_TYPE_SIZE   (BOOLEAN, 1)
3782     TEST_TYPE_ALIGN  (BOOLEAN, 1)
3783     TEST_TYPE_UNSIGNED(BOOLEAN)
3784 }
3785 
3786 static void test_pack_CCHAR(void)
3787 {
3788     /* CCHAR */
3789     TEST_TYPE_SIZE   (CCHAR, 1)
3790     TEST_TYPE_ALIGN  (CCHAR, 1)
3791 }
3792 
3793 static void test_pack_CHAR(void)
3794 {
3795     /* CHAR */
3796     TEST_TYPE_SIZE   (CHAR, 1)
3797     TEST_TYPE_ALIGN  (CHAR, 1)
3798 }
3799 
3800 static void test_pack_DWORDLONG(void)
3801 {
3802     /* DWORDLONG */
3803     TEST_TYPE_SIZE   (DWORDLONG, 8)
3804     TEST_TYPE_ALIGN  (DWORDLONG, 8)
3805     TEST_TYPE_UNSIGNED(DWORDLONG)
3806 }
3807 
3808 static void test_pack_EXCEPTION_POINTERS(void)
3809 {
3810     /* EXCEPTION_POINTERS */
3811     TEST_TYPE_SIZE   (EXCEPTION_POINTERS, 8)
3812     TEST_TYPE_ALIGN  (EXCEPTION_POINTERS, 4)
3813     TEST_FIELD_SIZE  (EXCEPTION_POINTERS, ExceptionRecord, 4)
3814     TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 4)
3815     TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
3816     TEST_FIELD_SIZE  (EXCEPTION_POINTERS, ContextRecord, 4)
3817     TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ContextRecord, 4)
3818     TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ContextRecord, 4)
3819 }
3820 
3821 static void test_pack_EXCEPTION_RECORD(void)
3822 {
3823     /* EXCEPTION_RECORD */
3824     TEST_TYPE_SIZE   (EXCEPTION_RECORD, 80)
3825     TEST_TYPE_ALIGN  (EXCEPTION_RECORD, 4)
3826     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionCode, 4)
3827     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionCode, 4)
3828     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionCode, 0)
3829     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionFlags, 4)
3830     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
3831     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
3832     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionRecord, 4)
3833     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 4)
3834     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
3835     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionAddress, 4)
3836     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 4)
3837     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 12)
3838     TEST_FIELD_SIZE  (EXCEPTION_RECORD, NumberParameters, 4)
3839     TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
3840     TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 16)
3841     TEST_FIELD_SIZE  (EXCEPTION_RECORD, ExceptionInformation, 60)
3842     TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 4)
3843     TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 20)
3844 }
3845 
3846 static void test_pack_EXECUTION_STATE(void)
3847 {
3848     /* EXECUTION_STATE */
3849     TEST_TYPE_SIZE   (EXECUTION_STATE, 4)
3850     TEST_TYPE_ALIGN  (EXECUTION_STATE, 4)
3851     TEST_TYPE_UNSIGNED(EXECUTION_STATE)
3852 }
3853 
3854 static void test_pack_FPO_DATA(void)
3855 {
3856     /* FPO_DATA */
3857     TEST_TYPE_SIZE   (FPO_DATA, 16)
3858     TEST_TYPE_ALIGN  (FPO_DATA, 4)
3859     TEST_FIELD_SIZE  (FPO_DATA, ulOffStart, 4)
3860     TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
3861     TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
3862     TEST_FIELD_SIZE  (FPO_DATA, cbProcSize, 4)
3863     TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
3864     TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
3865     TEST_FIELD_SIZE  (FPO_DATA, cdwLocals, 4)
3866     TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
3867     TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
3868     TEST_FIELD_SIZE  (FPO_DATA, cdwParams, 2)
3869     TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
3870     TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
3871 }
3872 
3873 static void test_pack_GENERIC_MAPPING(void)
3874 {
3875     /* GENERIC_MAPPING */
3876     TEST_TYPE_SIZE   (GENERIC_MAPPING, 16)
3877     TEST_TYPE_ALIGN  (GENERIC_MAPPING, 4)
3878     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericRead, 4)
3879     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
3880     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
3881     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericWrite, 4)
3882     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
3883     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
3884     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericExecute, 4)
3885     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
3886     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
3887     TEST_FIELD_SIZE  (GENERIC_MAPPING, GenericAll, 4)
3888     TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
3889     TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
3890 }
3891 
3892 static void test_pack_HANDLE(void)
3893 {
3894     /* HANDLE */
3895     TEST_TYPE_SIZE   (HANDLE, 4)
3896     TEST_TYPE_ALIGN  (HANDLE, 4)
3897 }
3898 
3899 static void test_pack_HRESULT(void)
3900 {
3901     /* HRESULT */
3902     TEST_TYPE_SIZE   (HRESULT, 4)
3903     TEST_TYPE_ALIGN  (HRESULT, 4)
3904 }
3905 
3906 static void test_pack_IMAGE_ARCHIVE_MEMBER_HEADER(void)
3907 {
3908     /* IMAGE_ARCHIVE_MEMBER_HEADER */
3909     TEST_TYPE_SIZE   (IMAGE_ARCHIVE_MEMBER_HEADER, 60)
3910     TEST_TYPE_ALIGN  (IMAGE_ARCHIVE_MEMBER_HEADER, 1)
3911     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 16)
3912     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 1)
3913     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Name, 0)
3914     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 12)
3915     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 1)
3916     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Date, 16)
3917     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 6)
3918     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 1)
3919     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 28)
3920     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 6)
3921     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 1)
3922     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 34)
3923     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 8)
3924     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 1)
3925     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 40)
3926     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 10)
3927     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 1)
3928     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Size, 48)
3929     TEST_FIELD_SIZE  (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 2)
3930     TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 1)
3931     TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 58)
3932 }
3933 
3934 static void test_pack_IMAGE_AUX_SYMBOL(void)
3935 {
3936     /* IMAGE_AUX_SYMBOL (pack 2) */
3937 }
3938 
3939 static void test_pack_IMAGE_BASE_RELOCATION(void)
3940 {
3941     /* IMAGE_BASE_RELOCATION */
3942     TEST_TYPE_SIZE   (IMAGE_BASE_RELOCATION, 8)
3943     TEST_TYPE_ALIGN  (IMAGE_BASE_RELOCATION, 4)
3944     TEST_FIELD_SIZE  (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
3945     TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
3946     TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, VirtualAddress, 0)
3947     TEST_FIELD_SIZE  (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3948     TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3949     TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3950 }
3951 
3952 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
3953 {
3954     /* IMAGE_BOUND_FORWARDER_REF */
3955     TEST_TYPE_SIZE   (IMAGE_BOUND_FORWARDER_REF, 8)
3956     TEST_TYPE_ALIGN  (IMAGE_BOUND_FORWARDER_REF, 4)
3957     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
3958     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
3959     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 0)
3960     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
3961     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
3962     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
3963     TEST_FIELD_SIZE  (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
3964     TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
3965     TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, Reserved, 6)
3966 }
3967 
3968 static void test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR(void)
3969 {
3970     /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
3971     TEST_TYPE_SIZE   (IMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
3972     TEST_TYPE_ALIGN  (IMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
3973     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
3974     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
3975     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 0)
3976     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
3977     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
3978     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 4)
3979     TEST_FIELD_SIZE  (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
3980     TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
3981     TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
3982 }
3983 
3984 static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void)
3985 {
3986     /* IMAGE_COFF_SYMBOLS_HEADER */
3987     TEST_TYPE_SIZE   (IMAGE_COFF_SYMBOLS_HEADER, 32)
3988     TEST_TYPE_ALIGN  (IMAGE_COFF_SYMBOLS_HEADER, 4)
3989     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
3990     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
3991     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0)
3992     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
3993     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
3994     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
3995     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
3996     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
3997     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
3998     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
3999     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
4000     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
4001     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
4002     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
4003     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
4004     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
4005     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
4006     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
4007     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
4008     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
4009     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
4010     TEST_FIELD_SIZE  (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
4011     TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
4012     TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
4013 }
4014 
4015 static void test_pack_IMAGE_DATA_DIRECTORY(void)
4016 {
4017     /* IMAGE_DATA_DIRECTORY */
4018     TEST_TYPE_SIZE   (IMAGE_DATA_DIRECTORY, 8)
4019     TEST_TYPE_ALIGN  (IMAGE_DATA_DIRECTORY, 4)
4020     TEST_FIELD_SIZE  (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
4021     TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
4022     TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, VirtualAddress, 0)
4023     TEST_FIELD_SIZE  (IMAGE_DATA_DIRECTORY, Size, 4)
4024     TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, Size, 4)
4025     TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, Size, 4)
4026 }
4027 
4028 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
4029 {
4030     /* IMAGE_DEBUG_DIRECTORY */
4031     TEST_TYPE_SIZE   (IMAGE_DEBUG_DIRECTORY, 28)
4032     TEST_TYPE_ALIGN  (IMAGE_DEBUG_DIRECTORY, 4)
4033     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
4034     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
4035     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
4036     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4037     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4038     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4039     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
4040     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
4041     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MajorVersion, 8)
4042     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
4043     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
4044     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MinorVersion, 10)
4045     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, Type, 4)
4046     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Type, 4)
4047     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Type, 12)
4048     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
4049     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
4050     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, SizeOfData, 16)
4051     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
4052     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
4053     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
4054     TEST_FIELD_SIZE  (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
4055     TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
4056     TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
4057 }
4058 
4059 static void test_pack_IMAGE_DEBUG_MISC(void)
4060 {
4061     /* IMAGE_DEBUG_MISC */
4062     TEST_TYPE_SIZE   (IMAGE_DEBUG_MISC, 16)
4063     TEST_TYPE_ALIGN  (IMAGE_DEBUG_MISC, 4)
4064     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, DataType, 4)
4065     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, DataType, 4)
4066     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, DataType, 0)
4067     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Length, 4)
4068     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Length, 4)
4069     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Length, 4)
4070     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Unicode, 1)
4071     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
4072     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Unicode, 8)
4073     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Reserved, 3)
4074     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Reserved, 1)
4075     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Reserved, 9)
4076     TEST_FIELD_SIZE  (IMAGE_DEBUG_MISC, Data, 1)
4077     TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Data, 1)
4078     TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Data, 12)
4079 }
4080 
4081 static void test_pack_IMAGE_DOS_HEADER(void)
4082 {
4083     /* IMAGE_DOS_HEADER (pack 2) */
4084     TEST_TYPE_SIZE   (IMAGE_DOS_HEADER, 64)
4085     TEST_TYPE_ALIGN  (IMAGE_DOS_HEADER, 2)
4086     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_magic, 2)
4087     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_magic, 2)
4088     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_magic, 0)
4089     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cblp, 2)
4090     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2)
4091     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cblp, 2)
4092     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cp, 2)
4093     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cp, 2)
4094     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cp, 4)
4095     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_crlc, 2)
4096     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2)
4097     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_crlc, 6)
4098     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cparhdr, 2)
4099     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
4100     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8)
4101     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_minalloc, 2)
4102     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
4103     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
4104     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_maxalloc, 2)
4105     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
4106     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
4107     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ss, 2)
4108     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ss, 2)
4109     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ss, 14)
4110     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_sp, 2)
4111     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_sp, 2)
4112     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_sp, 16)
4113     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_csum, 2)
4114     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_csum, 2)
4115     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_csum, 18)
4116     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ip, 2)
4117     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ip, 2)
4118     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ip, 20)
4119     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_cs, 2)
4120     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cs, 2)
4121     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cs, 22)
4122     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_lfarlc, 2)
4123     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfarlc, 2)
4124     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfarlc, 24)
4125     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_ovno, 2)
4126     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ovno, 2)
4127     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ovno, 26)
4128     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_res, 8)
4129     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res, 2)
4130     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res, 28)
4131     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_oemid, 2)
4132     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oemid, 2)
4133     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oemid, 36)
4134     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_oeminfo, 2)
4135     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2)
4136     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38)
4137     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_res2, 20)
4138     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res2, 2)
4139     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res2, 40)
4140     TEST_FIELD_SIZE  (IMAGE_DOS_HEADER, e_lfanew, 4)
4141     TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfanew, 2)
4142     TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfanew, 60)
4143 }
4144 
4145 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
4146 {
4147     /* IMAGE_EXPORT_DIRECTORY */
4148     TEST_TYPE_SIZE   (IMAGE_EXPORT_DIRECTORY, 40)
4149     TEST_TYPE_ALIGN  (IMAGE_EXPORT_DIRECTORY, 4)
4150     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
4151     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
4152     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0)
4153     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
4154     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
4155     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
4156     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
4157     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
4158     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MajorVersion, 8)
4159     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
4160     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
4161     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MinorVersion, 10)
4162     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Name, 4)
4163     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Name, 4)
4164     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Name, 12)
4165     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, Base, 4)
4166     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Base, 4)
4167     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Base, 16)
4168     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
4169     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
4170     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20)
4171     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
4172     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
4173     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24)
4174     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
4175     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
4176     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28)
4177     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
4178     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
4179     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32)
4180     TEST_FIELD_SIZE  (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
4181     TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
4182     TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36)
4183 }
4184 
4185 static void test_pack_IMAGE_FILE_HEADER(void)
4186 {
4187     /* IMAGE_FILE_HEADER */
4188     TEST_TYPE_SIZE   (IMAGE_FILE_HEADER, 20)
4189     TEST_TYPE_ALIGN  (IMAGE_FILE_HEADER, 4)
4190     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, Machine, 2)
4191     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2)
4192     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Machine, 0)
4193     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, NumberOfSections, 2)
4194     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2)
4195     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2)
4196     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, TimeDateStamp, 4)
4197     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4)
4198     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4)
4199     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
4200     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
4201     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8)
4202     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
4203     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
4204     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12)
4205     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
4206     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
4207     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16)
4208     TEST_FIELD_SIZE  (IMAGE_FILE_HEADER, Characteristics, 2)
4209     TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2)
4210     TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18)
4211 }
4212 
4213 static void test_pack_IMAGE_FUNCTION_ENTRY(void)
4214 {
4215     /* IMAGE_FUNCTION_ENTRY */
4216     TEST_TYPE_SIZE   (IMAGE_FUNCTION_ENTRY, 12)
4217     TEST_TYPE_ALIGN  (IMAGE_FUNCTION_ENTRY, 4)
4218     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
4219     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
4220     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0)
4221     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
4222     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
4223     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
4224     TEST_FIELD_SIZE  (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
4225     TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
4226     TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8)
4227 }
4228 
4229 static void test_pack_IMAGE_IMPORT_BY_NAME(void)
4230 {
4231     /* IMAGE_IMPORT_BY_NAME */
4232     TEST_TYPE_SIZE   (IMAGE_IMPORT_BY_NAME, 4)
4233     TEST_TYPE_ALIGN  (IMAGE_IMPORT_BY_NAME, 2)
4234     TEST_FIELD_SIZE  (IMAGE_IMPORT_BY_NAME, Hint, 2)
4235     TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Hint, 2)
4236     TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Hint, 0)
4237     TEST_FIELD_SIZE  (IMAGE_IMPORT_BY_NAME, Name, 1)
4238     TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Name, 1)
4239     TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Name, 2)
4240 }
4241 
4242 static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
4243 {
4244     /* IMAGE_IMPORT_DESCRIPTOR */
4245 }
4246 
4247 static void test_pack_IMAGE_LINENUMBER(void)
4248 {
4249     /* IMAGE_LINENUMBER (pack 2) */
4250 }
4251 
4252 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void)
4253 {
4254     /* IMAGE_LOAD_CONFIG_DIRECTORY */
4255     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY, 72)
4256     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY, 4)
4257 }
4258 
4259 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(void)
4260 {
4261     /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
4262     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY32, 72)
4263     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY32, 4)
4264     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
4265     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
4266     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 0)
4267     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
4268     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
4269     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
4270     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
4271     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
4272     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 8)
4273     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
4274     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
4275     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 10)
4276     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
4277     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
4278     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12)
4279     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
4280     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
4281     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 16)
4282     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
4283     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
4284     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20)
4285     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
4286     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
4287     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24)
4288     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
4289     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
4290     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28)
4291     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 4)
4292     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 4)
4293     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 32)
4294     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
4295     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
4296     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 36)
4297     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
4298     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
4299     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 40)
4300     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
4301     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
4302     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 44)
4303     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
4304     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
4305     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 48)
4306     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
4307     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
4308     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 52)
4309     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
4310     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
4311     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 54)
4312     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 4)
4313     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 4)
4314     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 56)
4315     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
4316     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
4317     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 60)
4318     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
4319     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
4320     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 64)
4321     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
4322     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
4323     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 68)
4324 }
4325 
4326 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(void)
4327 {
4328     /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
4329     TEST_TYPE_SIZE   (IMAGE_LOAD_CONFIG_DIRECTORY64, 112)
4330     TEST_TYPE_ALIGN  (IMAGE_LOAD_CONFIG_DIRECTORY64, 8)
4331     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
4332     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
4333     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 0)
4334     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
4335     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
4336     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
4337     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
4338     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
4339     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 8)
4340     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
4341     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
4342     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 10)
4343     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
4344     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
4345     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12)
4346     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
4347     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
4348     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 16)
4349     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
4350     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
4351     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20)
4352     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
4353     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
4354     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24)
4355     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
4356     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
4357     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32)
4358     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
4359     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
4360     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 40)
4361     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
4362     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
4363     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48)
4364     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
4365     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
4366     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56)
4367     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
4368     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
4369     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 64)
4370     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
4371     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
4372     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72)
4373     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
4374     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
4375     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 76)
4376     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
4377     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
4378     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 78)
4379     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
4380     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
4381     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 80)
4382     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
4383     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
4384     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 88)
4385     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
4386     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
4387     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 96)
4388     TEST_FIELD_SIZE  (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
4389     TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
4390     TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 104)
4391 }
4392 
4393 static void test_pack_IMAGE_NT_HEADERS(void)
4394 {
4395     /* IMAGE_NT_HEADERS */
4396     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS, 248)
4397     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS, 4)
4398 }
4399 
4400 static void test_pack_IMAGE_NT_HEADERS32(void)
4401 {
4402     /* IMAGE_NT_HEADERS32 */
4403     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS32, 248)
4404     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS32, 4)
4405     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, Signature, 4)
4406     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, Signature, 4)
4407     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, Signature, 0)
4408     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, FileHeader, 20)
4409     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, FileHeader, 4)
4410     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, FileHeader, 4)
4411     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS32, OptionalHeader, 224)
4412     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, OptionalHeader, 4)
4413     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader, 24)
4414 }
4415 
4416 static void test_pack_IMAGE_NT_HEADERS64(void)
4417 {
4418     /* IMAGE_NT_HEADERS64 */
4419     TEST_TYPE_SIZE   (IMAGE_NT_HEADERS64, 264)
4420     TEST_TYPE_ALIGN  (IMAGE_NT_HEADERS64, 8)
4421     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, Signature, 4)
4422     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, Signature, 4)
4423     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, Signature, 0)
4424     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, FileHeader, 20)
4425     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, FileHeader, 4)
4426     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, FileHeader, 4)
4427     TEST_FIELD_SIZE  (IMAGE_NT_HEADERS64, OptionalHeader, 240)
4428     TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, OptionalHeader, 8)
4429     TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader, 24)
4430 }
4431 
4432 static void test_pack_IMAGE_OPTIONAL_HEADER(void)
4433 {
4434     /* IMAGE_OPTIONAL_HEADER */
4435     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER, 224)
4436     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER, 4)
4437 }
4438 
4439 static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
4440 {
4441     /* IMAGE_OPTIONAL_HEADER32 */
4442     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER32, 224)
4443     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER32, 4)
4444     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Magic, 2)
4445     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Magic, 2)
4446     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Magic, 0)
4447     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
4448     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
4449     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 2)
4450     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
4451     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
4452     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 3)
4453     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
4454     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
4455     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
4456     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
4457     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
4458     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 8)
4459     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
4460     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
4461     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 12)
4462     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
4463     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
4464     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 16)
4465     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
4466     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
4467     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfCode, 20)
4468     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
4469     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
4470     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfData, 24)
4471     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
4472     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
4473     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, ImageBase, 28)
4474     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
4475     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
4476     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SectionAlignment, 32)
4477     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
4478     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
4479     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, FileAlignment, 36)
4480     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
4481     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
4482     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 40)
4483     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
4484     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
4485     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 42)
4486     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
4487     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
4488     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 44)
4489     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
4490     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
4491     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 46)
4492     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
4493     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
4494     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 48)
4495     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
4496     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
4497     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 50)
4498     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
4499     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
4500     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 52)
4501     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
4502     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
4503     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfImage, 56)
4504     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
4505     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
4506     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 60)
4507     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
4508     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
4509     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, CheckSum, 64)
4510     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
4511     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
4512     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Subsystem, 68)
4513     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
4514     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
4515     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 70)
4516     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
4517     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
4518     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 72)
4519     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
4520     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
4521     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 76)
4522     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
4523     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
4524     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 80)
4525     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
4526     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
4527     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 84)
4528     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
4529     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
4530     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, LoaderFlags, 88)
4531     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
4532     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
4533     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 92)
4534     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER32, DataDirectory, 128)
4535     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DataDirectory, 4)
4536     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DataDirectory, 96)
4537 }
4538 
4539 static void test_pack_IMAGE_OPTIONAL_HEADER64(void)
4540 {
4541     /* IMAGE_OPTIONAL_HEADER64 */
4542     TEST_TYPE_SIZE   (IMAGE_OPTIONAL_HEADER64, 240)
4543     TEST_TYPE_ALIGN  (IMAGE_OPTIONAL_HEADER64, 8)
4544     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Magic, 2)
4545     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Magic, 2)
4546     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Magic, 0)
4547     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
4548     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
4549     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 2)
4550     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
4551     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
4552     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 3)
4553     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
4554     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
4555     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
4556     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
4557     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
4558     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 8)
4559     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
4560     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
4561     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 12)
4562     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
4563     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
4564     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 16)
4565     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
4566     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
4567     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, BaseOfCode, 20)
4568     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
4569     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
4570     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, ImageBase, 24)
4571     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
4572     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
4573     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SectionAlignment, 32)
4574     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
4575     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
4576     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, FileAlignment, 36)
4577     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
4578     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
4579     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 40)
4580     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
4581     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
4582     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 42)
4583     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
4584     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
4585     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 44)
4586     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
4587     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
4588     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 46)
4589     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
4590     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
4591     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 48)
4592     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
4593     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
4594     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 50)
4595     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
4596     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
4597     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 52)
4598     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
4599     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
4600     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfImage, 56)
4601     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
4602     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
4603     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 60)
4604     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
4605     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
4606     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, CheckSum, 64)
4607     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
4608     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
4609     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Subsystem, 68)
4610     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
4611     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
4612     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 70)
4613     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
4614     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
4615     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 72)
4616     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
4617     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
4618     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 80)
4619     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
4620     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
4621     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 88)
4622     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
4623     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
4624     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 96)
4625     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
4626     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
4627     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, LoaderFlags, 104)
4628     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
4629     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
4630     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 108)
4631     TEST_FIELD_SIZE  (IMAGE_OPTIONAL_HEADER64, DataDirectory, 128)
4632     TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DataDirectory, 4)
4633     TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DataDirectory, 112)
4634 }
4635 
4636 static void test_pack_IMAGE_OS2_HEADER(void)
4637 {
4638     /* IMAGE_OS2_HEADER (pack 2) */
4639     TEST_TYPE_SIZE   (IMAGE_OS2_HEADER, 64)
4640     TEST_TYPE_ALIGN  (IMAGE_OS2_HEADER, 2)
4641     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_magic, 2)
4642     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2)
4643     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_magic, 0)
4644     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_ver, 1)
4645     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_ver, 1)
4646     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_ver, 2)
4647     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_rev, 1)
4648     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1)
4649     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rev, 3)
4650     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_enttab, 2)
4651     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2)
4652     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4)
4653     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cbenttab, 2)
4654     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2)
4655     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6)
4656     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_crc, 4)
4657     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_crc, 2)
4658     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_crc, 8)
4659     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_flags, 2)
4660     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2)
4661     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12)
4662     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_autodata, 2)
4663     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2)
4664     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14)
4665     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_heap, 2)
4666     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_heap, 2)
4667     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_heap, 16)
4668     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_stack, 2)
4669     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2)
4670     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18)
4671     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_csip, 4)
4672     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_csip, 2)
4673     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_csip, 20)
4674     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_sssp, 4)
4675     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_sssp, 2)
4676     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_sssp, 24)
4677     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cseg, 2)
4678     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cseg, 2)
4679     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cseg, 28)
4680     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cmod, 2)
4681     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmod, 2)
4682     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmod, 30)
4683     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
4684     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
4685     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32)
4686     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_segtab, 2)
4687     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2)
4688     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34)
4689     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_rsrctab, 2)
4690     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2)
4691     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36)
4692     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_restab, 2)
4693     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2)
4694     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38)
4695     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_modtab, 2)
4696     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2)
4697     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40)
4698     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_imptab, 2)
4699     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2)
4700     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42)
4701     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_nrestab, 4)
4702     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2)
4703     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44)
4704     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cmovent, 2)
4705     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2)
4706     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48)
4707     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_align, 2)
4708     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2)
4709     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50)
4710     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_cres, 2)
4711     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cres, 2)
4712     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cres, 52)
4713     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_exetyp, 1)
4714     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1)
4715     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54)
4716     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_flagsothers, 1)
4717     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1)
4718     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55)
4719     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_pretthunks, 2)
4720     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2)
4721     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56)
4722     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
4723     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
4724     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58)
4725     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_swaparea, 2)
4726     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2)
4727     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60)
4728     TEST_FIELD_SIZE  (IMAGE_OS2_HEADER, ne_expver, 2)
4729     TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2)
4730     TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62)
4731 }
4732 
4733 static void test_pack_IMAGE_RELOCATION(void)
4734 {
4735     /* IMAGE_RELOCATION (pack 2) */
4736 }
4737 
4738 static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void)
4739 {
4740     /* IMAGE_RESOURCE_DATA_ENTRY */
4741     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DATA_ENTRY, 16)
4742     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DATA_ENTRY, 4)
4743     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
4744     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
4745     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 0)
4746     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
4747     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
4748     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
4749     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
4750     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
4751     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, CodePage, 8)
4752     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
4753     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
4754     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Reserved, 12)
4755 }
4756 
4757 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
4758 {
4759     /* IMAGE_RESOURCE_DIRECTORY */
4760     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIRECTORY, 16)
4761     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIRECTORY, 4)
4762     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
4763     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
4764     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0)
4765     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
4766     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
4767     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
4768     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
4769     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
4770     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MajorVersion, 8)
4771     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
4772     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
4773     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MinorVersion, 10)
4774     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
4775     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
4776     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12)
4777     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
4778     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
4779     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14)
4780 }
4781 
4782 static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void)
4783 {
4784     /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
4785 }
4786 
4787 static void test_pack_IMAGE_RESOURCE_DIRECTORY_STRING(void)
4788 {
4789     /* IMAGE_RESOURCE_DIRECTORY_STRING */
4790     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIRECTORY_STRING, 4)
4791     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIRECTORY_STRING, 2)
4792     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
4793     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
4794     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, Length, 0)
4795     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
4796     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
4797     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 2)
4798 }
4799 
4800 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
4801 {
4802     /* IMAGE_RESOURCE_DIR_STRING_U */
4803     TEST_TYPE_SIZE   (IMAGE_RESOURCE_DIR_STRING_U, 4)
4804     TEST_TYPE_ALIGN  (IMAGE_RESOURCE_DIR_STRING_U, 2)
4805     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
4806     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
4807     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, Length, 0)
4808     TEST_FIELD_SIZE  (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
4809     TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
4810     TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
4811 }
4812 
4813 static void test_pack_IMAGE_SECTION_HEADER(void)
4814 {
4815     /* IMAGE_SECTION_HEADER */
4816     TEST_FIELD_SIZE  (IMAGE_SECTION_HEADER, Name, 8)
4817     TEST_FIELD_ALIGN (IMAGE_SECTION_HEADER, Name, 1)
4818     TEST_FIELD_OFFSET(IMAGE_SECTION_HEADER, Name, 0)
4819 }
4820 
4821 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
4822 {
4823     /* IMAGE_SEPARATE_DEBUG_HEADER */
4824     TEST_TYPE_SIZE   (IMAGE_SEPARATE_DEBUG_HEADER, 48)
4825     TEST_TYPE_ALIGN  (IMAGE_SEPARATE_DEBUG_HEADER, 4)
4826     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
4827     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
4828     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Signature, 0)
4829     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
4830     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
4831     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
4832     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
4833     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
4834     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Machine, 4)
4835     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
4836     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
4837     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 6)
4838     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
4839     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
4840     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 8)
4841     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
4842     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
4843     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 12)
4844     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
4845     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
4846     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 16)
4847     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
4848     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
4849     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 20)
4850     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
4851     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
4852     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24)
4853     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
4854     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
4855     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28)
4856     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
4857     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
4858     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32)
4859     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
4860     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
4861     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36)
4862     TEST_FIELD_SIZE  (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 8)
4863     TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 4)
4864     TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 40)
4865 }
4866 
4867 static void test_pack_IMAGE_SYMBOL(void)
4868 {
4869     /* IMAGE_SYMBOL (pack 2) */
4870 }
4871 
4872 static void test_pack_IMAGE_THUNK_DATA(void)
4873 {
4874     /* IMAGE_THUNK_DATA */
4875 }
4876 
4877 static void test_pack_IMAGE_TLS_DIRECTORY(void)
4878 {
4879     /* IMAGE_TLS_DIRECTORY */
4880     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY, 24)
4881     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY, 4)
4882 }
4883 
4884 static void test_pack_IMAGE_TLS_DIRECTORY32(void)
4885 {
4886     /* IMAGE_TLS_DIRECTORY32 */
4887     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY32, 24)
4888     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY32, 4)
4889     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
4890     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
4891     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 0)
4892     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
4893     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
4894     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
4895     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
4896     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
4897     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfIndex, 8)
4898     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
4899     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
4900     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 12)
4901     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
4902     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
4903     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 16)
4904     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
4905     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
4906     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, Characteristics, 20)
4907 }
4908 
4909 static void test_pack_IMAGE_TLS_DIRECTORY64(void)
4910 {
4911     /* IMAGE_TLS_DIRECTORY64 */
4912     TEST_TYPE_SIZE   (IMAGE_TLS_DIRECTORY64, 40)
4913     TEST_TYPE_ALIGN  (IMAGE_TLS_DIRECTORY64, 8)
4914     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
4915     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
4916     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 0)
4917     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
4918     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
4919     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
4920     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
4921     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
4922     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfIndex, 16)
4923     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
4924     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
4925     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 24)
4926     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
4927     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
4928     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 32)
4929     TEST_FIELD_SIZE  (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
4930     TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
4931     TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, Characteristics, 36)
4932 }
4933 
4934 static void test_pack_IMAGE_VXD_HEADER(void)
4935 {
4936     /* IMAGE_VXD_HEADER (pack 2) */
4937     TEST_TYPE_SIZE   (IMAGE_VXD_HEADER, 196)
4938     TEST_TYPE_ALIGN  (IMAGE_VXD_HEADER, 2)
4939     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_magic, 2)
4940     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2)
4941     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0)
4942     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_border, 1)
4943     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1)
4944     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2)
4945     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_worder, 1)
4946     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1)
4947     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3)
4948     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_level, 4)
4949     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2)
4950     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4)
4951     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_cpu, 2)
4952     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cpu, 2)
4953     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cpu, 8)
4954     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_os, 2)
4955     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_os, 2)
4956     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_os, 10)
4957     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ver, 4)
4958     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ver, 2)
4959     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ver, 12)
4960     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_mflags, 4)
4961     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2)
4962     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16)
4963     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_mpages, 4)
4964     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2)
4965     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20)
4966     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_startobj, 4)
4967     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2)
4968     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24)
4969     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_eip, 4)
4970     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_eip, 2)
4971     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_eip, 28)
4972     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_stackobj, 4)
4973     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2)
4974     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32)
4975     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_esp, 4)
4976     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_esp, 2)
4977     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_esp, 36)
4978     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_pagesize, 4)
4979     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2)
4980     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40)
4981     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_lastpagesize, 4)
4982     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2)
4983     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44)
4984     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fixupsize, 4)
4985     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2)
4986     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48)
4987     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fixupsum, 4)
4988     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2)
4989     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52)
4990     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ldrsize, 4)
4991     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2)
4992     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56)
4993     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ldrsum, 4)
4994     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2)
4995     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60)
4996     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objtab, 4)
4997     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2)
4998     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64)
4999     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objcnt, 4)
5000     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2)
5001     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68)
5002     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_objmap, 4)
5003     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2)
5004     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72)
5005     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_itermap, 4)
5006     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2)
5007     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76)
5008     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_rsrctab, 4)
5009     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2)
5010     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80)
5011     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_rsrccnt, 4)
5012     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2)
5013     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84)
5014     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_restab, 4)
5015     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2)
5016     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88)
5017     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_enttab, 4)
5018     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2)
5019     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92)
5020     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_dirtab, 4)
5021     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2)
5022     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96)
5023     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_dircnt, 4)
5024     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2)
5025     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100)
5026     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_fpagetab, 4)
5027     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2)
5028     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104)
5029     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_frectab, 4)
5030     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2)
5031     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108)
5032     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impmod, 4)
5033     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2)
5034     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112)
5035     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impmodcnt, 4)
5036     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2)
5037     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116)
5038     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_impproc, 4)
5039     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2)
5040     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120)
5041     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_pagesum, 4)
5042     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2)
5043     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124)
5044     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_datapage, 4)
5045     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2)
5046     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128)
5047     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_preload, 4)
5048     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2)
5049     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132)
5050     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_nrestab, 4)
5051     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2)
5052     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136)
5053     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_cbnrestab, 4)
5054     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2)
5055     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140)
5056     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_nressum, 4)
5057     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2)
5058     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144)
5059     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_autodata, 4)
5060     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2)
5061     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148)
5062     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_debuginfo, 4)
5063     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2)
5064     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152)
5065     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_debuglen, 4)
5066     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2)
5067     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156)
5068     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_instpreload, 4)
5069     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2)
5070     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160)
5071     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_instdemand, 4)
5072     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2)
5073     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164)
5074     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_heapsize, 4)
5075     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2)
5076     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168)
5077     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_res3, 12)
5078     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1)
5079     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172)
5080     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_winresoff, 4)
5081     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2)
5082     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184)
5083     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_winreslen, 4)
5084     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2)
5085     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188)
5086     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_devid, 2)
5087     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2)
5088     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192)
5089     TEST_FIELD_SIZE  (IMAGE_VXD_HEADER, e32_ddkver, 2)
5090     TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2)
5091     TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194)
5092 }
5093 
5094 static void test_pack_IO_COUNTERS(void)
5095 {
5096     /* IO_COUNTERS (pack 8) */
5097     TEST_TYPE_SIZE   (IO_COUNTERS, 48)
5098     TEST_TYPE_ALIGN  (IO_COUNTERS, 8)
5099     TEST_FIELD_SIZE  (IO_COUNTERS, ReadOperationCount, 8)
5100     TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8)
5101     TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0)
5102     TEST_FIELD_SIZE  (IO_COUNTERS, WriteOperationCount, 8)
5103     TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8)
5104     TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8)
5105     TEST_FIELD_SIZE  (IO_COUNTERS, OtherOperationCount, 8)
5106     TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8)
5107     TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16)
5108     TEST_FIELD_SIZE  (IO_COUNTERS, ReadTransferCount, 8)
5109     TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8)
5110     TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24)
5111     TEST_FIELD_SIZE  (IO_COUNTERS, WriteTransferCount, 8)
5112     TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8)
5113     TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32)
5114     TEST_FIELD_SIZE  (IO_COUNTERS, OtherTransferCount, 8)
5115     TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8)
5116     TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40)
5117 }
5118 
5119 static void test_pack_LANGID(void)
5120 {
5121     /* LANGID */
5122     TEST_TYPE_SIZE   (LANGID, 2)
5123     TEST_TYPE_ALIGN  (LANGID, 2)
5124     TEST_TYPE_UNSIGNED(LANGID)
5125 }
5126 
5127 static void test_pack_LARGE_INTEGER(void)
5128 {
5129     /* LARGE_INTEGER */
5130 }
5131 
5132 static void test_pack_LCID(void)
5133 {
5134     /* LCID */
5135     TEST_TYPE_SIZE   (LCID, 4)
5136     TEST_TYPE_ALIGN  (LCID, 4)
5137     TEST_TYPE_UNSIGNED(LCID)
5138 }
5139 
5140 static void test_pack_LIST_ENTRY(void)
5141 {
5142     /* LIST_ENTRY */
5143     TEST_TYPE_SIZE   (LIST_ENTRY, 8)
5144     TEST_TYPE_ALIGN  (LIST_ENTRY, 4)
5145     TEST_FIELD_SIZE  (LIST_ENTRY, Flink, 4)
5146     TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 4)
5147     TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0)
5148     TEST_FIELD_SIZE  (LIST_ENTRY, Blink, 4)
5149     TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 4)
5150     TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 4)
5151 }
5152 
5153 static void test_pack_LONG(void)
5154 {
5155     /* LONG */
5156     TEST_TYPE_SIZE   (LONG, 4)
5157     TEST_TYPE_ALIGN  (LONG, 4)
5158     TEST_TYPE_SIGNED(LONG)
5159 }
5160 
5161 static void test_pack_LONGLONG(void)
5162 {
5163     /* LONGLONG */
5164     TEST_TYPE_SIZE   (LONGLONG, 8)
5165     TEST_TYPE_ALIGN  (LONGLONG, 8)
5166     TEST_TYPE_SIGNED(LONGLONG)
5167 }
5168 
5169 static void test_pack_LUID(void)
5170 {
5171     /* LUID */
5172     TEST_TYPE_SIZE   (LUID, 8)
5173     TEST_TYPE_ALIGN  (LUID, 4)
5174     TEST_FIELD_SIZE  (LUID, LowPart, 4)
5175     TEST_FIELD_ALIGN (LUID, LowPart, 4)
5176     TEST_FIELD_OFFSET(LUID, LowPart, 0)
5177     TEST_FIELD_SIZE  (LUID, HighPart, 4)
5178     TEST_FIELD_ALIGN (LUID, HighPart, 4)
5179     TEST_FIELD_OFFSET(LUID, HighPart, 4)
5180 }
5181 
5182 static void test_pack_LUID_AND_ATTRIBUTES(void)
5183 {
5184     /* LUID_AND_ATTRIBUTES (pack 4) */
5185     TEST_TYPE_SIZE   (LUID_AND_ATTRIBUTES, 12)
5186     TEST_TYPE_ALIGN  (LUID_AND_ATTRIBUTES, 4)
5187     TEST_FIELD_SIZE  (LUID_AND_ATTRIBUTES, Luid, 8)
5188     TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Luid, 4)
5189     TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Luid, 0)
5190     TEST_FIELD_SIZE  (LUID_AND_ATTRIBUTES, Attributes, 4)
5191     TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Attributes, 4)
5192     TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Attributes, 8)
5193 }
5194 
5195 static void test_pack_MEMORY_BASIC_INFORMATION(void)
5196 {
5197     /* MEMORY_BASIC_INFORMATION */
5198     TEST_TYPE_SIZE   (MEMORY_BASIC_INFORMATION, 28)
5199     TEST_TYPE_ALIGN  (MEMORY_BASIC_INFORMATION, 4)
5200     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, BaseAddress, 4)
5201     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, BaseAddress, 4)
5202     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, BaseAddress, 0)
5203     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, AllocationBase, 4)
5204     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 4)
5205     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationBase, 4)
5206     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
5207     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
5208     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 8)
5209     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, RegionSize, 4)
5210     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, RegionSize, 4)
5211     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, RegionSize, 12)
5212     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, State, 4)
5213     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, State, 4)
5214     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, State, 16)
5215     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, Protect, 4)
5216     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Protect, 4)
5217     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Protect, 20)
5218     TEST_FIELD_SIZE  (MEMORY_BASIC_INFORMATION, Type, 4)
5219     TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Type, 4)
5220     TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Type, 24)
5221 }
5222 
5223 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
5224 {
5225     /* MESSAGE_RESOURCE_BLOCK */
5226     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_BLOCK, 12)
5227     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_BLOCK, 4)
5228     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, LowId, 4)
5229     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, LowId, 4)
5230     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, LowId, 0)
5231     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, HighId, 4)
5232     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, HighId, 4)
5233     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, HighId, 4)
5234     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
5235     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
5236     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8)
5237 }
5238 
5239 static void test_pack_MESSAGE_RESOURCE_DATA(void)
5240 {
5241     /* MESSAGE_RESOURCE_DATA */
5242     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_DATA, 16)
5243     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_DATA, 4)
5244     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
5245     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
5246     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0)
5247     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_DATA, Blocks, 12)
5248     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, Blocks, 4)
5249     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, Blocks, 4)
5250 }
5251 
5252 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
5253 {
5254     /* MESSAGE_RESOURCE_ENTRY */
5255     TEST_TYPE_SIZE   (MESSAGE_RESOURCE_ENTRY, 6)
5256     TEST_TYPE_ALIGN  (MESSAGE_RESOURCE_ENTRY, 2)
5257     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Length, 2)
5258     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Length, 2)
5259     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Length, 0)
5260     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Flags, 2)
5261     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Flags, 2)
5262     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Flags, 2)
5263     TEST_FIELD_SIZE  (MESSAGE_RESOURCE_ENTRY, Text, 1)
5264     TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Text, 1)
5265     TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Text, 4)
5266 }
5267 
5268 static void test_pack_NT_TIB(void)
5269 {
5270     /* NT_TIB */
5271     TEST_FIELD_SIZE  (NT_TIB, ExceptionList, 4)
5272     TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 4)
5273     TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0)
5274     TEST_FIELD_SIZE  (NT_TIB, StackBase, 4)
5275     TEST_FIELD_ALIGN (NT_TIB, StackBase, 4)
5276     TEST_FIELD_OFFSET(NT_TIB, StackBase, 4)
5277     TEST_FIELD_SIZE  (NT_TIB, StackLimit, 4)
5278     TEST_FIELD_ALIGN (NT_TIB, StackLimit, 4)
5279     TEST_FIELD_OFFSET(NT_TIB, StackLimit, 8)
5280     TEST_FIELD_SIZE  (NT_TIB, SubSystemTib, 4)
5281     TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 4)
5282     TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 12)
5283 }
5284 
5285 static void test_pack_OBJECT_TYPE_LIST(void)
5286 {
5287     /* OBJECT_TYPE_LIST */
5288     TEST_TYPE_SIZE   (OBJECT_TYPE_LIST, 8)
5289     TEST_TYPE_ALIGN  (OBJECT_TYPE_LIST, 4)
5290     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, Level, 2)
5291     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Level, 2)
5292     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Level, 0)
5293     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, Sbz, 2)
5294     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Sbz, 2)
5295     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Sbz, 2)
5296     TEST_FIELD_SIZE  (OBJECT_TYPE_LIST, ObjectType, 4)
5297     TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, ObjectType, 4)
5298     TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, ObjectType, 4)
5299 }
5300 
5301 static void test_pack_PACCESS_ALLOWED_ACE(void)
5302 {
5303     /* PACCESS_ALLOWED_ACE */
5304     TEST_TYPE_SIZE   (PACCESS_ALLOWED_ACE, 4)
5305     TEST_TYPE_ALIGN  (PACCESS_ALLOWED_ACE, 4)
5306     TEST_TARGET_SIZE (PACCESS_ALLOWED_ACE, 12)
5307     TEST_TARGET_ALIGN(PACCESS_ALLOWED_ACE, 4)
5308 }
5309 
5310 static void test_pack_PACCESS_DENIED_ACE(void)
5311 {
5312     /* PACCESS_DENIED_ACE */
5313     TEST_TYPE_SIZE   (PACCESS_DENIED_ACE, 4)
5314     TEST_TYPE_ALIGN  (PACCESS_DENIED_ACE, 4)
5315     TEST_TARGET_SIZE (PACCESS_DENIED_ACE, 12)
5316     TEST_TARGET_ALIGN(PACCESS_DENIED_ACE, 4)
5317 }
5318 
5319 static void test_pack_PACCESS_TOKEN(void)
5320 {
5321     /* PACCESS_TOKEN */
5322     TEST_TYPE_SIZE   (PACCESS_TOKEN, 4)
5323     TEST_TYPE_ALIGN  (PACCESS_TOKEN, 4)
5324 }
5325 
5326 static void test_pack_PACE_HEADER(void)
5327 {
5328     /* PACE_HEADER */
5329     TEST_TYPE_SIZE   (PACE_HEADER, 4)
5330     TEST_TYPE_ALIGN  (PACE_HEADER, 4)
5331     TEST_TARGET_SIZE (PACE_HEADER, 4)
5332     TEST_TARGET_ALIGN(PACE_HEADER, 2)
5333 }
5334 
5335 static void test_pack_PACL(void)
5336 {
5337     /* PACL */
5338     TEST_TYPE_SIZE   (PACL, 4)
5339     TEST_TYPE_ALIGN  (PACL, 4)
5340     TEST_TARGET_SIZE (PACL, 8)
5341     TEST_TARGET_ALIGN(PACL, 2)
5342 }
5343 
5344 static void test_pack_PACL_REVISION_INFORMATION(void)
5345 {
5346     /* PACL_REVISION_INFORMATION */
5347     TEST_TYPE_SIZE   (PACL_REVISION_INFORMATION, 4)
5348     TEST_TYPE_ALIGN  (PACL_REVISION_INFORMATION, 4)
5349     TEST_TARGET_SIZE (PACL_REVISION_INFORMATION, 4)
5350     TEST_TARGET_ALIGN(PACL_REVISION_INFORMATION, 4)
5351 }
5352 
5353 static void test_pack_PACL_SIZE_INFORMATION(void)
5354 {
5355     /* PACL_SIZE_INFORMATION */
5356     TEST_TYPE_SIZE   (PACL_SIZE_INFORMATION, 4)
5357     TEST_TYPE_ALIGN  (PACL_SIZE_INFORMATION, 4)
5358     TEST_TARGET_SIZE (PACL_SIZE_INFORMATION, 12)
5359     TEST_TARGET_ALIGN(PACL_SIZE_INFORMATION, 4)
5360 }
5361 
5362 static void test_pack_PCCH(void)
5363 {
5364     /* PCCH */
5365     TEST_TYPE_SIZE   (PCCH, 4)
5366     TEST_TYPE_ALIGN  (PCCH, 4)
5367     TEST_TARGET_SIZE (PCCH, 1)
5368     TEST_TARGET_ALIGN(PCCH, 1)
5369 }
5370 
5371 static void test_pack_PCH(void)
5372 {
5373     /* PCH */
5374     TEST_TYPE_SIZE   (PCH, 4)
5375     TEST_TYPE_ALIGN  (PCH, 4)
5376     TEST_TARGET_SIZE (PCH, 1)
5377     TEST_TARGET_ALIGN(PCH, 1)
5378 }
5379 
5380 static void test_pack_PCSTR(void)
5381 {
5382     /* PCSTR */
5383     TEST_TYPE_SIZE   (PCSTR, 4)
5384     TEST_TYPE_ALIGN  (PCSTR, 4)
5385     TEST_TARGET_SIZE (PCSTR, 1)
5386     TEST_TARGET_ALIGN(PCSTR, 1)
5387 }
5388 
5389 static void test_pack_PCWCH(void)
5390 {
5391     /* PCWCH */
5392     TEST_TYPE_SIZE   (PCWCH, 4)
5393     TEST_TYPE_ALIGN  (PCWCH, 4)
5394     TEST_TARGET_SIZE (PCWCH, 2)
5395     TEST_TARGET_ALIGN(PCWCH, 2)
5396 }
5397 
5398 static void test_pack_PCWSTR(void)
5399 {
5400     /* PCWSTR */
5401     TEST_TYPE_SIZE   (PCWSTR, 4)
5402     TEST_TYPE_ALIGN  (PCWSTR, 4)
5403     TEST_TARGET_SIZE (PCWSTR, 2)
5404     TEST_TARGET_ALIGN(PCWSTR, 2)
5405 }
5406 
5407 static void test_pack_PEXCEPTION_POINTERS(void)
5408 {
5409     /* PEXCEPTION_POINTERS */
5410     TEST_TYPE_SIZE   (PEXCEPTION_POINTERS, 4)
5411     TEST_TYPE_ALIGN  (PEXCEPTION_POINTERS, 4)
5412     TEST_TARGET_SIZE (PEXCEPTION_POINTERS, 8)
5413     TEST_TARGET_ALIGN(PEXCEPTION_POINTERS, 4)
5414 }
5415 
5416 static void test_pack_PEXCEPTION_RECORD(void)
5417 {
5418     /* PEXCEPTION_RECORD */
5419     TEST_TYPE_SIZE   (PEXCEPTION_RECORD, 4)
5420     TEST_TYPE_ALIGN  (PEXCEPTION_RECORD, 4)
5421     TEST_TARGET_SIZE (PEXCEPTION_RECORD, 80)
5422     TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 4)
5423 }
5424 
5425 static void test_pack_PFPO_DATA(void)
5426 {
5427     /* PFPO_DATA */
5428     TEST_TYPE_SIZE   (PFPO_DATA, 4)
5429     TEST_TYPE_ALIGN  (PFPO_DATA, 4)
5430     TEST_TARGET_SIZE (PFPO_DATA, 16)
5431     TEST_TARGET_ALIGN(PFPO_DATA, 4)
5432 }
5433 
5434 static void test_pack_PGENERIC_MAPPING(void)
5435 {
5436     /* PGENERIC_MAPPING */
5437     TEST_TYPE_SIZE   (PGENERIC_MAPPING, 4)
5438     TEST_TYPE_ALIGN  (PGENERIC_MAPPING, 4)
5439     TEST_TARGET_SIZE (PGENERIC_MAPPING, 16)
5440     TEST_TARGET_ALIGN(PGENERIC_MAPPING, 4)
5441 }
5442 
5443 static void test_pack_PHANDLE(void)
5444 {
5445     /* PHANDLE */
5446     TEST_TYPE_SIZE   (PHANDLE, 4)
5447     TEST_TYPE_ALIGN  (PHANDLE, 4)
5448     TEST_TARGET_SIZE (PHANDLE, 4)
5449     TEST_TARGET_ALIGN(PHANDLE, 4)
5450 }
5451 
5452 static void test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER(void)
5453 {
5454     /* PIMAGE_ARCHIVE_MEMBER_HEADER */
5455     TEST_TYPE_SIZE   (PIMAGE_ARCHIVE_MEMBER_HEADER, 4)
5456     TEST_TYPE_ALIGN  (PIMAGE_ARCHIVE_MEMBER_HEADER, 4)
5457     TEST_TARGET_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 60)
5458     TEST_TARGET_ALIGN(PIMAGE_ARCHIVE_MEMBER_HEADER, 1)
5459 }
5460 
5461 static void test_pack_PIMAGE_AUX_SYMBOL(void)
5462 {
5463     /* PIMAGE_AUX_SYMBOL */
5464     TEST_TYPE_SIZE   (PIMAGE_AUX_SYMBOL, 4)
5465     TEST_TYPE_ALIGN  (PIMAGE_AUX_SYMBOL, 4)
5466 }
5467 
5468 static void test_pack_PIMAGE_BASE_RELOCATION(void)
5469 {
5470     /* PIMAGE_BASE_RELOCATION */
5471     TEST_TYPE_SIZE   (PIMAGE_BASE_RELOCATION, 4)
5472     TEST_TYPE_ALIGN  (PIMAGE_BASE_RELOCATION, 4)
5473     TEST_TARGET_SIZE (PIMAGE_BASE_RELOCATION, 8)
5474     TEST_TARGET_ALIGN(PIMAGE_BASE_RELOCATION, 4)
5475 }
5476 
5477 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
5478 {
5479     /* PIMAGE_BOUND_FORWARDER_REF */
5480     TEST_TYPE_SIZE   (PIMAGE_BOUND_FORWARDER_REF, 4)
5481     TEST_TYPE_ALIGN  (PIMAGE_BOUND_FORWARDER_REF, 4)
5482     TEST_TARGET_SIZE (PIMAGE_BOUND_FORWARDER_REF, 8)
5483     TEST_TARGET_ALIGN(PIMAGE_BOUND_FORWARDER_REF, 4)
5484 }
5485 
5486 static void test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR(void)
5487 {
5488     /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
5489     TEST_TYPE_SIZE   (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
5490     TEST_TYPE_ALIGN  (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
5491     TEST_TARGET_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
5492     TEST_TARGET_ALIGN(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
5493 }
5494 
5495 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
5496 {
5497     /* PIMAGE_COFF_SYMBOLS_HEADER */
5498     TEST_TYPE_SIZE   (PIMAGE_COFF_SYMBOLS_HEADER, 4)
5499     TEST_TYPE_ALIGN  (PIMAGE_COFF_SYMBOLS_HEADER, 4)
5500     TEST_TARGET_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 32)
5501     TEST_TARGET_ALIGN(PIMAGE_COFF_SYMBOLS_HEADER, 4)
5502 }
5503 
5504 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
5505 {
5506     /* PIMAGE_DATA_DIRECTORY */
5507     TEST_TYPE_SIZE   (PIMAGE_DATA_DIRECTORY, 4)
5508     TEST_TYPE_ALIGN  (PIMAGE_DATA_DIRECTORY, 4)
5509     TEST_TARGET_SIZE (PIMAGE_DATA_DIRECTORY, 8)
5510     TEST_TARGET_ALIGN(PIMAGE_DATA_DIRECTORY, 4)
5511 }
5512 
5513 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
5514 {
5515     /* PIMAGE_DEBUG_DIRECTORY */
5516     TEST_TYPE_SIZE   (PIMAGE_DEBUG_DIRECTORY, 4)
5517     TEST_TYPE_ALIGN  (PIMAGE_DEBUG_DIRECTORY, 4)
5518     TEST_TARGET_SIZE (PIMAGE_DEBUG_DIRECTORY, 28)
5519     TEST_TARGET_ALIGN(PIMAGE_DEBUG_DIRECTORY, 4)
5520 }
5521 
5522 static void test_pack_PIMAGE_DEBUG_MISC(void)
5523 {
5524     /* PIMAGE_DEBUG_MISC */
5525     TEST_TYPE_SIZE   (PIMAGE_DEBUG_MISC, 4)
5526     TEST_TYPE_ALIGN  (PIMAGE_DEBUG_MISC, 4)
5527     TEST_TARGET_SIZE (PIMAGE_DEBUG_MISC, 16)
5528     TEST_TARGET_ALIGN(PIMAGE_DEBUG_MISC, 4)
5529 }
5530 
5531 static void test_pack_PIMAGE_DOS_HEADER(void)
5532 {
5533     /* PIMAGE_DOS_HEADER */
5534     TEST_TYPE_SIZE   (PIMAGE_DOS_HEADER, 4)
5535     TEST_TYPE_ALIGN  (PIMAGE_DOS_HEADER, 4)
5536     TEST_TARGET_SIZE (PIMAGE_DOS_HEADER, 64)
5537     TEST_TARGET_ALIGN(PIMAGE_DOS_HEADER, 2)
5538 }
5539 
5540 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
5541 {
5542     /* PIMAGE_EXPORT_DIRECTORY */
5543     TEST_TYPE_SIZE   (PIMAGE_EXPORT_DIRECTORY, 4)
5544     TEST_TYPE_ALIGN  (PIMAGE_EXPORT_DIRECTORY, 4)
5545     TEST_TARGET_SIZE (PIMAGE_EXPORT_DIRECTORY, 40)
5546     TEST_TARGET_ALIGN(PIMAGE_EXPORT_DIRECTORY, 4)
5547 }
5548 
5549 static void test_pack_PIMAGE_FILE_HEADER(void)
5550 {
5551     /* PIMAGE_FILE_HEADER */
5552     TEST_TYPE_SIZE   (PIMAGE_FILE_HEADER, 4)
5553     TEST_TYPE_ALIGN  (PIMAGE_FILE_HEADER, 4)
5554     TEST_TARGET_SIZE (PIMAGE_FILE_HEADER, 20)
5555     TEST_TARGET_ALIGN(PIMAGE_FILE_HEADER, 4)
5556 }
5557 
5558 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
5559 {
5560     /* PIMAGE_FUNCTION_ENTRY */
5561     TEST_TYPE_SIZE   (PIMAGE_FUNCTION_ENTRY, 4)
5562     TEST_TYPE_ALIGN  (PIMAGE_FUNCTION_ENTRY, 4)
5563     TEST_TARGET_SIZE (PIMAGE_FUNCTION_ENTRY, 12)
5564     TEST_TARGET_ALIGN(PIMAGE_FUNCTION_ENTRY, 4)
5565 }
5566 
5567 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
5568 {
5569     /* PIMAGE_IMPORT_BY_NAME */
5570     TEST_TYPE_SIZE   (PIMAGE_IMPORT_BY_NAME, 4)
5571     TEST_TYPE_ALIGN  (PIMAGE_IMPORT_BY_NAME, 4)
5572     TEST_TARGET_SIZE (PIMAGE_IMPORT_BY_NAME, 4)
5573     TEST_TARGET_ALIGN(PIMAGE_IMPORT_BY_NAME, 2)
5574 }
5575 
5576 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
5577 {
5578     /* PIMAGE_IMPORT_DESCRIPTOR */
5579     TEST_TYPE_SIZE   (PIMAGE_IMPORT_DESCRIPTOR, 4)
5580     TEST_TYPE_ALIGN  (PIMAGE_IMPORT_DESCRIPTOR, 4)
5581 }
5582 
5583 static void test_pack_PIMAGE_LINENUMBER(void)
5584 {
5585     /* PIMAGE_LINENUMBER */
5586     TEST_TYPE_SIZE   (PIMAGE_LINENUMBER, 4)
5587     TEST_TYPE_ALIGN  (PIMAGE_LINENUMBER, 4)
5588 }
5589 
5590 static void test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY(void)
5591 {
5592     /* PIMAGE_LOAD_CONFIG_DIRECTORY */
5593     TEST_TYPE_SIZE   (PIMAGE_LOAD_CONFIG_DIRECTORY, 4)
5594     TEST_TYPE_ALIGN  (PIMAGE_LOAD_CONFIG_DIRECTORY, 4)
5595 }
5596 
5597 static void test_pack_PIMAGE_NT_HEADERS(void)
5598 {
5599     /* PIMAGE_NT_HEADERS */
5600     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS, 4)
5601     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS, 4)
5602 }
5603 
5604 static void test_pack_PIMAGE_NT_HEADERS32(void)
5605 {
5606     /* PIMAGE_NT_HEADERS32 */
5607     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS32, 4)
5608     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS32, 4)
5609     TEST_TARGET_SIZE (PIMAGE_NT_HEADERS32, 248)
5610     TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS32, 4)
5611 }
5612 
5613 static void test_pack_PIMAGE_NT_HEADERS64(void)
5614 {
5615     /* PIMAGE_NT_HEADERS64 */
5616     TEST_TYPE_SIZE   (PIMAGE_NT_HEADERS64, 4)
5617     TEST_TYPE_ALIGN  (PIMAGE_NT_HEADERS64, 4)
5618     TEST_TARGET_SIZE (PIMAGE_NT_HEADERS64, 264)
5619     TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS64, 8)
5620 }
5621 
5622 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
5623 {
5624     /* PIMAGE_OPTIONAL_HEADER */
5625     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER, 4)
5626     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER, 4)
5627 }
5628 
5629 static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
5630 {
5631     /* PIMAGE_OPTIONAL_HEADER32 */
5632     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER32, 4)
5633     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER32, 4)
5634     TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER32, 224)
5635     TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER32, 4)
5636 }
5637 
5638 static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
5639 {
5640     /* PIMAGE_OPTIONAL_HEADER64 */
5641     TEST_TYPE_SIZE   (PIMAGE_OPTIONAL_HEADER64, 4)
5642     TEST_TYPE_ALIGN  (PIMAGE_OPTIONAL_HEADER64, 4)
5643     TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER64, 240)
5644     TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER64, 8)
5645 }
5646 
5647 static void test_pack_PIMAGE_OS2_HEADER(void)
5648 {
5649     /* PIMAGE_OS2_HEADER */
5650     TEST_TYPE_SIZE   (PIMAGE_OS2_HEADER, 4)
5651     TEST_TYPE_ALIGN  (PIMAGE_OS2_HEADER, 4)
5652     TEST_TARGET_SIZE (PIMAGE_OS2_HEADER, 64)
5653     TEST_TARGET_ALIGN(PIMAGE_OS2_HEADER, 2)
5654 }
5655 
5656 static void test_pack_PIMAGE_RELOCATION(void)
5657 {
5658     /* PIMAGE_RELOCATION */
5659     TEST_TYPE_SIZE   (PIMAGE_RELOCATION, 4)
5660     TEST_TYPE_ALIGN  (PIMAGE_RELOCATION, 4)
5661 }
5662 
5663 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
5664 {
5665     /* PIMAGE_RESOURCE_DATA_ENTRY */
5666     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DATA_ENTRY, 4)
5667     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DATA_ENTRY, 4)
5668     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 16)
5669     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DATA_ENTRY, 4)
5670 }
5671 
5672 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
5673 {
5674     /* PIMAGE_RESOURCE_DIRECTORY */
5675     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY, 4)
5676     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY, 4)
5677     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY, 16)
5678     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY, 4)
5679 }
5680 
5681 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY(void)
5682 {
5683     /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
5684     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4)
5685     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4)
5686 }
5687 
5688 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING(void)
5689 {
5690     /* PIMAGE_RESOURCE_DIRECTORY_STRING */
5691     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIRECTORY_STRING, 4)
5692     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIRECTORY_STRING, 4)
5693     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 4)
5694     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY_STRING, 2)
5695 }
5696 
5697 static void test_pack_PIMAGE_RESOURCE_DIR_STRING_U(void)
5698 {
5699     /* PIMAGE_RESOURCE_DIR_STRING_U */
5700     TEST_TYPE_SIZE   (PIMAGE_RESOURCE_DIR_STRING_U, 4)
5701     TEST_TYPE_ALIGN  (PIMAGE_RESOURCE_DIR_STRING_U, 4)
5702     TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 4)
5703     TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIR_STRING_U, 2)
5704 }
5705 
5706 static void test_pack_PIMAGE_SECTION_HEADER(void)
5707 {
5708     /* PIMAGE_SECTION_HEADER */
5709     TEST_TYPE_SIZE   (PIMAGE_SECTION_HEADER, 4)
5710     TEST_TYPE_ALIGN  (PIMAGE_SECTION_HEADER, 4)
5711 }
5712 
5713 static void test_pack_PIMAGE_SEPARATE_DEBUG_HEADER(void)
5714 {
5715     /* PIMAGE_SEPARATE_DEBUG_HEADER */
5716     TEST_TYPE_SIZE   (PIMAGE_SEPARATE_DEBUG_HEADER, 4)
5717     TEST_TYPE_ALIGN  (PIMAGE_SEPARATE_DEBUG_HEADER, 4)
5718     TEST_TARGET_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 48)
5719     TEST_TARGET_ALIGN(PIMAGE_SEPARATE_DEBUG_HEADER, 4)
5720 }
5721 
5722 static void test_pack_PIMAGE_SYMBOL(void)
5723 {
5724     /* PIMAGE_SYMBOL */
5725     TEST_TYPE_SIZE   (PIMAGE_SYMBOL, 4)
5726     TEST_TYPE_ALIGN  (PIMAGE_SYMBOL, 4)
5727 }
5728 
5729 static void test_pack_PIMAGE_THUNK_DATA(void)
5730 {
5731     /* PIMAGE_THUNK_DATA */
5732     TEST_TYPE_SIZE   (PIMAGE_THUNK_DATA, 4)
5733     TEST_TYPE_ALIGN  (PIMAGE_THUNK_DATA, 4)
5734 }
5735 
5736 static void test_pack_PIMAGE_TLS_CALLBACK(void)
5737 {
5738     /* PIMAGE_TLS_CALLBACK */
5739     TEST_TYPE_SIZE   (PIMAGE_TLS_CALLBACK, 4)
5740     TEST_TYPE_ALIGN  (PIMAGE_TLS_CALLBACK, 4)
5741 }
5742 
5743 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
5744 {
5745     /* PIMAGE_TLS_DIRECTORY */
5746     TEST_TYPE_SIZE   (PIMAGE_TLS_DIRECTORY, 4)
5747     TEST_TYPE_ALIGN  (PIMAGE_TLS_DIRECTORY, 4)
5748 }
5749 
5750 static void test_pack_PIMAGE_VXD_HEADER(void)
5751 {
5752     /* PIMAGE_VXD_HEADER */
5753     TEST_TYPE_SIZE   (PIMAGE_VXD_HEADER, 4)
5754     TEST_TYPE_ALIGN  (PIMAGE_VXD_HEADER, 4)
5755     TEST_TARGET_SIZE (PIMAGE_VXD_HEADER, 196)
5756     TEST_TARGET_ALIGN(PIMAGE_VXD_HEADER, 2)
5757 }
5758 
5759 static void test_pack_PIO_COUNTERS(void)
5760 {
5761     /* PIO_COUNTERS */
5762     TEST_TYPE_SIZE   (PIO_COUNTERS, 4)
5763     TEST_TYPE_ALIGN  (PIO_COUNTERS, 4)
5764     TEST_TARGET_SIZE (PIO_COUNTERS, 48)
5765     TEST_TARGET_ALIGN(PIO_COUNTERS, 8)
5766 }
5767 
5768 static void test_pack_PISECURITY_DESCRIPTOR(void)
5769 {
5770     /* PISECURITY_DESCRIPTOR */
5771     TEST_TYPE_SIZE   (PISECURITY_DESCRIPTOR, 4)
5772     TEST_TYPE_ALIGN  (PISECURITY_DESCRIPTOR, 4)
5773     TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR, 20)
5774     TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR, 4)
5775 }
5776 
5777 static void test_pack_PISECURITY_DESCRIPTOR_RELATIVE(void)
5778 {
5779     /* PISECURITY_DESCRIPTOR_RELATIVE */
5780     TEST_TYPE_SIZE   (PISECURITY_DESCRIPTOR_RELATIVE, 4)
5781     TEST_TYPE_ALIGN  (PISECURITY_DESCRIPTOR_RELATIVE, 4)
5782     TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 20)
5783     TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR_RELATIVE, 4)
5784 }
5785 
5786 static void test_pack_PISID(void)
5787 {
5788     /* PISID */
5789     TEST_TYPE_SIZE   (PISID, 4)
5790     TEST_TYPE_ALIGN  (PISID, 4)
5791     TEST_TARGET_SIZE (PISID, 12)
5792     TEST_TARGET_ALIGN(PISID, 4)
5793 }
5794 
5795 static void test_pack_PLARGE_INTEGER(void)
5796 {
5797     /* PLARGE_INTEGER */
5798     TEST_TYPE_SIZE   (PLARGE_INTEGER, 4)
5799     TEST_TYPE_ALIGN  (PLARGE_INTEGER, 4)
5800 }
5801 
5802 static void test_pack_PLIST_ENTRY(void)
5803 {
5804     /* PLIST_ENTRY */
5805     TEST_TYPE_SIZE   (PLIST_ENTRY, 4)
5806     TEST_TYPE_ALIGN  (PLIST_ENTRY, 4)
5807     TEST_TARGET_SIZE (PLIST_ENTRY, 8)
5808     TEST_TARGET_ALIGN(PLIST_ENTRY, 4)
5809 }
5810 
5811 static void test_pack_PLUID(void)
5812 {
5813     /* PLUID */
5814     TEST_TYPE_SIZE   (PLUID, 4)
5815     TEST_TYPE_ALIGN  (PLUID, 4)
5816     TEST_TARGET_SIZE (PLUID, 8)
5817     TEST_TARGET_ALIGN(PLUID, 4)
5818 }
5819 
5820 static void test_pack_PLUID_AND_ATTRIBUTES(void)
5821 {
5822     /* PLUID_AND_ATTRIBUTES */
5823     TEST_TYPE_SIZE   (PLUID_AND_ATTRIBUTES, 4)
5824     TEST_TYPE_ALIGN  (PLUID_AND_ATTRIBUTES, 4)
5825     TEST_TARGET_SIZE (PLUID_AND_ATTRIBUTES, 12)
5826     TEST_TARGET_ALIGN(PLUID_AND_ATTRIBUTES, 4)
5827 }
5828 
5829 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
5830 {
5831     /* PMEMORY_BASIC_INFORMATION */
5832     TEST_TYPE_SIZE   (PMEMORY_BASIC_INFORMATION, 4)
5833     TEST_TYPE_ALIGN  (PMEMORY_BASIC_INFORMATION, 4)
5834     TEST_TARGET_SIZE (PMEMORY_BASIC_INFORMATION, 28)
5835     TEST_TARGET_ALIGN(PMEMORY_BASIC_INFORMATION, 4)
5836 }
5837 
5838 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
5839 {
5840     /* PMESSAGE_RESOURCE_BLOCK */
5841     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_BLOCK, 4)
5842     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_BLOCK, 4)
5843     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_BLOCK, 12)
5844     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_BLOCK, 4)
5845 }
5846 
5847 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
5848 {
5849     /* PMESSAGE_RESOURCE_DATA */
5850     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_DATA, 4)
5851     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_DATA, 4)
5852     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_DATA, 16)
5853     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_DATA, 4)
5854 }
5855 
5856 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
5857 {
5858     /* PMESSAGE_RESOURCE_ENTRY */
5859     TEST_TYPE_SIZE   (PMESSAGE_RESOURCE_ENTRY, 4)
5860     TEST_TYPE_ALIGN  (PMESSAGE_RESOURCE_ENTRY, 4)
5861     TEST_TARGET_SIZE (PMESSAGE_RESOURCE_ENTRY, 6)
5862     TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_ENTRY, 2)
5863 }
5864 
5865 static void test_pack_PNT_TIB(void)
5866 {
5867     /* PNT_TIB */
5868     TEST_TYPE_SIZE   (PNT_TIB, 4)
5869     TEST_TYPE_ALIGN  (PNT_TIB, 4)
5870 }
5871 
5872 static void test_pack_POBJECT_TYPE_LIST(void)
5873 {
5874     /* POBJECT_TYPE_LIST */
5875     TEST_TYPE_SIZE   (POBJECT_TYPE_LIST, 4)
5876     TEST_TYPE_ALIGN  (POBJECT_TYPE_LIST, 4)
5877     TEST_TARGET_SIZE (POBJECT_TYPE_LIST, 8)
5878     TEST_TARGET_ALIGN(POBJECT_TYPE_LIST, 4)
5879 }
5880 
5881 static void test_pack_PPRIVILEGE_SET(void)
5882 {
5883     /* PPRIVILEGE_SET */
5884     TEST_TYPE_SIZE   (PPRIVILEGE_SET, 4)
5885     TEST_TYPE_ALIGN  (PPRIVILEGE_SET, 4)
5886     TEST_TARGET_SIZE (PPRIVILEGE_SET, 20)
5887     TEST_TARGET_ALIGN(PPRIVILEGE_SET, 4)
5888 }
5889 
5890 static void test_pack_PRIVILEGE_SET(void)
5891 {
5892     /* PRIVILEGE_SET */
5893     TEST_TYPE_SIZE   (PRIVILEGE_SET, 20)
5894     TEST_TYPE_ALIGN  (PRIVILEGE_SET, 4)
5895     TEST_FIELD_SIZE  (PRIVILEGE_SET, PrivilegeCount, 4)
5896     TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
5897     TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
5898     TEST_FIELD_SIZE  (PRIVILEGE_SET, Control, 4)
5899     TEST_FIELD_ALIGN (PRIVILEGE_SET, Control, 4)
5900     TEST_FIELD_OFFSET(PRIVILEGE_SET, Control, 4)
5901     TEST_FIELD_SIZE  (PRIVILEGE_SET, Privilege, 12)
5902     TEST_FIELD_ALIGN (PRIVILEGE_SET, Privilege, 4)
5903     TEST_FIELD_OFFSET(PRIVILEGE_SET, Privilege, 8)
5904 }
5905 
5906 static void test_pack_PRLIST_ENTRY(void)
5907 {
5908     /* PRLIST_ENTRY */
5909     TEST_TYPE_SIZE   (PRLIST_ENTRY, 4)
5910     TEST_TYPE_ALIGN  (PRLIST_ENTRY, 4)
5911     TEST_TARGET_SIZE (PRLIST_ENTRY, 8)
5912     TEST_TARGET_ALIGN(PRLIST_ENTRY, 4)
5913 }
5914 
5915 static void test_pack_PRTL_CRITICAL_SECTION(void)
5916 {
5917     /* PRTL_CRITICAL_SECTION */
5918     TEST_TYPE_SIZE   (PRTL_CRITICAL_SECTION, 4)
5919     TEST_TYPE_ALIGN  (PRTL_CRITICAL_SECTION, 4)
5920     TEST_TARGET_SIZE (PRTL_CRITICAL_SECTION, 24)
5921     TEST_TARGET_ALIGN(PRTL_CRITICAL_SECTION, 4)
5922 }
5923 
5924 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
5925 {
5926     /* PRTL_CRITICAL_SECTION_DEBUG */
5927     TEST_TYPE_SIZE   (PRTL_CRITICAL_SECTION_DEBUG, 4)
5928     TEST_TYPE_ALIGN  (PRTL_CRITICAL_SECTION_DEBUG, 4)
5929 }
5930 
5931 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
5932 {
5933     /* PRTL_OSVERSIONINFOEXW */
5934     TEST_TYPE_SIZE   (PRTL_OSVERSIONINFOEXW, 4)
5935     TEST_TYPE_ALIGN  (PRTL_OSVERSIONINFOEXW, 4)
5936     TEST_TARGET_SIZE (PRTL_OSVERSIONINFOEXW, 284)
5937     TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOEXW, 4)
5938 }
5939 
5940 static void test_pack_PRTL_OSVERSIONINFOW(void)
5941 {
5942     /* PRTL_OSVERSIONINFOW */
5943     TEST_TYPE_SIZE   (PRTL_OSVERSIONINFOW, 4)
5944     TEST_TYPE_ALIGN  (PRTL_OSVERSIONINFOW, 4)
5945     TEST_TARGET_SIZE (PRTL_OSVERSIONINFOW, 276)
5946     TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOW, 4)
5947 }
5948 
5949 static void test_pack_PRTL_RESOURCE_DEBUG(void)
5950 {
5951     /* PRTL_RESOURCE_DEBUG */
5952     TEST_TYPE_SIZE   (PRTL_RESOURCE_DEBUG, 4)
5953     TEST_TYPE_ALIGN  (PRTL_RESOURCE_DEBUG, 4)
5954 }
5955 
5956 static void test_pack_PSECURITY_DESCRIPTOR(void)
5957 {
5958     /* PSECURITY_DESCRIPTOR */
5959     TEST_TYPE_SIZE   (PSECURITY_DESCRIPTOR, 4)
5960     TEST_TYPE_ALIGN  (PSECURITY_DESCRIPTOR, 4)
5961 }
5962 
5963 static void test_pack_PSECURITY_QUALITY_OF_SERVICE(void)
5964 {
5965     /* PSECURITY_QUALITY_OF_SERVICE */
5966     TEST_TYPE_SIZE   (PSECURITY_QUALITY_OF_SERVICE, 4)
5967     TEST_TYPE_ALIGN  (PSECURITY_QUALITY_OF_SERVICE, 4)
5968 }
5969 
5970 static void test_pack_PSID(void)
5971 {
5972     /* PSID */
5973     TEST_TYPE_SIZE   (PSID, 4)
5974     TEST_TYPE_ALIGN  (PSID, 4)
5975 }
5976 
5977 static void test_pack_PSID_IDENTIFIER_AUTHORITY(void)
5978 {
5979     /* PSID_IDENTIFIER_AUTHORITY */
5980     TEST_TYPE_SIZE   (PSID_IDENTIFIER_AUTHORITY, 4)
5981     TEST_TYPE_ALIGN  (PSID_IDENTIFIER_AUTHORITY, 4)
5982     TEST_TARGET_SIZE (PSID_IDENTIFIER_AUTHORITY, 6)
5983     TEST_TARGET_ALIGN(PSID_IDENTIFIER_AUTHORITY, 1)
5984 }
5985 
5986 static void test_pack_PSINGLE_LIST_ENTRY(void)
5987 {
5988     /* PSINGLE_LIST_ENTRY */
5989     TEST_TYPE_SIZE   (PSINGLE_LIST_ENTRY, 4)
5990     TEST_TYPE_ALIGN  (PSINGLE_LIST_ENTRY, 4)
5991     TEST_TARGET_SIZE (PSINGLE_LIST_ENTRY, 4)
5992     TEST_TARGET_ALIGN(PSINGLE_LIST_ENTRY, 4)
5993 }
5994 
5995 static void test_pack_PSTR(void)
5996 {
5997     /* PSTR */
5998     TEST_TYPE_SIZE   (PSTR, 4)
5999     TEST_TYPE_ALIGN  (PSTR, 4)
6000     TEST_TARGET_SIZE (PSTR, 1)
6001     TEST_TARGET_ALIGN(PSTR, 1)
6002 }
6003 
6004 static void test_pack_PSYSTEM_ALARM_ACE(void)
6005 {
6006     /* PSYSTEM_ALARM_ACE */
6007     TEST_TYPE_SIZE   (PSYSTEM_ALARM_ACE, 4)
6008     TEST_TYPE_ALIGN  (PSYSTEM_ALARM_ACE, 4)
6009     TEST_TARGET_SIZE (PSYSTEM_ALARM_ACE, 12)
6010     TEST_TARGET_ALIGN(PSYSTEM_ALARM_ACE, 4)
6011 }
6012 
6013 static void test_pack_PSYSTEM_AUDIT_ACE(void)
6014 {
6015     /* PSYSTEM_AUDIT_ACE */
6016     TEST_TYPE_SIZE   (PSYSTEM_AUDIT_ACE, 4)
6017     TEST_TYPE_ALIGN  (PSYSTEM_AUDIT_ACE, 4)
6018     TEST_TARGET_SIZE (PSYSTEM_AUDIT_ACE, 12)
6019     TEST_TARGET_ALIGN(PSYSTEM_AUDIT_ACE, 4)
6020 }
6021 
6022 static void test_pack_PTOKEN_GROUPS(void)
6023 {
6024     /* PTOKEN_GROUPS */
6025     TEST_TYPE_SIZE   (PTOKEN_GROUPS, 4)
6026     TEST_TYPE_ALIGN  (PTOKEN_GROUPS, 4)
6027     TEST_TARGET_SIZE (PTOKEN_GROUPS, 12)
6028     TEST_TARGET_ALIGN(PTOKEN_GROUPS, 4)
6029 }
6030 
6031 static void test_pack_PTOKEN_PRIVILEGES(void)
6032 {
6033     /* PTOKEN_PRIVILEGES */
6034     TEST_TYPE_SIZE   (PTOKEN_PRIVILEGES, 4)
6035     TEST_TYPE_ALIGN  (PTOKEN_PRIVILEGES, 4)
6036     TEST_TARGET_SIZE (PTOKEN_PRIVILEGES, 16)
6037     TEST_TARGET_ALIGN(PTOKEN_PRIVILEGES, 4)
6038 }
6039 
6040 static void test_pack_PTOKEN_USER(void)
6041 {
6042     /* PTOKEN_USER */
6043     TEST_TYPE_SIZE   (PTOKEN_USER, 4)
6044     TEST_TYPE_ALIGN  (PTOKEN_USER, 4)
6045     TEST_TARGET_SIZE (PTOKEN_USER, 8)
6046     TEST_TARGET_ALIGN(PTOKEN_USER, 4)
6047 }
6048 
6049 static void test_pack_PULARGE_INTEGER(void)
6050 {
6051     /* PULARGE_INTEGER */
6052     TEST_TYPE_SIZE   (PULARGE_INTEGER, 4)
6053     TEST_TYPE_ALIGN  (PULARGE_INTEGER, 4)
6054 }
6055 
6056 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
6057 {
6058     /* PVECTORED_EXCEPTION_HANDLER */
6059     TEST_TYPE_SIZE   (PVECTORED_EXCEPTION_HANDLER, 4)
6060     TEST_TYPE_ALIGN  (PVECTORED_EXCEPTION_HANDLER, 4)
6061 }
6062 
6063 static void test_pack_PVOID(void)
6064 {
6065     /* PVOID */
6066     TEST_TYPE_SIZE   (PVOID, 4)
6067     TEST_TYPE_ALIGN  (PVOID, 4)
6068 }
6069 
6070 static void test_pack_PWCH(void)
6071 {
6072     /* PWCH */
6073     TEST_TYPE_SIZE   (PWCH, 4)
6074     TEST_TYPE_ALIGN  (PWCH, 4)
6075     TEST_TARGET_SIZE (PWCH, 2)
6076     TEST_TARGET_ALIGN(PWCH, 2)
6077 }
6078 
6079 static void test_pack_PWSTR(void)
6080 {
6081     /* PWSTR */
6082     TEST_TYPE_SIZE   (PWSTR, 4)
6083     TEST_TYPE_ALIGN  (PWSTR, 4)
6084     TEST_TARGET_SIZE (PWSTR, 2)
6085     TEST_TARGET_ALIGN(PWSTR, 2)
6086 }
6087 
6088 static void test_pack_RTL_CRITICAL_SECTION(void)
6089 {
6090     /* RTL_CRITICAL_SECTION */
6091     TEST_TYPE_SIZE   (RTL_CRITICAL_SECTION, 24)
6092     TEST_TYPE_ALIGN  (RTL_CRITICAL_SECTION, 4)
6093     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, DebugInfo, 4)
6094     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 4)
6095     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, DebugInfo, 0)
6096     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, LockCount, 4)
6097     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockCount, 4)
6098     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockCount, 4)
6099     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, RecursionCount, 4)
6100     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4)
6101     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 8)
6102     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, OwningThread, 4)
6103     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, OwningThread, 4)
6104     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, OwningThread, 12)
6105     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, LockSemaphore, 4)
6106     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 4)
6107     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 16)
6108     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION, SpinCount, 4)
6109     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, SpinCount, 4)
6110     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, SpinCount, 20)
6111 }
6112 
6113 static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void)
6114 {
6115     /* RTL_CRITICAL_SECTION_DEBUG */
6116     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, Type, 2)
6117     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, Type, 2)
6118     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, Type, 0)
6119     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
6120     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
6121     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
6122     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4)
6123     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4)
6124     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CriticalSection, 4)
6125     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8)
6126     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 4)
6127     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8)
6128     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4)
6129     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, EntryCount, 4)
6130     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, EntryCount, 16)
6131     TEST_FIELD_SIZE  (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
6132     TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
6133     TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 20)
6134 }
6135 
6136 static void test_pack_RTL_OSVERSIONINFOEXW(void)
6137 {
6138     /* RTL_OSVERSIONINFOEXW */
6139     TEST_TYPE_SIZE   (RTL_OSVERSIONINFOEXW, 284)
6140     TEST_TYPE_ALIGN  (RTL_OSVERSIONINFOEXW, 4)
6141     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
6142     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
6143     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 0)
6144     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
6145     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
6146     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
6147     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
6148     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
6149     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMinorVersion, 8)
6150     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
6151     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
6152     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwBuildNumber, 12)
6153     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
6154     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
6155     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwPlatformId, 16)
6156     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, szCSDVersion, 256)
6157     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, szCSDVersion, 2)
6158     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, szCSDVersion, 20)
6159     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
6160     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
6161     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMajor, 276)
6162     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
6163     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
6164     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMinor, 278)
6165     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
6166     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
6167     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wSuiteMask, 280)
6168     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wProductType, 1)
6169     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wProductType, 1)
6170     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wProductType, 282)
6171     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOEXW, wReserved, 1)
6172     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wReserved, 1)
6173     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wReserved, 283)
6174 }
6175 
6176 static void test_pack_RTL_OSVERSIONINFOW(void)
6177 {
6178     /* RTL_OSVERSIONINFOW */
6179     TEST_TYPE_SIZE   (RTL_OSVERSIONINFOW, 276)
6180     TEST_TYPE_ALIGN  (RTL_OSVERSIONINFOW, 4)
6181     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
6182     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
6183     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 0)
6184     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
6185     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
6186     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMajorVersion, 4)
6187     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
6188     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
6189     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMinorVersion, 8)
6190     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
6191     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
6192     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwBuildNumber, 12)
6193     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, dwPlatformId, 4)
6194     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwPlatformId, 4)
6195     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwPlatformId, 16)
6196     TEST_FIELD_SIZE  (RTL_OSVERSIONINFOW, szCSDVersion, 256)
6197     TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, szCSDVersion, 2)
6198     TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, szCSDVersion, 20)
6199 }
6200 
6201 static void test_pack_RTL_RESOURCE_DEBUG(void)
6202 {
6203     /* RTL_RESOURCE_DEBUG */
6204     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, Type, 2)
6205     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, Type, 2)
6206     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, Type, 0)
6207     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
6208     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
6209     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
6210     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, CriticalSection, 4)
6211     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CriticalSection, 4)
6212     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CriticalSection, 4)
6213     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, ProcessLocksList, 8)
6214     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ProcessLocksList, 4)
6215     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ProcessLocksList, 8)
6216     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, EntryCount, 4)
6217     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, EntryCount, 4)
6218     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, EntryCount, 16)
6219     TEST_FIELD_SIZE  (RTL_RESOURCE_DEBUG, ContentionCount, 4)
6220     TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ContentionCount, 4)
6221     TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ContentionCount, 20)
6222 }
6223 
6224 static void test_pack_SECURITY_CONTEXT_TRACKING_MODE(void)
6225 {
6226     /* SECURITY_CONTEXT_TRACKING_MODE */
6227     TEST_TYPE_SIZE   (SECURITY_CONTEXT_TRACKING_MODE, 1)
6228     TEST_TYPE_ALIGN  (SECURITY_CONTEXT_TRACKING_MODE, 1)
6229 }
6230 
6231 static void test_pack_SECURITY_DESCRIPTOR(void)
6232 {
6233     /* SECURITY_DESCRIPTOR */
6234     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR, 20)
6235     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR, 4)
6236     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Revision, 1)
6237     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Revision, 1)
6238     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Revision, 0)
6239     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Sbz1, 1)
6240     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sbz1, 1)
6241     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sbz1, 1)
6242     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Control, 2)
6243     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Control, 2)
6244     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Control, 2)
6245     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Owner, 4)
6246     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Owner, 4)
6247     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Owner, 4)
6248     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Group, 4)
6249     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Group, 4)
6250     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Group, 8)
6251     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Sacl, 4)
6252     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Sacl, 4)
6253     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Sacl, 12)
6254     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR, Dacl, 4)
6255     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR, Dacl, 4)
6256     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR, Dacl, 16)
6257 }
6258 
6259 static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void)
6260 {
6261     /* SECURITY_DESCRIPTOR_CONTROL */
6262     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR_CONTROL, 2)
6263     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR_CONTROL, 2)
6264     TEST_TYPE_UNSIGNED(SECURITY_DESCRIPTOR_CONTROL)
6265 }
6266 
6267 static void test_pack_SECURITY_DESCRIPTOR_RELATIVE(void)
6268 {
6269     /* SECURITY_DESCRIPTOR_RELATIVE */
6270     TEST_TYPE_SIZE   (SECURITY_DESCRIPTOR_RELATIVE, 20)
6271     TEST_TYPE_ALIGN  (SECURITY_DESCRIPTOR_RELATIVE, 4)
6272     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1)
6273     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Revision, 1)
6274     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Revision, 0)
6275     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
6276     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
6277     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sbz1, 1)
6278     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
6279     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
6280     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Control, 2)
6281     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
6282     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
6283     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Owner, 4)
6284     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Group, 4)
6285     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Group, 4)
6286     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Group, 8)
6287     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4)
6288     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Sacl, 4)
6289     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Sacl, 12)
6290     TEST_FIELD_SIZE  (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4)
6291     TEST_FIELD_ALIGN (SECURITY_DESCRIPTOR_RELATIVE, Dacl, 4)
6292     TEST_FIELD_OFFSET(SECURITY_DESCRIPTOR_RELATIVE, Dacl, 16)
6293 }
6294 
6295 static void test_pack_SECURITY_INFORMATION(void)
6296 {
6297     /* SECURITY_INFORMATION */
6298     TEST_TYPE_SIZE   (SECURITY_INFORMATION, 4)
6299     TEST_TYPE_ALIGN  (SECURITY_INFORMATION, 4)
6300     TEST_TYPE_UNSIGNED(SECURITY_INFORMATION)
6301 }
6302 
6303 static void test_pack_SECURITY_QUALITY_OF_SERVICE(void)
6304 {
6305     /* SECURITY_QUALITY_OF_SERVICE */
6306     TEST_FIELD_SIZE  (SECURITY_QUALITY_OF_SERVICE, Length, 4)
6307     TEST_FIELD_ALIGN (SECURITY_QUALITY_OF_SERVICE, Length, 4)
6308     TEST_FIELD_OFFSET(SECURITY_QUALITY_OF_SERVICE, Length, 0)
6309 }
6310 
6311 static void test_pack_SHORT(void)
6312 {
6313     /* SHORT */
6314     TEST_TYPE_SIZE   (SHORT, 2)
6315     TEST_TYPE_ALIGN  (SHORT, 2)
6316     TEST_TYPE_SIGNED(SHORT)
6317 }
6318 
6319 static void test_pack_SID(void)
6320 {
6321     /* SID */
6322     TEST_TYPE_SIZE   (SID, 12)
6323     TEST_TYPE_ALIGN  (SID, 4)
6324     TEST_FIELD_SIZE  (SID, Revision, 1)
6325     TEST_FIELD_ALIGN (SID, Revision, 1)
6326     TEST_FIELD_OFFSET(SID, Revision, 0)
6327     TEST_FIELD_SIZE  (SID, SubAuthorityCount, 1)
6328     TEST_FIELD_ALIGN (SID, SubAuthorityCount, 1)
6329     TEST_FIELD_OFFSET(SID, SubAuthorityCount, 1)
6330     TEST_FIELD_SIZE  (SID, IdentifierAuthority, 6)
6331     TEST_FIELD_ALIGN (SID, IdentifierAuthority, 1)
6332     TEST_FIELD_OFFSET(SID, IdentifierAuthority, 2)
6333     TEST_FIELD_SIZE  (SID, SubAuthority, 4)
6334     TEST_FIELD_ALIGN (SID, SubAuthority, 4)
6335     TEST_FIELD_OFFSET(SID, SubAuthority, 8)
6336 }
6337 
6338 static void test_pack_SID_AND_ATTRIBUTES(void)
6339 {
6340     /* SID_AND_ATTRIBUTES */
6341     TEST_TYPE_SIZE   (SID_AND_ATTRIBUTES, 8)
6342     TEST_TYPE_ALIGN  (SID_AND_ATTRIBUTES, 4)
6343     TEST_FIELD_SIZE  (SID_AND_ATTRIBUTES, Sid, 4)
6344     TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Sid, 4)
6345     TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Sid, 0)
6346     TEST_FIELD_SIZE  (SID_AND_ATTRIBUTES, Attributes, 4)
6347     TEST_FIELD_ALIGN (SID_AND_ATTRIBUTES, Attributes, 4)
6348     TEST_FIELD_OFFSET(SID_AND_ATTRIBUTES, Attributes, 4)
6349 }
6350 
6351 static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
6352 {
6353     /* SID_IDENTIFIER_AUTHORITY */
6354     TEST_TYPE_SIZE   (SID_IDENTIFIER_AUTHORITY, 6)
6355     TEST_TYPE_ALIGN  (SID_IDENTIFIER_AUTHORITY, 1)
6356     TEST_FIELD_SIZE  (SID_IDENTIFIER_AUTHORITY, Value, 6)
6357     TEST_FIELD_ALIGN (SID_IDENTIFIER_AUTHORITY, Value, 1)
6358     TEST_FIELD_OFFSET(SID_IDENTIFIER_AUTHORITY, Value, 0)
6359 }
6360 
6361 static void test_pack_SINGLE_LIST_ENTRY(void)
6362 {
6363     /* SINGLE_LIST_ENTRY */
6364     TEST_TYPE_SIZE   (SINGLE_LIST_ENTRY, 4)
6365     TEST_TYPE_ALIGN  (SINGLE_LIST_ENTRY, 4)
6366     TEST_FIELD_SIZE  (SINGLE_LIST_ENTRY, Next, 4)
6367     TEST_FIELD_ALIGN (SINGLE_LIST_ENTRY, Next, 4)
6368     TEST_FIELD_OFFSET(SINGLE_LIST_ENTRY, Next, 0)
6369 }
6370 
6371 static void test_pack_SYSTEM_ALARM_ACE(void)
6372 {
6373     /* SYSTEM_ALARM_ACE */
6374     TEST_TYPE_SIZE   (SYSTEM_ALARM_ACE, 12)
6375     TEST_TYPE_ALIGN  (SYSTEM_ALARM_ACE, 4)
6376     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, Header, 4)
6377     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Header, 2)
6378     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Header, 0)
6379     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, Mask, 4)
6380     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, Mask, 4)
6381     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, Mask, 4)
6382     TEST_FIELD_SIZE  (SYSTEM_ALARM_ACE, SidStart, 4)
6383     TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, SidStart, 4)
6384     TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart, 8)
6385 }
6386 
6387 static void test_pack_SYSTEM_AUDIT_ACE(void)
6388 {
6389     /* SYSTEM_AUDIT_ACE */
6390     TEST_TYPE_SIZE   (SYSTEM_AUDIT_ACE, 12)
6391     TEST_TYPE_ALIGN  (SYSTEM_AUDIT_ACE, 4)
6392     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, Header, 4)
6393     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Header, 2)
6394     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Header, 0)
6395     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, Mask, 4)
6396     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, Mask, 4)
6397     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, Mask, 4)
6398     TEST_FIELD_SIZE  (SYSTEM_AUDIT_ACE, SidStart, 4)
6399     TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, SidStart, 4)
6400     TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8)
6401 }
6402 
6403 static void test_pack_TOKEN_DEFAULT_DACL(void)
6404 {
6405     /* TOKEN_DEFAULT_DACL */
6406     TEST_TYPE_SIZE   (TOKEN_DEFAULT_DACL, 4)
6407     TEST_TYPE_ALIGN  (TOKEN_DEFAULT_DACL, 4)
6408     TEST_FIELD_SIZE  (TOKEN_DEFAULT_DACL, DefaultDacl, 4)
6409     TEST_FIELD_ALIGN (TOKEN_DEFAULT_DACL, DefaultDacl, 4)
6410     TEST_FIELD_OFFSET(TOKEN_DEFAULT_DACL, DefaultDacl, 0)
6411 }
6412 
6413 static void test_pack_TOKEN_GROUPS(void)
6414 {
6415     /* TOKEN_GROUPS */
6416     TEST_TYPE_SIZE   (TOKEN_GROUPS, 12)
6417     TEST_TYPE_ALIGN  (TOKEN_GROUPS, 4)
6418     TEST_FIELD_SIZE  (TOKEN_GROUPS, GroupCount, 4)
6419     TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4)
6420     TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0)
6421     TEST_FIELD_SIZE  (TOKEN_GROUPS, Groups, 8)
6422     TEST_FIELD_ALIGN (TOKEN_GROUPS, Groups, 4)
6423     TEST_FIELD_OFFSET(TOKEN_GROUPS, Groups, 4)
6424 }
6425 
6426 static void test_pack_TOKEN_OWNER(void)
6427 {
6428     /* TOKEN_OWNER */
6429     TEST_TYPE_SIZE   (TOKEN_OWNER, 4)
6430     TEST_TYPE_ALIGN  (TOKEN_OWNER, 4)
6431     TEST_FIELD_SIZE  (TOKEN_OWNER, Owner, 4)
6432     TEST_FIELD_ALIGN (TOKEN_OWNER, Owner, 4)
6433     TEST_FIELD_OFFSET(TOKEN_OWNER, Owner, 0)
6434 }
6435 
6436 static void test_pack_TOKEN_PRIMARY_GROUP(void)
6437 {
6438     /* TOKEN_PRIMARY_GROUP */
6439     TEST_TYPE_SIZE   (TOKEN_PRIMARY_GROUP, 4)
6440     TEST_TYPE_ALIGN  (TOKEN_PRIMARY_GROUP, 4)
6441     TEST_FIELD_SIZE  (TOKEN_PRIMARY_GROUP, PrimaryGroup, 4)
6442     TEST_FIELD_ALIGN (TOKEN_PRIMARY_GROUP, PrimaryGroup, 4)
6443     TEST_FIELD_OFFSET(TOKEN_PRIMARY_GROUP, PrimaryGroup, 0)
6444 }
6445 
6446 static void test_pack_TOKEN_PRIVILEGES(void)
6447 {
6448     /* TOKEN_PRIVILEGES */
6449     TEST_TYPE_SIZE   (TOKEN_PRIVILEGES, 16)
6450     TEST_TYPE_ALIGN  (TOKEN_PRIVILEGES, 4)
6451     TEST_FIELD_SIZE  (TOKEN_PRIVILEGES, PrivilegeCount, 4)
6452     TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4)
6453     TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0)
6454     TEST_FIELD_SIZE  (TOKEN_PRIVILEGES, Privileges, 12)
6455     TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, Privileges, 4)
6456     TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges, 4)
6457 }
6458 
6459 static void test_pack_TOKEN_SOURCE(void)
6460 {
6461     /* TOKEN_SOURCE */
6462     TEST_TYPE_SIZE   (TOKEN_SOURCE, 16)
6463     TEST_TYPE_ALIGN  (TOKEN_SOURCE, 4)
6464     TEST_FIELD_SIZE  (TOKEN_SOURCE, SourceName, 8)
6465     TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceName, 1)
6466     TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceName, 0)
6467     TEST_FIELD_SIZE  (TOKEN_SOURCE, SourceIdentifier, 8)
6468     TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceIdentifier, 4)
6469     TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceIdentifier, 8)
6470 }
6471 
6472 static void test_pack_TOKEN_STATISTICS(void)
6473 {
6474     /* TOKEN_STATISTICS (pack 4) */
6475     TEST_FIELD_SIZE  (TOKEN_STATISTICS, TokenId, 8)
6476     TEST_FIELD_ALIGN (TOKEN_STATISTICS, TokenId, 4)
6477     TEST_FIELD_OFFSET(TOKEN_STATISTICS, TokenId, 0)
6478     TEST_FIELD_SIZE  (TOKEN_STATISTICS, AuthenticationId, 8)
6479     TEST_FIELD_ALIGN (TOKEN_STATISTICS, AuthenticationId, 4)
6480     TEST_FIELD_OFFSET(TOKEN_STATISTICS, AuthenticationId, 8)
6481     TEST_FIELD_SIZE  (TOKEN_STATISTICS, ExpirationTime, 8)
6482     TEST_FIELD_ALIGN (TOKEN_STATISTICS, ExpirationTime, 4)
6483     TEST_FIELD_OFFSET(TOKEN_STATISTICS, ExpirationTime, 16)
6484 }
6485 
6486 static void test_pack_TOKEN_USER(void)
6487 {
6488     /* TOKEN_USER */
6489     TEST_TYPE_SIZE   (TOKEN_USER, 8)
6490     TEST_TYPE_ALIGN  (TOKEN_USER, 4)
6491     TEST_FIELD_SIZE  (TOKEN_USER, User, 8)
6492     TEST_FIELD_ALIGN (TOKEN_USER, User, 4)
6493     TEST_FIELD_OFFSET(TOKEN_USER, User, 0)
6494 }
6495 
6496 static void test_pack_ULARGE_INTEGER(void)
6497 {
6498     /* ULARGE_INTEGER */
6499 }
6500 
6501 static void test_pack_ULONGLONG(void)
6502 {
6503     /* ULONGLONG */
6504     TEST_TYPE_SIZE   (ULONGLONG, 8)
6505     TEST_TYPE_ALIGN  (ULONGLONG, 8)
6506     TEST_TYPE_UNSIGNED(ULONGLONG)
6507 }
6508 
6509 static void test_pack_WAITORTIMERCALLBACKFUNC(void)
6510 {
6511     /* WAITORTIMERCALLBACKFUNC */
6512     TEST_TYPE_SIZE   (WAITORTIMERCALLBACKFUNC, 4)
6513     TEST_TYPE_ALIGN  (WAITORTIMERCALLBACKFUNC, 4)
6514 }
6515 
6516 static void test_pack_WCHAR(void)
6517 {
6518     /* WCHAR */
6519     TEST_TYPE_SIZE   (WCHAR, 2)
6520     TEST_TYPE_ALIGN  (WCHAR, 2)
6521     TEST_TYPE_UNSIGNED(WCHAR)
6522 }
6523 
6524 static void test_pack_ATOM(void)
6525 {
6526     /* ATOM */
6527     TEST_TYPE_SIZE   (ATOM, 2)
6528     TEST_TYPE_ALIGN  (ATOM, 2)
6529     TEST_TYPE_UNSIGNED(ATOM)
6530 }
6531 
6532 static void test_pack_BOOL(void)
6533 {
6534     /* BOOL */
6535     TEST_TYPE_SIZE   (BOOL, 4)
6536     TEST_TYPE_ALIGN  (BOOL, 4)
6537     TEST_TYPE_SIGNED(BOOL)
6538 }
6539 
6540 static void test_pack_BYTE(void)
6541 {
6542     /* BYTE */
6543     TEST_TYPE_SIZE   (BYTE, 1)
6544     TEST_TYPE_ALIGN  (BYTE, 1)
6545     TEST_TYPE_UNSIGNED(BYTE)
6546 }
6547 
6548 static void test_pack_COLORREF(void)
6549 {
6550     /* COLORREF */
6551     TEST_TYPE_SIZE   (COLORREF, 4)
6552     TEST_TYPE_ALIGN  (COLORREF, 4)
6553     TEST_TYPE_UNSIGNED(COLORREF)
6554 }
6555 
6556 static void test_pack_DWORD(void)
6557 {
6558     /* DWORD */
6559     TEST_TYPE_SIZE   (DWORD, 4)
6560     TEST_TYPE_ALIGN  (DWORD, 4)
6561     TEST_TYPE_UNSIGNED(DWORD)
6562 }
6563 
6564 static void test_pack_FARPROC(void)
6565 {
6566     /* FARPROC */
6567     TEST_TYPE_SIZE   (FARPROC, 4)
6568     TEST_TYPE_ALIGN  (FARPROC, 4)
6569 }
6570 
6571 static void test_pack_FLOAT(void)
6572 {
6573     /* FLOAT */
6574     TEST_TYPE_SIZE   (FLOAT, 4)
6575     TEST_TYPE_ALIGN  (FLOAT, 4)
6576 }
6577 
6578 static void test_pack_GLOBALHANDLE(void)
6579 {
6580     /* GLOBALHANDLE */
6581     TEST_TYPE_SIZE   (GLOBALHANDLE, 4)
6582     TEST_TYPE_ALIGN  (GLOBALHANDLE, 4)
6583 }
6584 
6585 static void test_pack_HCURSOR(void)
6586 {
6587     /* HCURSOR */
6588     TEST_TYPE_SIZE   (HCURSOR, 4)
6589     TEST_TYPE_ALIGN  (HCURSOR, 4)
6590 }
6591 
6592 static void test_pack_HFILE(void)
6593 {
6594     /* HFILE */
6595     TEST_TYPE_SIZE   (HFILE, 4)
6596     TEST_TYPE_ALIGN  (HFILE, 4)
6597     TEST_TYPE_SIGNED(HFILE)
6598 }
6599 
6600 static void test_pack_HGDIOBJ(void)
6601 {
6602     /* HGDIOBJ */
6603     TEST_TYPE_SIZE   (HGDIOBJ, 4)
6604     TEST_TYPE_ALIGN  (HGDIOBJ, 4)
6605 }
6606 
6607 static void test_pack_HGLOBAL(void)
6608 {
6609     /* HGLOBAL */
6610     TEST_TYPE_SIZE   (HGLOBAL, 4)
6611     TEST_TYPE_ALIGN  (HGLOBAL, 4)
6612 }
6613 
6614 static void test_pack_HLOCAL(void)
6615 {
6616     /* HLOCAL */
6617     TEST_TYPE_SIZE   (HLOCAL, 4)
6618     TEST_TYPE_ALIGN  (HLOCAL, 4)
6619 }
6620 
6621 static void test_pack_HMODULE(void)
6622 {
6623     /* HMODULE */
6624     TEST_TYPE_SIZE   (HMODULE, 4)
6625     TEST_TYPE_ALIGN  (HMODULE, 4)
6626 }
6627 
6628 static void test_pack_INT(void)
6629 {
6630     /* INT */
6631     TEST_TYPE_SIZE   (INT, 4)
6632     TEST_TYPE_ALIGN  (INT, 4)
6633     TEST_TYPE_SIGNED(INT)
6634 }
6635 
6636 static void test_pack_LOCALHANDLE(void)
6637 {
6638     /* LOCALHANDLE */
6639     TEST_TYPE_SIZE   (LOCALHANDLE, 4)
6640     TEST_TYPE_ALIGN  (LOCALHANDLE, 4)
6641 }
6642 
6643 static void test_pack_LPARAM(void)
6644 {
6645     /* LPARAM */
6646     TEST_TYPE_SIZE   (LPARAM, 4)
6647     TEST_TYPE_ALIGN  (LPARAM, 4)
6648 }
6649 
6650 static void test_pack_LPCRECT(void)
6651 {
6652     /* LPCRECT */
6653     TEST_TYPE_SIZE   (LPCRECT, 4)
6654     TEST_TYPE_ALIGN  (LPCRECT, 4)
6655     TEST_TARGET_SIZE (LPCRECT, 16)
6656     TEST_TARGET_ALIGN(LPCRECT, 4)
6657 }
6658 
6659 static void test_pack_LPCRECTL(void)
6660 {
6661     /* LPCRECTL */
6662     TEST_TYPE_SIZE   (LPCRECTL, 4)
6663     TEST_TYPE_ALIGN  (LPCRECTL, 4)
6664     TEST_TARGET_SIZE (LPCRECTL, 16)
6665     TEST_TARGET_ALIGN(LPCRECTL, 4)
6666 }
6667 
6668 static void test_pack_LPCVOID(void)
6669 {
6670     /* LPCVOID */
6671     TEST_TYPE_SIZE   (LPCVOID, 4)
6672     TEST_TYPE_ALIGN  (LPCVOID, 4)
6673 }
6674 
6675 static void test_pack_LPPOINT(void)
6676 {
6677     /* LPPOINT */
6678     TEST_TYPE_SIZE   (LPPOINT, 4)
6679     TEST_TYPE_ALIGN  (LPPOINT, 4)
6680     TEST_TARGET_SIZE (LPPOINT, 8)
6681     TEST_TARGET_ALIGN(LPPOINT, 4)
6682 }
6683 
6684 static void test_pack_LPRECT(void)
6685 {
6686     /* LPRECT */
6687     TEST_TYPE_SIZE   (LPRECT, 4)
6688     TEST_TYPE_ALIGN  (LPRECT, 4)
6689     TEST_TARGET_SIZE (LPRECT, 16)
6690     TEST_TARGET_ALIGN(LPRECT, 4)
6691 }
6692 
6693 static void test_pack_LPRECTL(void)
6694 {
6695     /* LPRECTL */
6696     TEST_TYPE_SIZE   (LPRECTL, 4)
6697     TEST_TYPE_ALIGN  (LPRECTL, 4)
6698     TEST_TARGET_SIZE (LPRECTL, 16)
6699     TEST_TARGET_ALIGN(LPRECTL, 4)
6700 }
6701 
6702 static void test_pack_LPSIZE(void)
6703 {
6704     /* LPSIZE */
6705     TEST_TYPE_SIZE   (LPSIZE, 4)
6706     TEST_TYPE_ALIGN  (LPSIZE, 4)
6707     TEST_TARGET_SIZE (LPSIZE, 8)
6708     TEST_TARGET_ALIGN(LPSIZE, 4)
6709 }
6710 
6711 static void test_pack_LRESULT(void)
6712 {
6713     /* LRESULT */
6714     TEST_TYPE_SIZE   (LRESULT, 4)
6715     TEST_TYPE_ALIGN  (LRESULT, 4)
6716 }
6717 
6718 static void test_pack_POINT(void)
6719 {
6720     /* POINT */
6721     TEST_TYPE_SIZE   (POINT, 8)
6722     TEST_TYPE_ALIGN  (POINT, 4)
6723     TEST_FIELD_SIZE  (POINT, x, 4)
6724     TEST_FIELD_ALIGN (POINT, x, 4)
6725     TEST_FIELD_OFFSET(POINT, x, 0)
6726     TEST_FIELD_SIZE  (POINT, y, 4)
6727     TEST_FIELD_ALIGN (POINT, y, 4)
6728     TEST_FIELD_OFFSET(POINT, y, 4)
6729 }
6730 
6731 static void test_pack_POINTL(void)
6732 {
6733     /* POINTL */
6734     TEST_TYPE_SIZE   (POINTL, 8)
6735     TEST_TYPE_ALIGN  (POINTL, 4)
6736     TEST_FIELD_SIZE  (POINTL, x, 4)
6737     TEST_FIELD_ALIGN (POINTL, x, 4)
6738     TEST_FIELD_OFFSET(POINTL, x, 0)
6739     TEST_FIELD_SIZE  (POINTL, y, 4)
6740     TEST_FIELD_ALIGN (POINTL, y, 4)
6741     TEST_FIELD_OFFSET(POINTL, y, 4)
6742 }
6743 
6744 static void test_pack_PPOINT(void)
6745 {
6746     /* PPOINT */
6747     TEST_TYPE_SIZE   (PPOINT, 4)
6748     TEST_TYPE_ALIGN  (PPOINT, 4)
6749     TEST_TARGET_SIZE (PPOINT, 8)
6750     TEST_TARGET_ALIGN(PPOINT, 4)
6751 }
6752 
6753 static void test_pack_PPOINTL(void)
6754 {
6755     /* PPOINTL */
6756     TEST_TYPE_SIZE   (PPOINTL, 4)
6757     TEST_TYPE_ALIGN  (PPOINTL, 4)
6758     TEST_TARGET_SIZE (PPOINTL, 8)
6759     TEST_TARGET_ALIGN(PPOINTL, 4)
6760 }
6761 
6762 static void test_pack_PRECT(void)
6763 {
6764     /* PRECT */
6765     TEST_TYPE_SIZE   (PRECT, 4)
6766     TEST_TYPE_ALIGN  (PRECT, 4)
6767     TEST_TARGET_SIZE (PRECT, 16)
6768     TEST_TARGET_ALIGN(PRECT, 4)
6769 }
6770 
6771 static void test_pack_PRECTL(void)
6772 {
6773     /* PRECTL */
6774     TEST_TYPE_SIZE   (PRECTL, 4)
6775     TEST_TYPE_ALIGN  (PRECTL, 4)
6776     TEST_TARGET_SIZE (PRECTL, 16)
6777     TEST_TARGET_ALIGN(PRECTL, 4)
6778 }
6779 
6780 static void test_pack_PROC(void)
6781 {
6782     /* PROC */
6783     TEST_TYPE_SIZE   (PROC, 4)
6784     TEST_TYPE_ALIGN  (PROC, 4)
6785 }
6786 
6787 static void test_pack_PSIZE(void)
6788 {
6789     /* PSIZE */
6790     TEST_TYPE_SIZE   (PSIZE, 4)
6791     TEST_TYPE_ALIGN  (PSIZE, 4)
6792     TEST_TARGET_SIZE (PSIZE, 8)
6793     TEST_TARGET_ALIGN(PSIZE, 4)
6794 }
6795 
6796 static void test_pack_PSZ(void)
6797 {
6798     /* PSZ */
6799     TEST_TYPE_SIZE   (PSZ, 4)
6800     TEST_TYPE_ALIGN  (PSZ, 4)
6801 }
6802 
6803 static void test_pack_RECT(void)
6804 {
6805     /* RECT */
6806     TEST_TYPE_SIZE   (RECT, 16)
6807     TEST_TYPE_ALIGN  (RECT, 4)
6808     TEST_FIELD_SIZE  (RECT, left, 4)
6809     TEST_FIELD_ALIGN (RECT, left, 4)
6810     TEST_FIELD_OFFSET(RECT, left, 0)
6811     TEST_FIELD_SIZE  (RECT, top, 4)
6812     TEST_FIELD_ALIGN (RECT, top, 4)
6813     TEST_FIELD_OFFSET(RECT, top, 4)
6814     TEST_FIELD_SIZE  (RECT, right, 4)
6815     TEST_FIELD_ALIGN (RECT, right, 4)
6816     TEST_FIELD_OFFSET(RECT, right, 8)
6817     TEST_FIELD_SIZE  (RECT, bottom, 4)
6818     TEST_FIELD_ALIGN (RECT, bottom, 4)
6819     TEST_FIELD_OFFSET(RECT, bottom, 12)
6820 }
6821 
6822 static void test_pack_RECTL(void)
6823 {
6824     /* RECTL */
6825     TEST_TYPE_SIZE   (RECTL, 16)
6826     TEST_TYPE_ALIGN  (RECTL, 4)
6827     TEST_FIELD_SIZE  (RECTL, left, 4)
6828     TEST_FIELD_ALIGN (RECTL, left, 4)
6829     TEST_FIELD_OFFSET(RECTL, left, 0)
6830     TEST_FIELD_SIZE  (RECTL, top, 4)
6831     TEST_FIELD_ALIGN (RECTL, top, 4)
6832     TEST_FIELD_OFFSET(RECTL, top, 4)
6833     TEST_FIELD_SIZE  (RECTL, right, 4)
6834     TEST_FIELD_ALIGN (RECTL, right, 4)
6835     TEST_FIELD_OFFSET(RECTL, right, 8)
6836     TEST_FIELD_SIZE  (RECTL, bottom, 4)
6837     TEST_FIELD_ALIGN (RECTL, bottom, 4)
6838     TEST_FIELD_OFFSET(RECTL, bottom, 12)
6839 }
6840 
6841 static void test_pack_SIZE(void)
6842 {
6843     /* SIZE */
6844     TEST_TYPE_SIZE   (SIZE, 8)
6845     TEST_TYPE_ALIGN  (SIZE, 4)
6846     TEST_FIELD_SIZE  (SIZE, cx, 4)
6847     TEST_FIELD_ALIGN (SIZE, cx, 4)
6848     TEST_FIELD_OFFSET(SIZE, cx, 0)
6849     TEST_FIELD_SIZE  (SIZE, cy, 4)
6850     TEST_FIELD_ALIGN (SIZE, cy, 4)
6851     TEST_FIELD_OFFSET(SIZE, cy, 4)
6852 }
6853 
6854 static void test_pack_SIZEL(void)
6855 {
6856     /* SIZEL */
6857     TEST_TYPE_SIZE   (SIZEL, 8)
6858     TEST_TYPE_ALIGN  (SIZEL, 4)
6859 }
6860 
6861 static void test_pack_UCHAR(void)
6862 {
6863     /* UCHAR */
6864     TEST_TYPE_SIZE   (UCHAR, 1)
6865     TEST_TYPE_ALIGN  (UCHAR, 1)
6866     TEST_TYPE_UNSIGNED(UCHAR)
6867 }
6868 
6869 static void test_pack_UINT(void)
6870 {
6871     /* UINT */
6872     TEST_TYPE_SIZE   (UINT, 4)
6873     TEST_TYPE_ALIGN  (UINT, 4)
6874     TEST_TYPE_UNSIGNED(UINT)
6875 }
6876 
6877 static void test_pack_ULONG(void)
6878 {
6879     /* ULONG */
6880     TEST_TYPE_SIZE   (ULONG, 4)
6881     TEST_TYPE_ALIGN  (ULONG, 4)
6882     TEST_TYPE_UNSIGNED(ULONG)
6883 }
6884 
6885 static void test_pack_USHORT(void)
6886 {
6887     /* USHORT */
6888     TEST_TYPE_SIZE   (USHORT, 2)
6889     TEST_TYPE_ALIGN  (USHORT, 2)
6890     TEST_TYPE_UNSIGNED(USHORT)
6891 }
6892 
6893 static void test_pack_WORD(void)
6894 {
6895     /* WORD */
6896     TEST_TYPE_SIZE   (WORD, 2)
6897     TEST_TYPE_ALIGN  (WORD, 2)
6898     TEST_TYPE_UNSIGNED(WORD)
6899 }
6900 
6901 static void test_pack_WPARAM(void)
6902 {
6903     /* WPARAM */
6904     TEST_TYPE_SIZE   (WPARAM, 4)
6905     TEST_TYPE_ALIGN  (WPARAM, 4)
6906 }
6907 
6908 #endif /* _WIN64 */
6909 
6910 static void test_pack(void)
6911 {
6912     test_pack_ACCESS_ALLOWED_ACE();
6913     test_pack_ACCESS_DENIED_ACE();
6914     test_pack_ACCESS_MASK();
6915     test_pack_ACE_HEADER();
6916     test_pack_ACL();
6917     test_pack_ACL_REVISION_INFORMATION();
6918     test_pack_ACL_SIZE_INFORMATION();
6919     test_pack_ATOM();
6920     test_pack_BOOL();
6921     test_pack_BOOLEAN();
6922     test_pack_BYTE();
6923     test_pack_CCHAR();
6924     test_pack_CHAR();
6925     test_pack_COLORREF();
6926     test_pack_DWORD();
6927     test_pack_DWORD32();
6928     test_pack_DWORD64();
6929     test_pack_DWORDLONG();
6930     test_pack_DWORD_PTR();
6931     test_pack_EXCEPTION_POINTERS();
6932     test_pack_EXCEPTION_RECORD();
6933     test_pack_EXECUTION_STATE();
6934     test_pack_FARPROC();
6935     test_pack_FLOAT();
6936     test_pack_FPO_DATA();
6937     test_pack_GENERIC_MAPPING();
6938     test_pack_GLOBALHANDLE();
6939     test_pack_HALF_PTR();
6940     test_pack_HANDLE();
6941     test_pack_HCURSOR();
6942     test_pack_HFILE();
6943     test_pack_HGDIOBJ();
6944     test_pack_HGLOBAL();
6945     test_pack_HLOCAL();
6946     test_pack_HMODULE();
6947     test_pack_HRESULT();
6948     test_pack_IMAGE_ARCHIVE_MEMBER_HEADER();
6949     test_pack_IMAGE_AUX_SYMBOL();
6950     test_pack_IMAGE_BASE_RELOCATION();
6951     test_pack_IMAGE_BOUND_FORWARDER_REF();
6952     test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR();
6953     test_pack_IMAGE_COFF_SYMBOLS_HEADER();
6954     test_pack_IMAGE_DATA_DIRECTORY();
6955     test_pack_IMAGE_DEBUG_DIRECTORY();
6956     test_pack_IMAGE_DEBUG_MISC();
6957     test_pack_IMAGE_DOS_HEADER();
6958     test_pack_IMAGE_EXPORT_DIRECTORY();
6959     test_pack_IMAGE_FILE_HEADER();
6960     test_pack_IMAGE_FUNCTION_ENTRY();
6961     test_pack_IMAGE_IMPORT_BY_NAME();
6962     test_pack_IMAGE_IMPORT_DESCRIPTOR();
6963     test_pack_IMAGE_LINENUMBER();
6964     test_pack_IMAGE_LOAD_CONFIG_DIRECTORY();
6965     test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32();
6966     test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64();
6967     test_pack_IMAGE_NT_HEADERS();
6968     test_pack_IMAGE_NT_HEADERS32();
6969     test_pack_IMAGE_NT_HEADERS64();
6970     test_pack_IMAGE_OPTIONAL_HEADER();
6971     test_pack_IMAGE_OPTIONAL_HEADER32();
6972     test_pack_IMAGE_OPTIONAL_HEADER64();
6973     test_pack_IMAGE_OS2_HEADER();
6974     test_pack_IMAGE_RELOCATION();
6975     test_pack_IMAGE_RESOURCE_DATA_ENTRY();
6976     test_pack_IMAGE_RESOURCE_DIRECTORY();
6977     test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY();
6978     test_pack_IMAGE_RESOURCE_DIRECTORY_STRING();
6979     test_pack_IMAGE_RESOURCE_DIR_STRING_U();
6980     test_pack_IMAGE_SECTION_HEADER();
6981     test_pack_IMAGE_SEPARATE_DEBUG_HEADER();
6982     test_pack_IMAGE_SYMBOL();
6983     test_pack_IMAGE_THUNK_DATA();
6984     test_pack_IMAGE_TLS_DIRECTORY();
6985     test_pack_IMAGE_TLS_DIRECTORY32();
6986     test_pack_IMAGE_TLS_DIRECTORY64();
6987     test_pack_IMAGE_VXD_HEADER();
6988     test_pack_INT();
6989     test_pack_INT16();
6990     test_pack_INT32();
6991     test_pack_INT64();
6992     test_pack_INT8();
6993     test_pack_INT_PTR();
6994     test_pack_IO_COUNTERS();
6995     test_pack_LANGID();
6996     test_pack_LARGE_INTEGER();
6997     test_pack_LCID();
6998     test_pack_LIST_ENTRY();
6999     test_pack_LOCALHANDLE();
7000     test_pack_LONG();
7001     test_pack_LONG32();
7002     test_pack_LONG64();
7003     test_pack_LONGLONG();
7004     test_pack_LONG_PTR();
7005     test_pack_LPARAM();
7006     test_pack_LPCRECT();
7007     test_pack_LPCRECTL();
7008     test_pack_LPCVOID();
7009     test_pack_LPPOINT();
7010     test_pack_LPRECT();
7011     test_pack_LPRECTL();
7012     test_pack_LPSIZE();
7013     test_pack_LRESULT();
7014     test_pack_LUID();
7015     test_pack_LUID_AND_ATTRIBUTES();
7016     test_pack_MEMORY_BASIC_INFORMATION();
7017     test_pack_MESSAGE_RESOURCE_BLOCK();
7018     test_pack_MESSAGE_RESOURCE_DATA();
7019     test_pack_MESSAGE_RESOURCE_ENTRY();
7020     test_pack_NT_TIB();
7021     test_pack_OBJECT_TYPE_LIST();
7022     test_pack_PACCESS_ALLOWED_ACE();
7023     test_pack_PACCESS_DENIED_ACE();
7024     test_pack_PACCESS_TOKEN();
7025     test_pack_PACE_HEADER();
7026     test_pack_PACL();
7027     test_pack_PACL_REVISION_INFORMATION();
7028     test_pack_PACL_SIZE_INFORMATION();
7029     test_pack_PCCH();
7030     test_pack_PCH();
7031     test_pack_PCSTR();
7032     test_pack_PCWCH();
7033     test_pack_PCWSTR();
7034     test_pack_PEXCEPTION_POINTERS();
7035     test_pack_PEXCEPTION_RECORD();
7036     test_pack_PFPO_DATA();
7037     test_pack_PGENERIC_MAPPING();
7038     test_pack_PHANDLE();
7039     test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER();
7040     test_pack_PIMAGE_AUX_SYMBOL();
7041     test_pack_PIMAGE_BASE_RELOCATION();
7042     test_pack_PIMAGE_BOUND_FORWARDER_REF();
7043     test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR();
7044     test_pack_PIMAGE_COFF_SYMBOLS_HEADER();
7045     test_pack_PIMAGE_DATA_DIRECTORY();
7046     test_pack_PIMAGE_DEBUG_DIRECTORY();
7047     test_pack_PIMAGE_DEBUG_MISC();
7048     test_pack_PIMAGE_DOS_HEADER();
7049     test_pack_PIMAGE_EXPORT_DIRECTORY();
7050     test_pack_PIMAGE_FILE_HEADER();
7051     test_pack_PIMAGE_FUNCTION_ENTRY();
7052     test_pack_PIMAGE_IMPORT_BY_NAME();
7053     test_pack_PIMAGE_IMPORT_DESCRIPTOR();
7054     test_pack_PIMAGE_LINENUMBER();
7055     test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY();
7056     test_pack_PIMAGE_NT_HEADERS();
7057     test_pack_PIMAGE_NT_HEADERS32();
7058     test_pack_PIMAGE_NT_HEADERS64();
7059     test_pack_PIMAGE_OPTIONAL_HEADER();
7060     test_pack_PIMAGE_OPTIONAL_HEADER32();
7061     test_pack_PIMAGE_OPTIONAL_HEADER64();
7062     test_pack_PIMAGE_OS2_HEADER();
7063     test_pack_PIMAGE_RELOCATION();
7064     test_pack_PIMAGE_RESOURCE_DATA_ENTRY();
7065     test_pack_PIMAGE_RESOURCE_DIRECTORY();
7066     test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY();
7067     test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING();
7068     test_pack_PIMAGE_RESOURCE_DIR_STRING_U();
7069     test_pack_PIMAGE_SECTION_HEADER();
7070     test_pack_PIMAGE_SEPARATE_DEBUG_HEADER();
7071     test_pack_PIMAGE_SYMBOL();
7072     test_pack_PIMAGE_THUNK_DATA();
7073     test_pack_PIMAGE_TLS_CALLBACK();
7074     test_pack_PIMAGE_TLS_DIRECTORY();
7075     test_pack_PIMAGE_VXD_HEADER();
7076     test_pack_PIO_COUNTERS();
7077     test_pack_PISECURITY_DESCRIPTOR();
7078     test_pack_PISECURITY_DESCRIPTOR_RELATIVE();
7079     test_pack_PISID();
7080     test_pack_PLARGE_INTEGER();
7081     test_pack_PLIST_ENTRY();
7082     test_pack_PLUID();
7083     test_pack_PLUID_AND_ATTRIBUTES();
7084     test_pack_PMEMORY_BASIC_INFORMATION();
7085     test_pack_PMESSAGE_RESOURCE_BLOCK();
7086     test_pack_PMESSAGE_RESOURCE_DATA();
7087     test_pack_PMESSAGE_RESOURCE_ENTRY();
7088     test_pack_PNT_TIB();
7089     test_pack_POBJECT_TYPE_LIST();
7090     test_pack_POINT();
7091     test_pack_POINTL();
7092     test_pack_PPOINT();
7093     test_pack_PPOINTL();
7094     test_pack_PPRIVILEGE_SET();
7095     test_pack_PRECT();
7096     test_pack_PRECTL();
7097     test_pack_PRIVILEGE_SET();
7098     test_pack_PRLIST_ENTRY();
7099     test_pack_PROC();
7100     test_pack_PRTL_CRITICAL_SECTION();
7101     test_pack_PRTL_CRITICAL_SECTION_DEBUG();
7102     test_pack_PRTL_OSVERSIONINFOEXW();
7103     test_pack_PRTL_OSVERSIONINFOW();
7104     test_pack_PRTL_RESOURCE_DEBUG();
7105     test_pack_PSECURITY_DESCRIPTOR();
7106     test_pack_PSECURITY_QUALITY_OF_SERVICE();
7107     test_pack_PSID();
7108     test_pack_PSID_IDENTIFIER_AUTHORITY();
7109     test_pack_PSINGLE_LIST_ENTRY();
7110     test_pack_PSIZE();
7111     test_pack_PSTR();
7112     test_pack_PSYSTEM_ALARM_ACE();
7113     test_pack_PSYSTEM_AUDIT_ACE();
7114     test_pack_PSZ();
7115     test_pack_PTOKEN_GROUPS();
7116     test_pack_PTOKEN_PRIVILEGES();
7117     test_pack_PTOKEN_USER();
7118     test_pack_PULARGE_INTEGER();
7119     test_pack_PVECTORED_EXCEPTION_HANDLER();
7120     test_pack_PVOID();
7121     test_pack_PWCH();
7122     test_pack_PWSTR();
7123     test_pack_RECT();
7124     test_pack_RECTL();
7125     test_pack_RTL_CRITICAL_SECTION();
7126     test_pack_RTL_CRITICAL_SECTION_DEBUG();
7127     test_pack_RTL_OSVERSIONINFOEXW();
7128     test_pack_RTL_OSVERSIONINFOW();
7129     test_pack_RTL_RESOURCE_DEBUG();
7130     test_pack_SECURITY_CONTEXT_TRACKING_MODE();
7131     test_pack_SECURITY_DESCRIPTOR();
7132     test_pack_SECURITY_DESCRIPTOR_CONTROL();
7133     test_pack_SECURITY_DESCRIPTOR_RELATIVE();
7134     test_pack_SECURITY_INFORMATION();
7135     test_pack_SECURITY_QUALITY_OF_SERVICE();
7136     test_pack_SHORT();
7137     test_pack_SID();
7138     test_pack_SID_AND_ATTRIBUTES();
7139     test_pack_SID_IDENTIFIER_AUTHORITY();
7140     test_pack_SINGLE_LIST_ENTRY();
7141     test_pack_SIZE();
7142     test_pack_SIZEL();
7143     test_pack_SIZE_T();
7144     test_pack_SSIZE_T();
7145     test_pack_SYSTEM_ALARM_ACE();
7146     test_pack_SYSTEM_AUDIT_ACE();
7147     test_pack_TOKEN_DEFAULT_DACL();
7148     test_pack_TOKEN_GROUPS();
7149     test_pack_TOKEN_OWNER();
7150     test_pack_TOKEN_PRIMARY_GROUP();
7151     test_pack_TOKEN_PRIVILEGES();
7152     test_pack_TOKEN_SOURCE();
7153     test_pack_TOKEN_STATISTICS();
7154     test_pack_TOKEN_USER();
7155     test_pack_UCHAR();
7156     test_pack_UHALF_PTR();
7157     test_pack_UINT();
7158     test_pack_UINT16();
7159     test_pack_UINT32();
7160     test_pack_UINT64();
7161     test_pack_UINT8();
7162     test_pack_UINT_PTR();
7163     test_pack_ULARGE_INTEGER();
7164     test_pack_ULONG();
7165     test_pack_ULONG32();
7166     test_pack_ULONG64();
7167     test_pack_ULONGLONG();
7168     test_pack_ULONG_PTR();
7169     test_pack_USHORT();
7170     test_pack_WAITORTIMERCALLBACKFUNC();
7171     test_pack_WCHAR();
7172     test_pack_WORD();
7173     test_pack_WPARAM();
7174 }
7175 
7176 START_TEST(generated)
7177 {
7178     test_pack();
7179 }
7180