ReactOS  0.4.13-dev-698-g77671f0
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 #ifndef __REACTOS__
9 #define WINVER 0x0501
10 #define _WIN32_IE 0x0501
11 #define _WIN32_WINNT 0x0501
12 #endif
13 
14 #define WINE_NOWINSOCK
15 
16 #include "ntdll_test.h"
17 
18 #include "wine/test.h"
19 
20 /***********************************************************************
21  * Compatibility macros
22  */
23 
24 #define DWORD_PTR UINT_PTR
25 #define LONG_PTR INT_PTR
26 #define ULONG_PTR UINT_PTR
27 
28 /***********************************************************************
29  * Windows API extension
30  */
31 
32 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
33 # define _TYPE_ALIGNMENT(type) __alignof(type)
34 #elif defined(__GNUC__)
35 # define _TYPE_ALIGNMENT(type) __alignof__(type)
36 #else
37 /*
38  * FIXME: May not be possible without a compiler extension
39  * (if type is not just a name that is, otherwise the normal
40  * TYPE_ALIGNMENT can be used)
41  */
42 #endif
43 
44 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
45 #pragma warning(disable:4116)
46 #endif
47 
48 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
49 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
50 #endif
51 
52 /***********************************************************************
53  * Test helper macros
54  */
55 
56 #define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
57 
58 #ifdef TYPE_ALIGNMENT
59 # define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
60 #else
61 # define TEST_TYPE_ALIGN(type, align)
62 #endif
63 
64 #ifdef _TYPE_ALIGNMENT
65 # define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
66 # define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
67 #else
68 # define TEST_TARGET_ALIGN(type, align)
69 # define TEST_FIELD_ALIGN(type, field, align)
70 #endif
71 
72 #define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
73 
74 #define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
75 #define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
76 #define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
77 #define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);
78 
79 
80 #ifdef _WIN64
81 
82 static void test_pack_DWORD32(void)
83 {
84  /* DWORD32 */
88 }
89 
90 static void test_pack_DWORD64(void)
91 {
92  /* DWORD64 */
96 }
97 
98 static void test_pack_DWORD_PTR(void)
99 {
100  /* DWORD_PTR */
103 }
104 
105 static void test_pack_HALF_PTR(void)
106 {
107  /* HALF_PTR */
111 }
112 
113 static void test_pack_INT16(void)
114 {
115  /* INT16 */
116  TEST_TYPE_SIZE (INT16, 2)
119 }
120 
121 static void test_pack_INT32(void)
122 {
123  /* INT32 */
124  TEST_TYPE_SIZE (INT32, 4)
127 }
128 
129 static void test_pack_INT64(void)
130 {
131  /* INT64 */
132  TEST_TYPE_SIZE (INT64, 8)
135 }
136 
137 static void test_pack_INT8(void)
138 {
139  /* INT8 */
140  TEST_TYPE_SIZE (INT8, 1)
141  TEST_TYPE_ALIGN (INT8, 1)
143 }
144 
145 static void test_pack_INT_PTR(void)
146 {
147  /* INT_PTR */
151 }
152 
153 static void test_pack_LONG32(void)
154 {
155  /* LONG32 */
159 }
160 
161 static void test_pack_LONG64(void)
162 {
163  /* LONG64 */
167 }
168 
169 static void test_pack_LONG_PTR(void)
170 {
171  /* LONG_PTR */
175 }
176 
177 static void test_pack_SIZE_T(void)
178 {
179  /* SIZE_T */
182 }
183 
184 static void test_pack_SSIZE_T(void)
185 {
186  /* SSIZE_T */
189 }
190 
191 static void test_pack_UHALF_PTR(void)
192 {
193  /* UHALF_PTR */
197 }
198 
199 static void test_pack_UINT16(void)
200 {
201  /* UINT16 */
205 }
206 
207 static void test_pack_UINT32(void)
208 {
209  /* UINT32 */
213 }
214 
215 static void test_pack_UINT64(void)
216 {
217  /* UINT64 */
221 }
222 
223 static void test_pack_UINT8(void)
224 {
225  /* UINT8 */
226  TEST_TYPE_SIZE (UINT8, 1)
229 }
230 
231 static void test_pack_UINT_PTR(void)
232 {
233  /* UINT_PTR */
237 }
238 
239 static void test_pack_ULONG32(void)
240 {
241  /* ULONG32 */
245 }
246 
247 static void test_pack_ULONG64(void)
248 {
249  /* ULONG64 */
253 }
254 
255 static void test_pack_ULONG_PTR(void)
256 {
257  /* ULONG_PTR */
261 }
262 
263 static void test_pack_ACCESS_ALLOWED_ACE(void)
264 {
265  /* ACCESS_ALLOWED_ACE */
274  TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
275  TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
277 }
278 
279 static void test_pack_ACCESS_DENIED_ACE(void)
280 {
281  /* ACCESS_DENIED_ACE */
290  TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4)
291  TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
293 }
294 
295 static void test_pack_ACCESS_MASK(void)
296 {
297  /* ACCESS_MASK */
301 }
302 
303 static void test_pack_ACE_HEADER(void)
304 {
305  /* ACE_HEADER */
314  TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2)
315  TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
316  TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
317 }
318 
319 static void test_pack_ACL(void)
320 {
321  /* ACL */
322  TEST_TYPE_SIZE (ACL, 8)
323  TEST_TYPE_ALIGN (ACL, 2)
327  TEST_FIELD_SIZE (ACL, Sbz1, 1)
328  TEST_FIELD_ALIGN (ACL, Sbz1, 1)
329  TEST_FIELD_OFFSET(ACL, Sbz1, 1)
330  TEST_FIELD_SIZE (ACL, AclSize, 2)
331  TEST_FIELD_ALIGN (ACL, AclSize, 2)
332  TEST_FIELD_OFFSET(ACL, AclSize, 2)
333  TEST_FIELD_SIZE (ACL, AceCount, 2)
334  TEST_FIELD_ALIGN (ACL, AceCount, 2)
335  TEST_FIELD_OFFSET(ACL, AceCount, 4)
336  TEST_FIELD_SIZE (ACL, Sbz2, 2)
337  TEST_FIELD_ALIGN (ACL, Sbz2, 2)
338  TEST_FIELD_OFFSET(ACL, Sbz2, 6)
339 }
340 
341 static void test_pack_ACL_REVISION_INFORMATION(void)
342 {
343  /* ACL_REVISION_INFORMATION */
349 }
350 
351 static void test_pack_ACL_SIZE_INFORMATION(void)
352 {
353  /* ACL_SIZE_INFORMATION */
359  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
360  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
361  TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
362  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4)
363  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
364  TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
365 }
366 
367 static void test_pack_BOOLEAN(void)
368 {
369  /* BOOLEAN */
373 }
374 
375 static void test_pack_CCHAR(void)
376 {
377  /* CCHAR */
378  TEST_TYPE_SIZE (CCHAR, 1)
380 }
381 
382 static void test_pack_CHAR(void)
383 {
384  /* CHAR */
385  TEST_TYPE_SIZE (CHAR, 1)
386  TEST_TYPE_ALIGN (CHAR, 1)
387 }
388 
389 static void test_pack_DWORDLONG(void)
390 {
391  /* DWORDLONG */
395 }
396 
397 static void test_pack_EXCEPTION_POINTERS(void)
398 {
399  /* EXCEPTION_POINTERS */
402  TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 8)
403  TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 8)
404  TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
408 }
409 
410 static void test_pack_EXCEPTION_RECORD(void)
411 {
412  /* EXCEPTION_RECORD */
418  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4)
419  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
420  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
421  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 8)
422  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 8)
423  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
424  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 8)
425  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 8)
426  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 16)
427  TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4)
428  TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
429  TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 24)
430  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionInformation, 120)
431  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 8)
432  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 32)
433 }
434 
435 static void test_pack_EXECUTION_STATE(void)
436 {
437  /* EXECUTION_STATE */
441 }
442 
443 static void test_pack_FPO_DATA(void)
444 {
445  /* FPO_DATA */
448  TEST_FIELD_SIZE (FPO_DATA, ulOffStart, 4)
449  TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
450  TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
451  TEST_FIELD_SIZE (FPO_DATA, cbProcSize, 4)
452  TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
453  TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
454  TEST_FIELD_SIZE (FPO_DATA, cdwLocals, 4)
455  TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
456  TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
457  TEST_FIELD_SIZE (FPO_DATA, cdwParams, 2)
458  TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
459  TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
460 }
461 
462 static void test_pack_GENERIC_MAPPING(void)
463 {
464  /* GENERIC_MAPPING */
467  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericRead, 4)
468  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
469  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
470  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericWrite, 4)
471  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
472  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
473  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericExecute, 4)
474  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
475  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
476  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericAll, 4)
477  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
478  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
479 }
480 
481 static void test_pack_HANDLE(void)
482 {
483  /* HANDLE */
486 }
487 
488 static void test_pack_HRESULT(void)
489 {
490  /* HRESULT */
493 }
494 
496 {
497  /* IMAGE_ARCHIVE_MEMBER_HEADER */
521 }
522 
523 static void test_pack_IMAGE_AUX_SYMBOL(void)
524 {
525  /* IMAGE_AUX_SYMBOL (pack 2) */
526 }
527 
528 static void test_pack_IMAGE_BASE_RELOCATION(void)
529 {
530  /* IMAGE_BASE_RELOCATION */
536  TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
537  TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
539 }
540 
541 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
542 {
543  /* IMAGE_BOUND_FORWARDER_REF */
546  TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
547  TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
549  TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
550  TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
551  TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
555 }
556 
558 {
559  /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
565  TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
566  TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
568  TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
569  TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
570  TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
571 }
572 
573 static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void)
574 {
575  /* IMAGE_COFF_SYMBOLS_HEADER */
578  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
579  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
580  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0)
581  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
582  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
583  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
584  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
585  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
586  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
587  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
588  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
589  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
590  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
591  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
592  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
593  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
594  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
595  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
596  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
597  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
598  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
599  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
600  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
601  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
602 }
603 
604 static void test_pack_IMAGE_DATA_DIRECTORY(void)
605 {
606  /* IMAGE_DATA_DIRECTORY */
615 }
616 
617 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
618 {
619  /* IMAGE_DEBUG_DIRECTORY */
622  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
623  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
624  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
625  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
626  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
627  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
637  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
638  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
640  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
641  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
642  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
643  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
644  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
645  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
646 }
647 
648 static void test_pack_IMAGE_DEBUG_MISC(void)
649 {
650  /* IMAGE_DEBUG_MISC */
659  TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Unicode, 1)
660  TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
668 }
669 
670 static void test_pack_IMAGE_DOS_HEADER(void)
671 {
672  /* IMAGE_DOS_HEADER (pack 2) */
678  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2)
684  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2)
687  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cparhdr, 2)
688  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
689  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8)
690  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_minalloc, 2)
691  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
692  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
693  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_maxalloc, 2)
694  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
695  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
702  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_csum, 2)
711  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfarlc, 2)
712  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfarlc, 2)
713  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfarlc, 24)
714  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ovno, 2)
720  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oemid, 2)
721  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oemid, 2)
722  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oemid, 36)
723  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oeminfo, 2)
724  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2)
725  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38)
726  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_res2, 20)
732 }
733 
734 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
735 {
736  /* IMAGE_EXPORT_DIRECTORY */
739  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
740  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
741  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0)
742  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
743  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
744  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
757  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
758  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
759  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20)
760  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
761  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
762  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24)
763  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
764  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
765  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28)
766  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
767  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
768  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32)
769  TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
770  TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
771  TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36)
772 }
773 
774 static void test_pack_IMAGE_FILE_HEADER(void)
775 {
776  /* IMAGE_FILE_HEADER */
779  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Machine, 2)
780  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2)
782  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSections, 2)
783  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2)
784  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2)
785  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, TimeDateStamp, 4)
786  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4)
787  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4)
788  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
789  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
790  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8)
791  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
792  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
793  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12)
794  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
795  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
796  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16)
797  TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Characteristics, 2)
798  TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2)
799  TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18)
800 }
801 
802 static void test_pack_IMAGE_FUNCTION_ENTRY(void)
803 {
804  /* IMAGE_FUNCTION_ENTRY */
807  TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
808  TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
809  TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0)
810  TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
811  TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
812  TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
813  TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
814  TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
815  TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8)
816 }
817 
818 static void test_pack_IMAGE_IMPORT_BY_NAME(void)
819 {
820  /* IMAGE_IMPORT_BY_NAME */
829 }
830 
831 static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
832 {
833  /* IMAGE_IMPORT_DESCRIPTOR */
834 }
835 
836 static void test_pack_IMAGE_LINENUMBER(void)
837 {
838  /* IMAGE_LINENUMBER (pack 2) */
839 }
840 
842 {
843  /* IMAGE_LOAD_CONFIG_DIRECTORY */
846 }
847 
849 {
850  /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
865  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
866  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
867  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12)
871  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
872  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
873  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20)
874  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
875  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
876  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24)
877  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
878  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
879  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28)
880  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
881  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
883  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
884  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
885  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 40)
886  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
887  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
888  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 44)
889  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
890  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
891  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 48)
913 }
914 
916 {
917  /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
932  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
933  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
934  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12)
938  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
939  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
940  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20)
941  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
942  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
943  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24)
944  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
945  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
946  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32)
947  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
948  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
950  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
951  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
952  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48)
953  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
954  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
955  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56)
959  TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
960  TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
961  TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72)
980 }
981 
982 static void test_pack_IMAGE_NT_HEADERS(void)
983 {
984  /* IMAGE_NT_HEADERS */
987 }
988 
989 static void test_pack_IMAGE_NT_HEADERS32(void)
990 {
991  /* IMAGE_NT_HEADERS32 */
997  TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, FileHeader, 20)
998  TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, FileHeader, 4)
999  TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, FileHeader, 4)
1000  TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, OptionalHeader, 224)
1001  TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, OptionalHeader, 4)
1002  TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader, 24)
1003 }
1004 
1005 static void test_pack_IMAGE_NT_HEADERS64(void)
1006 {
1007  /* IMAGE_NT_HEADERS64 */
1013  TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, FileHeader, 20)
1014  TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, FileHeader, 4)
1015  TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, FileHeader, 4)
1016  TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, OptionalHeader, 240)
1017  TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, OptionalHeader, 8)
1018  TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader, 24)
1019 }
1020 
1021 static void test_pack_IMAGE_OPTIONAL_HEADER(void)
1022 {
1023  /* IMAGE_OPTIONAL_HEADER */
1026 }
1027 
1028 static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
1029 {
1030  /* IMAGE_OPTIONAL_HEADER32 */
1036  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1037  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1038  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 2)
1039  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1040  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1041  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 3)
1042  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1043  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1045  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1046  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1047  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 8)
1048  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1049  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1050  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 12)
1051  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1052  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1053  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 16)
1054  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1055  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1057  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1058  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1063  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1064  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1065  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SectionAlignment, 32)
1066  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1067  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1068  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, FileAlignment, 36)
1069  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1070  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1071  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 40)
1072  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1073  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1074  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 42)
1075  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1076  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1077  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 44)
1078  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1079  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1080  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 46)
1081  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1082  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1083  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 48)
1084  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1085  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1086  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 50)
1087  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1088  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1089  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 52)
1090  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1091  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1092  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfImage, 56)
1093  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1094  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1095  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 60)
1102  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1103  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1104  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 70)
1105  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1106  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1107  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 72)
1108  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1109  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1110  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 76)
1111  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1112  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1113  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 80)
1114  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1115  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1116  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 84)
1117  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1118  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1119  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, LoaderFlags, 88)
1120  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1121  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1122  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 92)
1123  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DataDirectory, 128)
1124  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DataDirectory, 4)
1125  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DataDirectory, 96)
1126 }
1127 
1128 static void test_pack_IMAGE_OPTIONAL_HEADER64(void)
1129 {
1130  /* IMAGE_OPTIONAL_HEADER64 */
1136  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1137  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1138  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 2)
1139  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1140  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1141  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 3)
1142  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1143  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1145  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1146  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1147  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 8)
1148  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1149  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1150  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 12)
1151  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1152  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1153  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 16)
1154  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1155  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1160  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1161  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1162  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SectionAlignment, 32)
1163  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1164  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1165  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, FileAlignment, 36)
1166  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1167  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1168  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 40)
1169  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1170  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1171  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 42)
1172  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1173  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1174  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 44)
1175  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1176  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1177  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 46)
1178  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1179  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1180  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 48)
1181  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1182  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1183  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 50)
1184  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1185  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1186  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 52)
1187  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1188  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1189  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfImage, 56)
1190  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1191  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1192  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 60)
1199  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1200  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1201  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 70)
1202  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1203  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1204  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 72)
1205  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1206  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1207  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 80)
1208  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1209  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1210  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 88)
1211  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1212  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1213  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 96)
1214  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1215  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1216  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, LoaderFlags, 104)
1217  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1218  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1219  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 108)
1220  TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DataDirectory, 128)
1221  TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DataDirectory, 4)
1222  TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DataDirectory, 112)
1223 }
1224 
1225 static void test_pack_IMAGE_OS2_HEADER(void)
1226 {
1227  /* IMAGE_OS2_HEADER (pack 2) */
1230  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_magic, 2)
1231  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2)
1232  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_magic, 0)
1233  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_ver, 1)
1234  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_ver, 1)
1236  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rev, 1)
1237  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1)
1239  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_enttab, 2)
1240  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2)
1241  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4)
1242  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1243  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1244  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6)
1245  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_crc, 4)
1246  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_crc, 2)
1248  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flags, 2)
1249  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2)
1250  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12)
1251  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_autodata, 2)
1252  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2)
1253  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14)
1254  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_heap, 2)
1255  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_heap, 2)
1256  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_heap, 16)
1257  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_stack, 2)
1258  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2)
1259  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18)
1260  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_csip, 4)
1261  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_csip, 2)
1262  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_csip, 20)
1263  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_sssp, 4)
1264  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_sssp, 2)
1265  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_sssp, 24)
1266  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cseg, 2)
1267  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cseg, 2)
1268  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cseg, 28)
1269  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmod, 2)
1270  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmod, 2)
1271  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmod, 30)
1272  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1273  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1274  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32)
1275  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_segtab, 2)
1276  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2)
1277  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34)
1278  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1279  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1280  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36)
1281  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_restab, 2)
1282  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2)
1283  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38)
1284  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_modtab, 2)
1285  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2)
1286  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40)
1287  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_imptab, 2)
1288  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2)
1289  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42)
1290  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_nrestab, 4)
1291  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2)
1292  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44)
1293  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmovent, 2)
1294  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2)
1295  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48)
1296  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_align, 2)
1297  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2)
1298  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50)
1299  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cres, 2)
1300  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cres, 2)
1301  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cres, 52)
1302  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_exetyp, 1)
1303  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1)
1304  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54)
1305  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1306  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1307  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55)
1308  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1309  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1310  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56)
1311  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1312  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1313  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58)
1314  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_swaparea, 2)
1315  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2)
1316  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60)
1317  TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_expver, 2)
1318  TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2)
1319  TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62)
1320 }
1321 
1322 static void test_pack_IMAGE_RELOCATION(void)
1323 {
1324  /* IMAGE_RELOCATION (pack 2) */
1325 }
1326 
1327 static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void)
1328 {
1329  /* IMAGE_RESOURCE_DATA_ENTRY */
1332  TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1333  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1344 }
1345 
1346 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
1347 {
1348  /* IMAGE_RESOURCE_DIRECTORY */
1351  TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1352  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1353  TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0)
1354  TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1355  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1356  TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1363  TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1364  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1365  TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12)
1366  TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1367  TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1368  TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14)
1369 }
1370 
1372 {
1373  /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
1374 }
1375 
1377 {
1378  /* IMAGE_RESOURCE_DIRECTORY_STRING */
1387 }
1388 
1389 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
1390 {
1391  /* IMAGE_RESOURCE_DIR_STRING_U */
1400 }
1401 
1402 static void test_pack_IMAGE_SECTION_HEADER(void)
1403 {
1404  /* IMAGE_SECTION_HEADER */
1408 }
1409 
1410 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
1411 {
1412  /* IMAGE_SEPARATE_DEBUG_HEADER */
1424  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1425  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1426  TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 6)
1427  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1428  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1439  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1440  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1441  TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24)
1442  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1443  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1444  TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28)
1445  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1446  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1447  TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32)
1448  TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1449  TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1450  TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36)
1454 }
1455 
1456 static void test_pack_IMAGE_SYMBOL(void)
1457 {
1458  /* IMAGE_SYMBOL (pack 2) */
1459 }
1460 
1461 static void test_pack_IMAGE_THUNK_DATA(void)
1462 {
1463  /* IMAGE_THUNK_DATA */
1464 }
1465 
1466 static void test_pack_IMAGE_TLS_DIRECTORY(void)
1467 {
1468  /* IMAGE_TLS_DIRECTORY */
1471 }
1472 
1473 static void test_pack_IMAGE_TLS_DIRECTORY32(void)
1474 {
1475  /* IMAGE_TLS_DIRECTORY32 */
1478  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1479  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1480  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 0)
1481  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1482  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1483  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1484  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1485  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1486  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfIndex, 8)
1487  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1488  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1489  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 12)
1490  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1491  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1492  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 16)
1493  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1494  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1495  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, Characteristics, 20)
1496 }
1497 
1498 static void test_pack_IMAGE_TLS_DIRECTORY64(void)
1499 {
1500  /* IMAGE_TLS_DIRECTORY64 */
1503  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1504  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1505  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 0)
1506  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1507  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1508  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1509  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1510  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1511  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfIndex, 16)
1512  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1513  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1514  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 24)
1515  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1516  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1517  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 32)
1518  TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1519  TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1520  TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, Characteristics, 36)
1521 }
1522 
1523 static void test_pack_IMAGE_VXD_HEADER(void)
1524 {
1525  /* IMAGE_VXD_HEADER (pack 2) */
1528  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_magic, 2)
1529  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2)
1530  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0)
1531  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_border, 1)
1532  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1)
1533  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2)
1534  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_worder, 1)
1535  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1)
1536  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3)
1537  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_level, 4)
1538  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2)
1539  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4)
1540  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cpu, 2)
1541  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cpu, 2)
1542  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cpu, 8)
1543  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_os, 2)
1544  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_os, 2)
1545  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_os, 10)
1546  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ver, 4)
1547  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ver, 2)
1548  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ver, 12)
1549  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mflags, 4)
1550  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2)
1551  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16)
1552  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mpages, 4)
1553  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2)
1554  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20)
1555  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_startobj, 4)
1556  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2)
1557  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24)
1558  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_eip, 4)
1559  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_eip, 2)
1560  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_eip, 28)
1561  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_stackobj, 4)
1562  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2)
1563  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32)
1564  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_esp, 4)
1565  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_esp, 2)
1566  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_esp, 36)
1567  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesize, 4)
1568  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2)
1569  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40)
1570  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_lastpagesize, 4)
1571  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2)
1572  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44)
1573  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsize, 4)
1574  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2)
1575  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48)
1576  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsum, 4)
1577  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2)
1578  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52)
1579  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsize, 4)
1580  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2)
1581  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56)
1582  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsum, 4)
1583  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2)
1584  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60)
1585  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objtab, 4)
1586  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2)
1587  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64)
1588  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objcnt, 4)
1589  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2)
1590  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68)
1591  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objmap, 4)
1592  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2)
1593  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72)
1594  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_itermap, 4)
1595  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2)
1596  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76)
1597  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrctab, 4)
1598  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2)
1599  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80)
1600  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrccnt, 4)
1601  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2)
1602  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84)
1603  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_restab, 4)
1604  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2)
1605  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88)
1606  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_enttab, 4)
1607  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2)
1608  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92)
1609  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dirtab, 4)
1610  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2)
1611  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96)
1612  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dircnt, 4)
1613  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2)
1614  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100)
1615  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fpagetab, 4)
1616  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2)
1617  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104)
1618  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_frectab, 4)
1619  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2)
1620  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108)
1621  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmod, 4)
1622  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2)
1623  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112)
1624  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmodcnt, 4)
1625  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2)
1626  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116)
1627  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impproc, 4)
1628  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2)
1629  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120)
1630  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesum, 4)
1631  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2)
1632  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124)
1633  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_datapage, 4)
1634  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2)
1635  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128)
1636  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_preload, 4)
1637  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2)
1638  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132)
1639  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nrestab, 4)
1640  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2)
1641  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136)
1642  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cbnrestab, 4)
1643  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2)
1644  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140)
1645  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nressum, 4)
1646  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2)
1647  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144)
1648  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_autodata, 4)
1649  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2)
1650  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148)
1651  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuginfo, 4)
1652  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2)
1653  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152)
1654  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuglen, 4)
1655  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2)
1656  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156)
1657  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instpreload, 4)
1658  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2)
1659  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160)
1660  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instdemand, 4)
1661  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2)
1662  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164)
1663  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_heapsize, 4)
1664  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2)
1665  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168)
1666  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_res3, 12)
1667  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1)
1668  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172)
1669  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winresoff, 4)
1670  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2)
1671  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184)
1672  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winreslen, 4)
1673  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2)
1674  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188)
1675  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_devid, 2)
1676  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2)
1677  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192)
1678  TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ddkver, 2)
1679  TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2)
1680  TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194)
1681 }
1682 
1683 static void test_pack_IO_COUNTERS(void)
1684 {
1685  /* IO_COUNTERS (pack 8) */
1688  TEST_FIELD_SIZE (IO_COUNTERS, ReadOperationCount, 8)
1689  TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8)
1690  TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0)
1691  TEST_FIELD_SIZE (IO_COUNTERS, WriteOperationCount, 8)
1692  TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8)
1693  TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8)
1694  TEST_FIELD_SIZE (IO_COUNTERS, OtherOperationCount, 8)
1695  TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8)
1696  TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16)
1697  TEST_FIELD_SIZE (IO_COUNTERS, ReadTransferCount, 8)
1698  TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8)
1699  TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24)
1700  TEST_FIELD_SIZE (IO_COUNTERS, WriteTransferCount, 8)
1701  TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8)
1702  TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32)
1703  TEST_FIELD_SIZE (IO_COUNTERS, OtherTransferCount, 8)
1704  TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8)
1705  TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40)
1706 }
1707 
1708 static void test_pack_LANGID(void)
1709 {
1710  /* LANGID */
1711  TEST_TYPE_SIZE (LANGID, 2)
1712  TEST_TYPE_ALIGN (LANGID, 2)
1714 }
1715 
1716 static void test_pack_LARGE_INTEGER(void)
1717 {
1718  /* LARGE_INTEGER */
1719 }
1720 
1721 static void test_pack_LCID(void)
1722 {
1723  /* LCID */
1724  TEST_TYPE_SIZE (LCID, 4)
1725  TEST_TYPE_ALIGN (LCID, 4)
1727 }
1728 
1729 static void test_pack_LIST_ENTRY(void)
1730 {
1731  /* LIST_ENTRY */
1734  TEST_FIELD_SIZE (LIST_ENTRY, Flink, 8)
1735  TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 8)
1736  TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0)
1737  TEST_FIELD_SIZE (LIST_ENTRY, Blink, 8)
1738  TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 8)
1739  TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 8)
1740 }
1741 
1742 static void test_pack_LONG(void)
1743 {
1744  /* LONG */
1745  TEST_TYPE_SIZE (LONG, 4)
1746  TEST_TYPE_ALIGN (LONG, 4)
1748 }
1749 
1750 static void test_pack_LONGLONG(void)
1751 {
1752  /* LONGLONG */
1756 }
1757 
1758 static void test_pack_LUID(void)
1759 {
1760  /* LUID */
1761  TEST_TYPE_SIZE (LUID, 8)
1762  TEST_TYPE_ALIGN (LUID, 4)
1763  TEST_FIELD_SIZE (LUID, LowPart, 4)
1764  TEST_FIELD_ALIGN (LUID, LowPart, 4)
1765  TEST_FIELD_OFFSET(LUID, LowPart, 0)
1766  TEST_FIELD_SIZE (LUID, HighPart, 4)
1767  TEST_FIELD_ALIGN (LUID, HighPart, 4)
1768  TEST_FIELD_OFFSET(LUID, HighPart, 4)
1769 }
1770 
1771 static void test_pack_LUID_AND_ATTRIBUTES(void)
1772 {
1773  /* LUID_AND_ATTRIBUTES (pack 4) */
1782 }
1783 
1784 static void test_pack_MEMORY_BASIC_INFORMATION(void)
1785 {
1786  /* MEMORY_BASIC_INFORMATION */
1792  TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1793  TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1794  TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1795  TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1796  TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1797  TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 16)
1810 }
1811 
1812 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
1813 {
1814  /* MESSAGE_RESOURCE_BLOCK */
1823  TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1824  TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1825  TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8)
1826 }
1827 
1828 static void test_pack_MESSAGE_RESOURCE_DATA(void)
1829 {
1830  /* MESSAGE_RESOURCE_DATA */
1833  TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1834  TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1835  TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0)
1839 }
1840 
1841 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
1842 {
1843  /* MESSAGE_RESOURCE_ENTRY */
1855 }
1856 
1857 static void test_pack_NT_TIB(void)
1858 {
1859  /* NT_TIB */
1860  TEST_FIELD_SIZE (NT_TIB, ExceptionList, 8)
1861  TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 8)
1862  TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0)
1863  TEST_FIELD_SIZE (NT_TIB, StackBase, 8)
1864  TEST_FIELD_ALIGN (NT_TIB, StackBase, 8)
1865  TEST_FIELD_OFFSET(NT_TIB, StackBase, 8)
1866  TEST_FIELD_SIZE (NT_TIB, StackLimit, 8)
1867  TEST_FIELD_ALIGN (NT_TIB, StackLimit, 8)
1868  TEST_FIELD_OFFSET(NT_TIB, StackLimit, 16)
1869  TEST_FIELD_SIZE (NT_TIB, SubSystemTib, 8)
1870  TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 8)
1871  TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 24)
1872 }
1873 
1874 static void test_pack_OBJECT_TYPE_LIST(void)
1875 {
1876  /* OBJECT_TYPE_LIST */
1888 }
1889 
1890 static void test_pack_PACCESS_ALLOWED_ACE(void)
1891 {
1892  /* PACCESS_ALLOWED_ACE */
1897 }
1898 
1899 static void test_pack_PACCESS_DENIED_ACE(void)
1900 {
1901  /* PACCESS_DENIED_ACE */
1906 }
1907 
1908 static void test_pack_PACCESS_TOKEN(void)
1909 {
1910  /* PACCESS_TOKEN */
1913 }
1914 
1915 static void test_pack_PACE_HEADER(void)
1916 {
1917  /* PACE_HEADER */
1922 }
1923 
1924 static void test_pack_PACL(void)
1925 {
1926  /* PACL */
1927  TEST_TYPE_SIZE (PACL, 8)
1928  TEST_TYPE_ALIGN (PACL, 8)
1929  TEST_TARGET_SIZE (PACL, 8)
1931 }
1932 
1933 static void test_pack_PACL_REVISION_INFORMATION(void)
1934 {
1935  /* PACL_REVISION_INFORMATION */
1940 }
1941 
1942 static void test_pack_PACL_SIZE_INFORMATION(void)
1943 {
1944  /* PACL_SIZE_INFORMATION */
1949 }
1950 
1951 static void test_pack_PCCH(void)
1952 {
1953  /* PCCH */
1954  TEST_TYPE_SIZE (PCCH, 8)
1955  TEST_TYPE_ALIGN (PCCH, 8)
1956  TEST_TARGET_SIZE (PCCH, 1)
1958 }
1959 
1960 static void test_pack_PCH(void)
1961 {
1962  /* PCH */
1963  TEST_TYPE_SIZE (PCH, 8)
1964  TEST_TYPE_ALIGN (PCH, 8)
1965  TEST_TARGET_SIZE (PCH, 1)
1967 }
1968 
1969 static void test_pack_PCSTR(void)
1970 {
1971  /* PCSTR */
1972  TEST_TYPE_SIZE (PCSTR, 8)
1973  TEST_TYPE_ALIGN (PCSTR, 8)
1974  TEST_TARGET_SIZE (PCSTR, 1)
1976 }
1977 
1978 static void test_pack_PCWCH(void)
1979 {
1980  /* PCWCH */
1981  TEST_TYPE_SIZE (PCWCH, 8)
1982  TEST_TYPE_ALIGN (PCWCH, 8)
1983  TEST_TARGET_SIZE (PCWCH, 2)
1985 }
1986 
1987 static void test_pack_PCWSTR(void)
1988 {
1989  /* PCWSTR */
1990  TEST_TYPE_SIZE (PCWSTR, 8)
1991  TEST_TYPE_ALIGN (PCWSTR, 8)
1994 }
1995 
1996 static void test_pack_PEXCEPTION_POINTERS(void)
1997 {
1998  /* PEXCEPTION_POINTERS */
2003 }
2004 
2005 static void test_pack_PEXCEPTION_RECORD(void)
2006 {
2007  /* PEXCEPTION_RECORD */
2012 }
2013 
2014 static void test_pack_PFPO_DATA(void)
2015 {
2016  /* PFPO_DATA */
2021 }
2022 
2023 static void test_pack_PGENERIC_MAPPING(void)
2024 {
2025  /* PGENERIC_MAPPING */
2030 }
2031 
2032 static void test_pack_PHANDLE(void)
2033 {
2034  /* PHANDLE */
2035  TEST_TYPE_SIZE (PHANDLE, 8)
2039 }
2040 
2042 {
2043  /* PIMAGE_ARCHIVE_MEMBER_HEADER */
2048 }
2049 
2050 static void test_pack_PIMAGE_AUX_SYMBOL(void)
2051 {
2052  /* PIMAGE_AUX_SYMBOL */
2055 }
2056 
2057 static void test_pack_PIMAGE_BASE_RELOCATION(void)
2058 {
2059  /* PIMAGE_BASE_RELOCATION */
2064 }
2065 
2066 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
2067 {
2068  /* PIMAGE_BOUND_FORWARDER_REF */
2073 }
2074 
2076 {
2077  /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
2082 }
2083 
2084 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
2085 {
2086  /* PIMAGE_COFF_SYMBOLS_HEADER */
2091 }
2092 
2093 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
2094 {
2095  /* PIMAGE_DATA_DIRECTORY */
2100 }
2101 
2102 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
2103 {
2104  /* PIMAGE_DEBUG_DIRECTORY */
2109 }
2110 
2111 static void test_pack_PIMAGE_DEBUG_MISC(void)
2112 {
2113  /* PIMAGE_DEBUG_MISC */
2118 }
2119 
2120 static void test_pack_PIMAGE_DOS_HEADER(void)
2121 {
2122  /* PIMAGE_DOS_HEADER */
2127 }
2128 
2129 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
2130 {
2131  /* PIMAGE_EXPORT_DIRECTORY */
2136 }
2137 
2138 static void test_pack_PIMAGE_FILE_HEADER(void)
2139 {
2140  /* PIMAGE_FILE_HEADER */
2145 }
2146 
2147 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
2148 {
2149  /* PIMAGE_FUNCTION_ENTRY */
2154 }
2155 
2156 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
2157 {
2158  /* PIMAGE_IMPORT_BY_NAME */
2163 }
2164 
2165 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
2166 {
2167  /* PIMAGE_IMPORT_DESCRIPTOR */
2170 }
2171 
2172 static void test_pack_PIMAGE_LINENUMBER(void)
2173 {
2174  /* PIMAGE_LINENUMBER */
2177 }
2178 
2180 {
2181  /* PIMAGE_LOAD_CONFIG_DIRECTORY */
2184 }
2185 
2186 static void test_pack_PIMAGE_NT_HEADERS(void)
2187 {
2188  /* PIMAGE_NT_HEADERS */
2191 }
2192 
2193 static void test_pack_PIMAGE_NT_HEADERS32(void)
2194 {
2195  /* PIMAGE_NT_HEADERS32 */
2200 }
2201 
2202 static void test_pack_PIMAGE_NT_HEADERS64(void)
2203 {
2204  /* PIMAGE_NT_HEADERS64 */
2209 }
2210 
2211 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
2212 {
2213  /* PIMAGE_OPTIONAL_HEADER */
2216 }
2217 
2218 static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
2219 {
2220  /* PIMAGE_OPTIONAL_HEADER32 */
2225 }
2226 
2227 static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
2228 {
2229  /* PIMAGE_OPTIONAL_HEADER64 */
2234 }
2235 
2236 static void test_pack_PIMAGE_OS2_HEADER(void)
2237 {
2238  /* PIMAGE_OS2_HEADER */
2243 }
2244 
2245 static void test_pack_PIMAGE_RELOCATION(void)
2246 {
2247  /* PIMAGE_RELOCATION */
2250 }
2251 
2252 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
2253 {
2254  /* PIMAGE_RESOURCE_DATA_ENTRY */
2259 }
2260 
2261 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
2262 {
2263  /* PIMAGE_RESOURCE_DIRECTORY */
2268 }
2269 
2271 {
2272  /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
2275 }
2276 
2278 {
2279  /* PIMAGE_RESOURCE_DIRECTORY_STRING */
2284 }
2285 
2287 {
2288  /* PIMAGE_RESOURCE_DIR_STRING_U */
2293 }
2294 
2295 static void test_pack_PIMAGE_SECTION_HEADER(void)
2296 {
2297  /* PIMAGE_SECTION_HEADER */
2300 }
2301 
2303 {
2304  /* PIMAGE_SEPARATE_DEBUG_HEADER */
2309 }
2310 
2311 static void test_pack_PIMAGE_SYMBOL(void)
2312 {
2313  /* PIMAGE_SYMBOL */
2316 }
2317 
2318 static void test_pack_PIMAGE_THUNK_DATA(void)
2319 {
2320  /* PIMAGE_THUNK_DATA */
2323 }
2324 
2325 static void test_pack_PIMAGE_TLS_CALLBACK(void)
2326 {
2327  /* PIMAGE_TLS_CALLBACK */
2330 }
2331 
2332 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
2333 {
2334  /* PIMAGE_TLS_DIRECTORY */
2337 }
2338 
2339 static void test_pack_PIMAGE_VXD_HEADER(void)
2340 {
2341  /* PIMAGE_VXD_HEADER */
2346 }
2347 
2348 static void test_pack_PIO_COUNTERS(void)
2349 {
2350  /* PIO_COUNTERS */
2355 }
2356 
2357 static void test_pack_PISECURITY_DESCRIPTOR(void)
2358 {
2359  /* PISECURITY_DESCRIPTOR */
2364 }
2365 
2367 {
2368  /* PISECURITY_DESCRIPTOR_RELATIVE */
2373 }
2374 
2375 static void test_pack_PISID(void)
2376 {
2377  /* PISID */
2378  TEST_TYPE_SIZE (PISID, 8)
2379  TEST_TYPE_ALIGN (PISID, 8)
2380  TEST_TARGET_SIZE (PISID, 12)
2382 }
2383 
2384 static void test_pack_PLARGE_INTEGER(void)
2385 {
2386  /* PLARGE_INTEGER */
2389 }
2390 
2391 static void test_pack_PLIST_ENTRY(void)
2392 {
2393  /* PLIST_ENTRY */
2398 }
2399 
2400 static void test_pack_PLUID(void)
2401 {
2402  /* PLUID */
2403  TEST_TYPE_SIZE (PLUID, 8)
2404  TEST_TYPE_ALIGN (PLUID, 8)
2405  TEST_TARGET_SIZE (PLUID, 8)
2407 }
2408 
2409 static void test_pack_PLUID_AND_ATTRIBUTES(void)
2410 {
2411  /* PLUID_AND_ATTRIBUTES */
2416 }
2417 
2418 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
2419 {
2420  /* PMEMORY_BASIC_INFORMATION */
2425 }
2426 
2427 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
2428 {
2429  /* PMESSAGE_RESOURCE_BLOCK */
2434 }
2435 
2436 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
2437 {
2438  /* PMESSAGE_RESOURCE_DATA */
2443 }
2444 
2445 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
2446 {
2447  /* PMESSAGE_RESOURCE_ENTRY */
2452 }
2453 
2454 static void test_pack_PNT_TIB(void)
2455 {
2456  /* PNT_TIB */
2457  TEST_TYPE_SIZE (PNT_TIB, 8)
2459 }
2460 
2461 static void test_pack_POBJECT_TYPE_LIST(void)
2462 {
2463  /* POBJECT_TYPE_LIST */
2468 }
2469 
2470 static void test_pack_PPRIVILEGE_SET(void)
2471 {
2472  /* PPRIVILEGE_SET */
2477 }
2478 
2479 static void test_pack_PRIVILEGE_SET(void)
2480 {
2481  /* PRIVILEGE_SET */
2484  TEST_FIELD_SIZE (PRIVILEGE_SET, PrivilegeCount, 4)
2485  TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
2486  TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
2493 }
2494 
2495 static void test_pack_PRLIST_ENTRY(void)
2496 {
2497  /* PRLIST_ENTRY */
2502 }
2503 
2504 static void test_pack_PRTL_CRITICAL_SECTION(void)
2505 {
2506  /* PRTL_CRITICAL_SECTION */
2511 }
2512 
2513 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
2514 {
2515  /* PRTL_CRITICAL_SECTION_DEBUG */
2518 }
2519 
2520 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
2521 {
2522  /* PRTL_OSVERSIONINFOEXW */
2527 }
2528 
2529 static void test_pack_PRTL_OSVERSIONINFOW(void)
2530 {
2531  /* PRTL_OSVERSIONINFOW */
2536 }
2537 
2538 static void test_pack_PRTL_RESOURCE_DEBUG(void)
2539 {
2540  /* PRTL_RESOURCE_DEBUG */
2543 }
2544 
2545 static void test_pack_PSECURITY_DESCRIPTOR(void)
2546 {
2547  /* PSECURITY_DESCRIPTOR */
2550 }
2551 
2553 {
2554  /* PSECURITY_QUALITY_OF_SERVICE */
2557 }
2558 
2559 static void test_pack_PSID(void)
2560 {
2561  /* PSID */
2562  TEST_TYPE_SIZE (PSID, 8)
2563  TEST_TYPE_ALIGN (PSID, 8)
2564 }
2565 
2566 static void test_pack_PSID_IDENTIFIER_AUTHORITY(void)
2567 {
2568  /* PSID_IDENTIFIER_AUTHORITY */
2573 }
2574 
2575 static void test_pack_PSINGLE_LIST_ENTRY(void)
2576 {
2577  /* PSINGLE_LIST_ENTRY */
2582 }
2583 
2584 static void test_pack_PSTR(void)
2585 {
2586  /* PSTR */
2587  TEST_TYPE_SIZE (PSTR, 8)
2588  TEST_TYPE_ALIGN (PSTR, 8)
2589  TEST_TARGET_SIZE (PSTR, 1)
2591 }
2592 
2593 static void test_pack_PSYSTEM_ALARM_ACE(void)
2594 {
2595  /* PSYSTEM_ALARM_ACE */
2600 }
2601 
2602 static void test_pack_PSYSTEM_AUDIT_ACE(void)
2603 {
2604  /* PSYSTEM_AUDIT_ACE */
2609 }
2610 
2611 static void test_pack_PTOKEN_GROUPS(void)
2612 {
2613  /* PTOKEN_GROUPS */
2618 }
2619 
2620 static void test_pack_PTOKEN_PRIVILEGES(void)
2621 {
2622  /* PTOKEN_PRIVILEGES */
2627 }
2628 
2629 static void test_pack_PTOKEN_USER(void)
2630 {
2631  /* PTOKEN_USER */
2636 }
2637 
2638 static void test_pack_PULARGE_INTEGER(void)
2639 {
2640  /* PULARGE_INTEGER */
2643 }
2644 
2645 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
2646 {
2647  /* PVECTORED_EXCEPTION_HANDLER */
2650 }
2651 
2652 static void test_pack_PVOID(void)
2653 {
2654  /* PVOID */
2655  TEST_TYPE_SIZE (PVOID, 8)
2656  TEST_TYPE_ALIGN (PVOID, 8)
2657 }
2658 
2659 static void test_pack_PWCH(void)
2660 {
2661  /* PWCH */
2662  TEST_TYPE_SIZE (PWCH, 8)
2663  TEST_TYPE_ALIGN (PWCH, 8)
2664  TEST_TARGET_SIZE (PWCH, 2)
2666 }
2667 
2668 static void test_pack_PWSTR(void)
2669 {
2670  /* PWSTR */
2671  TEST_TYPE_SIZE (PWSTR, 8)
2672  TEST_TYPE_ALIGN (PWSTR, 8)
2673  TEST_TARGET_SIZE (PWSTR, 2)
2675 }
2676 
2677 static void test_pack_RTL_CRITICAL_SECTION(void)
2678 {
2679  /* RTL_CRITICAL_SECTION */
2682  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, DebugInfo, 8)
2683  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 8)
2688  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, RecursionCount, 4)
2689  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4)
2690  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 12)
2694  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2695  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2696  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 24)
2697  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, SpinCount, 8)
2698  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, SpinCount, 8)
2699  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, SpinCount, 32)
2700 }
2701 
2702 static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void)
2703 {
2704  /* RTL_CRITICAL_SECTION_DEBUG */
2708  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2709  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2710  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2714  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2715  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8)
2716  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2720  TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2721  TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2722  TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 36)
2723 }
2724 
2725 static void test_pack_RTL_OSVERSIONINFOEXW(void)
2726 {
2727  /* RTL_OSVERSIONINFOEXW */
2730  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2731  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2732  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 0)
2733  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2734  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2735  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2736  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2737  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2738  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMinorVersion, 8)
2739  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2740  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2741  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwBuildNumber, 12)
2742  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2743  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2744  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwPlatformId, 16)
2745  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, szCSDVersion, 256)
2746  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, szCSDVersion, 2)
2747  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, szCSDVersion, 20)
2748  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2749  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2750  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMajor, 276)
2751  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2752  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2753  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMinor, 278)
2754  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2755  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2756  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wSuiteMask, 280)
2757  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wProductType, 1)
2758  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wProductType, 1)
2759  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wProductType, 282)
2760  TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wReserved, 1)
2761  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wReserved, 1)
2762  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wReserved, 283)
2763 }
2764 
2765 static void test_pack_RTL_OSVERSIONINFOW(void)
2766 {
2767  /* RTL_OSVERSIONINFOW */
2770  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2771  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2772  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 0)
2773  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2774  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2775  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2776  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2777  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2778  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMinorVersion, 8)
2779  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2780  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2781  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwBuildNumber, 12)
2782  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2783  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2784  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwPlatformId, 16)
2785  TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, szCSDVersion, 256)
2786  TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, szCSDVersion, 2)
2787  TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, szCSDVersion, 20)
2788 }
2789 
2790 static void test_pack_RTL_RESOURCE_DEBUG(void)
2791 {
2792  /* RTL_RESOURCE_DEBUG */
2796  TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2797  TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2798  TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2802  TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2803  TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ProcessLocksList, 8)
2804  TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2805  TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, EntryCount, 4)
2806  TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, EntryCount, 4)
2807  TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, EntryCount, 32)
2808  TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2809  TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2810  TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ContentionCount, 36)
2811 }
2812 
2814 {
2815  /* SECURITY_CONTEXT_TRACKING_MODE */
2818 }
2819 
2820 static void test_pack_SECURITY_DESCRIPTOR(void)
2821 {
2822  /* SECURITY_DESCRIPTOR */
2846 }
2847 
2848 static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void)
2849 {
2850  /* SECURITY_DESCRIPTOR_CONTROL */
2854 }
2855 
2857 {
2858  /* SECURITY_DESCRIPTOR_RELATIVE */
2882 }
2883 
2884 static void test_pack_SECURITY_INFORMATION(void)
2885 {
2886  /* SECURITY_INFORMATION */
2890 }
2891 
2892 static void test_pack_SECURITY_QUALITY_OF_SERVICE(void)
2893 {
2894  /* SECURITY_QUALITY_OF_SERVICE */
2898 }
2899 
2900 static void test_pack_SHORT(void)
2901 {
2902  /* SHORT */
2903  TEST_TYPE_SIZE (SHORT, 2)
2904  TEST_TYPE_ALIGN (SHORT, 2)
2906 }
2907 
2908 static void test_pack_SID(void)
2909 {
2910  /* SID */
2911  TEST_TYPE_SIZE (SID, 12)
2912  TEST_TYPE_ALIGN (SID, 4)
2922  TEST_FIELD_SIZE (SID, SubAuthority, 4)
2923  TEST_FIELD_ALIGN (SID, SubAuthority, 4)
2924  TEST_FIELD_OFFSET(SID, SubAuthority, 8)
2925 }
2926 
2927 static void test_pack_SID_AND_ATTRIBUTES(void)
2928 {
2929  /* SID_AND_ATTRIBUTES */
2938 }
2939 
2940 static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
2941 {
2942  /* SID_IDENTIFIER_AUTHORITY */
2948 }
2949 
2950 static void test_pack_SINGLE_LIST_ENTRY(void)
2951 {
2952  /* SINGLE_LIST_ENTRY */
2958 }
2959 
2960 static void test_pack_SYSTEM_ALARM_ACE(void)
2961 {
2962  /* SYSTEM_ALARM_ACE */
2971  TEST_FIELD_SIZE (SYSTEM_ALARM_ACE, SidStart, 4)
2972  TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, SidStart, 4)
2973  TEST_FIELD_OFFSET(SYSTEM_ALARM_ACE, SidStart, 8)
2974 }
2975 
2976 static void test_pack_SYSTEM_AUDIT_ACE(void)
2977 {
2978  /* SYSTEM_AUDIT_ACE */
2987  TEST_FIELD_SIZE (SYSTEM_AUDIT_ACE, SidStart, 4)
2988  TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, SidStart, 4)
2989  TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8)
2990 }
2991 
2992 static void test_pack_TOKEN_DEFAULT_DACL(void)
2993 {
2994  /* TOKEN_DEFAULT_DACL */
2997  TEST_FIELD_SIZE (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2998  TEST_FIELD_ALIGN (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2999  TEST_FIELD_OFFSET(TOKEN_DEFAULT_DACL, DefaultDacl, 0)
3000 }
3001 
3002 static void test_pack_TOKEN_GROUPS(void)
3003 {
3004  /* TOKEN_GROUPS */
3007  TEST_FIELD_SIZE (TOKEN_GROUPS, GroupCount, 4)
3008  TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4)
3009  TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0)
3013 }
3014 
3015 static void test_pack_TOKEN_OWNER(void)
3016 {
3017  /* TOKEN_OWNER */
3023 }
3024 
3025 static void test_pack_TOKEN_PRIMARY_GROUP(void)
3026 {
3027  /* TOKEN_PRIMARY_GROUP */
3033 }
3034 
3035 static void test_pack_TOKEN_PRIVILEGES(void)
3036 {
3037  /* TOKEN_PRIVILEGES */
3040  TEST_FIELD_SIZE (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3041  TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3042  TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0)
3046 }
3047 
3048 static void test_pack_TOKEN_SOURCE(void)
3049 {
3050  /* TOKEN_SOURCE */
3056  TEST_FIELD_SIZE (TOKEN_SOURCE, SourceIdentifier, 8)
3057  TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceIdentifier, 4)
3058  TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceIdentifier, 8)
3059 }
3060 
3061 static void test_pack_TOKEN_STATISTICS(void)
3062 {
3063  /* TOKEN_STATISTICS (pack 4) */
3064  TEST_FIELD_SIZE (TOKEN_STATISTICS, TokenId, 8)
3065  TEST_FIELD_ALIGN (TOKEN_STATISTICS, TokenId, 4)
3066  TEST_FIELD_OFFSET(TOKEN_STATISTICS, TokenId, 0)
3067  TEST_FIELD_SIZE (TOKEN_STATISTICS, AuthenticationId, 8)
3068  TEST_FIELD_ALIGN (TOKEN_STATISTICS, AuthenticationId, 4)
3069  TEST_FIELD_OFFSET(TOKEN_STATISTICS, AuthenticationId, 8)
3070  TEST_FIELD_SIZE (TOKEN_STATISTICS, ExpirationTime, 8)
3071  TEST_FIELD_ALIGN (TOKEN_STATISTICS, ExpirationTime, 4)
3072  TEST_FIELD_OFFSET(TOKEN_STATISTICS, ExpirationTime, 16)
3073 }
3074 
3075 static void test_pack_TOKEN_USER(void)
3076 {
3077  /* TOKEN_USER */
3080  TEST_FIELD_SIZE (TOKEN_USER, User, 16)
3081  TEST_FIELD_ALIGN (TOKEN_USER, User, 8)
3082  TEST_FIELD_OFFSET(TOKEN_USER, User, 0)
3083 }
3084 
3085 static void test_pack_ULARGE_INTEGER(void)
3086 {
3087  /* ULARGE_INTEGER */
3088 }
3089 
3090 static void test_pack_ULONGLONG(void)
3091 {
3092  /* ULONGLONG */
3096 }
3097 
3098 static void test_pack_WAITORTIMERCALLBACKFUNC(void)
3099 {
3100  /* WAITORTIMERCALLBACKFUNC */
3103 }
3104 
3105 static void test_pack_WCHAR(void)
3106 {
3107  /* WCHAR */
3108  TEST_TYPE_SIZE (WCHAR, 2)
3109  TEST_TYPE_ALIGN (WCHAR, 2)
3111 }
3112 
3113 static void test_pack_ATOM(void)
3114 {
3115  /* ATOM */
3116  TEST_TYPE_SIZE (ATOM, 2)
3117  TEST_TYPE_ALIGN (ATOM, 2)
3119 }
3120 
3121 static void test_pack_BOOL(void)
3122 {
3123  /* BOOL */
3124  TEST_TYPE_SIZE (BOOL, 4)
3125  TEST_TYPE_ALIGN (BOOL, 4)
3127 }
3128 
3129 static void test_pack_BYTE(void)
3130 {
3131  /* BYTE */
3132  TEST_TYPE_SIZE (BYTE, 1)
3133  TEST_TYPE_ALIGN (BYTE, 1)
3135 }
3136 
3137 static void test_pack_COLORREF(void)
3138 {
3139  /* COLORREF */
3143 }
3144 
3145 static void test_pack_DWORD(void)
3146 {
3147  /* DWORD */
3148  TEST_TYPE_SIZE (DWORD, 4)
3149  TEST_TYPE_ALIGN (DWORD, 4)
3151 }
3152 
3153 static void test_pack_FARPROC(void)
3154 {
3155  /* FARPROC */
3156  TEST_TYPE_SIZE (FARPROC, 8)
3158 }
3159 
3160 static void test_pack_FLOAT(void)
3161 {
3162  /* FLOAT */
3163  TEST_TYPE_SIZE (FLOAT, 4)
3164  TEST_TYPE_ALIGN (FLOAT, 4)
3165 }
3166 
3167 static void test_pack_GLOBALHANDLE(void)
3168 {
3169  /* GLOBALHANDLE */
3172 }
3173 
3174 static void test_pack_HCURSOR(void)
3175 {
3176  /* HCURSOR */
3177  TEST_TYPE_SIZE (HCURSOR, 8)
3179 }
3180 
3181 static void test_pack_HFILE(void)
3182 {
3183  /* HFILE */
3184  TEST_TYPE_SIZE (HFILE, 4)
3185  TEST_TYPE_ALIGN (HFILE, 4)
3187 }
3188 
3189 static void test_pack_HGDIOBJ(void)
3190 {
3191  /* HGDIOBJ */
3192  TEST_TYPE_SIZE (HGDIOBJ, 8)
3194 }
3195 
3196 static void test_pack_HGLOBAL(void)
3197 {
3198  /* HGLOBAL */
3199  TEST_TYPE_SIZE (HGLOBAL, 8)
3201 }
3202 
3203 static void test_pack_HLOCAL(void)
3204 {
3205  /* HLOCAL */
3206  TEST_TYPE_SIZE (HLOCAL, 8)
3207  TEST_TYPE_ALIGN (HLOCAL, 8)
3208 }
3209 
3210 static void test_pack_HMODULE(void)
3211 {
3212  /* HMODULE */
3213  TEST_TYPE_SIZE (HMODULE, 8)
3215 }
3216 
3217 static void test_pack_INT(void)
3218 {
3219  /* INT */
3220  TEST_TYPE_SIZE (INT, 4)
3221  TEST_TYPE_ALIGN (INT, 4)
3223 }
3224 
3225 static void test_pack_LOCALHANDLE(void)
3226 {
3227  /* LOCALHANDLE */
3230 }
3231 
3232 static void test_pack_LPARAM(void)
3233 {
3234  /* LPARAM */
3235  TEST_TYPE_SIZE (LPARAM, 8)
3236  TEST_TYPE_ALIGN (LPARAM, 8)
3237 }
3238 
3239 static void test_pack_LPCRECT(void)
3240 {
3241  /* LPCRECT */
3242  TEST_TYPE_SIZE (LPCRECT, 8)
3246 }
3247 
3248 static void test_pack_LPCRECTL(void)
3249 {
3250  /* LPCRECTL */
3255 }
3256 
3257 static void test_pack_LPCVOID(void)
3258 {
3259  /* LPCVOID */
3260  TEST_TYPE_SIZE (LPCVOID, 8)
3262 }
3263 
3264 static void test_pack_LPPOINT(void)
3265 {
3266  /* LPPOINT */
3267  TEST_TYPE_SIZE (LPPOINT, 8)
3271 }
3272 
3273 static void test_pack_LPRECT(void)
3274 {
3275  /* LPRECT */
3276  TEST_TYPE_SIZE (LPRECT, 8)
3277  TEST_TYPE_ALIGN (LPRECT, 8)
3278  TEST_TARGET_SIZE (LPRECT, 16)
3280 }
3281 
3282 static void test_pack_LPRECTL(void)
3283 {
3284  /* LPRECTL */
3285  TEST_TYPE_SIZE (LPRECTL, 8)
3289 }
3290 
3291 static void test_pack_LPSIZE(void)
3292 {
3293  /* LPSIZE */
3294  TEST_TYPE_SIZE (LPSIZE, 8)
3295  TEST_TYPE_ALIGN (LPSIZE, 8)
3298 }
3299 
3300 static void test_pack_LRESULT(void)
3301 {
3302  /* LRESULT */
3303  TEST_TYPE_SIZE (LRESULT, 8)
3305 }
3306 
3307 static void test_pack_POINT(void)
3308 {
3309  /* POINT */
3310  TEST_TYPE_SIZE (POINT, 8)
3311  TEST_TYPE_ALIGN (POINT, 4)
3312  TEST_FIELD_SIZE (POINT, x, 4)
3313  TEST_FIELD_ALIGN (POINT, x, 4)
3315  TEST_FIELD_SIZE (POINT, y, 4)
3316  TEST_FIELD_ALIGN (POINT, y, 4)
3318 }
3319 
3320 static void test_pack_POINTL(void)
3321 {
3322  /* POINTL */
3323  TEST_TYPE_SIZE (POINTL, 8)
3324  TEST_TYPE_ALIGN (POINTL, 4)
3325  TEST_FIELD_SIZE (POINTL, x, 4)
3326  TEST_FIELD_ALIGN (POINTL, x, 4)
3328  TEST_FIELD_SIZE (POINTL, y, 4)
3329  TEST_FIELD_ALIGN (POINTL, y, 4)
3331 }
3332 
3333 static void test_pack_PPOINT(void)
3334 {
3335  /* PPOINT */
3336  TEST_TYPE_SIZE (PPOINT, 8)
3337  TEST_TYPE_ALIGN (PPOINT, 8)
3340 }
3341 
3342 static void test_pack_PPOINTL(void)
3343 {
3344  /* PPOINTL */
3345  TEST_TYPE_SIZE (PPOINTL, 8)
3349 }
3350 
3351 static void test_pack_PRECT(void)
3352 {
3353  /* PRECT */
3354  TEST_TYPE_SIZE (PRECT, 8)
3355  TEST_TYPE_ALIGN (PRECT, 8)
3356  TEST_TARGET_SIZE (PRECT, 16)
3358 }
3359 
3360 static void test_pack_PRECTL(void)
3361 {
3362  /* PRECTL */
3363  TEST_TYPE_SIZE (PRECTL, 8)
3364  TEST_TYPE_ALIGN (PRECTL, 8)
3365  TEST_TARGET_SIZE (PRECTL, 16)
3367 }
3368 
3369 static void test_pack_PROC(void)
3370 {
3371  /* PROC */
3372  TEST_TYPE_SIZE (PROC, 8)
3373  TEST_TYPE_ALIGN (PROC, 8)
3374 }
3375 
3376 static void test_pack_PSIZE(void)
3377 {
3378  /* PSIZE */
3379  TEST_TYPE_SIZE (PSIZE, 8)
3380  TEST_TYPE_ALIGN (PSIZE, 8)
3381  TEST_TARGET_SIZE (PSIZE, 8)
3383 }
3384 
3385 static void test_pack_PSZ(void)
3386 {
3387  /* PSZ */
3388  TEST_TYPE_SIZE (PSZ, 8)
3389  TEST_TYPE_ALIGN (PSZ, 8)
3390 }
3391 
3392 static void test_pack_RECT(void)
3393 {
3394  /* RECT */
3395  TEST_TYPE_SIZE (RECT, 16)
3396  TEST_TYPE_ALIGN (RECT, 4)
3397  TEST_FIELD_SIZE (RECT, left, 4)
3398  TEST_FIELD_ALIGN (RECT, left, 4)
3400  TEST_FIELD_SIZE (RECT, top, 4)
3401  TEST_FIELD_ALIGN (RECT, top, 4)
3403  TEST_FIELD_SIZE (RECT, right, 4)
3409 }
3410 
3411 static void test_pack_RECTL(void)
3412 {
3413  /* RECTL */
3414  TEST_TYPE_SIZE (RECTL, 16)
3415  TEST_TYPE_ALIGN (RECTL, 4)
3416  TEST_FIELD_SIZE (RECTL, left, 4)
3419  TEST_FIELD_SIZE (RECTL, top, 4)
3420  TEST_FIELD_ALIGN (RECTL, top, 4)
3428 }
3429 
3430 static void test_pack_SIZE(void)
3431 {
3432  /* SIZE */
3433  TEST_TYPE_SIZE (SIZE, 8)
3434  TEST_TYPE_ALIGN (SIZE, 4)
3435  TEST_FIELD_SIZE (SIZE, cx, 4)
3436  TEST_FIELD_ALIGN (SIZE, cx, 4)
3438  TEST_FIELD_SIZE (SIZE, cy, 4)
3439  TEST_FIELD_ALIGN (SIZE, cy, 4)
3441 }
3442 
3443 static void test_pack_SIZEL(void)
3444 {
3445  /* SIZEL */
3446  TEST_TYPE_SIZE (SIZEL, 8)
3447  TEST_TYPE_ALIGN (SIZEL, 4)
3448 }
3449 
3450 static void test_pack_UCHAR(void)
3451 {
3452  /* UCHAR */
3453  TEST_TYPE_SIZE (UCHAR, 1)
3454  TEST_TYPE_ALIGN (UCHAR, 1)
3456 }
3457 
3458 static void test_pack_UINT(void)
3459 {
3460  /* UINT */
3461  TEST_TYPE_SIZE (UINT, 4)
3462  TEST_TYPE_ALIGN (UINT, 4)
3464 }
3465 
3466 static void test_pack_ULONG(void)
3467 {
3468  /* ULONG */
3469  TEST_TYPE_SIZE (ULONG, 4)
3470  TEST_TYPE_ALIGN (ULONG, 4)
3472 }
3473 
3474 static void test_pack_USHORT(void)
3475 {
3476  /* USHORT */
3477  TEST_TYPE_SIZE (USHORT, 2)
3478  TEST_TYPE_ALIGN (USHORT, 2)
3480 }
3481 
3482 static void test_pack_WORD(void)
3483 {
3484  /* WORD */
3485  TEST_TYPE_SIZE (WORD, 2)
3486  TEST_TYPE_ALIGN (WORD, 2)
3488 }
3489 
3490 static void test_pack_WPARAM(void)
3491 {
3492  /* WPARAM */
3493  TEST_TYPE_SIZE (WPARAM, 8)
3494  TEST_TYPE_ALIGN (WPARAM, 8)
3495 }
3496 
3497 #else /* _WIN64 */
3498 
3499 static void test_pack_DWORD32(void)
3500 {
3501  /* DWORD32 */
3502  TEST_TYPE_SIZE (DWORD32, 4)
3505 }
3506 
3507 static void test_pack_DWORD64(void)
3508 {
3509  /* DWORD64 */
3510  TEST_TYPE_SIZE (DWORD64, 8)
3513 }
3514 
3515 static void test_pack_DWORD_PTR(void)
3516 {
3517  /* DWORD_PTR */
3520 }
3521 
3522 static void test_pack_HALF_PTR(void)
3523 {
3524  /* HALF_PTR */
3528 }
3529 
3530 static void test_pack_INT16(void)
3531 {
3532  /* INT16 */
3533  TEST_TYPE_SIZE (INT16, 2)
3534  TEST_TYPE_ALIGN (INT16, 2)
3536 }
3537 
3538 static void test_pack_INT32(void)
3539 {
3540  /* INT32 */
3541  TEST_TYPE_SIZE (INT32, 4)
3542  TEST_TYPE_ALIGN (INT32, 4)
3544 }
3545 
3546 static void test_pack_INT64(void)
3547 {
3548  /* INT64 */
3549  TEST_TYPE_SIZE (INT64, 8)
3550  TEST_TYPE_ALIGN (INT64, 8)
3552 }
3553 
3554 static void test_pack_INT8(void)
3555 {
3556  /* INT8 */
3557  TEST_TYPE_SIZE (INT8, 1)
3558  TEST_TYPE_ALIGN (INT8, 1)
3560 }
3561 
3562 static void test_pack_INT_PTR(void)
3563 {
3564  /* INT_PTR */
3565  TEST_TYPE_SIZE (INT_PTR, 4)
3568 }
3569 
3570 static void test_pack_LONG32(void)
3571 {
3572  /* LONG32 */
3573  TEST_TYPE_SIZE (LONG32, 4)
3574  TEST_TYPE_ALIGN (LONG32, 4)
3576 }
3577 
3578 static void test_pack_LONG64(void)
3579 {
3580  /* LONG64 */
3581  TEST_TYPE_SIZE (LONG64, 8)
3582  TEST_TYPE_ALIGN (LONG64, 8)
3584 }
3585 
3586 static void test_pack_LONG_PTR(void)
3587 {
3588  /* LONG_PTR */
3592 }
3593 
3594 static void test_pack_SIZE_T(void)
3595 {
3596  /* SIZE_T */
3597  TEST_TYPE_SIZE (SIZE_T, 4)
3598  TEST_TYPE_ALIGN (SIZE_T, 4)
3599 }
3600 
3601 static void test_pack_SSIZE_T(void)
3602 {
3603  /* SSIZE_T */
3604  TEST_TYPE_SIZE (SSIZE_T, 4)
3606 }
3607 
3608 static void test_pack_UHALF_PTR(void)
3609 {
3610  /* UHALF_PTR */
3614 }
3615 
3616 static void test_pack_UINT16(void)
3617 {
3618  /* UINT16 */
3619  TEST_TYPE_SIZE (UINT16, 2)
3620  TEST_TYPE_ALIGN (UINT16, 2)
3622 }
3623 
3624 static void test_pack_UINT32(void)
3625 {
3626  /* UINT32 */
3627  TEST_TYPE_SIZE (UINT32, 4)
3628  TEST_TYPE_ALIGN (UINT32, 4)
3630 }
3631 
3632 static void test_pack_UINT64(void)
3633 {
3634  /* UINT64 */
3635  TEST_TYPE_SIZE (UINT64, 8)
3636  TEST_TYPE_ALIGN (UINT64, 8)
3638 }
3639 
3640 static void test_pack_UINT8(void)
3641 {
3642  /* UINT8 */
3643  TEST_TYPE_SIZE (UINT8, 1)
3644  TEST_TYPE_ALIGN (UINT8, 1)
3646 }
3647 
3648 static void test_pack_UINT_PTR(void)
3649 {
3650  /* UINT_PTR */
3654 }
3655 
3656 static void test_pack_ULONG32(void)
3657 {
3658  /* ULONG32 */
3659  TEST_TYPE_SIZE (ULONG32, 4)
3662 }
3663 
3664 static void test_pack_ULONG64(void)
3665 {
3666  /* ULONG64 */
3667  TEST_TYPE_SIZE (ULONG64, 8)
3670 }
3671 
3672 static void test_pack_ULONG_PTR(void)
3673 {
3674  /* ULONG_PTR */
3678 }
3679 
3681 {
3682  /* ACCESS_ALLOWED_ACE */
3691  TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
3692  TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
3694 }
3695 
3697 {
3698  /* ACCESS_DENIED_ACE */
3707  TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4)
3708  TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
3709  TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart, 8)
3710 }
3711 
3712 static void test_pack_ACCESS_MASK(void)
3713 {
3714  /* ACCESS_MASK */
3718 }
3719 
3720 static void test_pack_ACE_HEADER(void)
3721 {
3722  /* ACE_HEADER */
3731  TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2)
3732  TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
3733  TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
3734 }
3735 
3736 static void test_pack_ACL(void)
3737 {
3738  /* ACL */
3739  TEST_TYPE_SIZE (ACL, 8)
3740  TEST_TYPE_ALIGN (ACL, 2)
3744  TEST_FIELD_SIZE (ACL, Sbz1, 1)
3745  TEST_FIELD_ALIGN (ACL, Sbz1, 1)
3746  TEST_FIELD_OFFSET(ACL, Sbz1, 1)
3747  TEST_FIELD_SIZE (ACL, AclSize, 2)
3748  TEST_FIELD_ALIGN (ACL, AclSize, 2)
3749  TEST_FIELD_OFFSET(ACL, AclSize, 2)
3750  TEST_FIELD_SIZE (ACL, AceCount, 2)
3751  TEST_FIELD_ALIGN (ACL, AceCount, 2)
3752  TEST_FIELD_OFFSET(ACL, AceCount, 4)
3753  TEST_FIELD_SIZE (ACL, Sbz2, 2)
3754  TEST_FIELD_ALIGN (ACL, Sbz2, 2)
3755  TEST_FIELD_OFFSET(ACL, Sbz2, 6)
3756 }
3757 
3759 {
3760  /* ACL_REVISION_INFORMATION */
3766 }
3767 
3769 {
3770  /* ACL_SIZE_INFORMATION */
3773  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AceCount, 4)
3774  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4)
3776  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3777  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3778  TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3779  TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3780  TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3781  TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
3782 }
3783 
3784 static void test_pack_BOOLEAN(void)
3785 {
3786  /* BOOLEAN */
3787  TEST_TYPE_SIZE (BOOLEAN, 1)
3790 }
3791 
3792 static void test_pack_CCHAR(void)
3793 {
3794  /* CCHAR */
3795  TEST_TYPE_SIZE (CCHAR, 1)
3796  TEST_TYPE_ALIGN (CCHAR, 1)
3797 }
3798 
3799 static void test_pack_CHAR(void)
3800 {
3801  /* CHAR */
3802  TEST_TYPE_SIZE (CHAR, 1)
3803  TEST_TYPE_ALIGN (CHAR, 1)
3804 }
3805 
3806 static void test_pack_DWORDLONG(void)
3807 {
3808  /* DWORDLONG */
3812 }
3813 
3815 {
3816  /* EXCEPTION_POINTERS */
3819  TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 4)
3820  TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 4)
3821  TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
3825 }
3826 
3828 {
3829  /* EXCEPTION_RECORD */
3835  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4)
3836  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
3837  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
3838  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 4)
3839  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 4)
3840  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
3841  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 4)
3842  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 4)
3843  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 12)
3844  TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4)
3845  TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
3846  TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 16)
3847  TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionInformation, 60)
3848  TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 4)
3849  TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 20)
3850 }
3851 
3852 static void test_pack_EXECUTION_STATE(void)
3853 {
3854  /* EXECUTION_STATE */
3858 }
3859 
3860 static void test_pack_FPO_DATA(void)
3861 {
3862  /* FPO_DATA */
3863  TEST_TYPE_SIZE (FPO_DATA, 16)
3865  TEST_FIELD_SIZE (FPO_DATA, ulOffStart, 4)
3866  TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
3867  TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
3868  TEST_FIELD_SIZE (FPO_DATA, cbProcSize, 4)
3869  TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
3870  TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
3871  TEST_FIELD_SIZE (FPO_DATA, cdwLocals, 4)
3872  TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
3873  TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
3874  TEST_FIELD_SIZE (FPO_DATA, cdwParams, 2)
3875  TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
3876  TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
3877 }
3878 
3879 static void test_pack_GENERIC_MAPPING(void)
3880 {
3881  /* GENERIC_MAPPING */
3884  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericRead, 4)
3885  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
3886  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
3887  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericWrite, 4)
3888  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
3889  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
3890  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericExecute, 4)
3891  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
3892  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
3893  TEST_FIELD_SIZE (GENERIC_MAPPING, GenericAll, 4)
3894  TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
3895  TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
3896 }
3897 
3898 static void test_pack_HANDLE(void)
3899 {
3900  /* HANDLE */
3901  TEST_TYPE_SIZE (HANDLE, 4)
3902  TEST_TYPE_ALIGN (HANDLE, 4)
3903 }
3904 
3905 static void test_pack_HRESULT(void)
3906 {
3907  /* HRESULT */
3908  TEST_TYPE_SIZE (HRESULT, 4)
3910 }
3911 
3913 {
3914  /* IMAGE_ARCHIVE_MEMBER_HEADER */
3938 }
3939 
3941 {
3942  /* IMAGE_AUX_SYMBOL (pack 2) */
3943 }
3944 
3946 {
3947  /* IMAGE_BASE_RELOCATION */
3953  TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3954  TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3955  TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
3956 }
3957 
3959 {
3960  /* IMAGE_BOUND_FORWARDER_REF */
3963  TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
3964  TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
3965  TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 0)
3966  TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
3967  TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
3968  TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
3972 }
3973 
3975 {
3976  /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
3982  TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
3983  TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
3984  TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 4)
3985  TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
3986  TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
3987  TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
3988 }
3989 
3991 {
3992  /* IMAGE_COFF_SYMBOLS_HEADER */
3995  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
3996  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
3997  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0)
3998  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
3999  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
4000  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
4001  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
4002  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
4003  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
4004  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
4005  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
4006  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
4007  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
4008  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
4009  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
4010  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
4011  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
4012  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
4013  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
4014  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
4015  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
4016  TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
4017  TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
4018  TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
4019 }
4020 
4022 {
4023  /* IMAGE_DATA_DIRECTORY */
4032 }
4033 
4035 {
4036  /* IMAGE_DEBUG_DIRECTORY */
4039  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
4040  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
4041  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
4042  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4043  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4044  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
4054  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
4055  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
4056  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, SizeOfData, 16)
4057  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
4058  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
4059  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
4060  TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
4061  TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
4062  TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
4063 }
4064 
4066 {
4067  /* IMAGE_DEBUG_MISC */
4076  TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Unicode, 1)
4077  TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
4078  TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Unicode, 8)
4085 }
4086 
4088 {
4089  /* IMAGE_DOS_HEADER (pack 2) */
4095  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2)
4096  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2)
4101  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2)
4102  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2)
4104  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cparhdr, 2)
4105  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
4106  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8)
4107  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_minalloc, 2)
4108  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
4109  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
4110  TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_maxalloc, 2)
4111  TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
4112  TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
4119  TEST_FIELD_SIZE (