ReactOS  0.4.15-dev-425-gc40b086
generated.c
Go to the documentation of this file.
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 */
82 }
83 
84 static void test_pack_DWORD64(void)
85 {
86  /* DWORD64 */
90 }
91 
92 static void test_pack_DWORD_PTR(void)
93 {
94  /* DWORD_PTR */
97 }
98 
99 static void test_pack_HALF_PTR(void)
100 {
101  /* HALF_PTR */
105 }
106 
107 static void test_pack_INT16(void)
108 {
109  /* INT16 */
110  TEST_TYPE_SIZE (INT16, 2)
113 }
114 
115 static void test_pack_INT32(void)
116 {
117  /* INT32 */
118  TEST_TYPE_SIZE (INT32, 4)
121 }
122 
123 static void test_pack_INT64(void)
124 {
125  /* INT64 */
126  TEST_TYPE_SIZE (INT64, 8)
129 }
130 
131 static void test_pack_INT8(void)
132 {
133  /* INT8 */
134  TEST_TYPE_SIZE (INT8, 1)
135  TEST_TYPE_ALIGN (INT8, 1)
137 }
138 
139 static void test_pack_INT_PTR(void)
140 {
141  /* INT_PTR */
145 }
146 
147 static void test_pack_LONG32(void)
148 {
149  /* LONG32 */
153 }
154 
155 static void test_pack_LONG64(void)
156 {
157  /* LONG64 */
161 }
162 
163 static void test_pack_LONG_PTR(void)
164 {
165  /* LONG_PTR */
169 }
170 
171 static void test_pack_SIZE_T(void)
172 {
173  /* SIZE_T */
176 }
177 
178 static void test_pack_SSIZE_T(void)
179 {
180  /* SSIZE_T */
183 }
184 
185 static void test_pack_UHALF_PTR(void)
186 {
187  /* UHALF_PTR */
191 }
192 
193 static void test_pack_UINT16(void)
194 {
195  /* UINT16 */
199 }
200 
201 static void test_pack_UINT32(void)
202 {
203  /* UINT32 */
207 }
208 
209 static void test_pack_UINT64(void)
210 {
211  /* UINT64 */
215 }
216 
217 static void test_pack_UINT8(void)
218 {
219  /* UINT8 */
220  TEST_TYPE_SIZE (UINT8, 1)
223 }
224 
225 static void test_pack_UINT_PTR(void)
226 {
227  /* UINT_PTR */
231 }
232 
233 static void test_pack_ULONG32(void)
234 {
235  /* ULONG32 */
239 }
240 
241 static void test_pack_ULONG64(void)
242 {
243  /* ULONG64 */
247 }
248 
249 static void test_pack_ULONG_PTR(void)
250 {
251  /* ULONG_PTR */
255 }
256 
257 static void test_pack_ACCESS_ALLOWED_ACE(void)
258 {
259  /* ACCESS_ALLOWED_ACE */
268  TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
269  TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
271 }
272 
273 static void test_pack_ACCESS_DENIED_ACE(void)
274 {
275  /* ACCESS_DENIED_ACE */
284  TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4)
285  TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
287 }
288 
289 static void test_pack_ACCESS_MASK(void)
290 {
291  /* ACCESS_MASK */
295 }
296 
297 static void test_pack_ACE_HEADER(void)
298 {
299  /* ACE_HEADER */
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)
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 */
343 }
344 
345 static void test_pack_ACL_SIZE_INFORMATION(void)
346 {
347  /* ACL_SIZE_INFORMATION */
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 */
367 }
368 
369 static void test_pack_CCHAR(void)
370 {
371  /* CCHAR */
372  TEST_TYPE_SIZE (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 */
389 }
390 
391 static void test_pack_EXCEPTION_POINTERS(void)
392 {
393  /* EXCEPTION_POINTERS */
396  TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 8)
397  TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 8)
398  TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
402 }
403 
404 static void test_pack_EXCEPTION_RECORD(void)
405 {
406  /* EXCEPTION_RECORD */
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 */
435 }
436 
437 static void test_pack_FPO_DATA(void)
438 {
439  /* FPO_DATA */
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 */
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 */
480 }
481 
482 static void test_pack_HRESULT(void)
483 {
484  /* HRESULT */
487 }
488 
490 {
491  /* IMAGE_ARCHIVE_MEMBER_HEADER */
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 */
530  TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
531  TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
533 }
534 
535 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
536 {
537  /* IMAGE_BOUND_FORWARDER_REF */
540  TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
541  TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
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)
549 }
550 
552 {
553  /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
559  TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
560  TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
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 */
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 */
609 }
610 
611 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
612 {
613  /* IMAGE_DEBUG_DIRECTORY */
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)
631  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
632  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
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 */
653  TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Unicode, 1)
654  TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
662 }
663 
664 static void test_pack_IMAGE_DOS_HEADER(void)
665 {
666  /* IMAGE_DOS_HEADER (pack 2) */
672  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2)
678  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2)
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)
696  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_csum, 2)
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)
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)
726 }
727 
728 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
729 {
730  /* IMAGE_EXPORT_DIRECTORY */
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)
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 */
773  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Machine, 2)
774  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2)
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 */
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 */
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 
836 {
837  /* IMAGE_LOAD_CONFIG_DIRECTORY */
840 }
841 
843 {
844  /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
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)
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)
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)
907 }
908 
910 {
911  /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
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)
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)
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)
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)
974 }
975 
976 static void test_pack_IMAGE_NT_HEADERS(void)
977 {
978  /* IMAGE_NT_HEADERS */
981 }
982 
983 static void test_pack_IMAGE_NT_HEADERS32(void)
984 {
985  /* IMAGE_NT_HEADERS32 */
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 */
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 */
1020 }
1021 
1022 static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
1023 {
1024  /* IMAGE_OPTIONAL_HEADER32 */
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)
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)
1051  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1052  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
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)
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 */
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)
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)
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)
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) */
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)
1230  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rev, 1)
1231  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1)
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)
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 */
1326  TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1327  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1338 }
1339 
1340 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
1341 {
1342  /* IMAGE_RESOURCE_DIRECTORY */
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)
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 
1366 {
1367  /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
1368 }
1369 
1371 {
1372  /* IMAGE_RESOURCE_DIRECTORY_STRING */
1381 }
1382 
1383 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
1384 {
1385  /* IMAGE_RESOURCE_DIR_STRING_U */
1394 }
1395 
1396 static void test_pack_IMAGE_SECTION_HEADER(void)
1397 {
1398  /* IMAGE_SECTION_HEADER */
1402 }
1403 
1404 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
1405 {
1406  /* IMAGE_SEPARATE_DEBUG_HEADER */
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)
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)
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 */
1465 }
1466 
1467 static void test_pack_IMAGE_TLS_DIRECTORY32(void)
1468 {
1469  /* IMAGE_TLS_DIRECTORY32 */
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 */
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) */
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) */
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)
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)
1721 }
1722 
1723 static void test_pack_LIST_ENTRY(void)
1724 {
1725  /* LIST_ENTRY */
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)
1742 }
1743 
1744 static void test_pack_LONGLONG(void)
1745 {
1746  /* 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) */
1776 }
1777 
1778 static void test_pack_MEMORY_BASIC_INFORMATION(void)
1779 {
1780  /* MEMORY_BASIC_INFORMATION */
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)
1804 }
1805 
1806 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
1807 {
1808  /* MESSAGE_RESOURCE_BLOCK */
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 */
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)
1833 }
1834 
1835 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
1836 {
1837  /* MESSAGE_RESOURCE_ENTRY */
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 */
1882 }
1883 
1884 static void test_pack_PACCESS_ALLOWED_ACE(void)
1885 {
1886  /* PACCESS_ALLOWED_ACE */
1891 }
1892 
1893 static void test_pack_PACCESS_DENIED_ACE(void)
1894 {
1895  /* PACCESS_DENIED_ACE */
1900 }
1901 
1902 static void test_pack_PACCESS_TOKEN(void)
1903 {
1904  /* PACCESS_TOKEN */
1907 }
1908 
1909 static void test_pack_PACE_HEADER(void)
1910 {
1911  /* PACE_HEADER */
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)
1925 }
1926 
1927 static void test_pack_PACL_REVISION_INFORMATION(void)
1928 {
1929  /* PACL_REVISION_INFORMATION */
1934 }
1935 
1936 static void test_pack_PACL_SIZE_INFORMATION(void)
1937 {
1938  /* PACL_SIZE_INFORMATION */
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)
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)
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)
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)
1979 }
1980 
1981 static void test_pack_PCWSTR(void)
1982 {
1983  /* PCWSTR */
1984  TEST_TYPE_SIZE (PCWSTR, 8)
1985  TEST_TYPE_ALIGN (PCWSTR, 8)
1988 }
1989 
1990 static void test_pack_PEXCEPTION_POINTERS(void)
1991 {
1992  /* PEXCEPTION_POINTERS */
1997 }
1998 
1999 static void test_pack_PEXCEPTION_RECORD(void)
2000 {
2001  /* PEXCEPTION_RECORD */
2006 }
2007 
2008 static void test_pack_PFPO_DATA(void)
2009 {
2010  /* PFPO_DATA */
2015 }
2016 
2017 static void test_pack_PGENERIC_MAPPING(void)
2018 {
2019  /* PGENERIC_MAPPING */
2024 }
2025 
2026 static void test_pack_PHANDLE(void)
2027 {
2028  /* PHANDLE */
2029  TEST_TYPE_SIZE (PHANDLE, 8)
2033 }
2034 
2036 {
2037  /* PIMAGE_ARCHIVE_MEMBER_HEADER */
2042 }
2043 
2044 static void test_pack_PIMAGE_AUX_SYMBOL(void)
2045 {
2046  /* PIMAGE_AUX_SYMBOL */
2049 }
2050 
2051 static void test_pack_PIMAGE_BASE_RELOCATION(void)
2052 {
2053  /* PIMAGE_BASE_RELOCATION */
2058 }
2059 
2060 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
2061 {
2062  /* PIMAGE_BOUND_FORWARDER_REF */
2067 }
2068 
2070 {
2071  /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
2076 }
2077 
2078 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
2079 {
2080  /* PIMAGE_COFF_SYMBOLS_HEADER */
2085 }
2086 
2087 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
2088 {
2089  /* PIMAGE_DATA_DIRECTORY */
2094 }
2095 
2096 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
2097 {
2098  /* PIMAGE_DEBUG_DIRECTORY */
2103 }
2104 
2105 static void test_pack_PIMAGE_DEBUG_MISC(void)
2106 {
2107  /* PIMAGE_DEBUG_MISC */
2112 }
2113 
2114 static void test_pack_PIMAGE_DOS_HEADER(void)
2115 {
2116  /* PIMAGE_DOS_HEADER */
2121 }
2122 
2123 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
2124 {
2125  /* PIMAGE_EXPORT_DIRECTORY */
2130 }
2131 
2132 static void test_pack_PIMAGE_FILE_HEADER(void)
2133 {
2134  /* PIMAGE_FILE_HEADER */
2139 }
2140 
2141 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
2142 {
2143  /* PIMAGE_FUNCTION_ENTRY */
2148 }
2149 
2150 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
2151 {
2152  /* PIMAGE_IMPORT_BY_NAME */
2157 }
2158 
2159 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
2160 {
2161  /* PIMAGE_IMPORT_DESCRIPTOR */
2164 }
2165 
2166 static void test_pack_PIMAGE_LINENUMBER(void)
2167 {
2168  /* PIMAGE_LINENUMBER */
2171 }
2172 
2174 {
2175  /* PIMAGE_LOAD_CONFIG_DIRECTORY */
2178 }
2179 
2180 static void test_pack_PIMAGE_NT_HEADERS(void)
2181 {
2182  /* PIMAGE_NT_HEADERS */
2185 }
2186 
2187 static void test_pack_PIMAGE_NT_HEADERS32(void)
2188 {
2189  /* PIMAGE_NT_HEADERS32 */
2194 }
2195 
2196 static void test_pack_PIMAGE_NT_HEADERS64(void)
2197 {
2198  /* PIMAGE_NT_HEADERS64 */
2203 }
2204 
2205 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
2206 {
2207  /* PIMAGE_OPTIONAL_HEADER */
2210 }
2211 
2212 static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
2213 {
2214  /* PIMAGE_OPTIONAL_HEADER32 */
2219 }
2220 
2221 static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
2222 {
2223  /* PIMAGE_OPTIONAL_HEADER64 */
2228 }
2229 
2230 static void test_pack_PIMAGE_OS2_HEADER(void)
2231 {
2232  /* PIMAGE_OS2_HEADER */
2237 }
2238 
2239 static void test_pack_PIMAGE_RELOCATION(void)
2240 {
2241  /* PIMAGE_RELOCATION */
2244 }
2245 
2246 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
2247 {
2248  /* PIMAGE_RESOURCE_DATA_ENTRY */
2253 }
2254 
2255 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
2256 {
2257  /* PIMAGE_RESOURCE_DIRECTORY */
2262 }
2263 
2265 {
2266  /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
2269 }
2270 
2272 {
2273  /* PIMAGE_RESOURCE_DIRECTORY_STRING */
2278 }
2279 
2281 {
2282  /* PIMAGE_RESOURCE_DIR_STRING_U */
2287 }
2288 
2289 static void test_pack_PIMAGE_SECTION_HEADER(void)
2290 {
2291  /* PIMAGE_SECTION_HEADER */
2294 }
2295 
2297 {
2298  /* PIMAGE_SEPARATE_DEBUG_HEADER */
2303 }
2304 
2305 static void test_pack_PIMAGE_SYMBOL(void)
2306 {
2307  /* PIMAGE_SYMBOL */
2310 }
2311 
2312 static void test_pack_PIMAGE_THUNK_DATA(void)
2313 {
2314  /* PIMAGE_THUNK_DATA */
2317 }
2318 
2319 static void test_pack_PIMAGE_TLS_CALLBACK(void)
2320 {
2321  /* PIMAGE_TLS_CALLBACK */
2324 }
2325 
2326 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
2327 {
2328  /* PIMAGE_TLS_DIRECTORY */
2331 }
2332 
2333 static void test_pack_PIMAGE_VXD_HEADER(void)
2334 {
2335  /* PIMAGE_VXD_HEADER */
2340 }
2341 
2342 static void test_pack_PIO_COUNTERS(void)
2343 {
2344  /* PIO_COUNTERS */
2349 }
2350 
2351 static void test_pack_PISECURITY_DESCRIPTOR(void)
2352 {
2353  /* PISECURITY_DESCRIPTOR */
2358 }
2359 
2361 {
2362  /* PISECURITY_DESCRIPTOR_RELATIVE */
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)
2376 }
2377 
2378 static void test_pack_PLARGE_INTEGER(void)
2379 {
2380  /* PLARGE_INTEGER */
2383 }
2384 
2385 static void test_pack_PLIST_ENTRY(void)
2386 {
2387  /* PLIST_ENTRY */
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)
2401 }
2402 
2403 static void test_pack_PLUID_AND_ATTRIBUTES(void)
2404 {
2405  /* PLUID_AND_ATTRIBUTES */
2410 }
2411 
2412 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
2413 {
2414  /* PMEMORY_BASIC_INFORMATION */
2419 }
2420 
2421 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
2422 {
2423  /* PMESSAGE_RESOURCE_BLOCK */
2428 }
2429 
2430 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
2431 {
2432  /* PMESSAGE_RESOURCE_DATA */
2437 }
2438 
2439 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
2440 {
2441  /* PMESSAGE_RESOURCE_ENTRY */
2446 }
2447 
2448 static void test_pack_PNT_TIB(void)
2449 {
2450  /* PNT_TIB */
2451  TEST_TYPE_SIZE (PNT_TIB, 8)
2453 }
2454 
2455 static void test_pack_POBJECT_TYPE_LIST(void)
2456 {
2457  /* POBJECT_TYPE_LIST */
2462 }
2463 
2464 static void test_pack_PPRIVILEGE_SET(void)
2465 {
2466  /* PPRIVILEGE_SET */
2471 }
2472 
2473 static void test_pack_PRIVILEGE_SET(void)
2474 {
2475  /* PRIVILEGE_SET */
2478  TEST_FIELD_SIZE (PRIVILEGE_SET, PrivilegeCount, 4)
2479  TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
2480  TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
2487 }
2488 
2489 static void test_pack_PRLIST_ENTRY(void)
2490 {
2491  /* PRLIST_ENTRY */
2496 }
2497 
2498 static void test_pack_PRTL_CRITICAL_SECTION(void)
2499 {
2500  /* PRTL_CRITICAL_SECTION */
2505 }
2506 
2507 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
2508 {
2509  /* PRTL_CRITICAL_SECTION_DEBUG */
2512 }
2513 
2514 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
2515 {
2516  /* PRTL_OSVERSIONINFOEXW */
2521 }
2522 
2523 static void test_pack_PRTL_OSVERSIONINFOW(void)
2524 {
2525  /* PRTL_OSVERSIONINFOW */
2530 }
2531 
2532 static void test_pack_PRTL_RESOURCE_DEBUG(void)
2533 {
2534  /* PRTL_RESOURCE_DEBUG */
2537 }
2538 
2539 static void test_pack_PSECURITY_DESCRIPTOR(void)
2540 {
2541  /* PSECURITY_DESCRIPTOR */
2544 }
2545 
2547 {
2548  /* PSECURITY_QUALITY_OF_SERVICE */
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 */
2567 }
2568 
2569 static void test_pack_PSINGLE_LIST_ENTRY(void)
2570 {
2571  /* PSINGLE_LIST_ENTRY */
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)
2585 }
2586 
2587 static void test_pack_PSYSTEM_ALARM_ACE(void)
2588 {
2589  /* PSYSTEM_ALARM_ACE */
2594 }
2595 
2596 static void test_pack_PSYSTEM_AUDIT_ACE(void)
2597 {
2598  /* PSYSTEM_AUDIT_ACE */
2603 }
2604 
2605 static void test_pack_PTOKEN_GROUPS(void)
2606 {
2607  /* PTOKEN_GROUPS */
2612 }
2613 
2614 static void test_pack_PTOKEN_PRIVILEGES(void)
2615 {
2616  /* PTOKEN_PRIVILEGES */
2621 }
2622 
2623 static void test_pack_PTOKEN_USER(void)
2624 {
2625  /* PTOKEN_USER */
2630 }
2631 
2632 static void test_pack_PULARGE_INTEGER(void)
2633 {
2634  /* PULARGE_INTEGER */
2637 }
2638 
2639 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
2640 {
2641  /* PVECTORED_EXCEPTION_HANDLER */
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)
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)
2669 }
2670 
2671 static void test_pack_RTL_CRITICAL_SECTION(void)
2672 {
2673  /* RTL_CRITICAL_SECTION */
2676  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, DebugInfo, 8)
2677  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 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)
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 */
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)
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)
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 */
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 */
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 */
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)
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 
2808 {
2809  /* SECURITY_CONTEXT_TRACKING_MODE */
2812 }
2813 
2814 static void test_pack_SECURITY_DESCRIPTOR(void)
2815 {
2816  /* SECURITY_DESCRIPTOR */
2840 }
2841 
2842 static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void)
2843 {
2844  /* SECURITY_DESCRIPTOR_CONTROL */
2848 }
2849 
2851 {
2852  /* SECURITY_DESCRIPTOR_RELATIVE */
2876 }
2877 
2878 static void test_pack_SECURITY_INFORMATION(void)
2879 {
2880  /* SECURITY_INFORMATION */
2884 }
2885 
2886 static void test_pack_SECURITY_QUALITY_OF_SERVICE(void)
2887 {
2888  /* SECURITY_QUALITY_OF_SERVICE */
2892 }
2893 
2894 static void test_pack_SHORT(void)
2895 {
2896  /* SHORT */
2897  TEST_TYPE_SIZE (SHORT, 2)
2898  TEST_TYPE_ALIGN (SHORT, 2)
2900 }
2901 
2902 static void test_pack_SID(void)
2903 {
2904  /* SID */
2905  TEST_TYPE_SIZE (SID, 12)
2906  TEST_TYPE_ALIGN (SID, 4)
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 */
2932 }
2933 
2934 static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
2935 {
2936  /* SID_IDENTIFIER_AUTHORITY */
2942 }
2943 
2944 static void test_pack_SINGLE_LIST_ENTRY(void)
2945 {
2946  /* SINGLE_LIST_ENTRY */
2952 }
2953 
2954 static void test_pack_SYSTEM_ALARM_ACE(void)
2955 {
2956  /* SYSTEM_ALARM_ACE */
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 */
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 */
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 */
3001  TEST_FIELD_SIZE (TOKEN_GROUPS, GroupCount, 4)
3002  TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4)
3003  TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0)
3007 }
3008 
3009 static void test_pack_TOKEN_OWNER(void)
3010 {
3011  /* TOKEN_OWNER */
3017 }
3018 
3019 static void test_pack_TOKEN_PRIMARY_GROUP(void)
3020 {
3021  /* TOKEN_PRIMARY_GROUP */
3027 }
3028 
3029 static void test_pack_TOKEN_PRIVILEGES(void)
3030 {
3031  /* TOKEN_PRIVILEGES */
3034  TEST_FIELD_SIZE (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3035  TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3036  TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0)
3040 }
3041 
3042 static void test_pack_TOKEN_SOURCE(void)
3043 {
3044  /* TOKEN_SOURCE */
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 */
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 */
3090 }
3091 
3092 static void test_pack_WAITORTIMERCALLBACKFUNC(void)
3093 {
3094  /* WAITORTIMERCALLBACKFUNC */
3097 }
3098 
3099 static void test_pack_WCHAR(void)
3100 {
3101  /* WCHAR */
3102  TEST_TYPE_SIZE (WCHAR, 2)
3103  TEST_TYPE_ALIGN (WCHAR, 2)
3105 }
3106 
3107 static void test_pack_ATOM(void)
3108 {
3109  /* ATOM */
3110  TEST_TYPE_SIZE (ATOM, 2)
3111  TEST_TYPE_ALIGN (ATOM, 2)
3113 }
3114 
3115 static void test_pack_BOOL(void)
3116 {
3117  /* BOOL */
3118  TEST_TYPE_SIZE (BOOL, 4)
3119  TEST_TYPE_ALIGN (BOOL, 4)
3121 }
3122 
3123 static void test_pack_BYTE(void)
3124 {
3125  /* BYTE */
3126  TEST_TYPE_SIZE (BYTE, 1)
3127  TEST_TYPE_ALIGN (BYTE, 1)
3129 }
3130 
3131 static void test_pack_COLORREF(void)
3132 {
3133  /* 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)
3145 }
3146 
3147 static void test_pack_FARPROC(void)
3148 {
3149  /* FARPROC */
3150  TEST_TYPE_SIZE (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 */
3166 }
3167 
3168 static void test_pack_HCURSOR(void)
3169 {
3170  /* HCURSOR */
3171  TEST_TYPE_SIZE (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)
3181 }
3182 
3183 static void test_pack_HGDIOBJ(void)
3184 {
3185  /* HGDIOBJ */
3186  TEST_TYPE_SIZE (HGDIOBJ, 8)
3188 }
3189 
3190 static void test_pack_HGLOBAL(void)
3191 {
3192  /* HGLOBAL */
3193  TEST_TYPE_SIZE (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)
3209 }
3210 
3211 static void test_pack_INT(void)
3212 {
3213  /* INT */
3214  TEST_TYPE_SIZE (INT, 4)
3215  TEST_TYPE_ALIGN (INT, 4)
3217 }
3218 
3219 static void test_pack_LOCALHANDLE(void)
3220 {
3221  /* LOCALHANDLE */
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)
3240 }
3241 
3242 static void test_pack_LPCRECTL(void)
3243 {
3244  /* LPCRECTL */
3249 }
3250 
3251 static void test_pack_LPCVOID(void)
3252 {
3253  /* LPCVOID */
3254  TEST_TYPE_SIZE (LPCVOID, 8)
3256 }
3257 
3258 static void test_pack_LPPOINT(void)
3259 {
3260  /* LPPOINT */
3261  TEST_TYPE_SIZE (LPPOINT, 8)
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)
3274 }
3275 
3276 static void test_pack_LPRECTL(void)
3277 {
3278  /* LPRECTL */
3279  TEST_TYPE_SIZE (LPRECTL, 8)
3283 }
3284 
3285 static void test_pack_LPSIZE(void)
3286 {
3287  /* LPSIZE */
3288  TEST_TYPE_SIZE (LPSIZE, 8)
3289  TEST_TYPE_ALIGN (LPSIZE, 8)
3292 }
3293 
3294 static void test_pack_LRESULT(void)
3295 {
3296  /* LRESULT */
3297  TEST_TYPE_SIZE (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)
3309  TEST_FIELD_SIZE (POINT, y, 4)
3310  TEST_FIELD_ALIGN (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)
3322  TEST_FIELD_SIZE (POINTL, y, 4)
3323  TEST_FIELD_ALIGN (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)
3334 }
3335 
3336 static void test_pack_PPOINTL(void)
3337 {
3338  /* PPOINTL */
3339  TEST_TYPE_SIZE (PPOINTL, 8)
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)
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)
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)
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)
3394  TEST_FIELD_SIZE (RECT, top, 4)
3395  TEST_FIELD_ALIGN (RECT, top, 4)
3397  TEST_FIELD_SIZE (RECT, right, 4)
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)
3413  TEST_FIELD_SIZE (RECTL, top, 4)
3414  TEST_FIELD_ALIGN (RECTL, top, 4)
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)
3432  TEST_FIELD_SIZE (SIZE, cy, 4)
3433  TEST_FIELD_ALIGN (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)
3450 }
3451 
3452 static void test_pack_UINT(void)
3453 {
3454  /* UINT */
3455  TEST_TYPE_SIZE (UINT, 4)
3456  TEST_TYPE_ALIGN (UINT, 4)
3458 }
3459 
3460 static void test_pack_ULONG(void)
3461 {
3462  /* ULONG */
3463  TEST_TYPE_SIZE (ULONG, 4)
3464  TEST_TYPE_ALIGN (ULONG, 4)
3466 }
3467 
3468 static void test_pack_USHORT(void)
3469 {
3470  /* USHORT */
3471  TEST_TYPE_SIZE (USHORT, 2)
3472  TEST_TYPE_ALIGN (USHORT, 2)
3474 }
3475 
3476 static void test_pack_WORD(void)
3477 {
3478  /* WORD */
3479  TEST_TYPE_SIZE (WORD, 2)
3480  TEST_TYPE_ALIGN (WORD, 2)
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)
3499 }
3500 
3501 static void test_pack_DWORD64(void)
3502 {
3503  /* DWORD64 */
3504  TEST_TYPE_SIZE (DWORD64, 8)
3507 }
3508 
3509 static void test_pack_DWORD_PTR(void)
3510 {
3511  /* DWORD_PTR */
3514 }
3515 
3516 static void test_pack_HALF_PTR(void)
3517 {
3518  /* 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)
3530 }
3531 
3532 static void test_pack_INT32(void)
3533 {
3534  /* INT32 */
3535  TEST_TYPE_SIZE (INT32, 4)
3536  TEST_TYPE_ALIGN (INT32, 4)
3538 }
3539 
3540 static void test_pack_INT64(void)
3541 {
3542  /* INT64 */
3543  TEST_TYPE_SIZE (INT64, 8)
3544  TEST_TYPE_ALIGN (INT64, 8)
3546 }
3547 
3548 static void test_pack_INT8(void)
3549 {
3550  /* INT8 */
3551  TEST_TYPE_SIZE (INT8, 1)
3552  TEST_TYPE_ALIGN (INT8, 1)
3554 }
3555 
3556 static void test_pack_INT_PTR(void)
3557 {
3558  /* INT_PTR */
3559  TEST_TYPE_SIZE (INT_PTR, 4)
3562 }
3563 
3564 static void test_pack_LONG32(void)
3565 {
3566  /* LONG32 */
3567  TEST_TYPE_SIZE (LONG32, 4)
3568  TEST_TYPE_ALIGN (LONG32, 4)
3570 }
3571 
3572 static void test_pack_LONG64(void)
3573 {
3574  /* LONG64 */
3575  TEST_TYPE_SIZE (LONG64, 8)
3576  TEST_TYPE_ALIGN (LONG64, 8)
3578 }
3579 
3580 static void test_pack_LONG_PTR(void)
3581 {
3582  /* 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)
3600 }
3601 
3602 static void test_pack_UHALF_PTR(void)
3603 {
3604  /* 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)
3616 }
3617 
3618 static void test_pack_UINT32(void)
3619 {
3620  /* UINT32 */
3621  TEST_TYPE_SIZE (UINT32, 4)
3622  TEST_TYPE_ALIGN (UINT32, 4)
3624 }
3625 
3626 static void test_pack_UINT64(void)
3627 {
3628  /* UINT64 */
3629  TEST_TYPE_SIZE (UINT64, 8)
3630  TEST_TYPE_ALIGN (UINT64, 8)
3632 }
3633 
3634 static void test_pack_UINT8(void)
3635 {
3636  /* UINT8 */
3637  TEST_TYPE_SIZE (UINT8, 1)
3638  TEST_TYPE_ALIGN (UINT8, 1)
3640 }
3641 
3642 static void test_pack_UINT_PTR(void)
3643 {
3644  /* UINT_PTR */
3648 }
3649 
3650 static void test_pack_ULONG32(void)
3651 {
3652  /* ULONG32 */
3653  TEST_TYPE_SIZE (ULONG32, 4)
3656 }
3657 
3658 static void test_pack_ULONG64(void)
3659 {
3660  /* ULONG64 */
3661  TEST_TYPE_SIZE (ULONG64, 8)
3664 }
3665 
3666 static void test_pack_ULONG_PTR(void)
3667 {
3668  /* ULONG_PTR */
3672 }
3673 
3675 {
3676  /* ACCESS_ALLOWED_ACE */
3685  TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
3686  TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
3688 }
3689 
3691 {
3692  /* ACCESS_DENIED_ACE */
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 */
3712 }
3713 
3714 static void test_pack_ACE_HEADER(void)
3715 {
3716  /* ACE_HEADER */
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)
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 
3753 {
3754  /* ACL_REVISION_INFORMATION */
3760 }
3761 
3763 {
3764  /* ACL_SIZE_INFORMATION */
3767  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AceCount, 4)
3768  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4)
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)
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 */
3806 }
3807 
3809 {
3810  /* EXCEPTION_POINTERS */
3813  TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 4)
3814  TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 4)
3815  TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
3819 }
3820 
3822 {
3823  /* EXCEPTION_RECORD */
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 */
3852 }
3853 
3854 static void test_pack_FPO_DATA(void)
3855 {
3856  /* FPO_DATA */
3857  TEST_TYPE_SIZE (FPO_DATA, 16)
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 */
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)
3904 }
3905 
3907 {
3908  /* IMAGE_ARCHIVE_MEMBER_HEADER */
3932 }
3933 
3935 {
3936  /* IMAGE_AUX_SYMBOL (pack 2) */
3937 }
3938 
3940 {
3941  /* IMAGE_BASE_RELOCATION */
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 
3953 {
3954  /* IMAGE_BOUND_FORWARDER_REF */
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)
3966 }
3967 
3969 {
3970  /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
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 
3985 {
3986  /* IMAGE_COFF_SYMBOLS_HEADER */
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 
4016 {
4017  /* IMAGE_DATA_DIRECTORY */
4026 }
4027 
4029 {
4030  /* IMAGE_DEBUG_DIRECTORY */
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)
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 
4060 {
4061  /* IMAGE_DEBUG_MISC */
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)
4079 }
4080 
4082 {
4083  /* IMAGE_DOS_HEADER (pack 2) */
4089  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2)
4090  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2)
4095  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2)
4096  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2)
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)
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)
4117