ReactOS 0.4.15-dev-5669-g09dde2c
generated.c
Go to the documentation of this file.
1/* File generated automatically from tools/winapi/tests.dat; do not edit! */
2/* This file can be copied, modified and distributed without restriction. */
3
4/*
5 * Unit tests for data structure packing
6 */
7
8#define WINE_NOWINSOCK
9
10#include "ntdll_test.h"
11
12#include "wine/test.h"
13
14/***********************************************************************
15 * Compatibility macros
16 */
17
18#define DWORD_PTR UINT_PTR
19#define LONG_PTR INT_PTR
20#define ULONG_PTR UINT_PTR
21
22/***********************************************************************
23 * Windows API extension
24 */
25
26#if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
27# define _TYPE_ALIGNMENT(type) __alignof(type)
28#elif defined(__GNUC__)
29# define _TYPE_ALIGNMENT(type) __alignof__(type)
30#else
31/*
32 * FIXME: May not be possible without a compiler extension
33 * (if type is not just a name that is, otherwise the normal
34 * TYPE_ALIGNMENT can be used)
35 */
36#endif
37
38#if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
39#pragma warning(disable:4116)
40#endif
41
42#if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
43# define TYPE_ALIGNMENT _TYPE_ALIGNMENT
44#endif
45
46/***********************************************************************
47 * Test helper macros
48 */
49
50#define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
51
52#ifdef TYPE_ALIGNMENT
53# define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
54#else
55# define TEST_TYPE_ALIGN(type, align)
56#endif
57
58#ifdef _TYPE_ALIGNMENT
59# define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
60# define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
61#else
62# define TEST_TARGET_ALIGN(type, align)
63# define TEST_FIELD_ALIGN(type, field, align)
64#endif
65
66#define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
67
68#define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
69#define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
70#define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
71#define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);
72
73
74#ifdef _WIN64
75
76static void test_pack_DWORD32(void)
77{
78 /* DWORD32 */
82}
83
84static void test_pack_DWORD64(void)
85{
86 /* DWORD64 */
90}
91
92static void test_pack_DWORD_PTR(void)
93{
94 /* DWORD_PTR */
97}
98
99static void test_pack_HALF_PTR(void)
100{
101 /* HALF_PTR */
105}
106
107static void test_pack_INT16(void)
108{
109 /* INT16 */
113}
114
115static void test_pack_INT32(void)
116{
117 /* INT32 */
121}
122
123static void test_pack_INT64(void)
124{
125 /* INT64 */
129}
130
131static void test_pack_INT8(void)
132{
133 /* INT8 */
137}
138
139static void test_pack_INT_PTR(void)
140{
141 /* INT_PTR */
145}
146
147static void test_pack_LONG32(void)
148{
149 /* LONG32 */
153}
154
155static void test_pack_LONG64(void)
156{
157 /* LONG64 */
161}
162
163static void test_pack_LONG_PTR(void)
164{
165 /* LONG_PTR */
169}
170
171static void test_pack_SIZE_T(void)
172{
173 /* SIZE_T */
176}
177
178static void test_pack_SSIZE_T(void)
179{
180 /* SSIZE_T */
183}
184
185static void test_pack_UHALF_PTR(void)
186{
187 /* UHALF_PTR */
191}
192
193static void test_pack_UINT16(void)
194{
195 /* UINT16 */
199}
200
201static void test_pack_UINT32(void)
202{
203 /* UINT32 */
207}
208
209static void test_pack_UINT64(void)
210{
211 /* UINT64 */
215}
216
217static void test_pack_UINT8(void)
218{
219 /* UINT8 */
223}
224
225static void test_pack_UINT_PTR(void)
226{
227 /* UINT_PTR */
231}
232
233static void test_pack_ULONG32(void)
234{
235 /* ULONG32 */
239}
240
241static void test_pack_ULONG64(void)
242{
243 /* ULONG64 */
247}
248
249static void test_pack_ULONG_PTR(void)
250{
251 /* ULONG_PTR */
255}
256
257static void test_pack_ACCESS_ALLOWED_ACE(void)
258{
259 /* ACCESS_ALLOWED_ACE */
271}
272
273static void test_pack_ACCESS_DENIED_ACE(void)
274{
275 /* ACCESS_DENIED_ACE */
287}
288
289static void test_pack_ACCESS_MASK(void)
290{
291 /* ACCESS_MASK */
295}
296
297static void test_pack_ACE_HEADER(void)
298{
299 /* ACE_HEADER */
308 TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2)
309 TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
310 TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
311}
312
313static void test_pack_ACL(void)
314{
315 /* ACL */
321 TEST_FIELD_SIZE (ACL, Sbz1, 1)
322 TEST_FIELD_ALIGN (ACL, Sbz1, 1)
323 TEST_FIELD_OFFSET(ACL, Sbz1, 1)
324 TEST_FIELD_SIZE (ACL, AclSize, 2)
325 TEST_FIELD_ALIGN (ACL, AclSize, 2)
326 TEST_FIELD_OFFSET(ACL, AclSize, 2)
327 TEST_FIELD_SIZE (ACL, AceCount, 2)
328 TEST_FIELD_ALIGN (ACL, AceCount, 2)
329 TEST_FIELD_OFFSET(ACL, AceCount, 4)
330 TEST_FIELD_SIZE (ACL, Sbz2, 2)
331 TEST_FIELD_ALIGN (ACL, Sbz2, 2)
332 TEST_FIELD_OFFSET(ACL, Sbz2, 6)
333}
334
336{
337 /* ACL_REVISION_INFORMATION */
343}
344
345static void test_pack_ACL_SIZE_INFORMATION(void)
346{
347 /* ACL_SIZE_INFORMATION */
353 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
354 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
355 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
356 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4)
357 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
359}
360
361static void test_pack_BOOLEAN(void)
362{
363 /* BOOLEAN */
367}
368
369static void test_pack_CCHAR(void)
370{
371 /* CCHAR */
374}
375
376static void test_pack_CHAR(void)
377{
378 /* CHAR */
381}
382
383static void test_pack_DWORDLONG(void)
384{
385 /* DWORDLONG */
389}
390
391static void test_pack_EXCEPTION_POINTERS(void)
392{
393 /* EXCEPTION_POINTERS */
396 TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 8)
397 TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 8)
398 TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
402}
403
404static void test_pack_EXCEPTION_RECORD(void)
405{
406 /* EXCEPTION_RECORD */
412 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4)
413 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
414 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
415 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 8)
416 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 8)
417 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
418 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 8)
419 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 8)
420 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 16)
421 TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4)
422 TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
423 TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 24)
424 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionInformation, 120)
425 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 8)
426 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 32)
427}
428
429static void test_pack_EXECUTION_STATE(void)
430{
431 /* EXECUTION_STATE */
435}
436
437static void test_pack_FPO_DATA(void)
438{
439 /* FPO_DATA */
442 TEST_FIELD_SIZE (FPO_DATA, ulOffStart, 4)
443 TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
444 TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
445 TEST_FIELD_SIZE (FPO_DATA, cbProcSize, 4)
446 TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
447 TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
448 TEST_FIELD_SIZE (FPO_DATA, cdwLocals, 4)
449 TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
450 TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
451 TEST_FIELD_SIZE (FPO_DATA, cdwParams, 2)
452 TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
453 TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
454}
455
456static void test_pack_GENERIC_MAPPING(void)
457{
458 /* GENERIC_MAPPING */
461 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericRead, 4)
462 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
463 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
464 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericWrite, 4)
465 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
466 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
467 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericExecute, 4)
468 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
469 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
470 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericAll, 4)
471 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
472 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
473}
474
475static void test_pack_HANDLE(void)
476{
477 /* HANDLE */
480}
481
482static void test_pack_HRESULT(void)
483{
484 /* HRESULT */
487}
488
490{
491 /* IMAGE_ARCHIVE_MEMBER_HEADER */
515}
516
517static void test_pack_IMAGE_AUX_SYMBOL(void)
518{
519 /* IMAGE_AUX_SYMBOL (pack 2) */
520}
521
522static void test_pack_IMAGE_BASE_RELOCATION(void)
523{
524 /* IMAGE_BASE_RELOCATION */
530 TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
533}
534
536{
537 /* IMAGE_BOUND_FORWARDER_REF */
543 TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
544 TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
545 TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
549}
550
552{
553 /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
562 TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
563 TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
564 TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
565}
566
568{
569 /* IMAGE_COFF_SYMBOLS_HEADER */
572 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
573 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
575 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
576 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
577 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
578 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
579 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
580 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
581 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
582 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
583 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
584 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
585 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
586 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
587 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
588 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
589 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
590 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
591 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
592 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
593 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
594 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
595 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
596}
597
598static void test_pack_IMAGE_DATA_DIRECTORY(void)
599{
600 /* IMAGE_DATA_DIRECTORY */
609}
610
611static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
612{
613 /* IMAGE_DEBUG_DIRECTORY */
616 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
617 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
618 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
619 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
620 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
634 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
635 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
636 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
637 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
638 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
639 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
640}
641
642static void test_pack_IMAGE_DEBUG_MISC(void)
643{
644 /* IMAGE_DEBUG_MISC */
662}
663
664static void test_pack_IMAGE_DOS_HEADER(void)
665{
666 /* IMAGE_DOS_HEADER (pack 2) */
681 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cparhdr, 2)
682 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
684 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_minalloc, 2)
685 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
686 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
687 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_maxalloc, 2)
688 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
689 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
705 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfarlc, 2)
717 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oeminfo, 2)
718 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2)
719 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38)
726}
727
728static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
729{
730 /* IMAGE_EXPORT_DIRECTORY */
733 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
734 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
735 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0)
736 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
737 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
751 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
752 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
753 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20)
754 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
755 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
756 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24)
757 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
758 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
759 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28)
760 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
761 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
762 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32)
763 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
764 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
765 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36)
766}
767
768static void test_pack_IMAGE_FILE_HEADER(void)
769{
770 /* IMAGE_FILE_HEADER */
776 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSections, 2)
777 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2)
778 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2)
779 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, TimeDateStamp, 4)
780 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4)
781 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4)
782 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
783 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
784 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8)
785 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
786 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
787 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12)
788 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
789 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
790 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16)
791 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Characteristics, 2)
792 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2)
793 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18)
794}
795
796static void test_pack_IMAGE_FUNCTION_ENTRY(void)
797{
798 /* IMAGE_FUNCTION_ENTRY */
801 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
802 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
803 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0)
804 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
805 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
806 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
807 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
808 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
809 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8)
810}
811
812static void test_pack_IMAGE_IMPORT_BY_NAME(void)
813{
814 /* IMAGE_IMPORT_BY_NAME */
823}
824
825static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
826{
827 /* IMAGE_IMPORT_DESCRIPTOR */
828}
829
830static void test_pack_IMAGE_LINENUMBER(void)
831{
832 /* IMAGE_LINENUMBER (pack 2) */
833}
834
836{
837 /* IMAGE_LOAD_CONFIG_DIRECTORY */
840}
841
843{
844 /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
865 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
866 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
867 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20)
868 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
869 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
870 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24)
871 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
872 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
873 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28)
877 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
878 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
879 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 40)
880 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
881 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
882 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 44)
907}
908
910{
911 /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
932 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
933 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
934 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20)
935 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
936 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
937 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24)
938 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
939 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
940 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32)
944 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
945 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
946 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48)
947 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
948 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
949 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56)
974}
975
976static void test_pack_IMAGE_NT_HEADERS(void)
977{
978 /* IMAGE_NT_HEADERS */
981}
982
983static void test_pack_IMAGE_NT_HEADERS32(void)
984{
985 /* IMAGE_NT_HEADERS32 */
991 TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, FileHeader, 20)
992 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, FileHeader, 4)
994 TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, OptionalHeader, 224)
995 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, OptionalHeader, 4)
996 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader, 24)
997}
998
999static void test_pack_IMAGE_NT_HEADERS64(void)
1000{
1001 /* IMAGE_NT_HEADERS64 */
1007 TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, FileHeader, 20)
1008 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, FileHeader, 4)
1010 TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, OptionalHeader, 240)
1011 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, OptionalHeader, 8)
1012 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader, 24)
1013}
1014
1015static void test_pack_IMAGE_OPTIONAL_HEADER(void)
1016{
1017 /* IMAGE_OPTIONAL_HEADER */
1020}
1021
1022static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
1023{
1024 /* IMAGE_OPTIONAL_HEADER32 */
1030 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1031 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1032 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 2)
1033 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1034 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1035 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 3)
1039 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1040 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1041 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 8)
1042 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1043 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1044 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 12)
1045 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1046 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1047 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 16)
1057 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1058 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1059 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SectionAlignment, 32)
1060 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1061 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1062 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, FileAlignment, 36)
1063 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1064 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1065 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 40)
1066 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1067 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1068 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 42)
1069 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1070 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1071 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 44)
1072 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1073 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1074 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 46)
1075 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1076 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1077 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 48)
1078 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1079 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1080 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 50)
1081 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1082 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1083 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 52)
1087 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1088 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1089 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 60)
1096 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1097 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1098 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 70)
1099 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1100 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1101 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 72)
1102 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1103 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1104 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 76)
1105 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1106 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1107 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 80)
1108 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1109 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1110 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 84)
1114 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1115 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1116 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 92)
1117 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DataDirectory, 128)
1118 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DataDirectory, 4)
1119 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DataDirectory, 96)
1120}
1121
1122static void test_pack_IMAGE_OPTIONAL_HEADER64(void)
1123{
1124 /* IMAGE_OPTIONAL_HEADER64 */
1130 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1131 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1132 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 2)
1133 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1134 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1135 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 3)
1139 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1140 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1141 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 8)
1142 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1143 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1144 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 12)
1145 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1146 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1147 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 16)
1154 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1155 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1156 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SectionAlignment, 32)
1157 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1158 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1159 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, FileAlignment, 36)
1160 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1161 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1162 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 40)
1163 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1164 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1165 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 42)
1166 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1167 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1168 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 44)
1169 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1170 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1171 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 46)
1172 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1173 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1174 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 48)
1175 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1176 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1177 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 50)
1178 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1179 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1180 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 52)
1184 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1185 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1186 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 60)
1193 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1194 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1195 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 70)
1196 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1197 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1198 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 72)
1199 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1200 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1201 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 80)
1202 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1203 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1204 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 88)
1205 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1206 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1207 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 96)
1211 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1212 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1213 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 108)
1214 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DataDirectory, 128)
1215 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DataDirectory, 4)
1216 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DataDirectory, 112)
1217}
1218
1219static void test_pack_IMAGE_OS2_HEADER(void)
1220{
1221 /* IMAGE_OS2_HEADER (pack 2) */
1224 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_magic, 2)
1225 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2)
1233 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_enttab, 2)
1234 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2)
1235 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4)
1236 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1237 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1238 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6)
1242 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flags, 2)
1243 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2)
1244 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12)
1245 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_autodata, 2)
1246 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2)
1247 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14)
1248 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_heap, 2)
1251 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_stack, 2)
1252 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2)
1253 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18)
1254 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_csip, 4)
1257 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_sssp, 4)
1260 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cseg, 2)
1263 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmod, 2)
1266 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1267 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1268 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32)
1269 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_segtab, 2)
1270 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2)
1271 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34)
1272 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1273 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1274 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36)
1275 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_restab, 2)
1276 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2)
1277 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38)
1278 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_modtab, 2)
1279 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2)
1280 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40)
1281 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_imptab, 2)
1282 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2)
1283 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42)
1284 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_nrestab, 4)
1285 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2)
1286 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44)
1287 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmovent, 2)
1288 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2)
1289 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48)
1290 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_align, 2)
1291 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2)
1292 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50)
1293 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cres, 2)
1296 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_exetyp, 1)
1297 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1)
1298 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54)
1299 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1300 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1301 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55)
1302 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1303 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1304 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56)
1305 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1306 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1307 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58)
1308 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_swaparea, 2)
1309 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2)
1310 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60)
1311 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_expver, 2)
1312 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2)
1313 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62)
1314}
1315
1316static void test_pack_IMAGE_RELOCATION(void)
1317{
1318 /* IMAGE_RELOCATION (pack 2) */
1319}
1320
1322{
1323 /* IMAGE_RESOURCE_DATA_ENTRY */
1338}
1339
1340static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
1341{
1342 /* IMAGE_RESOURCE_DIRECTORY */
1345 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1346 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1347 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0)
1348 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1349 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1357 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1358 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1359 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12)
1360 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1361 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1362 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14)
1363}
1364
1366{
1367 /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
1368}
1369
1371{
1372 /* IMAGE_RESOURCE_DIRECTORY_STRING */
1381}
1382
1384{
1385 /* IMAGE_RESOURCE_DIR_STRING_U */
1394}
1395
1396static void test_pack_IMAGE_SECTION_HEADER(void)
1397{
1398 /* IMAGE_SECTION_HEADER */
1402}
1403
1405{
1406 /* IMAGE_SEPARATE_DEBUG_HEADER */
1418 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1419 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1433 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1434 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1435 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24)
1436 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1437 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1438 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28)
1439 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1440 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1441 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32)
1442 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1443 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1444 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36)
1448}
1449
1450static void test_pack_IMAGE_SYMBOL(void)
1451{
1452 /* IMAGE_SYMBOL (pack 2) */
1453}
1454
1455static void test_pack_IMAGE_THUNK_DATA(void)
1456{
1457 /* IMAGE_THUNK_DATA */
1458}
1459
1460static void test_pack_IMAGE_TLS_DIRECTORY(void)
1461{
1462 /* IMAGE_TLS_DIRECTORY */
1465}
1466
1467static void test_pack_IMAGE_TLS_DIRECTORY32(void)
1468{
1469 /* IMAGE_TLS_DIRECTORY32 */
1472 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1473 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1474 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 0)
1475 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1476 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1477 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1478 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1479 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1480 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfIndex, 8)
1481 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1482 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1483 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 12)
1484 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1485 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1486 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 16)
1487 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1488 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1489 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, Characteristics, 20)
1490}
1491
1492static void test_pack_IMAGE_TLS_DIRECTORY64(void)
1493{
1494 /* IMAGE_TLS_DIRECTORY64 */
1497 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1498 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1499 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 0)
1500 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1501 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1502 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1503 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1504 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1505 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfIndex, 16)
1506 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1507 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1508 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 24)
1509 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1510 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1511 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 32)
1512 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1513 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1514 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, Characteristics, 36)
1515}
1516
1517static void test_pack_IMAGE_VXD_HEADER(void)
1518{
1519 /* IMAGE_VXD_HEADER (pack 2) */
1522 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_magic, 2)
1523 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2)
1524 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0)
1525 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_border, 1)
1526 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1)
1527 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2)
1528 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_worder, 1)
1529 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1)
1530 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3)
1531 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_level, 4)
1532 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2)
1533 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4)
1534 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cpu, 2)
1540 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ver, 4)
1543 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mflags, 4)
1544 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2)
1545 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16)
1546 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mpages, 4)
1547 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2)
1548 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20)
1549 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_startobj, 4)
1550 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2)
1551 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24)
1552 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_eip, 4)
1555 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_stackobj, 4)
1556 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2)
1557 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32)
1558 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_esp, 4)
1561 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesize, 4)
1562 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2)
1563 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40)
1564 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_lastpagesize, 4)
1565 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2)
1566 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44)
1567 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsize, 4)
1568 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2)
1569 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48)
1570 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsum, 4)
1571 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2)
1572 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52)
1573 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsize, 4)
1574 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2)
1575 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56)
1576 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsum, 4)
1577 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2)
1578 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60)
1579 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objtab, 4)
1580 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2)
1581 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64)
1582 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objcnt, 4)
1583 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2)
1584 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68)
1585 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objmap, 4)
1586 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2)
1587 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72)
1588 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_itermap, 4)
1589 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2)
1590 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76)
1591 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrctab, 4)
1592 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2)
1593 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80)
1594 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrccnt, 4)
1595 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2)
1596 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84)
1597 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_restab, 4)
1598 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2)
1599 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88)
1600 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_enttab, 4)
1601 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2)
1602 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92)
1603 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dirtab, 4)
1604 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2)
1605 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96)
1606 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dircnt, 4)
1607 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2)
1608 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100)
1609 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fpagetab, 4)
1610 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2)
1611 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104)
1612 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_frectab, 4)
1613 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2)
1614 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108)
1615 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmod, 4)
1616 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2)
1617 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112)
1618 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmodcnt, 4)
1619 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2)
1620 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116)
1621 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impproc, 4)
1622 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2)
1623 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120)
1624 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesum, 4)
1625 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2)
1626 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124)
1627 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_datapage, 4)
1628 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2)
1629 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128)
1630 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_preload, 4)
1631 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2)
1632 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132)
1633 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nrestab, 4)
1634 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2)
1635 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136)
1636 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cbnrestab, 4)
1637 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2)
1638 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140)
1639 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nressum, 4)
1640 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2)
1641 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144)
1642 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_autodata, 4)
1643 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2)
1644 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148)
1645 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuginfo, 4)
1646 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2)
1647 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152)
1648 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuglen, 4)
1649 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2)
1650 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156)
1651 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instpreload, 4)
1652 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2)
1653 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160)
1654 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instdemand, 4)
1655 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2)
1656 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164)
1657 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_heapsize, 4)
1658 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2)
1659 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168)
1660 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_res3, 12)
1661 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1)
1662 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172)
1663 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winresoff, 4)
1664 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2)
1665 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184)
1666 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winreslen, 4)
1667 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2)
1668 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188)
1669 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_devid, 2)
1670 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2)
1671 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192)
1672 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ddkver, 2)
1673 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2)
1674 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194)
1675}
1676
1677static void test_pack_IO_COUNTERS(void)
1678{
1679 /* IO_COUNTERS (pack 8) */
1682 TEST_FIELD_SIZE (IO_COUNTERS, ReadOperationCount, 8)
1683 TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8)
1684 TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0)
1685 TEST_FIELD_SIZE (IO_COUNTERS, WriteOperationCount, 8)
1686 TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8)
1687 TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8)
1688 TEST_FIELD_SIZE (IO_COUNTERS, OtherOperationCount, 8)
1689 TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8)
1690 TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16)
1691 TEST_FIELD_SIZE (IO_COUNTERS, ReadTransferCount, 8)
1692 TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8)
1693 TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24)
1694 TEST_FIELD_SIZE (IO_COUNTERS, WriteTransferCount, 8)
1695 TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8)
1696 TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32)
1697 TEST_FIELD_SIZE (IO_COUNTERS, OtherTransferCount, 8)
1698 TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8)
1699 TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40)
1700}
1701
1702static void test_pack_LANGID(void)
1703{
1704 /* LANGID */
1708}
1709
1710static void test_pack_LARGE_INTEGER(void)
1711{
1712 /* LARGE_INTEGER */
1713}
1714
1715static void test_pack_LCID(void)
1716{
1717 /* LCID */
1718 TEST_TYPE_SIZE (LCID, 4)
1721}
1722
1723static void test_pack_LIST_ENTRY(void)
1724{
1725 /* LIST_ENTRY */
1728 TEST_FIELD_SIZE (LIST_ENTRY, Flink, 8)
1729 TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 8)
1730 TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0)
1731 TEST_FIELD_SIZE (LIST_ENTRY, Blink, 8)
1732 TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 8)
1733 TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 8)
1734}
1735
1736static void test_pack_LONG(void)
1737{
1738 /* LONG */
1739 TEST_TYPE_SIZE (LONG, 4)
1742}
1743
1744static void test_pack_LONGLONG(void)
1745{
1746 /* LONGLONG */
1750}
1751
1752static void test_pack_LUID(void)
1753{
1754 /* LUID */
1755 TEST_TYPE_SIZE (LUID, 8)
1757 TEST_FIELD_SIZE (LUID, LowPart, 4)
1758 TEST_FIELD_ALIGN (LUID, LowPart, 4)
1759 TEST_FIELD_OFFSET(LUID, LowPart, 0)
1760 TEST_FIELD_SIZE (LUID, HighPart, 4)
1761 TEST_FIELD_ALIGN (LUID, HighPart, 4)
1762 TEST_FIELD_OFFSET(LUID, HighPart, 4)
1763}
1764
1765static void test_pack_LUID_AND_ATTRIBUTES(void)
1766{
1767 /* LUID_AND_ATTRIBUTES (pack 4) */
1776}
1777
1778static void test_pack_MEMORY_BASIC_INFORMATION(void)
1779{
1780 /* MEMORY_BASIC_INFORMATION */
1786 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1787 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1789 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1790 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1791 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 16)
1804}
1805
1806static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
1807{
1808 /* MESSAGE_RESOURCE_BLOCK */
1817 TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1818 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1819 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8)
1820}
1821
1822static void test_pack_MESSAGE_RESOURCE_DATA(void)
1823{
1824 /* MESSAGE_RESOURCE_DATA */
1827 TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1828 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1829 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0)
1833}
1834
1835static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
1836{
1837 /* MESSAGE_RESOURCE_ENTRY */
1849}
1850
1851static void test_pack_NT_TIB(void)
1852{
1853 /* NT_TIB */
1854 TEST_FIELD_SIZE (NT_TIB, ExceptionList, 8)
1855 TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 8)
1856 TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0)
1857 TEST_FIELD_SIZE (NT_TIB, StackBase, 8)
1858 TEST_FIELD_ALIGN (NT_TIB, StackBase, 8)
1859 TEST_FIELD_OFFSET(NT_TIB, StackBase, 8)
1860 TEST_FIELD_SIZE (NT_TIB, StackLimit, 8)
1861 TEST_FIELD_ALIGN (NT_TIB, StackLimit, 8)
1862 TEST_FIELD_OFFSET(NT_TIB, StackLimit, 16)
1863 TEST_FIELD_SIZE (NT_TIB, SubSystemTib, 8)
1864 TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 8)
1865 TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 24)
1866}
1867
1868static void test_pack_OBJECT_TYPE_LIST(void)
1869{
1870 /* OBJECT_TYPE_LIST */
1882}
1883
1884static void test_pack_PACCESS_ALLOWED_ACE(void)
1885{
1886 /* PACCESS_ALLOWED_ACE */
1891}
1892
1893static void test_pack_PACCESS_DENIED_ACE(void)
1894{
1895 /* PACCESS_DENIED_ACE */
1900}
1901
1902static void test_pack_PACCESS_TOKEN(void)
1903{
1904 /* PACCESS_TOKEN */
1907}
1908
1909static void test_pack_PACE_HEADER(void)
1910{
1911 /* PACE_HEADER */
1916}
1917
1918static void test_pack_PACL(void)
1919{
1920 /* PACL */
1921 TEST_TYPE_SIZE (PACL, 8)
1925}
1926
1928{
1929 /* PACL_REVISION_INFORMATION */
1934}
1935
1936static void test_pack_PACL_SIZE_INFORMATION(void)
1937{
1938 /* PACL_SIZE_INFORMATION */
1943}
1944
1945static void test_pack_PCCH(void)
1946{
1947 /* PCCH */
1948 TEST_TYPE_SIZE (PCCH, 8)
1952}
1953
1954static void test_pack_PCH(void)
1955{
1956 /* PCH */
1957 TEST_TYPE_SIZE (PCH, 8)
1958 TEST_TYPE_ALIGN (PCH, 8)
1961}
1962
1963static void test_pack_PCSTR(void)
1964{
1965 /* PCSTR */
1970}
1971
1972static void test_pack_PCWCH(void)
1973{
1974 /* PCWCH */
1979}
1980
1981static void test_pack_PCWSTR(void)
1982{
1983 /* PCWSTR */
1988}
1989
1990static void test_pack_PEXCEPTION_POINTERS(void)
1991{
1992 /* PEXCEPTION_POINTERS */
1997}
1998
1999static void test_pack_PEXCEPTION_RECORD(void)
2000{
2001 /* PEXCEPTION_RECORD */
2006}
2007
2008static void test_pack_PFPO_DATA(void)
2009{
2010 /* PFPO_DATA */
2015}
2016
2017static void test_pack_PGENERIC_MAPPING(void)
2018{
2019 /* PGENERIC_MAPPING */
2024}
2025
2026static void test_pack_PHANDLE(void)
2027{
2028 /* PHANDLE */
2033}
2034
2036{
2037 /* PIMAGE_ARCHIVE_MEMBER_HEADER */
2042}
2043
2044static void test_pack_PIMAGE_AUX_SYMBOL(void)
2045{
2046 /* PIMAGE_AUX_SYMBOL */
2049}
2050
2051static void test_pack_PIMAGE_BASE_RELOCATION(void)
2052{
2053 /* PIMAGE_BASE_RELOCATION */
2058}
2059
2061{
2062 /* PIMAGE_BOUND_FORWARDER_REF */
2067}
2068
2070{
2071 /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
2076}
2077
2079{
2080 /* PIMAGE_COFF_SYMBOLS_HEADER */
2085}
2086
2087static void test_pack_PIMAGE_DATA_DIRECTORY(void)
2088{
2089 /* PIMAGE_DATA_DIRECTORY */
2094}
2095
2096static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
2097{
2098 /* PIMAGE_DEBUG_DIRECTORY */
2103}
2104
2105static void test_pack_PIMAGE_DEBUG_MISC(void)
2106{
2107 /* PIMAGE_DEBUG_MISC */
2112}
2113
2114static void test_pack_PIMAGE_DOS_HEADER(void)
2115{
2116 /* PIMAGE_DOS_HEADER */
2121}
2122
2123static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
2124{
2125 /* PIMAGE_EXPORT_DIRECTORY */
2130}
2131
2132static void test_pack_PIMAGE_FILE_HEADER(void)
2133{
2134 /* PIMAGE_FILE_HEADER */
2139}
2140
2141static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
2142{
2143 /* PIMAGE_FUNCTION_ENTRY */
2148}
2149
2150static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
2151{
2152 /* PIMAGE_IMPORT_BY_NAME */
2157}
2158
2159static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
2160{
2161 /* PIMAGE_IMPORT_DESCRIPTOR */
2164}
2165
2166static void test_pack_PIMAGE_LINENUMBER(void)
2167{
2168 /* PIMAGE_LINENUMBER */
2171}
2172
2174{
2175 /* PIMAGE_LOAD_CONFIG_DIRECTORY */
2178}
2179
2180static void test_pack_PIMAGE_NT_HEADERS(void)
2181{
2182 /* PIMAGE_NT_HEADERS */
2185}
2186
2187static void test_pack_PIMAGE_NT_HEADERS32(void)
2188{
2189 /* PIMAGE_NT_HEADERS32 */
2194}
2195
2196static void test_pack_PIMAGE_NT_HEADERS64(void)
2197{
2198 /* PIMAGE_NT_HEADERS64 */
2203}
2204
2205static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
2206{
2207 /* PIMAGE_OPTIONAL_HEADER */
2210}
2211
2212static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
2213{
2214 /* PIMAGE_OPTIONAL_HEADER32 */
2219}
2220
2221static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
2222{
2223 /* PIMAGE_OPTIONAL_HEADER64 */
2228}
2229
2230static void test_pack_PIMAGE_OS2_HEADER(void)
2231{
2232 /* PIMAGE_OS2_HEADER */
2237}
2238
2239static void test_pack_PIMAGE_RELOCATION(void)
2240{
2241 /* PIMAGE_RELOCATION */
2244}
2245
2247{
2248 /* PIMAGE_RESOURCE_DATA_ENTRY */
2253}
2254
2256{
2257 /* PIMAGE_RESOURCE_DIRECTORY */
2262}
2263
2265{
2266 /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
2269}
2270
2272{
2273 /* PIMAGE_RESOURCE_DIRECTORY_STRING */
2278}
2279
2281{
2282 /* PIMAGE_RESOURCE_DIR_STRING_U */
2287}
2288
2289static void test_pack_PIMAGE_SECTION_HEADER(void)
2290{
2291 /* PIMAGE_SECTION_HEADER */
2294}
2295
2297{
2298 /* PIMAGE_SEPARATE_DEBUG_HEADER */
2303}
2304
2305static void test_pack_PIMAGE_SYMBOL(void)
2306{
2307 /* PIMAGE_SYMBOL */
2310}
2311
2312static void test_pack_PIMAGE_THUNK_DATA(void)
2313{
2314 /* PIMAGE_THUNK_DATA */
2317}
2318
2319static void test_pack_PIMAGE_TLS_CALLBACK(void)
2320{
2321 /* PIMAGE_TLS_CALLBACK */
2324}
2325
2326static void test_pack_PIMAGE_TLS_DIRECTORY(void)
2327{
2328 /* PIMAGE_TLS_DIRECTORY */
2331}
2332
2333static void test_pack_PIMAGE_VXD_HEADER(void)
2334{
2335 /* PIMAGE_VXD_HEADER */
2340}
2341
2342static void test_pack_PIO_COUNTERS(void)
2343{
2344 /* PIO_COUNTERS */
2349}
2350
2351static void test_pack_PISECURITY_DESCRIPTOR(void)
2352{
2353 /* PISECURITY_DESCRIPTOR */
2358}
2359
2361{
2362 /* PISECURITY_DESCRIPTOR_RELATIVE */
2367}
2368
2369static void test_pack_PISID(void)
2370{
2371 /* PISID */
2376}
2377
2378static void test_pack_PLARGE_INTEGER(void)
2379{
2380 /* PLARGE_INTEGER */
2383}
2384
2385static void test_pack_PLIST_ENTRY(void)
2386{
2387 /* PLIST_ENTRY */
2392}
2393
2394static void test_pack_PLUID(void)
2395{
2396 /* PLUID */
2401}
2402
2403static void test_pack_PLUID_AND_ATTRIBUTES(void)
2404{
2405 /* PLUID_AND_ATTRIBUTES */
2410}
2411
2413{
2414 /* PMEMORY_BASIC_INFORMATION */
2419}
2420
2421static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
2422{
2423 /* PMESSAGE_RESOURCE_BLOCK */
2428}
2429
2430static void test_pack_PMESSAGE_RESOURCE_DATA(void)
2431{
2432 /* PMESSAGE_RESOURCE_DATA */
2437}
2438
2439static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
2440{
2441 /* PMESSAGE_RESOURCE_ENTRY */
2446}
2447
2448static void test_pack_PNT_TIB(void)
2449{
2450 /* PNT_TIB */
2453}
2454
2455static void test_pack_POBJECT_TYPE_LIST(void)
2456{
2457 /* POBJECT_TYPE_LIST */
2462}
2463
2464static void test_pack_PPRIVILEGE_SET(void)
2465{
2466 /* PPRIVILEGE_SET */
2471}
2472
2473static void test_pack_PRIVILEGE_SET(void)
2474{
2475 /* PRIVILEGE_SET */
2478 TEST_FIELD_SIZE (PRIVILEGE_SET, PrivilegeCount, 4)
2479 TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
2480 TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
2487}
2488
2489static void test_pack_PRLIST_ENTRY(void)
2490{
2491 /* PRLIST_ENTRY */
2496}
2497
2498static void test_pack_PRTL_CRITICAL_SECTION(void)
2499{
2500 /* PRTL_CRITICAL_SECTION */
2505}
2506
2508{
2509 /* PRTL_CRITICAL_SECTION_DEBUG */
2512}
2513
2514static void test_pack_PRTL_OSVERSIONINFOEXW(void)
2515{
2516 /* PRTL_OSVERSIONINFOEXW */
2521}
2522
2523static void test_pack_PRTL_OSVERSIONINFOW(void)
2524{
2525 /* PRTL_OSVERSIONINFOW */
2530}
2531
2532static void test_pack_PRTL_RESOURCE_DEBUG(void)
2533{
2534 /* PRTL_RESOURCE_DEBUG */
2537}
2538
2539static void test_pack_PSECURITY_DESCRIPTOR(void)
2540{
2541 /* PSECURITY_DESCRIPTOR */
2544}
2545
2547{
2548 /* PSECURITY_QUALITY_OF_SERVICE */
2551}
2552
2553static void test_pack_PSID(void)
2554{
2555 /* PSID */
2556 TEST_TYPE_SIZE (PSID, 8)
2558}
2559
2561{
2562 /* PSID_IDENTIFIER_AUTHORITY */
2567}
2568
2569static void test_pack_PSINGLE_LIST_ENTRY(void)
2570{
2571 /* PSINGLE_LIST_ENTRY */
2576}
2577
2578static void test_pack_PSTR(void)
2579{
2580 /* PSTR */
2581 TEST_TYPE_SIZE (PSTR, 8)
2585}
2586
2587static void test_pack_PSYSTEM_ALARM_ACE(void)
2588{
2589 /* PSYSTEM_ALARM_ACE */
2594}
2595
2596static void test_pack_PSYSTEM_AUDIT_ACE(void)
2597{
2598 /* PSYSTEM_AUDIT_ACE */
2603}
2604
2605static void test_pack_PTOKEN_GROUPS(void)
2606{
2607 /* PTOKEN_GROUPS */
2612}
2613
2614static void test_pack_PTOKEN_PRIVILEGES(void)
2615{
2616 /* PTOKEN_PRIVILEGES */
2621}
2622
2623static void test_pack_PTOKEN_USER(void)
2624{
2625 /* PTOKEN_USER */
2630}
2631
2632static void test_pack_PULARGE_INTEGER(void)
2633{
2634 /* PULARGE_INTEGER */
2637}
2638
2640{
2641 /* PVECTORED_EXCEPTION_HANDLER */
2644}
2645
2646static void test_pack_PVOID(void)
2647{
2648 /* PVOID */
2651}
2652
2653static void test_pack_PWCH(void)
2654{
2655 /* PWCH */
2656 TEST_TYPE_SIZE (PWCH, 8)
2660}
2661
2662static void test_pack_PWSTR(void)
2663{
2664 /* PWSTR */
2669}
2670
2671static void test_pack_RTL_CRITICAL_SECTION(void)
2672{
2673 /* RTL_CRITICAL_SECTION */
2682 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, RecursionCount, 4)
2683 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4)
2684 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 12)
2688 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2689 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2690 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 24)
2694}
2695
2697{
2698 /* RTL_CRITICAL_SECTION_DEBUG */
2702 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2703 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2704 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex, 2)
2708 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2709 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 8)
2710 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList, 16)
2714 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2715 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 4)
2716 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION_DEBUG, ContentionCount, 36)
2717}
2718
2719static void test_pack_RTL_OSVERSIONINFOEXW(void)
2720{
2721 /* RTL_OSVERSIONINFOEXW */
2724 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2725 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 4)
2726 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwOSVersionInfoSize, 0)
2727 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2728 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2729 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMajorVersion, 4)
2730 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2731 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwMinorVersion, 4)
2732 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwMinorVersion, 8)
2733 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2734 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwBuildNumber, 4)
2735 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwBuildNumber, 12)
2736 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2737 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, dwPlatformId, 4)
2738 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, dwPlatformId, 16)
2739 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, szCSDVersion, 256)
2740 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, szCSDVersion, 2)
2741 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, szCSDVersion, 20)
2742 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2743 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMajor, 2)
2744 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMajor, 276)
2745 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2746 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wServicePackMinor, 2)
2747 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wServicePackMinor, 278)
2748 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2749 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wSuiteMask, 2)
2750 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wSuiteMask, 280)
2751 TEST_FIELD_SIZE (RTL_OSVERSIONINFOEXW, wProductType, 1)
2752 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOEXW, wProductType, 1)
2753 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOEXW, wProductType, 282)
2757}
2758
2759static void test_pack_RTL_OSVERSIONINFOW(void)
2760{
2761 /* RTL_OSVERSIONINFOW */
2764 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2765 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 4)
2766 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwOSVersionInfoSize, 0)
2767 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2768 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2769 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMajorVersion, 4)
2770 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2771 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwMinorVersion, 4)
2772 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwMinorVersion, 8)
2773 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2774 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwBuildNumber, 4)
2775 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwBuildNumber, 12)
2776 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2777 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, dwPlatformId, 4)
2778 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, dwPlatformId, 16)
2779 TEST_FIELD_SIZE (RTL_OSVERSIONINFOW, szCSDVersion, 256)
2780 TEST_FIELD_ALIGN (RTL_OSVERSIONINFOW, szCSDVersion, 2)
2781 TEST_FIELD_OFFSET(RTL_OSVERSIONINFOW, szCSDVersion, 20)
2782}
2783
2784static void test_pack_RTL_RESOURCE_DEBUG(void)
2785{
2786 /* RTL_RESOURCE_DEBUG */
2790 TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2791 TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2792 TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, CreatorBackTraceIndex, 2)
2796 TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2797 TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ProcessLocksList, 8)
2798 TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ProcessLocksList, 16)
2799 TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, EntryCount, 4)
2800 TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, EntryCount, 4)
2801 TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, EntryCount, 32)
2802 TEST_FIELD_SIZE (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2803 TEST_FIELD_ALIGN (RTL_RESOURCE_DEBUG, ContentionCount, 4)
2804 TEST_FIELD_OFFSET(RTL_RESOURCE_DEBUG, ContentionCount, 36)
2805}
2806
2808{
2809 /* SECURITY_CONTEXT_TRACKING_MODE */
2812}
2813
2814static void test_pack_SECURITY_DESCRIPTOR(void)
2815{
2816 /* SECURITY_DESCRIPTOR */
2840}
2841
2843{
2844 /* SECURITY_DESCRIPTOR_CONTROL */
2848}
2849
2851{
2852 /* SECURITY_DESCRIPTOR_RELATIVE */
2876}
2877
2878static void test_pack_SECURITY_INFORMATION(void)
2879{
2880 /* SECURITY_INFORMATION */
2884}
2885
2887{
2888 /* SECURITY_QUALITY_OF_SERVICE */
2892}
2893
2894static void test_pack_SHORT(void)
2895{
2896 /* SHORT */
2900}
2901
2902static void test_pack_SID(void)
2903{
2904 /* SID */
2905 TEST_TYPE_SIZE (SID, 12)
2906 TEST_TYPE_ALIGN (SID, 4)
2916 TEST_FIELD_SIZE (SID, SubAuthority, 4)
2917 TEST_FIELD_ALIGN (SID, SubAuthority, 4)
2918 TEST_FIELD_OFFSET(SID, SubAuthority, 8)
2919}
2920
2921static void test_pack_SID_AND_ATTRIBUTES(void)
2922{
2923 /* SID_AND_ATTRIBUTES */
2932}
2933
2934static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
2935{
2936 /* SID_IDENTIFIER_AUTHORITY */
2942}
2943
2944static void test_pack_SINGLE_LIST_ENTRY(void)
2945{
2946 /* SINGLE_LIST_ENTRY */
2952}
2953
2954static void test_pack_SYSTEM_ALARM_ACE(void)
2955{
2956 /* SYSTEM_ALARM_ACE */
2965 TEST_FIELD_SIZE (SYSTEM_ALARM_ACE, SidStart, 4)
2966 TEST_FIELD_ALIGN (SYSTEM_ALARM_ACE, SidStart, 4)
2968}
2969
2970static void test_pack_SYSTEM_AUDIT_ACE(void)
2971{
2972 /* SYSTEM_AUDIT_ACE */
2981 TEST_FIELD_SIZE (SYSTEM_AUDIT_ACE, SidStart, 4)
2982 TEST_FIELD_ALIGN (SYSTEM_AUDIT_ACE, SidStart, 4)
2984}
2985
2986static void test_pack_TOKEN_DEFAULT_DACL(void)
2987{
2988 /* TOKEN_DEFAULT_DACL */
2991 TEST_FIELD_SIZE (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2992 TEST_FIELD_ALIGN (TOKEN_DEFAULT_DACL, DefaultDacl, 8)
2993 TEST_FIELD_OFFSET(TOKEN_DEFAULT_DACL, DefaultDacl, 0)
2994}
2995
2996static void test_pack_TOKEN_GROUPS(void)
2997{
2998 /* TOKEN_GROUPS */
3001 TEST_FIELD_SIZE (TOKEN_GROUPS, GroupCount, 4)
3002 TEST_FIELD_ALIGN (TOKEN_GROUPS, GroupCount, 4)
3003 TEST_FIELD_OFFSET(TOKEN_GROUPS, GroupCount, 0)
3004 TEST_FIELD_SIZE (TOKEN_GROUPS, Groups, 16)
3005 TEST_FIELD_ALIGN (TOKEN_GROUPS, Groups, 8)
3007}
3008
3009static void test_pack_TOKEN_OWNER(void)
3010{
3011 /* TOKEN_OWNER */
3017}
3018
3019static void test_pack_TOKEN_PRIMARY_GROUP(void)
3020{
3021 /* TOKEN_PRIMARY_GROUP */
3027}
3028
3029static void test_pack_TOKEN_PRIVILEGES(void)
3030{
3031 /* TOKEN_PRIVILEGES */
3034 TEST_FIELD_SIZE (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3035 TEST_FIELD_ALIGN (TOKEN_PRIVILEGES, PrivilegeCount, 4)
3036 TEST_FIELD_OFFSET(TOKEN_PRIVILEGES, PrivilegeCount, 0)
3040}
3041
3042static void test_pack_TOKEN_SOURCE(void)
3043{
3044 /* TOKEN_SOURCE */
3050 TEST_FIELD_SIZE (TOKEN_SOURCE, SourceIdentifier, 8)
3051 TEST_FIELD_ALIGN (TOKEN_SOURCE, SourceIdentifier, 4)
3052 TEST_FIELD_OFFSET(TOKEN_SOURCE, SourceIdentifier, 8)
3053}
3054
3055static void test_pack_TOKEN_STATISTICS(void)
3056{
3057 /* TOKEN_STATISTICS (pack 4) */
3058 TEST_FIELD_SIZE (TOKEN_STATISTICS, TokenId, 8)
3061 TEST_FIELD_SIZE (TOKEN_STATISTICS, AuthenticationId, 8)
3062 TEST_FIELD_ALIGN (TOKEN_STATISTICS, AuthenticationId, 4)
3063 TEST_FIELD_OFFSET(TOKEN_STATISTICS, AuthenticationId, 8)
3064 TEST_FIELD_SIZE (TOKEN_STATISTICS, ExpirationTime, 8)
3065 TEST_FIELD_ALIGN (TOKEN_STATISTICS, ExpirationTime, 4)
3066 TEST_FIELD_OFFSET(TOKEN_STATISTICS, ExpirationTime, 16)
3067}
3068
3069static void test_pack_TOKEN_USER(void)
3070{
3071 /* TOKEN_USER */
3074 TEST_FIELD_SIZE (TOKEN_USER, User, 16)
3075 TEST_FIELD_ALIGN (TOKEN_USER, User, 8)
3077}
3078
3079static void test_pack_ULARGE_INTEGER(void)
3080{
3081 /* ULARGE_INTEGER */
3082}
3083
3084static void test_pack_ULONGLONG(void)
3085{
3086 /* ULONGLONG */
3090}
3091
3092static void test_pack_WAITORTIMERCALLBACKFUNC(void)
3093{
3094 /* WAITORTIMERCALLBACKFUNC */
3097}
3098
3099static void test_pack_WCHAR(void)
3100{
3101 /* WCHAR */
3105}
3106
3107static void test_pack_ATOM(void)
3108{
3109 /* ATOM */
3110 TEST_TYPE_SIZE (ATOM, 2)
3113}
3114
3115static void test_pack_BOOL(void)
3116{
3117 /* BOOL */
3118 TEST_TYPE_SIZE (BOOL, 4)
3121}
3122
3123static void test_pack_BYTE(void)
3124{
3125 /* BYTE */
3126 TEST_TYPE_SIZE (BYTE, 1)
3129}
3130
3131static void test_pack_COLORREF(void)
3132{
3133 /* COLORREF */
3137}
3138
3139static void test_pack_DWORD(void)
3140{
3141 /* DWORD */
3145}
3146
3147static void test_pack_FARPROC(void)
3148{
3149 /* FARPROC */
3152}
3153
3154static void test_pack_FLOAT(void)
3155{
3156 /* FLOAT */
3159}
3160
3161static void test_pack_GLOBALHANDLE(void)
3162{
3163 /* GLOBALHANDLE */
3166}
3167
3168static void test_pack_HCURSOR(void)
3169{
3170 /* HCURSOR */
3173}
3174
3175static void test_pack_HFILE(void)
3176{
3177 /* HFILE */
3181}
3182
3183static void test_pack_HGDIOBJ(void)
3184{
3185 /* HGDIOBJ */
3188}
3189
3190static void test_pack_HGLOBAL(void)
3191{
3192 /* HGLOBAL */
3195}
3196
3197static void test_pack_HLOCAL(void)
3198{
3199 /* HLOCAL */
3202}
3203
3204static void test_pack_HMODULE(void)
3205{
3206 /* HMODULE */
3209}
3210
3211static void test_pack_INT(void)
3212{
3213 /* INT */
3214 TEST_TYPE_SIZE (INT, 4)
3215 TEST_TYPE_ALIGN (INT, 4)
3217}
3218
3219static void test_pack_LOCALHANDLE(void)
3220{
3221 /* LOCALHANDLE */
3224}
3225
3226static void test_pack_LPARAM(void)
3227{
3228 /* LPARAM */
3231}
3232
3233static void test_pack_LPCRECT(void)
3234{
3235 /* LPCRECT */
3240}
3241
3242static void test_pack_LPCRECTL(void)
3243{
3244 /* LPCRECTL */
3249}
3250
3251static void test_pack_LPCVOID(void)
3252{
3253 /* LPCVOID */
3256}
3257
3258static void test_pack_LPPOINT(void)
3259{
3260 /* LPPOINT */
3265}
3266
3267static void test_pack_LPRECT(void)
3268{
3269 /* LPRECT */
3274}
3275
3276static void test_pack_LPRECTL(void)
3277{
3278 /* LPRECTL */
3283}
3284
3285static void test_pack_LPSIZE(void)
3286{
3287 /* LPSIZE */
3292}
3293
3294static void test_pack_LRESULT(void)
3295{
3296 /* LRESULT */
3299}
3300
3301static void test_pack_POINT(void)
3302{
3303 /* POINT */
3306 TEST_FIELD_SIZE (POINT, x, 4)
3309 TEST_FIELD_SIZE (POINT, y, 4)
3312}
3313
3314static void test_pack_POINTL(void)
3315{
3316 /* POINTL */
3325}
3326
3327static void test_pack_PPOINT(void)
3328{
3329 /* PPOINT */
3334}
3335
3336static void test_pack_PPOINTL(void)
3337{
3338 /* PPOINTL */
3343}
3344
3345static void test_pack_PRECT(void)
3346{
3347 /* PRECT */
3352}
3353
3354static void test_pack_PRECTL(void)
3355{
3356 /* PRECTL */
3361}
3362
3363static void test_pack_PROC(void)
3364{
3365 /* PROC */
3366 TEST_TYPE_SIZE (PROC, 8)
3368}
3369
3370static void test_pack_PSIZE(void)
3371{
3372 /* PSIZE */
3377}
3378
3379static void test_pack_PSZ(void)
3380{
3381 /* PSZ */
3382 TEST_TYPE_SIZE (PSZ, 8)
3383 TEST_TYPE_ALIGN (PSZ, 8)
3384}
3385
3386static void test_pack_RECT(void)
3387{
3388 /* RECT */
3389 TEST_TYPE_SIZE (RECT, 16)
3403}
3404
3405static void test_pack_RECTL(void)
3406{
3407 /* RECTL */
3408 TEST_TYPE_SIZE (RECTL, 16)
3422}
3423
3424static void test_pack_SIZE(void)
3425{
3426 /* SIZE */
3427 TEST_TYPE_SIZE (SIZE, 8)
3429 TEST_FIELD_SIZE (SIZE, cx, 4)
3432 TEST_FIELD_SIZE (SIZE, cy, 4)
3435}
3436
3437static void test_pack_SIZEL(void)
3438{
3439 /* SIZEL */
3442}
3443
3444static void test_pack_UCHAR(void)
3445{
3446 /* UCHAR */
3450}
3451
3452static void test_pack_UINT(void)
3453{
3454 /* UINT */
3455 TEST_TYPE_SIZE (UINT, 4)
3458}
3459
3460static void test_pack_ULONG(void)
3461{
3462 /* ULONG */
3466}
3467
3468static void test_pack_USHORT(void)
3469{
3470 /* USHORT */
3474}
3475
3476static void test_pack_WORD(void)
3477{
3478 /* WORD */
3479 TEST_TYPE_SIZE (WORD, 2)
3482}
3483
3484static void test_pack_WPARAM(void)
3485{
3486 /* WPARAM */
3489}
3490
3491#else /* _WIN64 */
3492
3493static void test_pack_DWORD32(void)
3494{
3495 /* DWORD32 */
3499}
3500
3501static void test_pack_DWORD64(void)
3502{
3503 /* DWORD64 */
3507}
3508
3509static void test_pack_DWORD_PTR(void)
3510{
3511 /* DWORD_PTR */
3514}
3515
3516static void test_pack_HALF_PTR(void)
3517{
3518 /* HALF_PTR */
3522}
3523
3524static void test_pack_INT16(void)
3525{
3526 /* INT16 */
3530}
3531
3532static void test_pack_INT32(void)
3533{
3534 /* INT32 */
3538}
3539
3540static void test_pack_INT64(void)
3541{
3542 /* INT64 */
3546}
3547
3548static void test_pack_INT8(void)
3549{
3550 /* INT8 */
3551 TEST_TYPE_SIZE (INT8, 1)
3554}
3555
3556static void test_pack_INT_PTR(void)
3557{
3558 /* INT_PTR */
3562}
3563
3564static void test_pack_LONG32(void)
3565{
3566 /* LONG32 */
3570}
3571
3572static void test_pack_LONG64(void)
3573{
3574 /* LONG64 */
3578}
3579
3580static void test_pack_LONG_PTR(void)
3581{
3582 /* LONG_PTR */
3586}
3587
3588static void test_pack_SIZE_T(void)
3589{
3590 /* SIZE_T */
3593}
3594
3595static void test_pack_SSIZE_T(void)
3596{
3597 /* SSIZE_T */
3600}
3601
3602static void test_pack_UHALF_PTR(void)
3603{
3604 /* UHALF_PTR */
3608}
3609
3610static void test_pack_UINT16(void)
3611{
3612 /* UINT16 */
3616}
3617
3618static void test_pack_UINT32(void)
3619{
3620 /* UINT32 */
3624}
3625
3626static void test_pack_UINT64(void)
3627{
3628 /* UINT64 */
3632}
3633
3634static void test_pack_UINT8(void)
3635{
3636 /* UINT8 */
3640}
3641
3642static void test_pack_UINT_PTR(void)
3643{
3644 /* UINT_PTR */
3648}
3649
3650static void test_pack_ULONG32(void)
3651{
3652 /* ULONG32 */
3656}
3657
3658static void test_pack_ULONG64(void)
3659{
3660 /* ULONG64 */
3664}
3665
3666static void test_pack_ULONG_PTR(void)
3667{
3668 /* ULONG_PTR */
3672}
3673
3675{
3676 /* ACCESS_ALLOWED_ACE */
3685 TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
3688}
3689
3691{
3692 /* ACCESS_DENIED_ACE */
3701 TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4)
3702 TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
3704}
3705
3706static void test_pack_ACCESS_MASK(void)
3707{
3708 /* ACCESS_MASK */
3712}
3713
3714static void test_pack_ACE_HEADER(void)
3715{
3716 /* ACE_HEADER */
3725 TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2)
3726 TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
3727 TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
3728}
3729
3730static void test_pack_ACL(void)
3731{
3732 /* ACL */
3733 TEST_TYPE_SIZE (ACL, 8)
3734 TEST_TYPE_ALIGN (ACL, 2)
3738 TEST_FIELD_SIZE (ACL, Sbz1, 1)
3739 TEST_FIELD_ALIGN (ACL, Sbz1, 1)
3740 TEST_FIELD_OFFSET(ACL, Sbz1, 1)
3741 TEST_FIELD_SIZE (ACL, AclSize, 2)
3742 TEST_FIELD_ALIGN (ACL, AclSize, 2)
3743 TEST_FIELD_OFFSET(ACL, AclSize, 2)
3744 TEST_FIELD_SIZE (ACL, AceCount, 2)
3745 TEST_FIELD_ALIGN (ACL, AceCount, 2)
3746 TEST_FIELD_OFFSET(ACL, AceCount, 4)
3747 TEST_FIELD_SIZE (ACL, Sbz2, 2)
3748 TEST_FIELD_ALIGN (ACL, Sbz2, 2)
3749 TEST_FIELD_OFFSET(ACL, Sbz2, 6)
3750}
3751
3753{
3754 /* ACL_REVISION_INFORMATION */
3760}
3761
3763{
3764 /* ACL_SIZE_INFORMATION */
3770 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3771 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3772 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
3773 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3774 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
3775 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
3776}
3777
3778static void test_pack_BOOLEAN(void)
3779{
3780 /* BOOLEAN */
3784}
3785
3786static void test_pack_CCHAR(void)
3787{
3788 /* CCHAR */
3791}
3792
3793static void test_pack_CHAR(void)
3794{
3795 /* CHAR */
3796 TEST_TYPE_SIZE (CHAR, 1)
3798}
3799
3800static void test_pack_DWORDLONG(void)
3801{
3802 /* DWORDLONG */
3806}
3807
3809{
3810 /* EXCEPTION_POINTERS */
3813 TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 4)
3814 TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 4)
3815 TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
3819}
3820
3822{
3823 /* EXCEPTION_RECORD */
3829 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4)
3830 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
3831 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
3832 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 4)
3833 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 4)
3834 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
3835 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 4)
3836 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 4)
3837 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 12)
3838 TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4)
3839 TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
3840 TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 16)
3841