1 /* File generated automatically from tools/winapi/test.dat; do not edit! */
2 /* This file can be copied, modified and distributed without restriction. */
5 * Unit tests for data structure packing
9 #define _WIN32_IE 0x0501
10 #define _WIN32_WINNT 0x0501
12 #define WINE_NOWINSOCK
14 #include "ntdll_test.h"
16 #include "wine/test.h"
18 /***********************************************************************
22 #define DWORD_PTR UINT_PTR
23 #define LONG_PTR INT_PTR
24 #define ULONG_PTR UINT_PTR
26 /***********************************************************************
27 * Windows API extension
30 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
31 # define FIELD_ALIGNMENT(type, field) __alignof(((type*)0)->field)
32 #elif defined(__GNUC__)
33 # define FIELD_ALIGNMENT(type, field) __alignof__(((type*)0)->field)
35 /* FIXME: Not sure if is possible to do without compiler extension */
38 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
39 # define _TYPE_ALIGNMENT(type) __alignof(type)
40 #elif defined(__GNUC__)
41 # define _TYPE_ALIGNMENT(type) __alignof__(type)
44 * FIXME: Not sure if is possible to do without compiler extension
45 * (if type is not just a name that is, if so the normal)
46 * TYPE_ALIGNMENT can be used)
50 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
51 #pragma warning(disable:4116)
54 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
55 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
58 /***********************************************************************
62 #ifdef FIELD_ALIGNMENT
63 # define TEST_FIELD_ALIGNMENT(type, field, align) \
64 ok(FIELD_ALIGNMENT(type, field) == align, \
65 "FIELD_ALIGNMENT(" #type ", " #field ") == %d (expected " #align ")\n", \
66 FIELD_ALIGNMENT(type, field))
68 # define TEST_FIELD_ALIGNMENT(type, field, align) do { } while (0)
71 #define TEST_FIELD_OFFSET(type, field, offset) \
72 ok(FIELD_OFFSET(type, field) == offset, \
73 "FIELD_OFFSET(" #type ", " #field ") == %ld (expected " #offset ")\n", \
74 FIELD_OFFSET(type, field))
76 #ifdef _TYPE_ALIGNMENT
77 #define TEST__TYPE_ALIGNMENT(type, align) \
78 ok(_TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", _TYPE_ALIGNMENT(type))
80 # define TEST__TYPE_ALIGNMENT(type, align) do { } while (0)
84 #define TEST_TYPE_ALIGNMENT(type, align) \
85 ok(TYPE_ALIGNMENT(type) == align, "TYPE_ALIGNMENT(" #type ") == %d (expected " #align ")\n", TYPE_ALIGNMENT(type))
87 # define TEST_TYPE_ALIGNMENT(type, align) do { } while (0)
90 #define TEST_TYPE_SIZE(type, size) \
91 ok(sizeof(type) == size, "sizeof(" #type ") == %d (expected " #size ")\n", sizeof(type))
93 /***********************************************************************
97 #define TEST_FIELD(type, field_type, field_name, field_offset, field_size, field_align) \
98 TEST_TYPE_SIZE(field_type, field_size); \
99 TEST_FIELD_ALIGNMENT(type, field_name, field_align); \
100 TEST_FIELD_OFFSET(type, field_name, field_offset); \
102 #define TEST_TYPE(type, size, align) \
103 TEST_TYPE_ALIGNMENT(type, align); \
104 TEST_TYPE_SIZE(type, size)
106 #define TEST_TYPE_POINTER(type, size, align) \
107 TEST__TYPE_ALIGNMENT(*(type)0, align); \
108 TEST_TYPE_SIZE(*(type)0, size)
110 #define TEST_TYPE_SIGNED(type) \
111 ok((type) -1 < 0, "(" #type ") -1 < 0\n");
113 #define TEST_TYPE_UNSIGNED(type) \
114 ok((type) -1 > 0, "(" #type ") -1 > 0\n");
116 static void test_pack_DWORD32(void)
119 TEST_TYPE(DWORD32, 4, 4);
120 TEST_TYPE_UNSIGNED(DWORD32);
123 static void test_pack_DWORD64(void)
126 TEST_TYPE(DWORD64, 8, 8);
127 TEST_TYPE_UNSIGNED(DWORD64);
130 static void test_pack_DWORD_PTR(void)
133 TEST_TYPE(DWORD_PTR, 4, 4);
136 static void test_pack_HALF_PTR(void)
139 TEST_TYPE(HALF_PTR, 2, 2);
140 TEST_TYPE_SIGNED(HALF_PTR);
143 static void test_pack_INT16(void)
146 TEST_TYPE(INT16, 2, 2);
147 TEST_TYPE_SIGNED(INT16);
150 static void test_pack_INT32(void)
153 TEST_TYPE(INT32, 4, 4);
154 TEST_TYPE_SIGNED(INT32);
157 static void test_pack_INT64(void)
160 TEST_TYPE(INT64, 8, 8);
161 TEST_TYPE_SIGNED(INT64);
164 static void test_pack_INT8(void)
167 TEST_TYPE(INT8, 1, 1);
168 TEST_TYPE_SIGNED(INT8);
171 static void test_pack_INT_PTR(void)
174 TEST_TYPE(INT_PTR, 4, 4);
175 TEST_TYPE_SIGNED(INT_PTR);
178 static void test_pack_LONG32(void)
181 TEST_TYPE(LONG32, 4, 4);
182 TEST_TYPE_SIGNED(LONG32);
185 static void test_pack_LONG64(void)
188 TEST_TYPE(LONG64, 8, 8);
189 TEST_TYPE_SIGNED(LONG64);
192 static void test_pack_LONG_PTR(void)
195 TEST_TYPE(LONG_PTR, 4, 4);
196 TEST_TYPE_SIGNED(LONG_PTR);
199 static void test_pack_SIZE_T(void)
202 TEST_TYPE(SIZE_T, 4, 4);
205 static void test_pack_SSIZE_T(void)
208 TEST_TYPE(SSIZE_T, 4, 4);
211 static void test_pack_UHALF_PTR(void)
214 TEST_TYPE(UHALF_PTR, 2, 2);
215 TEST_TYPE_UNSIGNED(UHALF_PTR);
218 static void test_pack_UINT16(void)
221 TEST_TYPE(UINT16, 2, 2);
222 TEST_TYPE_UNSIGNED(UINT16);
225 static void test_pack_UINT32(void)
228 TEST_TYPE(UINT32, 4, 4);
229 TEST_TYPE_UNSIGNED(UINT32);
232 static void test_pack_UINT64(void)
235 TEST_TYPE(UINT64, 8, 8);
236 TEST_TYPE_UNSIGNED(UINT64);
239 static void test_pack_UINT8(void)
242 TEST_TYPE(UINT8, 1, 1);
243 TEST_TYPE_UNSIGNED(UINT8);
246 static void test_pack_UINT_PTR(void)
249 TEST_TYPE(UINT_PTR, 4, 4);
250 TEST_TYPE_UNSIGNED(UINT_PTR);
253 static void test_pack_ULONG32(void)
256 TEST_TYPE(ULONG32, 4, 4);
257 TEST_TYPE_UNSIGNED(ULONG32);
260 static void test_pack_ULONG64(void)
263 TEST_TYPE(ULONG64, 8, 8);
264 TEST_TYPE_UNSIGNED(ULONG64);
267 static void test_pack_ULONG_PTR(void)
270 TEST_TYPE(ULONG_PTR, 4, 4);
271 TEST_TYPE_UNSIGNED(ULONG_PTR);
274 static void test_pack_ACCESS_ALLOWED_ACE(void)
276 /* ACCESS_ALLOWED_ACE (pack 4) */
277 TEST_TYPE(ACCESS_ALLOWED_ACE, 12, 4);
278 TEST_FIELD(ACCESS_ALLOWED_ACE, ACE_HEADER, Header, 0, 4, 2);
279 TEST_FIELD(ACCESS_ALLOWED_ACE, DWORD, Mask, 4, 4, 4);
280 TEST_FIELD(ACCESS_ALLOWED_ACE, DWORD, SidStart, 8, 4, 4);
283 static void test_pack_ACCESS_DENIED_ACE(void)
285 /* ACCESS_DENIED_ACE (pack 4) */
286 TEST_TYPE(ACCESS_DENIED_ACE, 12, 4);
287 TEST_FIELD(ACCESS_DENIED_ACE, ACE_HEADER, Header, 0, 4, 2);
288 TEST_FIELD(ACCESS_DENIED_ACE, DWORD, Mask, 4, 4, 4);
289 TEST_FIELD(ACCESS_DENIED_ACE, DWORD, SidStart, 8, 4, 4);
292 static void test_pack_ACCESS_MASK(void)
295 TEST_TYPE(ACCESS_MASK, 4, 4);
296 TEST_TYPE_UNSIGNED(ACCESS_MASK);
299 static void test_pack_ACE_HEADER(void)
301 /* ACE_HEADER (pack 4) */
302 TEST_TYPE(ACE_HEADER, 4, 2);
303 TEST_FIELD(ACE_HEADER, BYTE, AceType, 0, 1, 1);
304 TEST_FIELD(ACE_HEADER, BYTE, AceFlags, 1, 1, 1);
305 TEST_FIELD(ACE_HEADER, WORD, AceSize, 2, 2, 2);
308 static void test_pack_ACL(void)
311 TEST_TYPE(ACL, 8, 2);
312 TEST_FIELD(ACL, BYTE, AclRevision, 0, 1, 1);
313 TEST_FIELD(ACL, BYTE, Sbz1, 1, 1, 1);
314 TEST_FIELD(ACL, WORD, AclSize, 2, 2, 2);
315 TEST_FIELD(ACL, WORD, AceCount, 4, 2, 2);
316 TEST_FIELD(ACL, WORD, Sbz2, 6, 2, 2);
319 static void test_pack_ACL_REVISION_INFORMATION(void)
321 /* ACL_REVISION_INFORMATION (pack 4) */
322 TEST_TYPE(ACL_REVISION_INFORMATION, 4, 4);
323 TEST_FIELD(ACL_REVISION_INFORMATION, DWORD, AclRevision, 0, 4, 4);
326 static void test_pack_ACL_SIZE_INFORMATION(void)
328 /* ACL_SIZE_INFORMATION (pack 4) */
329 TEST_TYPE(ACL_SIZE_INFORMATION, 12, 4);
330 TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AceCount, 0, 4, 4);
331 TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AclBytesInUse, 4, 4, 4);
332 TEST_FIELD(ACL_SIZE_INFORMATION, DWORD, AclBytesFree, 8, 4, 4);
335 static void test_pack_BOOLEAN(void)
338 TEST_TYPE(BOOLEAN, 1, 1);
339 TEST_TYPE_UNSIGNED(BOOLEAN);
342 static void test_pack_CCHAR(void)
345 TEST_TYPE(CCHAR, 1, 1);
346 TEST_TYPE_SIGNED(CCHAR);
349 static void test_pack_CHAR(void)
352 TEST_TYPE(CHAR, 1, 1);
353 TEST_TYPE_SIGNED(CHAR);
356 static void test_pack_DWORDLONG(void)
359 TEST_TYPE(DWORDLONG, 8, 8);
360 TEST_TYPE_UNSIGNED(DWORDLONG);
363 static void test_pack_EXCEPTION_POINTERS(void)
365 /* EXCEPTION_POINTERS (pack 4) */
366 TEST_TYPE(EXCEPTION_POINTERS, 8, 4);
367 TEST_FIELD(EXCEPTION_POINTERS, PEXCEPTION_RECORD, ExceptionRecord, 0, 4, 4);
368 TEST_FIELD(EXCEPTION_POINTERS, PCONTEXT, ContextRecord, 4, 4, 4);
371 static void test_pack_EXCEPTION_RECORD(void)
373 /* EXCEPTION_RECORD (pack 4) */
374 TEST_TYPE(EXCEPTION_RECORD, 80, 4);
375 TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionCode, 0, 4, 4);
376 TEST_FIELD(EXCEPTION_RECORD, DWORD, ExceptionFlags, 4, 4, 4);
377 TEST_FIELD(EXCEPTION_RECORD, struct __EXCEPTION_RECORD *, ExceptionRecord, 8, 4, 4);
378 TEST_FIELD(EXCEPTION_RECORD, LPVOID, ExceptionAddress, 12, 4, 4);
379 TEST_FIELD(EXCEPTION_RECORD, DWORD, NumberParameters, 16, 4, 4);
380 TEST_FIELD(EXCEPTION_RECORD, DWORD[EXCEPTION_MAXIMUM_PARAMETERS], ExceptionInformation, 20, 60, 4);
383 static void test_pack_EXECUTION_STATE(void)
385 /* EXECUTION_STATE */
386 TEST_TYPE(EXECUTION_STATE, 4, 4);
387 TEST_TYPE_UNSIGNED(EXECUTION_STATE);
390 static void test_pack_FLOATING_SAVE_AREA(void)
392 /* FLOATING_SAVE_AREA (pack 4) */
393 TEST_TYPE(FLOATING_SAVE_AREA, 112, 4);
394 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ControlWord, 0, 4, 4);
395 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, StatusWord, 4, 4, 4);
396 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, TagWord, 8, 4, 4);
397 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ErrorOffset, 12, 4, 4);
398 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, ErrorSelector, 16, 4, 4);
399 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, DataOffset, 20, 4, 4);
400 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, DataSelector, 24, 4, 4);
401 TEST_FIELD(FLOATING_SAVE_AREA, BYTE[SIZE_OF_80387_REGISTERS], RegisterArea, 28, 80, 1);
402 TEST_FIELD(FLOATING_SAVE_AREA, DWORD, Cr0NpxState, 108, 4, 4);
405 static void test_pack_FPO_DATA(void)
407 /* FPO_DATA (pack 4) */
408 TEST_TYPE(FPO_DATA, 16, 4);
409 TEST_FIELD(FPO_DATA, DWORD, ulOffStart, 0, 4, 4);
410 TEST_FIELD(FPO_DATA, DWORD, cbProcSize, 4, 4, 4);
411 TEST_FIELD(FPO_DATA, DWORD, cdwLocals, 8, 4, 4);
412 TEST_FIELD(FPO_DATA, WORD, cdwParams, 12, 2, 2);
415 static void test_pack_GENERIC_MAPPING(void)
417 /* GENERIC_MAPPING (pack 4) */
418 TEST_TYPE(GENERIC_MAPPING, 16, 4);
419 TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericRead, 0, 4, 4);
420 TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericWrite, 4, 4, 4);
421 TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericExecute, 8, 4, 4);
422 TEST_FIELD(GENERIC_MAPPING, ACCESS_MASK, GenericAll, 12, 4, 4);
425 static void test_pack_HANDLE(void)
428 TEST_TYPE(HANDLE, 4, 4);
431 static void test_pack_HRESULT(void)
434 TEST_TYPE(HRESULT, 4, 4);
437 static void test_pack_IMAGE_ARCHIVE_MEMBER_HEADER(void)
439 /* IMAGE_ARCHIVE_MEMBER_HEADER (pack 4) */
440 TEST_TYPE(IMAGE_ARCHIVE_MEMBER_HEADER, 60, 1);
441 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[16], Name, 0, 16, 1);
442 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[12], Date, 16, 12, 1);
443 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[6], UserID, 28, 6, 1);
444 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[6], GroupID, 34, 6, 1);
445 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[8], Mode, 40, 8, 1);
446 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[10], Size, 48, 10, 1);
447 TEST_FIELD(IMAGE_ARCHIVE_MEMBER_HEADER, BYTE[2], EndHeader, 58, 2, 1);
450 static void test_pack_IMAGE_AUX_SYMBOL(void)
452 /* IMAGE_AUX_SYMBOL (pack 2) */
455 static void test_pack_IMAGE_BASE_RELOCATION(void)
457 /* IMAGE_BASE_RELOCATION (pack 4) */
458 TEST_TYPE(IMAGE_BASE_RELOCATION, 8, 4);
459 TEST_FIELD(IMAGE_BASE_RELOCATION, DWORD, VirtualAddress, 0, 4, 4);
460 TEST_FIELD(IMAGE_BASE_RELOCATION, DWORD, SizeOfBlock, 4, 4, 4);
463 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
465 /* IMAGE_BOUND_FORWARDER_REF (pack 4) */
466 TEST_TYPE(IMAGE_BOUND_FORWARDER_REF, 8, 4);
467 TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, DWORD, TimeDateStamp, 0, 4, 4);
468 TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, WORD, OffsetModuleName, 4, 2, 2);
469 TEST_FIELD(IMAGE_BOUND_FORWARDER_REF, WORD, Reserved, 6, 2, 2);
472 static void test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR(void)
474 /* IMAGE_BOUND_IMPORT_DESCRIPTOR (pack 4) */
475 TEST_TYPE(IMAGE_BOUND_IMPORT_DESCRIPTOR, 8, 4);
476 TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, DWORD, TimeDateStamp, 0, 4, 4);
477 TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, WORD, OffsetModuleName, 4, 2, 2);
478 TEST_FIELD(IMAGE_BOUND_IMPORT_DESCRIPTOR, WORD, NumberOfModuleForwarderRefs, 6, 2, 2);
481 static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void)
483 /* IMAGE_COFF_SYMBOLS_HEADER (pack 4) */
484 TEST_TYPE(IMAGE_COFF_SYMBOLS_HEADER, 32, 4);
485 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, NumberOfSymbols, 0, 4, 4);
486 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, LvaToFirstSymbol, 4, 4, 4);
487 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, NumberOfLinenumbers, 8, 4, 4);
488 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, LvaToFirstLinenumber, 12, 4, 4);
489 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToFirstByteOfCode, 16, 4, 4);
490 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToLastByteOfCode, 20, 4, 4);
491 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToFirstByteOfData, 24, 4, 4);
492 TEST_FIELD(IMAGE_COFF_SYMBOLS_HEADER, DWORD, RvaToLastByteOfData, 28, 4, 4);
495 static void test_pack_IMAGE_DATA_DIRECTORY(void)
497 /* IMAGE_DATA_DIRECTORY (pack 4) */
498 TEST_TYPE(IMAGE_DATA_DIRECTORY, 8, 4);
499 TEST_FIELD(IMAGE_DATA_DIRECTORY, DWORD, VirtualAddress, 0, 4, 4);
500 TEST_FIELD(IMAGE_DATA_DIRECTORY, DWORD, Size, 4, 4, 4);
503 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
505 /* IMAGE_DEBUG_DIRECTORY (pack 4) */
506 TEST_TYPE(IMAGE_DEBUG_DIRECTORY, 28, 4);
507 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, Characteristics, 0, 4, 4);
508 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4);
509 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, WORD, MajorVersion, 8, 2, 2);
510 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, WORD, MinorVersion, 10, 2, 2);
511 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, Type, 12, 4, 4);
512 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, SizeOfData, 16, 4, 4);
513 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, AddressOfRawData, 20, 4, 4);
514 TEST_FIELD(IMAGE_DEBUG_DIRECTORY, DWORD, PointerToRawData, 24, 4, 4);
517 static void test_pack_IMAGE_DEBUG_MISC(void)
519 /* IMAGE_DEBUG_MISC (pack 4) */
520 TEST_TYPE(IMAGE_DEBUG_MISC, 16, 4);
521 TEST_FIELD(IMAGE_DEBUG_MISC, DWORD, DataType, 0, 4, 4);
522 TEST_FIELD(IMAGE_DEBUG_MISC, DWORD, Length, 4, 4, 4);
523 TEST_FIELD(IMAGE_DEBUG_MISC, BYTE, Unicode, 8, 1, 1);
524 TEST_FIELD(IMAGE_DEBUG_MISC, BYTE[ 3 ], Reserved, 9, 3, 1);
525 TEST_FIELD(IMAGE_DEBUG_MISC, BYTE[ 1 ], Data, 12, 1, 1);
528 static void test_pack_IMAGE_DOS_HEADER(void)
530 /* IMAGE_DOS_HEADER (pack 2) */
531 TEST_TYPE(IMAGE_DOS_HEADER, 64, 2);
532 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_magic, 0, 2, 2);
533 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cblp, 2, 2, 2);
534 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cp, 4, 2, 2);
535 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_crlc, 6, 2, 2);
536 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cparhdr, 8, 2, 2);
537 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_minalloc, 10, 2, 2);
538 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_maxalloc, 12, 2, 2);
539 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ss, 14, 2, 2);
540 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_sp, 16, 2, 2);
541 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_csum, 18, 2, 2);
542 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ip, 20, 2, 2);
543 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_cs, 22, 2, 2);
544 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_lfarlc, 24, 2, 2);
545 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_ovno, 26, 2, 2);
546 TEST_FIELD(IMAGE_DOS_HEADER, WORD[4], e_res, 28, 8, 2);
547 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_oemid, 36, 2, 2);
548 TEST_FIELD(IMAGE_DOS_HEADER, WORD, e_oeminfo, 38, 2, 2);
549 TEST_FIELD(IMAGE_DOS_HEADER, WORD[10], e_res2, 40, 20, 2);
550 TEST_FIELD(IMAGE_DOS_HEADER, DWORD, e_lfanew, 60, 4, 2);
553 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
555 /* IMAGE_EXPORT_DIRECTORY (pack 4) */
556 TEST_TYPE(IMAGE_EXPORT_DIRECTORY, 40, 4);
557 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Characteristics, 0, 4, 4);
558 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4);
559 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, WORD, MajorVersion, 8, 2, 2);
560 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, WORD, MinorVersion, 10, 2, 2);
561 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Name, 12, 4, 4);
562 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, Base, 16, 4, 4);
563 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, NumberOfFunctions, 20, 4, 4);
564 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, NumberOfNames, 24, 4, 4);
565 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfFunctions, 28, 4, 4);
566 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfNames, 32, 4, 4);
567 TEST_FIELD(IMAGE_EXPORT_DIRECTORY, DWORD, AddressOfNameOrdinals, 36, 4, 4);
570 static void test_pack_IMAGE_FILE_HEADER(void)
572 /* IMAGE_FILE_HEADER (pack 4) */
573 TEST_TYPE(IMAGE_FILE_HEADER, 20, 4);
574 TEST_FIELD(IMAGE_FILE_HEADER, WORD, Machine, 0, 2, 2);
575 TEST_FIELD(IMAGE_FILE_HEADER, WORD, NumberOfSections, 2, 2, 2);
576 TEST_FIELD(IMAGE_FILE_HEADER, DWORD, TimeDateStamp, 4, 4, 4);
577 TEST_FIELD(IMAGE_FILE_HEADER, DWORD, PointerToSymbolTable, 8, 4, 4);
578 TEST_FIELD(IMAGE_FILE_HEADER, DWORD, NumberOfSymbols, 12, 4, 4);
579 TEST_FIELD(IMAGE_FILE_HEADER, WORD, SizeOfOptionalHeader, 16, 2, 2);
580 TEST_FIELD(IMAGE_FILE_HEADER, WORD, Characteristics, 18, 2, 2);
583 static void test_pack_IMAGE_FUNCTION_ENTRY(void)
585 /* IMAGE_FUNCTION_ENTRY (pack 4) */
586 TEST_TYPE(IMAGE_FUNCTION_ENTRY, 12, 4);
587 TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, StartingAddress, 0, 4, 4);
588 TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, EndingAddress, 4, 4, 4);
589 TEST_FIELD(IMAGE_FUNCTION_ENTRY, DWORD, EndOfPrologue, 8, 4, 4);
592 static void test_pack_IMAGE_IMPORT_BY_NAME(void)
594 /* IMAGE_IMPORT_BY_NAME (pack 4) */
595 TEST_TYPE(IMAGE_IMPORT_BY_NAME, 4, 2);
596 TEST_FIELD(IMAGE_IMPORT_BY_NAME, WORD, Hint, 0, 2, 2);
597 TEST_FIELD(IMAGE_IMPORT_BY_NAME, BYTE[1], Name, 2, 1, 1);
600 static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
602 /* IMAGE_IMPORT_DESCRIPTOR (pack 4) */
605 static void test_pack_IMAGE_LINENUMBER(void)
607 /* IMAGE_LINENUMBER (pack 2) */
610 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void)
612 /* IMAGE_LOAD_CONFIG_DIRECTORY (pack 4) */
613 TEST_TYPE(IMAGE_LOAD_CONFIG_DIRECTORY, 72, 4);
614 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, Size, 0, 4, 4);
615 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4);
616 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, MajorVersion, 8, 2, 2);
617 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, MinorVersion, 10, 2, 2);
618 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, GlobalFlagsClear, 12, 4, 4);
619 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, GlobalFlagsSet, 16, 4, 4);
620 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, CriticalSectionDefaultTimeout, 20, 4, 4);
621 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, DeCommitFreeBlockThreshold, 24, 4, 4);
622 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, DeCommitTotalFreeThreshold, 28, 4, 4);
623 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, PVOID, LockPrefixTable, 32, 4, 4);
624 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, MaximumAllocationSize, 36, 4, 4);
625 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, VirtualMemoryThreshold, 40, 4, 4);
626 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, ProcessHeapFlags, 44, 4, 4);
627 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, ProcessAffinityMask, 48, 4, 4);
628 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, CSDVersion, 52, 2, 2);
629 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, WORD, Reserved1, 54, 2, 2);
630 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, PVOID, EditList, 56, 4, 4);
631 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SecurityCookie, 60, 4, 4);
632 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SEHandlerTable, 64, 4, 4);
633 TEST_FIELD(IMAGE_LOAD_CONFIG_DIRECTORY, DWORD, SEHandlerCount, 68, 4, 4);
636 static void test_pack_IMAGE_NT_HEADERS(void)
638 /* IMAGE_NT_HEADERS (pack 4) */
639 TEST_TYPE(IMAGE_NT_HEADERS, 248, 4);
640 TEST_FIELD(IMAGE_NT_HEADERS, DWORD, Signature, 0, 4, 4);
641 TEST_FIELD(IMAGE_NT_HEADERS, IMAGE_FILE_HEADER, FileHeader, 4, 20, 4);
642 TEST_FIELD(IMAGE_NT_HEADERS, IMAGE_OPTIONAL_HEADER, OptionalHeader, 24, 224, 4);
645 static void test_pack_IMAGE_OPTIONAL_HEADER(void)
647 /* IMAGE_OPTIONAL_HEADER (pack 4) */
648 TEST_TYPE(IMAGE_OPTIONAL_HEADER, 224, 4);
649 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, Magic, 0, 2, 2);
650 TEST_FIELD(IMAGE_OPTIONAL_HEADER, BYTE, MajorLinkerVersion, 2, 1, 1);
651 TEST_FIELD(IMAGE_OPTIONAL_HEADER, BYTE, MinorLinkerVersion, 3, 1, 1);
652 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfCode, 4, 4, 4);
653 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfInitializedData, 8, 4, 4);
654 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfUninitializedData, 12, 4, 4);
655 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, AddressOfEntryPoint, 16, 4, 4);
656 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, BaseOfCode, 20, 4, 4);
657 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, BaseOfData, 24, 4, 4);
658 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, ImageBase, 28, 4, 4);
659 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SectionAlignment, 32, 4, 4);
660 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, FileAlignment, 36, 4, 4);
661 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MajorOperatingSystemVersion, 40, 2, 2);
662 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MinorOperatingSystemVersion, 42, 2, 2);
663 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MajorImageVersion, 44, 2, 2);
664 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MinorImageVersion, 46, 2, 2);
665 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MajorSubsystemVersion, 48, 2, 2);
666 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, MinorSubsystemVersion, 50, 2, 2);
667 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, Win32VersionValue, 52, 4, 4);
668 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfImage, 56, 4, 4);
669 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfHeaders, 60, 4, 4);
670 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, CheckSum, 64, 4, 4);
671 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, Subsystem, 68, 2, 2);
672 TEST_FIELD(IMAGE_OPTIONAL_HEADER, WORD, DllCharacteristics, 70, 2, 2);
673 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfStackReserve, 72, 4, 4);
674 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfStackCommit, 76, 4, 4);
675 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfHeapReserve, 80, 4, 4);
676 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, SizeOfHeapCommit, 84, 4, 4);
677 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, LoaderFlags, 88, 4, 4);
678 TEST_FIELD(IMAGE_OPTIONAL_HEADER, DWORD, NumberOfRvaAndSizes, 92, 4, 4);
679 TEST_FIELD(IMAGE_OPTIONAL_HEADER, IMAGE_DATA_DIRECTORY[IMAGE_NUMBEROF_DIRECTORY_ENTRIES], DataDirectory, 96, 128, 4);
682 static void test_pack_IMAGE_OS2_HEADER(void)
684 /* IMAGE_OS2_HEADER (pack 2) */
685 TEST_TYPE(IMAGE_OS2_HEADER, 64, 2);
686 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_magic, 0, 2, 2);
687 TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_ver, 2, 1, 1);
688 TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_rev, 3, 1, 1);
689 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_enttab, 4, 2, 2);
690 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cbenttab, 6, 2, 2);
691 TEST_FIELD(IMAGE_OS2_HEADER, LONG, ne_crc, 8, 4, 2);
692 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_flags, 12, 2, 2);
693 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_autodata, 14, 2, 2);
694 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_heap, 16, 2, 2);
695 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_stack, 18, 2, 2);
696 TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_csip, 20, 4, 2);
697 TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_sssp, 24, 4, 2);
698 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cseg, 28, 2, 2);
699 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cmod, 30, 2, 2);
700 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cbnrestab, 32, 2, 2);
701 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_segtab, 34, 2, 2);
702 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_rsrctab, 36, 2, 2);
703 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_restab, 38, 2, 2);
704 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_modtab, 40, 2, 2);
705 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_imptab, 42, 2, 2);
706 TEST_FIELD(IMAGE_OS2_HEADER, DWORD, ne_nrestab, 44, 4, 2);
707 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cmovent, 48, 2, 2);
708 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_align, 50, 2, 2);
709 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_cres, 52, 2, 2);
710 TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_exetyp, 54, 1, 1);
711 TEST_FIELD(IMAGE_OS2_HEADER, BYTE, ne_flagsothers, 55, 1, 1);
712 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_pretthunks, 56, 2, 2);
713 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_psegrefbytes, 58, 2, 2);
714 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_swaparea, 60, 2, 2);
715 TEST_FIELD(IMAGE_OS2_HEADER, WORD, ne_expver, 62, 2, 2);
718 static void test_pack_IMAGE_RELOCATION(void)
720 /* IMAGE_RELOCATION (pack 2) */
723 static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void)
725 /* IMAGE_RESOURCE_DATA_ENTRY (pack 4) */
726 TEST_TYPE(IMAGE_RESOURCE_DATA_ENTRY, 16, 4);
727 TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, OffsetToData, 0, 4, 4);
728 TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, Size, 4, 4, 4);
729 TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, CodePage, 8, 4, 4);
730 TEST_FIELD(IMAGE_RESOURCE_DATA_ENTRY, DWORD, Reserved, 12, 4, 4);
733 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
735 /* IMAGE_RESOURCE_DIRECTORY (pack 4) */
736 TEST_TYPE(IMAGE_RESOURCE_DIRECTORY, 16, 4);
737 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, DWORD, Characteristics, 0, 4, 4);
738 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, DWORD, TimeDateStamp, 4, 4, 4);
739 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, MajorVersion, 8, 2, 2);
740 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, MinorVersion, 10, 2, 2);
741 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, NumberOfNamedEntries, 12, 2, 2);
742 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY, WORD, NumberOfIdEntries, 14, 2, 2);
745 static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void)
747 /* IMAGE_RESOURCE_DIRECTORY_ENTRY (pack 4) */
750 static void test_pack_IMAGE_RESOURCE_DIRECTORY_STRING(void)
752 /* IMAGE_RESOURCE_DIRECTORY_STRING (pack 4) */
753 TEST_TYPE(IMAGE_RESOURCE_DIRECTORY_STRING, 4, 2);
754 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY_STRING, WORD, Length, 0, 2, 2);
755 TEST_FIELD(IMAGE_RESOURCE_DIRECTORY_STRING, CHAR[ 1 ], NameString, 2, 1, 1);
758 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
760 /* IMAGE_RESOURCE_DIR_STRING_U (pack 4) */
761 TEST_TYPE(IMAGE_RESOURCE_DIR_STRING_U, 4, 2);
762 TEST_FIELD(IMAGE_RESOURCE_DIR_STRING_U, WORD, Length, 0, 2, 2);
763 TEST_FIELD(IMAGE_RESOURCE_DIR_STRING_U, WCHAR[ 1 ], NameString, 2, 2, 2);
766 static void test_pack_IMAGE_SECTION_HEADER(void)
768 /* IMAGE_SECTION_HEADER (pack 4) */
769 TEST_FIELD(IMAGE_SECTION_HEADER, BYTE[IMAGE_SIZEOF_SHORT_NAME], Name, 0, 8, 1);
772 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
774 /* IMAGE_SEPARATE_DEBUG_HEADER (pack 4) */
775 TEST_TYPE(IMAGE_SEPARATE_DEBUG_HEADER, 48, 4);
776 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Signature, 0, 2, 2);
777 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Flags, 2, 2, 2);
778 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Machine, 4, 2, 2);
779 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, WORD, Characteristics, 6, 2, 2);
780 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, TimeDateStamp, 8, 4, 4);
781 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, CheckSum, 12, 4, 4);
782 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, ImageBase, 16, 4, 4);
783 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, SizeOfImage, 20, 4, 4);
784 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, NumberOfSections, 24, 4, 4);
785 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, ExportedNamesSize, 28, 4, 4);
786 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, DebugDirectorySize, 32, 4, 4);
787 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD, SectionAlignment, 36, 4, 4);
788 TEST_FIELD(IMAGE_SEPARATE_DEBUG_HEADER, DWORD[ 2 ], Reserved, 40, 8, 4);
791 static void test_pack_IMAGE_SYMBOL(void)
793 /* IMAGE_SYMBOL (pack 2) */
796 static void test_pack_IMAGE_THUNK_DATA(void)
798 /* IMAGE_THUNK_DATA (pack 4) */
801 static void test_pack_IMAGE_TLS_DIRECTORY(void)
803 /* IMAGE_TLS_DIRECTORY (pack 4) */
804 TEST_TYPE(IMAGE_TLS_DIRECTORY, 24, 4);
805 TEST_FIELD(IMAGE_TLS_DIRECTORY, DWORD, StartAddressOfRawData, 0, 4, 4);
806 TEST_FIELD(IMAGE_TLS_DIRECTORY, DWORD, EndAddressOfRawData, 4, 4, 4);
807 TEST_FIELD(IMAGE_TLS_DIRECTORY, LPDWORD, AddressOfIndex, 8, 4, 4);
808 TEST_FIELD(IMAGE_TLS_DIRECTORY, PIMAGE_TLS_CALLBACK *, AddressOfCallBacks, 12, 4, 4);
809 TEST_FIELD(IMAGE_TLS_DIRECTORY, DWORD, SizeOfZeroFill, 16, 4, 4);
810 TEST_FIELD(IMAGE_TLS_DIRECTORY, DWORD, Characteristics, 20, 4, 4);
813 static void test_pack_IMAGE_VXD_HEADER(void)
815 /* IMAGE_VXD_HEADER (pack 2) */
816 TEST_TYPE(IMAGE_VXD_HEADER, 196, 2);
817 TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_magic, 0, 2, 2);
818 TEST_FIELD(IMAGE_VXD_HEADER, BYTE, e32_border, 2, 1, 1);
819 TEST_FIELD(IMAGE_VXD_HEADER, BYTE, e32_worder, 3, 1, 1);
820 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_level, 4, 4, 2);
821 TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_cpu, 8, 2, 2);
822 TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_os, 10, 2, 2);
823 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ver, 12, 4, 2);
824 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_mflags, 16, 4, 2);
825 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_mpages, 20, 4, 2);
826 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_startobj, 24, 4, 2);
827 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_eip, 28, 4, 2);
828 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_stackobj, 32, 4, 2);
829 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_esp, 36, 4, 2);
830 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_pagesize, 40, 4, 2);
831 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_lastpagesize, 44, 4, 2);
832 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fixupsize, 48, 4, 2);
833 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fixupsum, 52, 4, 2);
834 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ldrsize, 56, 4, 2);
835 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_ldrsum, 60, 4, 2);
836 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objtab, 64, 4, 2);
837 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objcnt, 68, 4, 2);
838 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_objmap, 72, 4, 2);
839 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_itermap, 76, 4, 2);
840 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_rsrctab, 80, 4, 2);
841 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_rsrccnt, 84, 4, 2);
842 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_restab, 88, 4, 2);
843 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_enttab, 92, 4, 2);
844 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_dirtab, 96, 4, 2);
845 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_dircnt, 100, 4, 2);
846 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_fpagetab, 104, 4, 2);
847 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_frectab, 108, 4, 2);
848 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impmod, 112, 4, 2);
849 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impmodcnt, 116, 4, 2);
850 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_impproc, 120, 4, 2);
851 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_pagesum, 124, 4, 2);
852 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_datapage, 128, 4, 2);
853 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_preload, 132, 4, 2);
854 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_nrestab, 136, 4, 2);
855 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_cbnrestab, 140, 4, 2);
856 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_nressum, 144, 4, 2);
857 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_autodata, 148, 4, 2);
858 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_debuginfo, 152, 4, 2);
859 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_debuglen, 156, 4, 2);
860 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_instpreload, 160, 4, 2);
861 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_instdemand, 164, 4, 2);
862 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_heapsize, 168, 4, 2);
863 TEST_FIELD(IMAGE_VXD_HEADER, BYTE[12], e32_res3, 172, 12, 1);
864 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_winresoff, 184, 4, 2);
865 TEST_FIELD(IMAGE_VXD_HEADER, DWORD, e32_winreslen, 188, 4, 2);
866 TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_devid, 192, 2, 2);
867 TEST_FIELD(IMAGE_VXD_HEADER, WORD, e32_ddkver, 194, 2, 2);
870 static void test_pack_IO_COUNTERS(void)
872 /* IO_COUNTERS (pack 8) */
873 TEST_TYPE(IO_COUNTERS, 48, 8);
874 TEST_FIELD(IO_COUNTERS, ULONGLONG, ReadOperationCount, 0, 8, 8);
875 TEST_FIELD(IO_COUNTERS, ULONGLONG, WriteOperationCount, 8, 8, 8);
876 TEST_FIELD(IO_COUNTERS, ULONGLONG, OtherOperationCount, 16, 8, 8);
877 TEST_FIELD(IO_COUNTERS, ULONGLONG, ReadTransferCount, 24, 8, 8);
878 TEST_FIELD(IO_COUNTERS, ULONGLONG, WriteTransferCount, 32, 8, 8);
879 TEST_FIELD(IO_COUNTERS, ULONGLONG, OtherTransferCount, 40, 8, 8);
882 static void test_pack_LANGID(void)
885 TEST_TYPE(LANGID, 2, 2);
886 TEST_TYPE_UNSIGNED(LANGID);
889 static void test_pack_LARGE_INTEGER(void)
891 /* LARGE_INTEGER (pack 4) */
894 static void test_pack_LCID(void)
897 TEST_TYPE(LCID, 4, 4);
898 TEST_TYPE_UNSIGNED(LCID);
901 static void test_pack_LIST_ENTRY(void)
903 /* LIST_ENTRY (pack 4) */
904 TEST_TYPE(LIST_ENTRY, 8, 4);
905 TEST_FIELD(LIST_ENTRY, struct _LIST_ENTRY *, Flink, 0, 4, 4);
906 TEST_FIELD(LIST_ENTRY, struct _LIST_ENTRY *, Blink, 4, 4, 4);
909 static void test_pack_LONG(void)
912 TEST_TYPE(LONG, 4, 4);
913 TEST_TYPE_SIGNED(LONG);
916 static void test_pack_LONGLONG(void)
919 TEST_TYPE(LONGLONG, 8, 8);
920 TEST_TYPE_SIGNED(LONGLONG);
923 static void test_pack_LPTOP_LEVEL_EXCEPTION_FILTER(void)
925 /* LPTOP_LEVEL_EXCEPTION_FILTER */
926 TEST_TYPE(LPTOP_LEVEL_EXCEPTION_FILTER, 4, 4);
929 static void test_pack_LUID(void)
932 TEST_TYPE(LUID, 8, 4);
933 TEST_FIELD(LUID, DWORD, LowPart, 0, 4, 4);
934 TEST_FIELD(LUID, LONG, HighPart, 4, 4, 4);
937 static void test_pack_LUID_AND_ATTRIBUTES(void)
939 /* LUID_AND_ATTRIBUTES (pack 4) */
940 TEST_TYPE(LUID_AND_ATTRIBUTES, 12, 4);
941 TEST_FIELD(LUID_AND_ATTRIBUTES, LUID, Luid, 0, 8, 4);
942 TEST_FIELD(LUID_AND_ATTRIBUTES, DWORD, Attributes, 8, 4, 4);
945 static void test_pack_MEMORY_BASIC_INFORMATION(void)
947 /* MEMORY_BASIC_INFORMATION (pack 4) */
948 TEST_TYPE(MEMORY_BASIC_INFORMATION, 28, 4);
949 TEST_FIELD(MEMORY_BASIC_INFORMATION, LPVOID, BaseAddress, 0, 4, 4);
950 TEST_FIELD(MEMORY_BASIC_INFORMATION, LPVOID, AllocationBase, 4, 4, 4);
951 TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, AllocationProtect, 8, 4, 4);
952 TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, RegionSize, 12, 4, 4);
953 TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, State, 16, 4, 4);
954 TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, Protect, 20, 4, 4);
955 TEST_FIELD(MEMORY_BASIC_INFORMATION, DWORD, Type, 24, 4, 4);
958 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
960 /* MESSAGE_RESOURCE_BLOCK (pack 4) */
961 TEST_TYPE(MESSAGE_RESOURCE_BLOCK, 12, 4);
962 TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, LowId, 0, 4, 4);
963 TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, HighId, 4, 4, 4);
964 TEST_FIELD(MESSAGE_RESOURCE_BLOCK, DWORD, OffsetToEntries, 8, 4, 4);
967 static void test_pack_MESSAGE_RESOURCE_DATA(void)
969 /* MESSAGE_RESOURCE_DATA (pack 4) */
970 TEST_TYPE(MESSAGE_RESOURCE_DATA, 16, 4);
971 TEST_FIELD(MESSAGE_RESOURCE_DATA, DWORD, NumberOfBlocks, 0, 4, 4);
972 TEST_FIELD(MESSAGE_RESOURCE_DATA, MESSAGE_RESOURCE_BLOCK[ 1 ], Blocks, 4, 12, 4);
975 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
977 /* MESSAGE_RESOURCE_ENTRY (pack 4) */
978 TEST_TYPE(MESSAGE_RESOURCE_ENTRY, 6, 2);
979 TEST_FIELD(MESSAGE_RESOURCE_ENTRY, WORD, Length, 0, 2, 2);
980 TEST_FIELD(MESSAGE_RESOURCE_ENTRY, WORD, Flags, 2, 2, 2);
981 TEST_FIELD(MESSAGE_RESOURCE_ENTRY, BYTE[1], Text, 4, 1, 1);
984 static void test_pack_NT_TIB(void)
986 /* NT_TIB (pack 4) */
987 TEST_FIELD(NT_TIB, struct _EXCEPTION_REGISTRATION_RECORD *, ExceptionList, 0, 4, 4);
988 TEST_FIELD(NT_TIB, PVOID, StackBase, 4, 4, 4);
989 TEST_FIELD(NT_TIB, PVOID, StackLimit, 8, 4, 4);
990 TEST_FIELD(NT_TIB, PVOID, SubSystemTib, 12, 4, 4);
993 static void test_pack_OBJECT_TYPE_LIST(void)
995 /* OBJECT_TYPE_LIST (pack 4) */
996 TEST_TYPE(OBJECT_TYPE_LIST, 8, 4);
997 TEST_FIELD(OBJECT_TYPE_LIST, WORD, Level, 0, 2, 2);
998 TEST_FIELD(OBJECT_TYPE_LIST, WORD, Sbz, 2, 2, 2);
999 TEST_FIELD(OBJECT_TYPE_LIST, GUID *, ObjectType, 4, 4, 4);
1002 static void test_pack_PACCESS_ALLOWED_ACE(void)
1004 /* PACCESS_ALLOWED_ACE */
1005 TEST_TYPE(PACCESS_ALLOWED_ACE, 4, 4);
1006 TEST_TYPE_POINTER(PACCESS_ALLOWED_ACE, 12, 4);
1009 static void test_pack_PACCESS_DENIED_ACE(void)
1011 /* PACCESS_DENIED_ACE */
1012 TEST_TYPE(PACCESS_DENIED_ACE, 4, 4);
1013 TEST_TYPE_POINTER(PACCESS_DENIED_ACE, 12, 4);
1016 static void test_pack_PACCESS_TOKEN(void)
1019 TEST_TYPE(PACCESS_TOKEN, 4, 4);
1022 static void test_pack_PACE_HEADER(void)
1025 TEST_TYPE(PACE_HEADER, 4, 4);
1026 TEST_TYPE_POINTER(PACE_HEADER, 4, 2);
1029 static void test_pack_PACL(void)
1032 TEST_TYPE(PACL, 4, 4);
1033 TEST_TYPE_POINTER(PACL, 8, 2);
1036 static void test_pack_PACL_REVISION_INFORMATION(void)
1038 /* PACL_REVISION_INFORMATION */
1039 TEST_TYPE(PACL_REVISION_INFORMATION, 4, 4);
1040 TEST_TYPE_POINTER(PACL_REVISION_INFORMATION, 4, 4);
1043 static void test_pack_PACL_SIZE_INFORMATION(void)
1045 /* PACL_SIZE_INFORMATION */
1046 TEST_TYPE(PACL_SIZE_INFORMATION, 4, 4);
1047 TEST_TYPE_POINTER(PACL_SIZE_INFORMATION, 12, 4);
1050 static void test_pack_PCCH(void)
1053 TEST_TYPE(PCCH, 4, 4);
1054 TEST_TYPE_POINTER(PCCH, 1, 1);
1057 static void test_pack_PCH(void)
1060 TEST_TYPE(PCH, 4, 4);
1061 TEST_TYPE_POINTER(PCH, 1, 1);
1064 static void test_pack_PCSTR(void)
1067 TEST_TYPE(PCSTR, 4, 4);
1068 TEST_TYPE_POINTER(PCSTR, 1, 1);
1071 static void test_pack_PCTSTR(void)
1074 TEST_TYPE(PCTSTR, 4, 4);
1077 static void test_pack_PCWCH(void)
1080 TEST_TYPE(PCWCH, 4, 4);
1081 TEST_TYPE_POINTER(PCWCH, 2, 2);
1084 static void test_pack_PCWSTR(void)
1087 TEST_TYPE(PCWSTR, 4, 4);
1088 TEST_TYPE_POINTER(PCWSTR, 2, 2);
1091 static void test_pack_PEXCEPTION_POINTERS(void)
1093 /* PEXCEPTION_POINTERS */
1094 TEST_TYPE(PEXCEPTION_POINTERS, 4, 4);
1095 TEST_TYPE_POINTER(PEXCEPTION_POINTERS, 8, 4);
1098 static void test_pack_PEXCEPTION_RECORD(void)
1100 /* PEXCEPTION_RECORD */
1101 TEST_TYPE(PEXCEPTION_RECORD, 4, 4);
1102 TEST_TYPE_POINTER(PEXCEPTION_RECORD, 80, 4);
1105 static void test_pack_PFLOATING_SAVE_AREA(void)
1107 /* PFLOATING_SAVE_AREA */
1108 TEST_TYPE(PFLOATING_SAVE_AREA, 4, 4);
1109 TEST_TYPE_POINTER(PFLOATING_SAVE_AREA, 112, 4);
1112 static void test_pack_PFPO_DATA(void)
1115 TEST_TYPE(PFPO_DATA, 4, 4);
1116 TEST_TYPE_POINTER(PFPO_DATA, 16, 4);
1119 static void test_pack_PGENERIC_MAPPING(void)
1121 /* PGENERIC_MAPPING */
1122 TEST_TYPE(PGENERIC_MAPPING, 4, 4);
1123 TEST_TYPE_POINTER(PGENERIC_MAPPING, 16, 4);
1126 static void test_pack_PHANDLE(void)
1129 TEST_TYPE(PHANDLE, 4, 4);
1130 TEST_TYPE_POINTER(PHANDLE, 4, 4);
1133 static void test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER(void)
1135 /* PIMAGE_ARCHIVE_MEMBER_HEADER */
1136 TEST_TYPE(PIMAGE_ARCHIVE_MEMBER_HEADER, 4, 4);
1137 TEST_TYPE_POINTER(PIMAGE_ARCHIVE_MEMBER_HEADER, 60, 1);
1140 static void test_pack_PIMAGE_AUX_SYMBOL(void)
1142 /* PIMAGE_AUX_SYMBOL */
1143 TEST_TYPE(PIMAGE_AUX_SYMBOL, 4, 4);
1146 static void test_pack_PIMAGE_BASE_RELOCATION(void)
1148 /* PIMAGE_BASE_RELOCATION */
1149 TEST_TYPE(PIMAGE_BASE_RELOCATION, 4, 4);
1150 TEST_TYPE_POINTER(PIMAGE_BASE_RELOCATION, 8, 4);
1153 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
1155 /* PIMAGE_BOUND_FORWARDER_REF */
1156 TEST_TYPE(PIMAGE_BOUND_FORWARDER_REF, 4, 4);
1157 TEST_TYPE_POINTER(PIMAGE_BOUND_FORWARDER_REF, 8, 4);
1160 static void test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR(void)
1162 /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
1163 TEST_TYPE(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4, 4);
1164 TEST_TYPE_POINTER(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8, 4);
1167 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
1169 /* PIMAGE_COFF_SYMBOLS_HEADER */
1170 TEST_TYPE(PIMAGE_COFF_SYMBOLS_HEADER, 4, 4);
1171 TEST_TYPE_POINTER(PIMAGE_COFF_SYMBOLS_HEADER, 32, 4);
1174 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
1176 /* PIMAGE_DATA_DIRECTORY */
1177 TEST_TYPE(PIMAGE_DATA_DIRECTORY, 4, 4);
1178 TEST_TYPE_POINTER(PIMAGE_DATA_DIRECTORY, 8, 4);
1181 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
1183 /* PIMAGE_DEBUG_DIRECTORY */
1184 TEST_TYPE(PIMAGE_DEBUG_DIRECTORY, 4, 4);
1185 TEST_TYPE_POINTER(PIMAGE_DEBUG_DIRECTORY, 28, 4);
1188 static void test_pack_PIMAGE_DEBUG_MISC(void)
1190 /* PIMAGE_DEBUG_MISC */
1191 TEST_TYPE(PIMAGE_DEBUG_MISC, 4, 4);
1192 TEST_TYPE_POINTER(PIMAGE_DEBUG_MISC, 16, 4);
1195 static void test_pack_PIMAGE_DOS_HEADER(void)
1197 /* PIMAGE_DOS_HEADER */
1198 TEST_TYPE(PIMAGE_DOS_HEADER, 4, 4);
1199 TEST_TYPE_POINTER(PIMAGE_DOS_HEADER, 64, 2);
1202 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
1204 /* PIMAGE_EXPORT_DIRECTORY */
1205 TEST_TYPE(PIMAGE_EXPORT_DIRECTORY, 4, 4);
1206 TEST_TYPE_POINTER(PIMAGE_EXPORT_DIRECTORY, 40, 4);
1209 static void test_pack_PIMAGE_FILE_HEADER(void)
1211 /* PIMAGE_FILE_HEADER */
1212 TEST_TYPE(PIMAGE_FILE_HEADER, 4, 4);
1213 TEST_TYPE_POINTER(PIMAGE_FILE_HEADER, 20, 4);
1216 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
1218 /* PIMAGE_FUNCTION_ENTRY */
1219 TEST_TYPE(PIMAGE_FUNCTION_ENTRY, 4, 4);
1220 TEST_TYPE_POINTER(PIMAGE_FUNCTION_ENTRY, 12, 4);
1223 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
1225 /* PIMAGE_IMPORT_BY_NAME */
1226 TEST_TYPE(PIMAGE_IMPORT_BY_NAME, 4, 4);
1227 TEST_TYPE_POINTER(PIMAGE_IMPORT_BY_NAME, 4, 2);
1230 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
1232 /* PIMAGE_IMPORT_DESCRIPTOR */
1233 TEST_TYPE(PIMAGE_IMPORT_DESCRIPTOR, 4, 4);
1236 static void test_pack_PIMAGE_LINENUMBER(void)
1238 /* PIMAGE_LINENUMBER */
1239 TEST_TYPE(PIMAGE_LINENUMBER, 4, 4);
1242 static void test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY(void)
1244 /* PIMAGE_LOAD_CONFIG_DIRECTORY */
1245 TEST_TYPE(PIMAGE_LOAD_CONFIG_DIRECTORY, 4, 4);
1246 TEST_TYPE_POINTER(PIMAGE_LOAD_CONFIG_DIRECTORY, 72, 4);
1249 static void test_pack_PIMAGE_NT_HEADERS(void)
1251 /* PIMAGE_NT_HEADERS */
1252 TEST_TYPE(PIMAGE_NT_HEADERS, 4, 4);
1253 TEST_TYPE_POINTER(PIMAGE_NT_HEADERS, 248, 4);
1256 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
1258 /* PIMAGE_OPTIONAL_HEADER */
1259 TEST_TYPE(PIMAGE_OPTIONAL_HEADER, 4, 4);
1260 TEST_TYPE_POINTER(PIMAGE_OPTIONAL_HEADER, 224, 4);
1263 static void test_pack_PIMAGE_OS2_HEADER(void)
1265 /* PIMAGE_OS2_HEADER */
1266 TEST_TYPE(PIMAGE_OS2_HEADER, 4, 4);
1267 TEST_TYPE_POINTER(PIMAGE_OS2_HEADER, 64, 2);
1270 static void test_pack_PIMAGE_RELOCATION(void)
1272 /* PIMAGE_RELOCATION */
1273 TEST_TYPE(PIMAGE_RELOCATION, 4, 4);
1276 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
1278 /* PIMAGE_RESOURCE_DATA_ENTRY */
1279 TEST_TYPE(PIMAGE_RESOURCE_DATA_ENTRY, 4, 4);
1280 TEST_TYPE_POINTER(PIMAGE_RESOURCE_DATA_ENTRY, 16, 4);
1283 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
1285 /* PIMAGE_RESOURCE_DIRECTORY */
1286 TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY, 4, 4);
1287 TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIRECTORY, 16, 4);
1290 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY(void)
1292 /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
1293 TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY_ENTRY, 4, 4);
1296 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING(void)
1298 /* PIMAGE_RESOURCE_DIRECTORY_STRING */
1299 TEST_TYPE(PIMAGE_RESOURCE_DIRECTORY_STRING, 4, 4);
1300 TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIRECTORY_STRING, 4, 2);
1303 static void test_pack_PIMAGE_RESOURCE_DIR_STRING_U(void)
1305 /* PIMAGE_RESOURCE_DIR_STRING_U */
1306 TEST_TYPE(PIMAGE_RESOURCE_DIR_STRING_U, 4, 4);
1307 TEST_TYPE_POINTER(PIMAGE_RESOURCE_DIR_STRING_U, 4, 2);
1310 static void test_pack_PIMAGE_SECTION_HEADER(void)
1312 /* PIMAGE_SECTION_HEADER */
1313 TEST_TYPE(PIMAGE_SECTION_HEADER, 4, 4);
1316 static void test_pack_PIMAGE_SEPARATE_DEBUG_HEADER(void)
1318 /* PIMAGE_SEPARATE_DEBUG_HEADER */
1319 TEST_TYPE(PIMAGE_SEPARATE_DEBUG_HEADER, 4, 4);
1320 TEST_TYPE_POINTER(PIMAGE_SEPARATE_DEBUG_HEADER, 48, 4);
1323 static void test_pack_PIMAGE_SYMBOL(void)
1326 TEST_TYPE(PIMAGE_SYMBOL, 4, 4);
1329 static void test_pack_PIMAGE_THUNK_DATA(void)
1331 /* PIMAGE_THUNK_DATA */
1332 TEST_TYPE(PIMAGE_THUNK_DATA, 4, 4);
1335 static void test_pack_PIMAGE_TLS_CALLBACK(void)
1337 /* PIMAGE_TLS_CALLBACK */
1338 TEST_TYPE(PIMAGE_TLS_CALLBACK, 4, 4);
1341 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
1343 /* PIMAGE_TLS_DIRECTORY */
1344 TEST_TYPE(PIMAGE_TLS_DIRECTORY, 4, 4);
1345 TEST_TYPE_POINTER(PIMAGE_TLS_DIRECTORY, 24, 4);
1348 static void test_pack_PIMAGE_VXD_HEADER(void)
1350 /* PIMAGE_VXD_HEADER */
1351 TEST_TYPE(PIMAGE_VXD_HEADER, 4, 4);
1352 TEST_TYPE_POINTER(PIMAGE_VXD_HEADER, 196, 2);
1355 static void test_pack_PIO_COUNTERS(void)
1358 TEST_TYPE(PIO_COUNTERS, 4, 4);
1359 TEST_TYPE_POINTER(PIO_COUNTERS, 48, 8);
1362 static void test_pack_PISECURITY_DESCRIPTOR(void)
1364 /* PISECURITY_DESCRIPTOR */
1365 TEST_TYPE(PISECURITY_DESCRIPTOR, 4, 4);
1366 TEST_TYPE_POINTER(PISECURITY_DESCRIPTOR, 20, 4);
1369 static void test_pack_PISECURITY_DESCRIPTOR_RELATIVE(void)
1371 /* PISECURITY_DESCRIPTOR_RELATIVE */
1372 TEST_TYPE(PISECURITY_DESCRIPTOR_RELATIVE, 4, 4);
1373 TEST_TYPE_POINTER(PISECURITY_DESCRIPTOR_RELATIVE, 20, 4);
1376 static void test_pack_PISID(void)
1379 TEST_TYPE(PISID, 4, 4);
1380 TEST_TYPE_POINTER(PISID, 12, 4);
1383 static void test_pack_PLARGE_INTEGER(void)
1385 /* PLARGE_INTEGER */
1386 TEST_TYPE(PLARGE_INTEGER, 4, 4);
1389 static void test_pack_PLIST_ENTRY(void)
1392 TEST_TYPE(PLIST_ENTRY, 4, 4);
1393 TEST_TYPE_POINTER(PLIST_ENTRY, 8, 4);
1396 static void test_pack_PLUID(void)
1399 TEST_TYPE(PLUID, 4, 4);
1400 TEST_TYPE_POINTER(PLUID, 8, 4);
1403 static void test_pack_PLUID_AND_ATTRIBUTES(void)
1405 /* PLUID_AND_ATTRIBUTES */
1406 TEST_TYPE(PLUID_AND_ATTRIBUTES, 4, 4);
1407 TEST_TYPE_POINTER(PLUID_AND_ATTRIBUTES, 12, 4);
1410 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
1412 /* PMEMORY_BASIC_INFORMATION */
1413 TEST_TYPE(PMEMORY_BASIC_INFORMATION, 4, 4);
1414 TEST_TYPE_POINTER(PMEMORY_BASIC_INFORMATION, 28, 4);
1417 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
1419 /* PMESSAGE_RESOURCE_BLOCK */
1420 TEST_TYPE(PMESSAGE_RESOURCE_BLOCK, 4, 4);
1421 TEST_TYPE_POINTER(PMESSAGE_RESOURCE_BLOCK, 12, 4);
1424 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
1426 /* PMESSAGE_RESOURCE_DATA */
1427 TEST_TYPE(PMESSAGE_RESOURCE_DATA, 4, 4);
1428 TEST_TYPE_POINTER(PMESSAGE_RESOURCE_DATA, 16, 4);
1431 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
1433 /* PMESSAGE_RESOURCE_ENTRY */
1434 TEST_TYPE(PMESSAGE_RESOURCE_ENTRY, 4, 4);
1435 TEST_TYPE_POINTER(PMESSAGE_RESOURCE_ENTRY, 6, 2);
1438 static void test_pack_PNT_TIB(void)
1441 TEST_TYPE(PNT_TIB, 4, 4);
1444 static void test_pack_POBJECT_TYPE_LIST(void)
1446 /* POBJECT_TYPE_LIST */
1447 TEST_TYPE(POBJECT_TYPE_LIST, 4, 4);
1448 TEST_TYPE_POINTER(POBJECT_TYPE_LIST, 8, 4);
1451 static void test_pack_PPRIVILEGE_SET(void)
1453 /* PPRIVILEGE_SET */
1454 TEST_TYPE(PPRIVILEGE_SET, 4, 4);
1455 TEST_TYPE_POINTER(PPRIVILEGE_SET, 20, 4);
1458 static void test_pack_PRIVILEGE_SET(void)
1460 /* PRIVILEGE_SET (pack 4) */
1461 TEST_TYPE(PRIVILEGE_SET, 20, 4);
1462 TEST_FIELD(PRIVILEGE_SET, DWORD, PrivilegeCount, 0, 4, 4);
1463 TEST_FIELD(PRIVILEGE_SET, DWORD, Control, 4, 4, 4);
1464 TEST_FIELD(PRIVILEGE_SET, LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Privilege, 8, 12, 4);
1467 static void test_pack_PRLIST_ENTRY(void)
1470 TEST_TYPE(PRLIST_ENTRY, 4, 4);
1471 TEST_TYPE_POINTER(PRLIST_ENTRY, 8, 4);
1474 static void test_pack_PRTL_CRITICAL_SECTION(void)
1476 /* PRTL_CRITICAL_SECTION */
1477 TEST_TYPE(PRTL_CRITICAL_SECTION, 4, 4);
1478 TEST_TYPE_POINTER(PRTL_CRITICAL_SECTION, 24, 4);
1481 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
1483 /* PRTL_CRITICAL_SECTION_DEBUG */
1484 TEST_TYPE(PRTL_CRITICAL_SECTION_DEBUG, 4, 4);
1485 TEST_TYPE_POINTER(PRTL_CRITICAL_SECTION_DEBUG, 32, 4);
1488 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
1490 /* PRTL_OSVERSIONINFOEXW */
1491 TEST_TYPE(PRTL_OSVERSIONINFOEXW, 4, 4);
1492 TEST_TYPE_POINTER(PRTL_OSVERSIONINFOEXW, 284, 4);
1495 static void test_pack_PRTL_OSVERSIONINFOW(void)
1497 /* PRTL_OSVERSIONINFOW */
1498 TEST_TYPE(PRTL_OSVERSIONINFOW, 4, 4);
1499 TEST_TYPE_POINTER(PRTL_OSVERSIONINFOW, 276, 4);
1502 static void test_pack_PRTL_RESOURCE_DEBUG(void)
1504 /* PRTL_RESOURCE_DEBUG */
1505 TEST_TYPE(PRTL_RESOURCE_DEBUG, 4, 4);
1506 TEST_TYPE_POINTER(PRTL_RESOURCE_DEBUG, 32, 4);
1509 static void test_pack_PSECURITY_DESCRIPTOR(void)
1511 /* PSECURITY_DESCRIPTOR */
1512 TEST_TYPE(PSECURITY_DESCRIPTOR, 4, 4);
1515 static void test_pack_PSECURITY_QUALITY_OF_SERVICE(void)
1517 /* PSECURITY_QUALITY_OF_SERVICE */
1518 TEST_TYPE(PSECURITY_QUALITY_OF_SERVICE, 4, 4);
1521 static void test_pack_PSID(void)
1524 TEST_TYPE(PSID, 4, 4);
1527 static void test_pack_PSID_IDENTIFIER_AUTHORITY(void)
1529 /* PSID_IDENTIFIER_AUTHORITY */
1530 TEST_TYPE(PSID_IDENTIFIER_AUTHORITY, 4, 4);
1531 TEST_TYPE_POINTER(PSID_IDENTIFIER_AUTHORITY, 6, 1);
1534 static void test_pack_PSINGLE_LIST_ENTRY(void)
1536 /* PSINGLE_LIST_ENTRY */
1537 TEST_TYPE(PSINGLE_LIST_ENTRY, 4, 4);
1538 TEST_TYPE_POINTER(PSINGLE_LIST_ENTRY, 4, 4);
1541 static void test_pack_PSTR(void)
1544 TEST_TYPE(PSTR, 4, 4);
1545 TEST_TYPE_POINTER(PSTR, 1, 1);
1548 static void test_pack_PSYSTEM_ALARM_ACE(void)
1550 /* PSYSTEM_ALARM_ACE */
1551 TEST_TYPE(PSYSTEM_ALARM_ACE, 4, 4);
1552 TEST_TYPE_POINTER(PSYSTEM_ALARM_ACE, 12, 4);
1555 static void test_pack_PSYSTEM_AUDIT_ACE(void)
1557 /* PSYSTEM_AUDIT_ACE */
1558 TEST_TYPE(PSYSTEM_AUDIT_ACE, 4, 4);
1559 TEST_TYPE_POINTER(PSYSTEM_AUDIT_ACE, 12, 4);
1562 static void test_pack_PTOKEN_PRIVILEGES(void)
1564 /* PTOKEN_PRIVILEGES */
1565 TEST_TYPE(PTOKEN_PRIVILEGES, 4, 4);
1566 TEST_TYPE_POINTER(PTOKEN_PRIVILEGES, 16, 4);
1569 static void test_pack_PTOP_LEVEL_EXCEPTION_FILTER(void)
1571 /* PTOP_LEVEL_EXCEPTION_FILTER */
1572 TEST_TYPE(PTOP_LEVEL_EXCEPTION_FILTER, 4, 4);
1575 static void test_pack_PTSTR(void)
1578 TEST_TYPE(PTSTR, 4, 4);
1581 static void test_pack_PULARGE_INTEGER(void)
1583 /* PULARGE_INTEGER */
1584 TEST_TYPE(PULARGE_INTEGER, 4, 4);
1587 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
1589 /* PVECTORED_EXCEPTION_HANDLER */
1590 TEST_TYPE(PVECTORED_EXCEPTION_HANDLER, 4, 4);
1593 static void test_pack_PVOID(void)
1596 TEST_TYPE(PVOID, 4, 4);
1599 static void test_pack_PWCH(void)
1602 TEST_TYPE(PWCH, 4, 4);
1603 TEST_TYPE_POINTER(PWCH, 2, 2);
1606 static void test_pack_PWSTR(void)
1609 TEST_TYPE(PWSTR, 4, 4);
1610 TEST_TYPE_POINTER(PWSTR, 2, 2);
1613 static void test_pack_RTL_CRITICAL_SECTION(void)
1615 /* RTL_CRITICAL_SECTION (pack 4) */
1616 TEST_TYPE(RTL_CRITICAL_SECTION, 24, 4);
1617 TEST_FIELD(RTL_CRITICAL_SECTION, PRTL_CRITICAL_SECTION_DEBUG, DebugInfo, 0, 4, 4);
1618 TEST_FIELD(RTL_CRITICAL_SECTION, LONG, LockCount, 4, 4, 4);
1619 TEST_FIELD(RTL_CRITICAL_SECTION, LONG, RecursionCount, 8, 4, 4);
1620 TEST_FIELD(RTL_CRITICAL_SECTION, HANDLE, OwningThread, 12, 4, 4);
1621 TEST_FIELD(RTL_CRITICAL_SECTION, HANDLE, LockSemaphore, 16, 4, 4);
1622 TEST_FIELD(RTL_CRITICAL_SECTION, ULONG_PTR, SpinCount, 20, 4, 4);
1625 static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void)
1627 /* RTL_CRITICAL_SECTION_DEBUG (pack 4) */
1628 TEST_TYPE(RTL_CRITICAL_SECTION_DEBUG, 32, 4);
1629 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, WORD, Type, 0, 2, 2);
1630 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, WORD, CreatorBackTraceIndex, 2, 2, 2);
1631 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, struct _RTL_CRITICAL_SECTION *, CriticalSection, 4, 4, 4);
1632 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, LIST_ENTRY, ProcessLocksList, 8, 8, 4);
1633 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, DWORD, EntryCount, 16, 4, 4);
1634 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, DWORD, ContentionCount, 20, 4, 4);
1635 TEST_FIELD(RTL_CRITICAL_SECTION_DEBUG, DWORD[ 2 ], Spare, 24, 8, 4);
1638 static void test_pack_RTL_OSVERSIONINFOEXW(void)
1640 /* RTL_OSVERSIONINFOEXW (pack 4) */
1641 TEST_TYPE(RTL_OSVERSIONINFOEXW, 284, 4);
1642 TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwOSVersionInfoSize, 0, 4, 4);
1643 TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwMajorVersion, 4, 4, 4);
1644 TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwMinorVersion, 8, 4, 4);
1645 TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwBuildNumber, 12, 4, 4);
1646 TEST_FIELD(RTL_OSVERSIONINFOEXW, DWORD, dwPlatformId, 16, 4, 4);
1647 TEST_FIELD(RTL_OSVERSIONINFOEXW, WCHAR[128], szCSDVersion, 20, 256, 2);
1648 TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wServicePackMajor, 276, 2, 2);
1649 TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wServicePackMinor, 278, 2, 2);
1650 TEST_FIELD(RTL_OSVERSIONINFOEXW, WORD, wSuiteMask, 280, 2, 2);
1651 TEST_FIELD(RTL_OSVERSIONINFOEXW, BYTE, wProductType, 282, 1, 1);
1652 TEST_FIELD(RTL_OSVERSIONINFOEXW, BYTE, wReserved, 283, 1, 1);
1655 static void test_pack_RTL_OSVERSIONINFOW(void)
1657 /* RTL_OSVERSIONINFOW (pack 4) */
1658 TEST_TYPE(RTL_OSVERSIONINFOW, 276, 4);
1659 TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwOSVersionInfoSize, 0, 4, 4);
1660 TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwMajorVersion, 4, 4, 4);
1661 TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwMinorVersion, 8, 4, 4);
1662 TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwBuildNumber, 12, 4, 4);
1663 TEST_FIELD(RTL_OSVERSIONINFOW, DWORD, dwPlatformId, 16, 4, 4);
1664 TEST_FIELD(RTL_OSVERSIONINFOW, WCHAR[128], szCSDVersion, 20, 256, 2);
1667 static void test_pack_RTL_RESOURCE_DEBUG(void)
1669 /* RTL_RESOURCE_DEBUG (pack 4) */
1670 TEST_TYPE(RTL_RESOURCE_DEBUG, 32, 4);
1671 TEST_FIELD(RTL_RESOURCE_DEBUG, WORD, Type, 0, 2, 2);
1672 TEST_FIELD(RTL_RESOURCE_DEBUG, WORD, CreatorBackTraceIndex, 2, 2, 2);
1673 TEST_FIELD(RTL_RESOURCE_DEBUG, struct _RTL_CRITICAL_SECTION *, CriticalSection, 4, 4, 4);
1674 TEST_FIELD(RTL_RESOURCE_DEBUG, LIST_ENTRY, ProcessLocksList, 8, 8, 4);
1675 TEST_FIELD(RTL_RESOURCE_DEBUG, DWORD, EntryCount, 16, 4, 4);
1676 TEST_FIELD(RTL_RESOURCE_DEBUG, DWORD, ContentionCount, 20, 4, 4);
1677 TEST_FIELD(RTL_RESOURCE_DEBUG, DWORD[ 2 ], Spare, 24, 8, 4);
1680 static void test_pack_SECURITY_CONTEXT_TRACKING_MODE(void)
1682 /* SECURITY_CONTEXT_TRACKING_MODE */
1683 TEST_TYPE(SECURITY_CONTEXT_TRACKING_MODE, 1, 1);
1686 static void test_pack_SECURITY_DESCRIPTOR(void)
1688 /* SECURITY_DESCRIPTOR (pack 4) */
1689 TEST_TYPE(SECURITY_DESCRIPTOR, 20, 4);
1690 TEST_FIELD(SECURITY_DESCRIPTOR, BYTE, Revision, 0, 1, 1);
1691 TEST_FIELD(SECURITY_DESCRIPTOR, BYTE, Sbz1, 1, 1, 1);
1692 TEST_FIELD(SECURITY_DESCRIPTOR, SECURITY_DESCRIPTOR_CONTROL, Control, 2, 2, 2);
1693 TEST_FIELD(SECURITY_DESCRIPTOR, PSID, Owner, 4, 4, 4);
1694 TEST_FIELD(SECURITY_DESCRIPTOR, PSID, Group, 8, 4, 4);
1695 TEST_FIELD(SECURITY_DESCRIPTOR, PACL, Sacl, 12, 4, 4);
1696 TEST_FIELD(SECURITY_DESCRIPTOR, PACL, Dacl, 16, 4, 4);
1699 static void test_pack_SECURITY_DESCRIPTOR_CONTROL(void)
1701 /* SECURITY_DESCRIPTOR_CONTROL */
1702 TEST_TYPE(SECURITY_DESCRIPTOR_CONTROL, 2, 2);
1703 TEST_TYPE_UNSIGNED(SECURITY_DESCRIPTOR_CONTROL);
1706 static void test_pack_SECURITY_DESCRIPTOR_RELATIVE(void)
1708 /* SECURITY_DESCRIPTOR_RELATIVE (pack 4) */
1709 TEST_TYPE(SECURITY_DESCRIPTOR_RELATIVE, 20, 4);
1710 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, BYTE, Revision, 0, 1, 1);
1711 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, BYTE, Sbz1, 1, 1, 1);
1712 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, SECURITY_DESCRIPTOR_CONTROL, Control, 2, 2, 2);
1713 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Owner, 4, 4, 4);
1714 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Group, 8, 4, 4);
1715 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Sacl, 12, 4, 4);
1716 TEST_FIELD(SECURITY_DESCRIPTOR_RELATIVE, DWORD, Dacl, 16, 4, 4);
1719 static void test_pack_SECURITY_INFORMATION(void)
1721 /* SECURITY_INFORMATION */
1722 TEST_TYPE(SECURITY_INFORMATION, 4, 4);
1723 TEST_TYPE_UNSIGNED(SECURITY_INFORMATION);
1726 static void test_pack_SECURITY_QUALITY_OF_SERVICE(void)
1728 /* SECURITY_QUALITY_OF_SERVICE (pack 4) */
1729 TEST_FIELD(SECURITY_QUALITY_OF_SERVICE, DWORD, Length, 0, 4, 4);
1732 static void test_pack_SHORT(void)
1735 TEST_TYPE(SHORT, 2, 2);
1736 TEST_TYPE_SIGNED(SHORT);
1739 static void test_pack_SID(void)
1742 TEST_TYPE(SID, 12, 4);
1743 TEST_FIELD(SID, BYTE, Revision, 0, 1, 1);
1744 TEST_FIELD(SID, BYTE, SubAuthorityCount, 1, 1, 1);
1745 TEST_FIELD(SID, SID_IDENTIFIER_AUTHORITY, IdentifierAuthority, 2, 6, 1);
1746 TEST_FIELD(SID, DWORD[1], SubAuthority, 8, 4, 4);
1749 static void test_pack_SID_AND_ATTRIBUTES(void)
1751 /* SID_AND_ATTRIBUTES (pack 4) */
1752 TEST_TYPE(SID_AND_ATTRIBUTES, 8, 4);
1753 TEST_FIELD(SID_AND_ATTRIBUTES, PSID, Sid, 0, 4, 4);
1754 TEST_FIELD(SID_AND_ATTRIBUTES, DWORD, Attributes, 4, 4, 4);
1757 static void test_pack_SID_IDENTIFIER_AUTHORITY(void)
1759 /* SID_IDENTIFIER_AUTHORITY (pack 4) */
1760 TEST_TYPE(SID_IDENTIFIER_AUTHORITY, 6, 1);
1761 TEST_FIELD(SID_IDENTIFIER_AUTHORITY, BYTE[6], Value, 0, 6, 1);
1764 static void test_pack_SINGLE_LIST_ENTRY(void)
1766 /* SINGLE_LIST_ENTRY (pack 4) */
1767 TEST_TYPE(SINGLE_LIST_ENTRY, 4, 4);
1768 TEST_FIELD(SINGLE_LIST_ENTRY, struct _SINGLE_LIST_ENTRY *, Next, 0, 4, 4);
1771 static void test_pack_SYSTEM_ALARM_ACE(void)
1773 /* SYSTEM_ALARM_ACE (pack 4) */
1774 TEST_TYPE(SYSTEM_ALARM_ACE, 12, 4);
1775 TEST_FIELD(SYSTEM_ALARM_ACE, ACE_HEADER, Header, 0, 4, 2);
1776 TEST_FIELD(SYSTEM_ALARM_ACE, DWORD, Mask, 4, 4, 4);
1777 TEST_FIELD(SYSTEM_ALARM_ACE, DWORD, SidStart, 8, 4, 4);
1780 static void test_pack_SYSTEM_AUDIT_ACE(void)
1782 /* SYSTEM_AUDIT_ACE (pack 4) */
1783 TEST_TYPE(SYSTEM_AUDIT_ACE, 12, 4);
1784 TEST_FIELD(SYSTEM_AUDIT_ACE, ACE_HEADER, Header, 0, 4, 2);
1785 TEST_FIELD(SYSTEM_AUDIT_ACE, DWORD, Mask, 4, 4, 4);
1786 TEST_FIELD(SYSTEM_AUDIT_ACE, DWORD, SidStart, 8, 4, 4);
1789 static void test_pack_TCHAR(void)
1792 TEST_TYPE(TCHAR, 1, 1);
1795 static void test_pack_TOKEN_DEFAULT_DACL(void)
1797 /* TOKEN_DEFAULT_DACL (pack 4) */
1798 TEST_TYPE(TOKEN_DEFAULT_DACL, 4, 4);
1799 TEST_FIELD(TOKEN_DEFAULT_DACL, PACL, DefaultDacl, 0, 4, 4);
1802 static void test_pack_TOKEN_GROUPS(void)
1804 /* TOKEN_GROUPS (pack 4) */
1805 TEST_TYPE(TOKEN_GROUPS, 12, 4);
1806 TEST_FIELD(TOKEN_GROUPS, DWORD, GroupCount, 0, 4, 4);
1807 TEST_FIELD(TOKEN_GROUPS, SID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Groups, 4, 8, 4);
1810 static void test_pack_TOKEN_OWNER(void)
1812 /* TOKEN_OWNER (pack 4) */
1813 TEST_TYPE(TOKEN_OWNER, 4, 4);
1814 TEST_FIELD(TOKEN_OWNER, PSID, Owner, 0, 4, 4);
1817 static void test_pack_TOKEN_PRIMARY_GROUP(void)
1819 /* TOKEN_PRIMARY_GROUP (pack 4) */
1820 TEST_TYPE(TOKEN_PRIMARY_GROUP, 4, 4);
1821 TEST_FIELD(TOKEN_PRIMARY_GROUP, PSID, PrimaryGroup, 0, 4, 4);
1824 static void test_pack_TOKEN_PRIVILEGES(void)
1826 /* TOKEN_PRIVILEGES (pack 4) */
1827 TEST_TYPE(TOKEN_PRIVILEGES, 16, 4);
1828 TEST_FIELD(TOKEN_PRIVILEGES, DWORD, PrivilegeCount, 0, 4, 4);
1829 TEST_FIELD(TOKEN_PRIVILEGES, LUID_AND_ATTRIBUTES[ANYSIZE_ARRAY], Privileges, 4, 12, 4);
1832 static void test_pack_TOKEN_SOURCE(void)
1834 /* TOKEN_SOURCE (pack 4) */
1835 TEST_TYPE(TOKEN_SOURCE, 16, 4);
1836 TEST_FIELD(TOKEN_SOURCE, char[TOKEN_SOURCE_LENGTH], SourceName, 0, 8, 1);
1837 TEST_FIELD(TOKEN_SOURCE, LUID, SourceIdentifier, 8, 8, 4);
1840 static void test_pack_TOKEN_STATISTICS(void)
1842 /* TOKEN_STATISTICS (pack 4) */
1843 TEST_FIELD(TOKEN_STATISTICS, LUID, TokenId, 0, 8, 4);
1844 TEST_FIELD(TOKEN_STATISTICS, LUID, AuthenticationId, 8, 8, 4);
1845 TEST_FIELD(TOKEN_STATISTICS, LARGE_INTEGER, ExpirationTime, 16, 8, 4);
1848 static void test_pack_TOKEN_USER(void)
1850 /* TOKEN_USER (pack 4) */
1851 TEST_TYPE(TOKEN_USER, 8, 4);
1852 TEST_FIELD(TOKEN_USER, SID_AND_ATTRIBUTES, User, 0, 8, 4);
1855 static void test_pack_ULARGE_INTEGER(void)
1857 /* ULARGE_INTEGER (pack 4) */
1860 static void test_pack_ULONGLONG(void)
1863 TEST_TYPE(ULONGLONG, 8, 8);
1864 TEST_TYPE_UNSIGNED(ULONGLONG);
1867 static void test_pack_WAITORTIMERCALLBACKFUNC(void)
1869 /* WAITORTIMERCALLBACKFUNC */
1870 TEST_TYPE(WAITORTIMERCALLBACKFUNC, 4, 4);
1873 static void test_pack_WCHAR(void)
1876 TEST_TYPE(WCHAR, 2, 2);
1877 TEST_TYPE_UNSIGNED(WCHAR);
1880 static void test_pack_ATOM(void)
1883 TEST_TYPE(ATOM, 2, 2);
1884 TEST_TYPE_UNSIGNED(ATOM);
1887 static void test_pack_BOOL(void)
1890 TEST_TYPE(BOOL, 4, 4);
1891 TEST_TYPE_SIGNED(BOOL);
1894 static void test_pack_BYTE(void)
1897 TEST_TYPE(BYTE, 1, 1);
1898 TEST_TYPE_UNSIGNED(BYTE);
1901 static void test_pack_COLORREF(void)
1904 TEST_TYPE(COLORREF, 4, 4);
1905 TEST_TYPE_UNSIGNED(COLORREF);
1908 static void test_pack_DWORD(void)
1911 TEST_TYPE(DWORD, 4, 4);
1912 TEST_TYPE_UNSIGNED(DWORD);
1915 static void test_pack_FARPROC(void)
1918 TEST_TYPE(FARPROC, 4, 4);
1921 static void test_pack_FLOAT(void)
1924 TEST_TYPE(FLOAT, 4, 4);
1927 static void test_pack_GLOBALHANDLE(void)
1930 TEST_TYPE(GLOBALHANDLE, 4, 4);
1933 static void test_pack_HCURSOR(void)
1936 TEST_TYPE(HCURSOR, 4, 4);
1937 TEST_TYPE_UNSIGNED(HCURSOR);
1940 static void test_pack_HFILE(void)
1943 TEST_TYPE(HFILE, 4, 4);
1944 TEST_TYPE_SIGNED(HFILE);
1947 static void test_pack_HGDIOBJ(void)
1950 TEST_TYPE(HGDIOBJ, 4, 4);
1953 static void test_pack_HGLOBAL(void)
1956 TEST_TYPE(HGLOBAL, 4, 4);
1959 static void test_pack_HLOCAL(void)
1962 TEST_TYPE(HLOCAL, 4, 4);
1965 static void test_pack_HMODULE(void)
1968 TEST_TYPE(HMODULE, 4, 4);
1969 TEST_TYPE_UNSIGNED(HMODULE);
1972 static void test_pack_INT(void)
1975 TEST_TYPE(INT, 4, 4);
1976 TEST_TYPE_SIGNED(INT);
1979 static void test_pack_LOCALHANDLE(void)
1982 TEST_TYPE(LOCALHANDLE, 4, 4);
1985 static void test_pack_LPARAM(void)
1988 TEST_TYPE(LPARAM, 4, 4);
1991 static void test_pack_LPCRECT(void)
1994 TEST_TYPE(LPCRECT, 4, 4);
1995 TEST_TYPE_POINTER(LPCRECT, 16, 4);
1998 static void test_pack_LPCRECTL(void)
2001 TEST_TYPE(LPCRECTL, 4, 4);
2002 TEST_TYPE_POINTER(LPCRECTL, 16, 4);
2005 static void test_pack_LPCVOID(void)
2008 TEST_TYPE(LPCVOID, 4, 4);
2011 static void test_pack_LPPOINT(void)
2014 TEST_TYPE(LPPOINT, 4, 4);
2015 TEST_TYPE_POINTER(LPPOINT, 8, 4);
2018 static void test_pack_LPPOINTS(void)
2021 TEST_TYPE(LPPOINTS, 4, 4);
2022 TEST_TYPE_POINTER(LPPOINTS, 4, 2);
2025 static void test_pack_LPRECT(void)
2028 TEST_TYPE(LPRECT, 4, 4);
2029 TEST_TYPE_POINTER(LPRECT, 16, 4);
2032 static void test_pack_LPRECTL(void)
2035 TEST_TYPE(LPRECTL, 4, 4);
2036 TEST_TYPE_POINTER(LPRECTL, 16, 4);
2039 static void test_pack_LPSIZE(void)
2042 TEST_TYPE(LPSIZE, 4, 4);
2043 TEST_TYPE_POINTER(LPSIZE, 8, 4);
2046 static void test_pack_LRESULT(void)
2049 TEST_TYPE(LRESULT, 4, 4);
2052 static void test_pack_POINT(void)
2054 /* POINT (pack 4) */
2055 TEST_TYPE(POINT, 8, 4);
2056 TEST_FIELD(POINT, LONG, x, 0, 4, 4);
2057 TEST_FIELD(POINT, LONG, y, 4, 4, 4);
2060 static void test_pack_POINTL(void)
2062 /* POINTL (pack 4) */
2063 TEST_TYPE(POINTL, 8, 4);
2064 TEST_FIELD(POINTL, LONG, x, 0, 4, 4);
2065 TEST_FIELD(POINTL, LONG, y, 4, 4, 4);
2068 static void test_pack_POINTS(void)
2070 /* POINTS (pack 4) */
2071 TEST_TYPE(POINTS, 4, 2);
2072 TEST_FIELD(POINTS, SHORT, x, 0, 2, 2);
2073 TEST_FIELD(POINTS, SHORT, y, 2, 2, 2);
2076 static void test_pack_PPOINT(void)
2079 TEST_TYPE(PPOINT, 4, 4);
2080 TEST_TYPE_POINTER(PPOINT, 8, 4);
2083 static void test_pack_PPOINTS(void)
2086 TEST_TYPE(PPOINTS, 4, 4);
2087 TEST_TYPE_POINTER(PPOINTS, 4, 2);
2090 static void test_pack_PRECT(void)
2093 TEST_TYPE(PRECT, 4, 4);
2094 TEST_TYPE_POINTER(PRECT, 16, 4);
2097 static void test_pack_PRECTL(void)
2100 TEST_TYPE(PRECTL, 4, 4);
2101 TEST_TYPE_POINTER(PRECTL, 16, 4);
2104 static void test_pack_PROC(void)
2107 TEST_TYPE(PROC, 4, 4);
2110 static void test_pack_PSIZE(void)
2113 TEST_TYPE(PSIZE, 4, 4);
2114 TEST_TYPE_POINTER(PSIZE, 8, 4);
2117 static void test_pack_RECT(void)
2120 TEST_TYPE(RECT, 16, 4);
2121 TEST_FIELD(RECT, LONG, left, 0, 4, 4);
2122 TEST_FIELD(RECT, LONG, top, 4, 4, 4);
2123 TEST_FIELD(RECT, LONG, right, 8, 4, 4);
2124 TEST_FIELD(RECT, LONG, bottom, 12, 4, 4);
2127 static void test_pack_RECTL(void)
2129 /* RECTL (pack 4) */
2130 TEST_TYPE(RECTL, 16, 4);
2131 TEST_FIELD(RECTL, LONG, left, 0, 4, 4);
2132 TEST_FIELD(RECTL, LONG, top, 4, 4, 4);
2133 TEST_FIELD(RECTL, LONG, right, 8, 4, 4);
2134 TEST_FIELD(RECTL, LONG, bottom, 12, 4, 4);
2137 static void test_pack_SIZE(void)
2140 TEST_TYPE(SIZE, 8, 4);
2141 TEST_FIELD(SIZE, LONG, cx, 0, 4, 4);
2142 TEST_FIELD(SIZE, LONG, cy, 4, 4, 4);
2145 static void test_pack_SIZEL(void)
2148 TEST_TYPE(SIZEL, 8, 4);
2151 static void test_pack_UCHAR(void)
2154 TEST_TYPE(UCHAR, 1, 1);
2155 TEST_TYPE_UNSIGNED(UCHAR);
2158 static void test_pack_UINT(void)
2161 TEST_TYPE(UINT, 4, 4);
2162 TEST_TYPE_UNSIGNED(UINT);
2165 static void test_pack_ULONG(void)
2168 TEST_TYPE(ULONG, 4, 4);
2169 TEST_TYPE_UNSIGNED(ULONG);
2172 static void test_pack_USHORT(void)
2175 TEST_TYPE(USHORT, 2, 2);
2176 TEST_TYPE_UNSIGNED(USHORT);
2179 static void test_pack_WORD(void)
2182 TEST_TYPE(WORD, 2, 2);
2183 TEST_TYPE_UNSIGNED(WORD);
2186 static void test_pack_WPARAM(void)
2189 TEST_TYPE(WPARAM, 4, 4);
2192 static void test_pack(void)
2194 test_pack_ACCESS_ALLOWED_ACE();
2195 test_pack_ACCESS_DENIED_ACE();
2196 test_pack_ACCESS_MASK();
2197 test_pack_ACE_HEADER();
2199 test_pack_ACL_REVISION_INFORMATION();
2200 test_pack_ACL_SIZE_INFORMATION();
2203 test_pack_BOOLEAN();
2207 test_pack_COLORREF();
2209 test_pack_DWORD32();
2210 test_pack_DWORD64();
2211 test_pack_DWORDLONG();
2212 test_pack_DWORD_PTR();
2213 test_pack_EXCEPTION_POINTERS();
2214 test_pack_EXCEPTION_RECORD();
2215 test_pack_EXECUTION_STATE();
2216 test_pack_FARPROC();
2218 test_pack_FLOATING_SAVE_AREA();
2219 test_pack_FPO_DATA();
2220 test_pack_GENERIC_MAPPING();
2221 test_pack_GLOBALHANDLE();
2222 test_pack_HALF_PTR();
2224 test_pack_HCURSOR();
2226 test_pack_HGDIOBJ();
2227 test_pack_HGLOBAL();
2229 test_pack_HMODULE();
2230 test_pack_HRESULT();
2231 test_pack_IMAGE_ARCHIVE_MEMBER_HEADER();
2232 test_pack_IMAGE_AUX_SYMBOL();
2233 test_pack_IMAGE_BASE_RELOCATION();
2234 test_pack_IMAGE_BOUND_FORWARDER_REF();
2235 test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR();
2236 test_pack_IMAGE_COFF_SYMBOLS_HEADER();
2237 test_pack_IMAGE_DATA_DIRECTORY();
2238 test_pack_IMAGE_DEBUG_DIRECTORY();
2239 test_pack_IMAGE_DEBUG_MISC();
2240 test_pack_IMAGE_DOS_HEADER();
2241 test_pack_IMAGE_EXPORT_DIRECTORY();
2242 test_pack_IMAGE_FILE_HEADER();
2243 test_pack_IMAGE_FUNCTION_ENTRY();
2244 test_pack_IMAGE_IMPORT_BY_NAME();
2245 test_pack_IMAGE_IMPORT_DESCRIPTOR();
2246 test_pack_IMAGE_LINENUMBER();
2247 test_pack_IMAGE_LOAD_CONFIG_DIRECTORY();
2248 test_pack_IMAGE_NT_HEADERS();
2249 test_pack_IMAGE_OPTIONAL_HEADER();
2250 test_pack_IMAGE_OS2_HEADER();
2251 test_pack_IMAGE_RELOCATION();
2252 test_pack_IMAGE_RESOURCE_DATA_ENTRY();
2253 test_pack_IMAGE_RESOURCE_DIRECTORY();
2254 test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY();
2255 test_pack_IMAGE_RESOURCE_DIRECTORY_STRING();
2256 test_pack_IMAGE_RESOURCE_DIR_STRING_U();
2257 test_pack_IMAGE_SECTION_HEADER();
2258 test_pack_IMAGE_SEPARATE_DEBUG_HEADER();
2259 test_pack_IMAGE_SYMBOL();
2260 test_pack_IMAGE_THUNK_DATA();
2261 test_pack_IMAGE_TLS_DIRECTORY();
2262 test_pack_IMAGE_VXD_HEADER();
2268 test_pack_INT_PTR();
2269 test_pack_IO_COUNTERS();
2271 test_pack_LARGE_INTEGER();
2273 test_pack_LIST_ENTRY();
2274 test_pack_LOCALHANDLE();
2278 test_pack_LONGLONG();
2279 test_pack_LONG_PTR();
2281 test_pack_LPCRECT();
2282 test_pack_LPCRECTL();
2283 test_pack_LPCVOID();
2284 test_pack_LPPOINT();
2285 test_pack_LPPOINTS();
2287 test_pack_LPRECTL();
2289 test_pack_LPTOP_LEVEL_EXCEPTION_FILTER();
2290 test_pack_LRESULT();
2292 test_pack_LUID_AND_ATTRIBUTES();
2293 test_pack_MEMORY_BASIC_INFORMATION();
2294 test_pack_MESSAGE_RESOURCE_BLOCK();
2295 test_pack_MESSAGE_RESOURCE_DATA();
2296 test_pack_MESSAGE_RESOURCE_ENTRY();
2298 test_pack_OBJECT_TYPE_LIST();
2299 test_pack_PACCESS_ALLOWED_ACE();
2300 test_pack_PACCESS_DENIED_ACE();
2301 test_pack_PACCESS_TOKEN();
2302 test_pack_PACE_HEADER();
2304 test_pack_PACL_REVISION_INFORMATION();
2305 test_pack_PACL_SIZE_INFORMATION();
2312 test_pack_PEXCEPTION_POINTERS();
2313 test_pack_PEXCEPTION_RECORD();
2314 test_pack_PFLOATING_SAVE_AREA();
2315 test_pack_PFPO_DATA();
2316 test_pack_PGENERIC_MAPPING();
2317 test_pack_PHANDLE();
2318 test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER();
2319 test_pack_PIMAGE_AUX_SYMBOL();
2320 test_pack_PIMAGE_BASE_RELOCATION();
2321 test_pack_PIMAGE_BOUND_FORWARDER_REF();
2322 test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR();
2323 test_pack_PIMAGE_COFF_SYMBOLS_HEADER();
2324 test_pack_PIMAGE_DATA_DIRECTORY();
2325 test_pack_PIMAGE_DEBUG_DIRECTORY();
2326 test_pack_PIMAGE_DEBUG_MISC();
2327 test_pack_PIMAGE_DOS_HEADER();
2328 test_pack_PIMAGE_EXPORT_DIRECTORY();
2329 test_pack_PIMAGE_FILE_HEADER();
2330 test_pack_PIMAGE_FUNCTION_ENTRY();
2331 test_pack_PIMAGE_IMPORT_BY_NAME();
2332 test_pack_PIMAGE_IMPORT_DESCRIPTOR();
2333 test_pack_PIMAGE_LINENUMBER();
2334 test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY();
2335 test_pack_PIMAGE_NT_HEADERS();
2336 test_pack_PIMAGE_OPTIONAL_HEADER();
2337 test_pack_PIMAGE_OS2_HEADER();
2338 test_pack_PIMAGE_RELOCATION();
2339 test_pack_PIMAGE_RESOURCE_DATA_ENTRY();
2340 test_pack_PIMAGE_RESOURCE_DIRECTORY();
2341 test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY();
2342 test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING();
2343 test_pack_PIMAGE_RESOURCE_DIR_STRING_U();
2344 test_pack_PIMAGE_SECTION_HEADER();
2345 test_pack_PIMAGE_SEPARATE_DEBUG_HEADER();
2346 test_pack_PIMAGE_SYMBOL();
2347 test_pack_PIMAGE_THUNK_DATA();
2348 test_pack_PIMAGE_TLS_CALLBACK();
2349 test_pack_PIMAGE_TLS_DIRECTORY();
2350 test_pack_PIMAGE_VXD_HEADER();
2351 test_pack_PIO_COUNTERS();
2352 test_pack_PISECURITY_DESCRIPTOR();
2353 test_pack_PISECURITY_DESCRIPTOR_RELATIVE();
2355 test_pack_PLARGE_INTEGER();
2356 test_pack_PLIST_ENTRY();
2358 test_pack_PLUID_AND_ATTRIBUTES();
2359 test_pack_PMEMORY_BASIC_INFORMATION();
2360 test_pack_PMESSAGE_RESOURCE_BLOCK();
2361 test_pack_PMESSAGE_RESOURCE_DATA();
2362 test_pack_PMESSAGE_RESOURCE_ENTRY();
2363 test_pack_PNT_TIB();
2364 test_pack_POBJECT_TYPE_LIST();
2369 test_pack_PPOINTS();
2370 test_pack_PPRIVILEGE_SET();
2373 test_pack_PRIVILEGE_SET();
2374 test_pack_PRLIST_ENTRY();
2376 test_pack_PRTL_CRITICAL_SECTION();
2377 test_pack_PRTL_CRITICAL_SECTION_DEBUG();
2378 test_pack_PRTL_OSVERSIONINFOEXW();
2379 test_pack_PRTL_OSVERSIONINFOW();
2380 test_pack_PRTL_RESOURCE_DEBUG();
2381 test_pack_PSECURITY_DESCRIPTOR();
2382 test_pack_PSECURITY_QUALITY_OF_SERVICE();
2384 test_pack_PSID_IDENTIFIER_AUTHORITY();
2385 test_pack_PSINGLE_LIST_ENTRY();
2388 test_pack_PSYSTEM_ALARM_ACE();
2389 test_pack_PSYSTEM_AUDIT_ACE();
2390 test_pack_PTOKEN_PRIVILEGES();
2391 test_pack_PTOP_LEVEL_EXCEPTION_FILTER();
2393 test_pack_PULARGE_INTEGER();
2394 test_pack_PVECTORED_EXCEPTION_HANDLER();
2400 test_pack_RTL_CRITICAL_SECTION();
2401 test_pack_RTL_CRITICAL_SECTION_DEBUG();
2402 test_pack_RTL_OSVERSIONINFOEXW();
2403 test_pack_RTL_OSVERSIONINFOW();
2404 test_pack_RTL_RESOURCE_DEBUG();
2405 test_pack_SECURITY_CONTEXT_TRACKING_MODE();
2406 test_pack_SECURITY_DESCRIPTOR();
2407 test_pack_SECURITY_DESCRIPTOR_CONTROL();
2408 test_pack_SECURITY_DESCRIPTOR_RELATIVE();
2409 test_pack_SECURITY_INFORMATION();
2410 test_pack_SECURITY_QUALITY_OF_SERVICE();
2413 test_pack_SID_AND_ATTRIBUTES();
2414 test_pack_SID_IDENTIFIER_AUTHORITY();
2415 test_pack_SINGLE_LIST_ENTRY();
2419 test_pack_SSIZE_T();
2420 test_pack_SYSTEM_ALARM_ACE();
2421 test_pack_SYSTEM_AUDIT_ACE();
2423 test_pack_TOKEN_DEFAULT_DACL();
2424 test_pack_TOKEN_GROUPS();
2425 test_pack_TOKEN_OWNER();
2426 test_pack_TOKEN_PRIMARY_GROUP();
2427 test_pack_TOKEN_PRIVILEGES();
2428 test_pack_TOKEN_SOURCE();
2429 test_pack_TOKEN_STATISTICS();
2430 test_pack_TOKEN_USER();
2432 test_pack_UHALF_PTR();
2438 test_pack_UINT_PTR();
2439 test_pack_ULARGE_INTEGER();
2441 test_pack_ULONG32();
2442 test_pack_ULONG64();
2443 test_pack_ULONGLONG();
2444 test_pack_ULONG_PTR();
2446 test_pack_WAITORTIMERCALLBACKFUNC();
2452 START_TEST(generated)