[NTDLL_WINETEST] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / modules / rostests / winetests / ntdll / generated.c
1 /* File generated automatically from tools/winapi/tests.dat; do not edit! */
2 /* This file can be copied, modified and distributed without restriction. */
3
4 /*
5 * Unit tests for data structure packing
6 */
7
8 #ifndef __REACTOS__
9 #define WINVER 0x0501
10 #define _WIN32_IE 0x0501
11 #define _WIN32_WINNT 0x0501
12 #endif
13
14 #define WINE_NOWINSOCK
15
16 #include "ntdll_test.h"
17
18 #include "wine/test.h"
19
20 /***********************************************************************
21 * Compatibility macros
22 */
23
24 #define DWORD_PTR UINT_PTR
25 #define LONG_PTR INT_PTR
26 #define ULONG_PTR UINT_PTR
27
28 /***********************************************************************
29 * Windows API extension
30 */
31
32 #if defined(_MSC_VER) && (_MSC_VER >= 1300) && defined(__cplusplus)
33 # define _TYPE_ALIGNMENT(type) __alignof(type)
34 #elif defined(__GNUC__)
35 # define _TYPE_ALIGNMENT(type) __alignof__(type)
36 #else
37 /*
38 * FIXME: May not be possible without a compiler extension
39 * (if type is not just a name that is, otherwise the normal
40 * TYPE_ALIGNMENT can be used)
41 */
42 #endif
43
44 #if defined(TYPE_ALIGNMENT) && defined(_MSC_VER) && _MSC_VER >= 800 && !defined(__cplusplus)
45 #pragma warning(disable:4116)
46 #endif
47
48 #if !defined(TYPE_ALIGNMENT) && defined(_TYPE_ALIGNMENT)
49 # define TYPE_ALIGNMENT _TYPE_ALIGNMENT
50 #endif
51
52 /***********************************************************************
53 * Test helper macros
54 */
55
56 #define TEST_TYPE_SIZE(type, size) C_ASSERT(sizeof(type) == size);
57
58 #ifdef TYPE_ALIGNMENT
59 # define TEST_TYPE_ALIGN(type, align) C_ASSERT(TYPE_ALIGNMENT(type) == align);
60 #else
61 # define TEST_TYPE_ALIGN(type, align)
62 #endif
63
64 #ifdef _TYPE_ALIGNMENT
65 # define TEST_TARGET_ALIGN(type, align) C_ASSERT(_TYPE_ALIGNMENT(*(type)0) == align);
66 # define TEST_FIELD_ALIGN(type, field, align) C_ASSERT(_TYPE_ALIGNMENT(((type*)0)->field) == align);
67 #else
68 # define TEST_TARGET_ALIGN(type, align)
69 # define TEST_FIELD_ALIGN(type, field, align)
70 #endif
71
72 #define TEST_FIELD_OFFSET(type, field, offset) C_ASSERT(FIELD_OFFSET(type, field) == offset);
73
74 #define TEST_TARGET_SIZE(type, size) TEST_TYPE_SIZE(*(type)0, size)
75 #define TEST_FIELD_SIZE(type, field, size) TEST_TYPE_SIZE((((type*)0)->field), size)
76 #define TEST_TYPE_SIGNED(type) C_ASSERT((type) -1 < 0);
77 #define TEST_TYPE_UNSIGNED(type) C_ASSERT((type) -1 > 0);
78
79
80 #ifdef _WIN64
81
82 static void test_pack_DWORD32(void)
83 {
84 /* DWORD32 */
85 TEST_TYPE_SIZE (DWORD32, 4)
86 TEST_TYPE_ALIGN (DWORD32, 4)
87 TEST_TYPE_UNSIGNED(DWORD32)
88 }
89
90 static void test_pack_DWORD64(void)
91 {
92 /* DWORD64 */
93 TEST_TYPE_SIZE (DWORD64, 8)
94 TEST_TYPE_ALIGN (DWORD64, 8)
95 TEST_TYPE_UNSIGNED(DWORD64)
96 }
97
98 static void test_pack_DWORD_PTR(void)
99 {
100 /* DWORD_PTR */
101 TEST_TYPE_SIZE (DWORD_PTR, 8)
102 TEST_TYPE_ALIGN (DWORD_PTR, 8)
103 }
104
105 static void test_pack_HALF_PTR(void)
106 {
107 /* HALF_PTR */
108 TEST_TYPE_SIZE (HALF_PTR, 4)
109 TEST_TYPE_ALIGN (HALF_PTR, 4)
110 TEST_TYPE_SIGNED(HALF_PTR)
111 }
112
113 static void test_pack_INT16(void)
114 {
115 /* INT16 */
116 TEST_TYPE_SIZE (INT16, 2)
117 TEST_TYPE_ALIGN (INT16, 2)
118 TEST_TYPE_SIGNED(INT16)
119 }
120
121 static void test_pack_INT32(void)
122 {
123 /* INT32 */
124 TEST_TYPE_SIZE (INT32, 4)
125 TEST_TYPE_ALIGN (INT32, 4)
126 TEST_TYPE_SIGNED(INT32)
127 }
128
129 static void test_pack_INT64(void)
130 {
131 /* INT64 */
132 TEST_TYPE_SIZE (INT64, 8)
133 TEST_TYPE_ALIGN (INT64, 8)
134 TEST_TYPE_SIGNED(INT64)
135 }
136
137 static void test_pack_INT8(void)
138 {
139 /* INT8 */
140 TEST_TYPE_SIZE (INT8, 1)
141 TEST_TYPE_ALIGN (INT8, 1)
142 TEST_TYPE_SIGNED(INT8)
143 }
144
145 static void test_pack_INT_PTR(void)
146 {
147 /* INT_PTR */
148 TEST_TYPE_SIZE (INT_PTR, 8)
149 TEST_TYPE_ALIGN (INT_PTR, 8)
150 TEST_TYPE_SIGNED(INT_PTR)
151 }
152
153 static void test_pack_LONG32(void)
154 {
155 /* LONG32 */
156 TEST_TYPE_SIZE (LONG32, 4)
157 TEST_TYPE_ALIGN (LONG32, 4)
158 TEST_TYPE_SIGNED(LONG32)
159 }
160
161 static void test_pack_LONG64(void)
162 {
163 /* LONG64 */
164 TEST_TYPE_SIZE (LONG64, 8)
165 TEST_TYPE_ALIGN (LONG64, 8)
166 TEST_TYPE_SIGNED(LONG64)
167 }
168
169 static void test_pack_LONG_PTR(void)
170 {
171 /* LONG_PTR */
172 TEST_TYPE_SIZE (LONG_PTR, 8)
173 TEST_TYPE_ALIGN (LONG_PTR, 8)
174 TEST_TYPE_SIGNED(LONG_PTR)
175 }
176
177 static void test_pack_SIZE_T(void)
178 {
179 /* SIZE_T */
180 TEST_TYPE_SIZE (SIZE_T, 8)
181 TEST_TYPE_ALIGN (SIZE_T, 8)
182 }
183
184 static void test_pack_SSIZE_T(void)
185 {
186 /* SSIZE_T */
187 TEST_TYPE_SIZE (SSIZE_T, 8)
188 TEST_TYPE_ALIGN (SSIZE_T, 8)
189 }
190
191 static void test_pack_UHALF_PTR(void)
192 {
193 /* UHALF_PTR */
194 TEST_TYPE_SIZE (UHALF_PTR, 4)
195 TEST_TYPE_ALIGN (UHALF_PTR, 4)
196 TEST_TYPE_UNSIGNED(UHALF_PTR)
197 }
198
199 static void test_pack_UINT16(void)
200 {
201 /* UINT16 */
202 TEST_TYPE_SIZE (UINT16, 2)
203 TEST_TYPE_ALIGN (UINT16, 2)
204 TEST_TYPE_UNSIGNED(UINT16)
205 }
206
207 static void test_pack_UINT32(void)
208 {
209 /* UINT32 */
210 TEST_TYPE_SIZE (UINT32, 4)
211 TEST_TYPE_ALIGN (UINT32, 4)
212 TEST_TYPE_UNSIGNED(UINT32)
213 }
214
215 static void test_pack_UINT64(void)
216 {
217 /* UINT64 */
218 TEST_TYPE_SIZE (UINT64, 8)
219 TEST_TYPE_ALIGN (UINT64, 8)
220 TEST_TYPE_UNSIGNED(UINT64)
221 }
222
223 static void test_pack_UINT8(void)
224 {
225 /* UINT8 */
226 TEST_TYPE_SIZE (UINT8, 1)
227 TEST_TYPE_ALIGN (UINT8, 1)
228 TEST_TYPE_UNSIGNED(UINT8)
229 }
230
231 static void test_pack_UINT_PTR(void)
232 {
233 /* UINT_PTR */
234 TEST_TYPE_SIZE (UINT_PTR, 8)
235 TEST_TYPE_ALIGN (UINT_PTR, 8)
236 TEST_TYPE_UNSIGNED(UINT_PTR)
237 }
238
239 static void test_pack_ULONG32(void)
240 {
241 /* ULONG32 */
242 TEST_TYPE_SIZE (ULONG32, 4)
243 TEST_TYPE_ALIGN (ULONG32, 4)
244 TEST_TYPE_UNSIGNED(ULONG32)
245 }
246
247 static void test_pack_ULONG64(void)
248 {
249 /* ULONG64 */
250 TEST_TYPE_SIZE (ULONG64, 8)
251 TEST_TYPE_ALIGN (ULONG64, 8)
252 TEST_TYPE_UNSIGNED(ULONG64)
253 }
254
255 static void test_pack_ULONG_PTR(void)
256 {
257 /* ULONG_PTR */
258 TEST_TYPE_SIZE (ULONG_PTR, 8)
259 TEST_TYPE_ALIGN (ULONG_PTR, 8)
260 TEST_TYPE_UNSIGNED(ULONG_PTR)
261 }
262
263 static void test_pack_ACCESS_ALLOWED_ACE(void)
264 {
265 /* ACCESS_ALLOWED_ACE */
266 TEST_TYPE_SIZE (ACCESS_ALLOWED_ACE, 12)
267 TEST_TYPE_ALIGN (ACCESS_ALLOWED_ACE, 4)
268 TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, Header, 4)
269 TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Header, 2)
270 TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Header, 0)
271 TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, Mask, 4)
272 TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, Mask, 4)
273 TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, Mask, 4)
274 TEST_FIELD_SIZE (ACCESS_ALLOWED_ACE, SidStart, 4)
275 TEST_FIELD_ALIGN (ACCESS_ALLOWED_ACE, SidStart, 4)
276 TEST_FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart, 8)
277 }
278
279 static void test_pack_ACCESS_DENIED_ACE(void)
280 {
281 /* ACCESS_DENIED_ACE */
282 TEST_TYPE_SIZE (ACCESS_DENIED_ACE, 12)
283 TEST_TYPE_ALIGN (ACCESS_DENIED_ACE, 4)
284 TEST_FIELD_SIZE (ACCESS_DENIED_ACE, Header, 4)
285 TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Header, 2)
286 TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Header, 0)
287 TEST_FIELD_SIZE (ACCESS_DENIED_ACE, Mask, 4)
288 TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, Mask, 4)
289 TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, Mask, 4)
290 TEST_FIELD_SIZE (ACCESS_DENIED_ACE, SidStart, 4)
291 TEST_FIELD_ALIGN (ACCESS_DENIED_ACE, SidStart, 4)
292 TEST_FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart, 8)
293 }
294
295 static void test_pack_ACCESS_MASK(void)
296 {
297 /* ACCESS_MASK */
298 TEST_TYPE_SIZE (ACCESS_MASK, 4)
299 TEST_TYPE_ALIGN (ACCESS_MASK, 4)
300 TEST_TYPE_UNSIGNED(ACCESS_MASK)
301 }
302
303 static void test_pack_ACE_HEADER(void)
304 {
305 /* ACE_HEADER */
306 TEST_TYPE_SIZE (ACE_HEADER, 4)
307 TEST_TYPE_ALIGN (ACE_HEADER, 2)
308 TEST_FIELD_SIZE (ACE_HEADER, AceType, 1)
309 TEST_FIELD_ALIGN (ACE_HEADER, AceType, 1)
310 TEST_FIELD_OFFSET(ACE_HEADER, AceType, 0)
311 TEST_FIELD_SIZE (ACE_HEADER, AceFlags, 1)
312 TEST_FIELD_ALIGN (ACE_HEADER, AceFlags, 1)
313 TEST_FIELD_OFFSET(ACE_HEADER, AceFlags, 1)
314 TEST_FIELD_SIZE (ACE_HEADER, AceSize, 2)
315 TEST_FIELD_ALIGN (ACE_HEADER, AceSize, 2)
316 TEST_FIELD_OFFSET(ACE_HEADER, AceSize, 2)
317 }
318
319 static void test_pack_ACL(void)
320 {
321 /* ACL */
322 TEST_TYPE_SIZE (ACL, 8)
323 TEST_TYPE_ALIGN (ACL, 2)
324 TEST_FIELD_SIZE (ACL, AclRevision, 1)
325 TEST_FIELD_ALIGN (ACL, AclRevision, 1)
326 TEST_FIELD_OFFSET(ACL, AclRevision, 0)
327 TEST_FIELD_SIZE (ACL, Sbz1, 1)
328 TEST_FIELD_ALIGN (ACL, Sbz1, 1)
329 TEST_FIELD_OFFSET(ACL, Sbz1, 1)
330 TEST_FIELD_SIZE (ACL, AclSize, 2)
331 TEST_FIELD_ALIGN (ACL, AclSize, 2)
332 TEST_FIELD_OFFSET(ACL, AclSize, 2)
333 TEST_FIELD_SIZE (ACL, AceCount, 2)
334 TEST_FIELD_ALIGN (ACL, AceCount, 2)
335 TEST_FIELD_OFFSET(ACL, AceCount, 4)
336 TEST_FIELD_SIZE (ACL, Sbz2, 2)
337 TEST_FIELD_ALIGN (ACL, Sbz2, 2)
338 TEST_FIELD_OFFSET(ACL, Sbz2, 6)
339 }
340
341 static void test_pack_ACL_REVISION_INFORMATION(void)
342 {
343 /* ACL_REVISION_INFORMATION */
344 TEST_TYPE_SIZE (ACL_REVISION_INFORMATION, 4)
345 TEST_TYPE_ALIGN (ACL_REVISION_INFORMATION, 4)
346 TEST_FIELD_SIZE (ACL_REVISION_INFORMATION, AclRevision, 4)
347 TEST_FIELD_ALIGN (ACL_REVISION_INFORMATION, AclRevision, 4)
348 TEST_FIELD_OFFSET(ACL_REVISION_INFORMATION, AclRevision, 0)
349 }
350
351 static void test_pack_ACL_SIZE_INFORMATION(void)
352 {
353 /* ACL_SIZE_INFORMATION */
354 TEST_TYPE_SIZE (ACL_SIZE_INFORMATION, 12)
355 TEST_TYPE_ALIGN (ACL_SIZE_INFORMATION, 4)
356 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AceCount, 4)
357 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AceCount, 4)
358 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AceCount, 0)
359 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
360 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesInUse, 4)
361 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesInUse, 4)
362 TEST_FIELD_SIZE (ACL_SIZE_INFORMATION, AclBytesFree, 4)
363 TEST_FIELD_ALIGN (ACL_SIZE_INFORMATION, AclBytesFree, 4)
364 TEST_FIELD_OFFSET(ACL_SIZE_INFORMATION, AclBytesFree, 8)
365 }
366
367 static void test_pack_BOOLEAN(void)
368 {
369 /* BOOLEAN */
370 TEST_TYPE_SIZE (BOOLEAN, 1)
371 TEST_TYPE_ALIGN (BOOLEAN, 1)
372 TEST_TYPE_UNSIGNED(BOOLEAN)
373 }
374
375 static void test_pack_CCHAR(void)
376 {
377 /* CCHAR */
378 TEST_TYPE_SIZE (CCHAR, 1)
379 TEST_TYPE_ALIGN (CCHAR, 1)
380 }
381
382 static void test_pack_CHAR(void)
383 {
384 /* CHAR */
385 TEST_TYPE_SIZE (CHAR, 1)
386 TEST_TYPE_ALIGN (CHAR, 1)
387 }
388
389 static void test_pack_DWORDLONG(void)
390 {
391 /* DWORDLONG */
392 TEST_TYPE_SIZE (DWORDLONG, 8)
393 TEST_TYPE_ALIGN (DWORDLONG, 8)
394 TEST_TYPE_UNSIGNED(DWORDLONG)
395 }
396
397 static void test_pack_EXCEPTION_POINTERS(void)
398 {
399 /* EXCEPTION_POINTERS */
400 TEST_TYPE_SIZE (EXCEPTION_POINTERS, 16)
401 TEST_TYPE_ALIGN (EXCEPTION_POINTERS, 8)
402 TEST_FIELD_SIZE (EXCEPTION_POINTERS, ExceptionRecord, 8)
403 TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ExceptionRecord, 8)
404 TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ExceptionRecord, 0)
405 TEST_FIELD_SIZE (EXCEPTION_POINTERS, ContextRecord, 8)
406 TEST_FIELD_ALIGN (EXCEPTION_POINTERS, ContextRecord, 8)
407 TEST_FIELD_OFFSET(EXCEPTION_POINTERS, ContextRecord, 8)
408 }
409
410 static void test_pack_EXCEPTION_RECORD(void)
411 {
412 /* EXCEPTION_RECORD */
413 TEST_TYPE_SIZE (EXCEPTION_RECORD, 152)
414 TEST_TYPE_ALIGN (EXCEPTION_RECORD, 8)
415 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionCode, 4)
416 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionCode, 4)
417 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionCode, 0)
418 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionFlags, 4)
419 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionFlags, 4)
420 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionFlags, 4)
421 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionRecord, 8)
422 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionRecord, 8)
423 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionRecord, 8)
424 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionAddress, 8)
425 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionAddress, 8)
426 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionAddress, 16)
427 TEST_FIELD_SIZE (EXCEPTION_RECORD, NumberParameters, 4)
428 TEST_FIELD_ALIGN (EXCEPTION_RECORD, NumberParameters, 4)
429 TEST_FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters, 24)
430 TEST_FIELD_SIZE (EXCEPTION_RECORD, ExceptionInformation, 120)
431 TEST_FIELD_ALIGN (EXCEPTION_RECORD, ExceptionInformation, 8)
432 TEST_FIELD_OFFSET(EXCEPTION_RECORD, ExceptionInformation, 32)
433 }
434
435 static void test_pack_EXECUTION_STATE(void)
436 {
437 /* EXECUTION_STATE */
438 TEST_TYPE_SIZE (EXECUTION_STATE, 4)
439 TEST_TYPE_ALIGN (EXECUTION_STATE, 4)
440 TEST_TYPE_UNSIGNED(EXECUTION_STATE)
441 }
442
443 static void test_pack_FPO_DATA(void)
444 {
445 /* FPO_DATA */
446 TEST_TYPE_SIZE (FPO_DATA, 16)
447 TEST_TYPE_ALIGN (FPO_DATA, 4)
448 TEST_FIELD_SIZE (FPO_DATA, ulOffStart, 4)
449 TEST_FIELD_ALIGN (FPO_DATA, ulOffStart, 4)
450 TEST_FIELD_OFFSET(FPO_DATA, ulOffStart, 0)
451 TEST_FIELD_SIZE (FPO_DATA, cbProcSize, 4)
452 TEST_FIELD_ALIGN (FPO_DATA, cbProcSize, 4)
453 TEST_FIELD_OFFSET(FPO_DATA, cbProcSize, 4)
454 TEST_FIELD_SIZE (FPO_DATA, cdwLocals, 4)
455 TEST_FIELD_ALIGN (FPO_DATA, cdwLocals, 4)
456 TEST_FIELD_OFFSET(FPO_DATA, cdwLocals, 8)
457 TEST_FIELD_SIZE (FPO_DATA, cdwParams, 2)
458 TEST_FIELD_ALIGN (FPO_DATA, cdwParams, 2)
459 TEST_FIELD_OFFSET(FPO_DATA, cdwParams, 12)
460 }
461
462 static void test_pack_GENERIC_MAPPING(void)
463 {
464 /* GENERIC_MAPPING */
465 TEST_TYPE_SIZE (GENERIC_MAPPING, 16)
466 TEST_TYPE_ALIGN (GENERIC_MAPPING, 4)
467 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericRead, 4)
468 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericRead, 4)
469 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericRead, 0)
470 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericWrite, 4)
471 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericWrite, 4)
472 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericWrite, 4)
473 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericExecute, 4)
474 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericExecute, 4)
475 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericExecute, 8)
476 TEST_FIELD_SIZE (GENERIC_MAPPING, GenericAll, 4)
477 TEST_FIELD_ALIGN (GENERIC_MAPPING, GenericAll, 4)
478 TEST_FIELD_OFFSET(GENERIC_MAPPING, GenericAll, 12)
479 }
480
481 static void test_pack_HANDLE(void)
482 {
483 /* HANDLE */
484 TEST_TYPE_SIZE (HANDLE, 8)
485 TEST_TYPE_ALIGN (HANDLE, 8)
486 }
487
488 static void test_pack_HRESULT(void)
489 {
490 /* HRESULT */
491 TEST_TYPE_SIZE (HRESULT, 4)
492 TEST_TYPE_ALIGN (HRESULT, 4)
493 }
494
495 static void test_pack_IMAGE_ARCHIVE_MEMBER_HEADER(void)
496 {
497 /* IMAGE_ARCHIVE_MEMBER_HEADER */
498 TEST_TYPE_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, 60)
499 TEST_TYPE_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, 1)
500 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 16)
501 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Name, 1)
502 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Name, 0)
503 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 12)
504 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Date, 1)
505 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Date, 16)
506 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 6)
507 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 1)
508 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, UserID, 28)
509 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 6)
510 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 1)
511 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, GroupID, 34)
512 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 8)
513 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 1)
514 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Mode, 40)
515 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 10)
516 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, Size, 1)
517 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, Size, 48)
518 TEST_FIELD_SIZE (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 2)
519 TEST_FIELD_ALIGN (IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 1)
520 TEST_FIELD_OFFSET(IMAGE_ARCHIVE_MEMBER_HEADER, EndHeader, 58)
521 }
522
523 static void test_pack_IMAGE_AUX_SYMBOL(void)
524 {
525 /* IMAGE_AUX_SYMBOL (pack 2) */
526 }
527
528 static void test_pack_IMAGE_BASE_RELOCATION(void)
529 {
530 /* IMAGE_BASE_RELOCATION */
531 TEST_TYPE_SIZE (IMAGE_BASE_RELOCATION, 8)
532 TEST_TYPE_ALIGN (IMAGE_BASE_RELOCATION, 4)
533 TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
534 TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, VirtualAddress, 4)
535 TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, VirtualAddress, 0)
536 TEST_FIELD_SIZE (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
537 TEST_FIELD_ALIGN (IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
538 TEST_FIELD_OFFSET(IMAGE_BASE_RELOCATION, SizeOfBlock, 4)
539 }
540
541 static void test_pack_IMAGE_BOUND_FORWARDER_REF(void)
542 {
543 /* IMAGE_BOUND_FORWARDER_REF */
544 TEST_TYPE_SIZE (IMAGE_BOUND_FORWARDER_REF, 8)
545 TEST_TYPE_ALIGN (IMAGE_BOUND_FORWARDER_REF, 4)
546 TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
547 TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 4)
548 TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, TimeDateStamp, 0)
549 TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
550 TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 2)
551 TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, OffsetModuleName, 4)
552 TEST_FIELD_SIZE (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
553 TEST_FIELD_ALIGN (IMAGE_BOUND_FORWARDER_REF, Reserved, 2)
554 TEST_FIELD_OFFSET(IMAGE_BOUND_FORWARDER_REF, Reserved, 6)
555 }
556
557 static void test_pack_IMAGE_BOUND_IMPORT_DESCRIPTOR(void)
558 {
559 /* IMAGE_BOUND_IMPORT_DESCRIPTOR */
560 TEST_TYPE_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
561 TEST_TYPE_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
562 TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
563 TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 4)
564 TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, TimeDateStamp, 0)
565 TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
566 TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 2)
567 TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, OffsetModuleName, 4)
568 TEST_FIELD_SIZE (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
569 TEST_FIELD_ALIGN (IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 2)
570 TEST_FIELD_OFFSET(IMAGE_BOUND_IMPORT_DESCRIPTOR, NumberOfModuleForwarderRefs, 6)
571 }
572
573 static void test_pack_IMAGE_COFF_SYMBOLS_HEADER(void)
574 {
575 /* IMAGE_COFF_SYMBOLS_HEADER */
576 TEST_TYPE_SIZE (IMAGE_COFF_SYMBOLS_HEADER, 32)
577 TEST_TYPE_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, 4)
578 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
579 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 4)
580 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfSymbols, 0)
581 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
582 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
583 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstSymbol, 4)
584 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
585 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 4)
586 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, NumberOfLinenumbers, 8)
587 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
588 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 4)
589 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, LvaToFirstLinenumber, 12)
590 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
591 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 4)
592 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfCode, 16)
593 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
594 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 4)
595 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfCode, 20)
596 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
597 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 4)
598 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToFirstByteOfData, 24)
599 TEST_FIELD_SIZE (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
600 TEST_FIELD_ALIGN (IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 4)
601 TEST_FIELD_OFFSET(IMAGE_COFF_SYMBOLS_HEADER, RvaToLastByteOfData, 28)
602 }
603
604 static void test_pack_IMAGE_DATA_DIRECTORY(void)
605 {
606 /* IMAGE_DATA_DIRECTORY */
607 TEST_TYPE_SIZE (IMAGE_DATA_DIRECTORY, 8)
608 TEST_TYPE_ALIGN (IMAGE_DATA_DIRECTORY, 4)
609 TEST_FIELD_SIZE (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
610 TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, VirtualAddress, 4)
611 TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, VirtualAddress, 0)
612 TEST_FIELD_SIZE (IMAGE_DATA_DIRECTORY, Size, 4)
613 TEST_FIELD_ALIGN (IMAGE_DATA_DIRECTORY, Size, 4)
614 TEST_FIELD_OFFSET(IMAGE_DATA_DIRECTORY, Size, 4)
615 }
616
617 static void test_pack_IMAGE_DEBUG_DIRECTORY(void)
618 {
619 /* IMAGE_DEBUG_DIRECTORY */
620 TEST_TYPE_SIZE (IMAGE_DEBUG_DIRECTORY, 28)
621 TEST_TYPE_ALIGN (IMAGE_DEBUG_DIRECTORY, 4)
622 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
623 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Characteristics, 4)
624 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Characteristics, 0)
625 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
626 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
627 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, TimeDateStamp, 4)
628 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
629 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MajorVersion, 2)
630 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MajorVersion, 8)
631 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
632 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, MinorVersion, 2)
633 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, MinorVersion, 10)
634 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, Type, 4)
635 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, Type, 4)
636 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, Type, 12)
637 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
638 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, SizeOfData, 4)
639 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, SizeOfData, 16)
640 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
641 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 4)
642 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, AddressOfRawData, 20)
643 TEST_FIELD_SIZE (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
644 TEST_FIELD_ALIGN (IMAGE_DEBUG_DIRECTORY, PointerToRawData, 4)
645 TEST_FIELD_OFFSET(IMAGE_DEBUG_DIRECTORY, PointerToRawData, 24)
646 }
647
648 static void test_pack_IMAGE_DEBUG_MISC(void)
649 {
650 /* IMAGE_DEBUG_MISC */
651 TEST_TYPE_SIZE (IMAGE_DEBUG_MISC, 16)
652 TEST_TYPE_ALIGN (IMAGE_DEBUG_MISC, 4)
653 TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, DataType, 4)
654 TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, DataType, 4)
655 TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, DataType, 0)
656 TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Length, 4)
657 TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Length, 4)
658 TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Length, 4)
659 TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Unicode, 1)
660 TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Unicode, 1)
661 TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Unicode, 8)
662 TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Reserved, 3)
663 TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Reserved, 1)
664 TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Reserved, 9)
665 TEST_FIELD_SIZE (IMAGE_DEBUG_MISC, Data, 1)
666 TEST_FIELD_ALIGN (IMAGE_DEBUG_MISC, Data, 1)
667 TEST_FIELD_OFFSET(IMAGE_DEBUG_MISC, Data, 12)
668 }
669
670 static void test_pack_IMAGE_DOS_HEADER(void)
671 {
672 /* IMAGE_DOS_HEADER (pack 2) */
673 TEST_TYPE_SIZE (IMAGE_DOS_HEADER, 64)
674 TEST_TYPE_ALIGN (IMAGE_DOS_HEADER, 2)
675 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_magic, 2)
676 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_magic, 2)
677 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_magic, 0)
678 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cblp, 2)
679 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cblp, 2)
680 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cblp, 2)
681 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cp, 2)
682 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cp, 2)
683 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cp, 4)
684 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_crlc, 2)
685 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_crlc, 2)
686 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_crlc, 6)
687 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cparhdr, 2)
688 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cparhdr, 2)
689 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cparhdr, 8)
690 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_minalloc, 2)
691 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_minalloc, 2)
692 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_minalloc, 10)
693 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_maxalloc, 2)
694 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_maxalloc, 2)
695 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_maxalloc, 12)
696 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ss, 2)
697 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ss, 2)
698 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ss, 14)
699 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_sp, 2)
700 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_sp, 2)
701 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_sp, 16)
702 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_csum, 2)
703 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_csum, 2)
704 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_csum, 18)
705 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ip, 2)
706 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ip, 2)
707 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ip, 20)
708 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_cs, 2)
709 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_cs, 2)
710 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_cs, 22)
711 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfarlc, 2)
712 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfarlc, 2)
713 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfarlc, 24)
714 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_ovno, 2)
715 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_ovno, 2)
716 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_ovno, 26)
717 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_res, 8)
718 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res, 2)
719 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res, 28)
720 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oemid, 2)
721 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oemid, 2)
722 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oemid, 36)
723 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_oeminfo, 2)
724 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_oeminfo, 2)
725 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_oeminfo, 38)
726 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_res2, 20)
727 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_res2, 2)
728 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_res2, 40)
729 TEST_FIELD_SIZE (IMAGE_DOS_HEADER, e_lfanew, 4)
730 TEST_FIELD_ALIGN (IMAGE_DOS_HEADER, e_lfanew, 2)
731 TEST_FIELD_OFFSET(IMAGE_DOS_HEADER, e_lfanew, 60)
732 }
733
734 static void test_pack_IMAGE_EXPORT_DIRECTORY(void)
735 {
736 /* IMAGE_EXPORT_DIRECTORY */
737 TEST_TYPE_SIZE (IMAGE_EXPORT_DIRECTORY, 40)
738 TEST_TYPE_ALIGN (IMAGE_EXPORT_DIRECTORY, 4)
739 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
740 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Characteristics, 4)
741 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Characteristics, 0)
742 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
743 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
744 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, TimeDateStamp, 4)
745 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
746 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MajorVersion, 2)
747 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MajorVersion, 8)
748 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
749 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, MinorVersion, 2)
750 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, MinorVersion, 10)
751 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Name, 4)
752 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Name, 4)
753 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Name, 12)
754 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, Base, 4)
755 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, Base, 4)
756 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, Base, 16)
757 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
758 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 4)
759 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfFunctions, 20)
760 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
761 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, NumberOfNames, 4)
762 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, NumberOfNames, 24)
763 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
764 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 4)
765 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfFunctions, 28)
766 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
767 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNames, 4)
768 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNames, 32)
769 TEST_FIELD_SIZE (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
770 TEST_FIELD_ALIGN (IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 4)
771 TEST_FIELD_OFFSET(IMAGE_EXPORT_DIRECTORY, AddressOfNameOrdinals, 36)
772 }
773
774 static void test_pack_IMAGE_FILE_HEADER(void)
775 {
776 /* IMAGE_FILE_HEADER */
777 TEST_TYPE_SIZE (IMAGE_FILE_HEADER, 20)
778 TEST_TYPE_ALIGN (IMAGE_FILE_HEADER, 4)
779 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Machine, 2)
780 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Machine, 2)
781 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Machine, 0)
782 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSections, 2)
783 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSections, 2)
784 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSections, 2)
785 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, TimeDateStamp, 4)
786 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, TimeDateStamp, 4)
787 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, TimeDateStamp, 4)
788 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
789 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, PointerToSymbolTable, 4)
790 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, PointerToSymbolTable, 8)
791 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
792 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, NumberOfSymbols, 4)
793 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, NumberOfSymbols, 12)
794 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
795 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, SizeOfOptionalHeader, 2)
796 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, SizeOfOptionalHeader, 16)
797 TEST_FIELD_SIZE (IMAGE_FILE_HEADER, Characteristics, 2)
798 TEST_FIELD_ALIGN (IMAGE_FILE_HEADER, Characteristics, 2)
799 TEST_FIELD_OFFSET(IMAGE_FILE_HEADER, Characteristics, 18)
800 }
801
802 static void test_pack_IMAGE_FUNCTION_ENTRY(void)
803 {
804 /* IMAGE_FUNCTION_ENTRY */
805 TEST_TYPE_SIZE (IMAGE_FUNCTION_ENTRY, 12)
806 TEST_TYPE_ALIGN (IMAGE_FUNCTION_ENTRY, 4)
807 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
808 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, StartingAddress, 4)
809 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, StartingAddress, 0)
810 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
811 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
812 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndingAddress, 4)
813 TEST_FIELD_SIZE (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
814 TEST_FIELD_ALIGN (IMAGE_FUNCTION_ENTRY, EndOfPrologue, 4)
815 TEST_FIELD_OFFSET(IMAGE_FUNCTION_ENTRY, EndOfPrologue, 8)
816 }
817
818 static void test_pack_IMAGE_IMPORT_BY_NAME(void)
819 {
820 /* IMAGE_IMPORT_BY_NAME */
821 TEST_TYPE_SIZE (IMAGE_IMPORT_BY_NAME, 4)
822 TEST_TYPE_ALIGN (IMAGE_IMPORT_BY_NAME, 2)
823 TEST_FIELD_SIZE (IMAGE_IMPORT_BY_NAME, Hint, 2)
824 TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Hint, 2)
825 TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Hint, 0)
826 TEST_FIELD_SIZE (IMAGE_IMPORT_BY_NAME, Name, 1)
827 TEST_FIELD_ALIGN (IMAGE_IMPORT_BY_NAME, Name, 1)
828 TEST_FIELD_OFFSET(IMAGE_IMPORT_BY_NAME, Name, 2)
829 }
830
831 static void test_pack_IMAGE_IMPORT_DESCRIPTOR(void)
832 {
833 /* IMAGE_IMPORT_DESCRIPTOR */
834 }
835
836 static void test_pack_IMAGE_LINENUMBER(void)
837 {
838 /* IMAGE_LINENUMBER (pack 2) */
839 }
840
841 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY(void)
842 {
843 /* IMAGE_LOAD_CONFIG_DIRECTORY */
844 TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY, 112)
845 TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY, 8)
846 }
847
848 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY32(void)
849 {
850 /* IMAGE_LOAD_CONFIG_DIRECTORY32 */
851 TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, 88)
852 TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, 8)
853 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
854 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 4)
855 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Size, 0)
856 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
857 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
858 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, TimeDateStamp, 4)
859 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
860 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 2)
861 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MajorVersion, 8)
862 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
863 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 2)
864 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MinorVersion, 10)
865 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
866 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 4)
867 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsClear, 12)
868 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
869 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 4)
870 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, GlobalFlagsSet, 16)
871 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
872 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 4)
873 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CriticalSectionDefaultTimeout, 20)
874 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
875 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 4)
876 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitFreeBlockThreshold, 24)
877 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
878 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 4)
879 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, DeCommitTotalFreeThreshold, 28)
880 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
881 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 8)
882 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, LockPrefixTable, 32)
883 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
884 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 4)
885 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, MaximumAllocationSize, 40)
886 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
887 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 4)
888 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, VirtualMemoryThreshold, 44)
889 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
890 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 4)
891 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessHeapFlags, 48)
892 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
893 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 4)
894 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, ProcessAffinityMask, 52)
895 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
896 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 2)
897 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, CSDVersion, 56)
898 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
899 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 2)
900 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, Reserved1, 58)
901 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8)
902 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 8)
903 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, EditList, 64)
904 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
905 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 4)
906 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SecurityCookie, 72)
907 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
908 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 4)
909 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerTable, 76)
910 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
911 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 4)
912 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY32, SEHandlerCount, 80)
913 }
914
915 static void test_pack_IMAGE_LOAD_CONFIG_DIRECTORY64(void)
916 {
917 /* IMAGE_LOAD_CONFIG_DIRECTORY64 */
918 TEST_TYPE_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, 112)
919 TEST_TYPE_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, 8)
920 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
921 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 4)
922 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Size, 0)
923 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
924 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
925 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, TimeDateStamp, 4)
926 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
927 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 2)
928 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MajorVersion, 8)
929 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
930 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 2)
931 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MinorVersion, 10)
932 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
933 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 4)
934 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsClear, 12)
935 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
936 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 4)
937 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, GlobalFlagsSet, 16)
938 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
939 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 4)
940 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CriticalSectionDefaultTimeout, 20)
941 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
942 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 8)
943 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitFreeBlockThreshold, 24)
944 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
945 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 8)
946 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, DeCommitTotalFreeThreshold, 32)
947 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
948 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 8)
949 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, LockPrefixTable, 40)
950 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
951 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 8)
952 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, MaximumAllocationSize, 48)
953 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
954 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 8)
955 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, VirtualMemoryThreshold, 56)
956 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
957 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 8)
958 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessAffinityMask, 64)
959 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
960 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 4)
961 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, ProcessHeapFlags, 72)
962 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
963 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 2)
964 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, CSDVersion, 76)
965 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
966 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 2)
967 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, Reserved1, 78)
968 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
969 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 8)
970 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, EditList, 80)
971 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
972 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 8)
973 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SecurityCookie, 88)
974 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
975 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 8)
976 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerTable, 96)
977 TEST_FIELD_SIZE (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
978 TEST_FIELD_ALIGN (IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 8)
979 TEST_FIELD_OFFSET(IMAGE_LOAD_CONFIG_DIRECTORY64, SEHandlerCount, 104)
980 }
981
982 static void test_pack_IMAGE_NT_HEADERS(void)
983 {
984 /* IMAGE_NT_HEADERS */
985 TEST_TYPE_SIZE (IMAGE_NT_HEADERS, 264)
986 TEST_TYPE_ALIGN (IMAGE_NT_HEADERS, 8)
987 }
988
989 static void test_pack_IMAGE_NT_HEADERS32(void)
990 {
991 /* IMAGE_NT_HEADERS32 */
992 TEST_TYPE_SIZE (IMAGE_NT_HEADERS32, 248)
993 TEST_TYPE_ALIGN (IMAGE_NT_HEADERS32, 4)
994 TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, Signature, 4)
995 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, Signature, 4)
996 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, Signature, 0)
997 TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, FileHeader, 20)
998 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, FileHeader, 4)
999 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, FileHeader, 4)
1000 TEST_FIELD_SIZE (IMAGE_NT_HEADERS32, OptionalHeader, 224)
1001 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS32, OptionalHeader, 4)
1002 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader, 24)
1003 }
1004
1005 static void test_pack_IMAGE_NT_HEADERS64(void)
1006 {
1007 /* IMAGE_NT_HEADERS64 */
1008 TEST_TYPE_SIZE (IMAGE_NT_HEADERS64, 264)
1009 TEST_TYPE_ALIGN (IMAGE_NT_HEADERS64, 8)
1010 TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, Signature, 4)
1011 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, Signature, 4)
1012 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, Signature, 0)
1013 TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, FileHeader, 20)
1014 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, FileHeader, 4)
1015 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, FileHeader, 4)
1016 TEST_FIELD_SIZE (IMAGE_NT_HEADERS64, OptionalHeader, 240)
1017 TEST_FIELD_ALIGN (IMAGE_NT_HEADERS64, OptionalHeader, 8)
1018 TEST_FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader, 24)
1019 }
1020
1021 static void test_pack_IMAGE_OPTIONAL_HEADER(void)
1022 {
1023 /* IMAGE_OPTIONAL_HEADER */
1024 TEST_TYPE_SIZE (IMAGE_OPTIONAL_HEADER, 240)
1025 TEST_TYPE_ALIGN (IMAGE_OPTIONAL_HEADER, 8)
1026 }
1027
1028 static void test_pack_IMAGE_OPTIONAL_HEADER32(void)
1029 {
1030 /* IMAGE_OPTIONAL_HEADER32 */
1031 TEST_TYPE_SIZE (IMAGE_OPTIONAL_HEADER32, 224)
1032 TEST_TYPE_ALIGN (IMAGE_OPTIONAL_HEADER32, 4)
1033 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, Magic, 2)
1034 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Magic, 2)
1035 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Magic, 0)
1036 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1037 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 1)
1038 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorLinkerVersion, 2)
1039 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1040 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 1)
1041 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorLinkerVersion, 3)
1042 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1043 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1044 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfCode, 4)
1045 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1046 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 4)
1047 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfInitializedData, 8)
1048 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1049 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 4)
1050 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfUninitializedData, 12)
1051 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1052 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 4)
1053 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, AddressOfEntryPoint, 16)
1054 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1055 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfCode, 4)
1056 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfCode, 20)
1057 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1058 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, BaseOfData, 4)
1059 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, BaseOfData, 24)
1060 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
1061 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, ImageBase, 4)
1062 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, ImageBase, 28)
1063 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1064 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SectionAlignment, 4)
1065 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SectionAlignment, 32)
1066 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1067 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, FileAlignment, 4)
1068 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, FileAlignment, 36)
1069 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1070 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 2)
1071 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorOperatingSystemVersion, 40)
1072 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1073 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 2)
1074 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorOperatingSystemVersion, 42)
1075 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1076 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 2)
1077 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorImageVersion, 44)
1078 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1079 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 2)
1080 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorImageVersion, 46)
1081 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1082 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 2)
1083 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MajorSubsystemVersion, 48)
1084 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1085 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 2)
1086 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, MinorSubsystemVersion, 50)
1087 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1088 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 4)
1089 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Win32VersionValue, 52)
1090 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1091 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfImage, 4)
1092 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfImage, 56)
1093 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1094 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 4)
1095 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeaders, 60)
1096 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
1097 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, CheckSum, 4)
1098 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, CheckSum, 64)
1099 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
1100 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, Subsystem, 2)
1101 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, Subsystem, 68)
1102 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1103 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 2)
1104 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DllCharacteristics, 70)
1105 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1106 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 4)
1107 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackReserve, 72)
1108 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1109 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 4)
1110 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfStackCommit, 76)
1111 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1112 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 4)
1113 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapReserve, 80)
1114 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1115 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 4)
1116 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, SizeOfHeapCommit, 84)
1117 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1118 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, LoaderFlags, 4)
1119 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, LoaderFlags, 88)
1120 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1121 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 4)
1122 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, NumberOfRvaAndSizes, 92)
1123 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER32, DataDirectory, 128)
1124 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER32, DataDirectory, 4)
1125 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER32, DataDirectory, 96)
1126 }
1127
1128 static void test_pack_IMAGE_OPTIONAL_HEADER64(void)
1129 {
1130 /* IMAGE_OPTIONAL_HEADER64 */
1131 TEST_TYPE_SIZE (IMAGE_OPTIONAL_HEADER64, 240)
1132 TEST_TYPE_ALIGN (IMAGE_OPTIONAL_HEADER64, 8)
1133 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, Magic, 2)
1134 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Magic, 2)
1135 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Magic, 0)
1136 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1137 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 1)
1138 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorLinkerVersion, 2)
1139 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1140 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 1)
1141 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorLinkerVersion, 3)
1142 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1143 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1144 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfCode, 4)
1145 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1146 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 4)
1147 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfInitializedData, 8)
1148 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1149 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 4)
1150 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfUninitializedData, 12)
1151 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1152 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 4)
1153 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint, 16)
1154 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1155 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, BaseOfCode, 4)
1156 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, BaseOfCode, 20)
1157 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
1158 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, ImageBase, 8)
1159 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, ImageBase, 24)
1160 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1161 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SectionAlignment, 4)
1162 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SectionAlignment, 32)
1163 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1164 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, FileAlignment, 4)
1165 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, FileAlignment, 36)
1166 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1167 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 2)
1168 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorOperatingSystemVersion, 40)
1169 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1170 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 2)
1171 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorOperatingSystemVersion, 42)
1172 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1173 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 2)
1174 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorImageVersion, 44)
1175 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1176 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 2)
1177 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorImageVersion, 46)
1178 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1179 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 2)
1180 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion, 48)
1181 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1182 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 2)
1183 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion, 50)
1184 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1185 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 4)
1186 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Win32VersionValue, 52)
1187 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1188 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfImage, 4)
1189 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfImage, 56)
1190 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1191 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 4)
1192 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeaders, 60)
1193 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
1194 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, CheckSum, 4)
1195 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, CheckSum, 64)
1196 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
1197 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, Subsystem, 2)
1198 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, Subsystem, 68)
1199 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1200 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 2)
1201 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DllCharacteristics, 70)
1202 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1203 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 8)
1204 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackReserve, 72)
1205 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1206 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 8)
1207 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfStackCommit, 80)
1208 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1209 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 8)
1210 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapReserve, 88)
1211 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1212 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 8)
1213 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, SizeOfHeapCommit, 96)
1214 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1215 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, LoaderFlags, 4)
1216 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, LoaderFlags, 104)
1217 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1218 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 4)
1219 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, NumberOfRvaAndSizes, 108)
1220 TEST_FIELD_SIZE (IMAGE_OPTIONAL_HEADER64, DataDirectory, 128)
1221 TEST_FIELD_ALIGN (IMAGE_OPTIONAL_HEADER64, DataDirectory, 4)
1222 TEST_FIELD_OFFSET(IMAGE_OPTIONAL_HEADER64, DataDirectory, 112)
1223 }
1224
1225 static void test_pack_IMAGE_OS2_HEADER(void)
1226 {
1227 /* IMAGE_OS2_HEADER (pack 2) */
1228 TEST_TYPE_SIZE (IMAGE_OS2_HEADER, 64)
1229 TEST_TYPE_ALIGN (IMAGE_OS2_HEADER, 2)
1230 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_magic, 2)
1231 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_magic, 2)
1232 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_magic, 0)
1233 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_ver, 1)
1234 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_ver, 1)
1235 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_ver, 2)
1236 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rev, 1)
1237 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rev, 1)
1238 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rev, 3)
1239 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_enttab, 2)
1240 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_enttab, 2)
1241 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_enttab, 4)
1242 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1243 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbenttab, 2)
1244 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbenttab, 6)
1245 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_crc, 4)
1246 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_crc, 2)
1247 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_crc, 8)
1248 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flags, 2)
1249 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flags, 2)
1250 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flags, 12)
1251 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_autodata, 2)
1252 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_autodata, 2)
1253 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_autodata, 14)
1254 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_heap, 2)
1255 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_heap, 2)
1256 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_heap, 16)
1257 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_stack, 2)
1258 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_stack, 2)
1259 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_stack, 18)
1260 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_csip, 4)
1261 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_csip, 2)
1262 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_csip, 20)
1263 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_sssp, 4)
1264 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_sssp, 2)
1265 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_sssp, 24)
1266 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cseg, 2)
1267 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cseg, 2)
1268 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cseg, 28)
1269 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmod, 2)
1270 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmod, 2)
1271 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmod, 30)
1272 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1273 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cbnrestab, 2)
1274 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cbnrestab, 32)
1275 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_segtab, 2)
1276 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_segtab, 2)
1277 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_segtab, 34)
1278 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1279 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_rsrctab, 2)
1280 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_rsrctab, 36)
1281 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_restab, 2)
1282 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_restab, 2)
1283 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_restab, 38)
1284 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_modtab, 2)
1285 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_modtab, 2)
1286 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_modtab, 40)
1287 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_imptab, 2)
1288 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_imptab, 2)
1289 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_imptab, 42)
1290 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_nrestab, 4)
1291 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_nrestab, 2)
1292 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_nrestab, 44)
1293 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cmovent, 2)
1294 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cmovent, 2)
1295 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cmovent, 48)
1296 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_align, 2)
1297 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_align, 2)
1298 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_align, 50)
1299 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_cres, 2)
1300 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_cres, 2)
1301 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_cres, 52)
1302 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_exetyp, 1)
1303 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_exetyp, 1)
1304 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_exetyp, 54)
1305 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1306 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_flagsothers, 1)
1307 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_flagsothers, 55)
1308 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1309 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_pretthunks, 2)
1310 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_pretthunks, 56)
1311 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1312 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_psegrefbytes, 2)
1313 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_psegrefbytes, 58)
1314 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_swaparea, 2)
1315 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_swaparea, 2)
1316 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_swaparea, 60)
1317 TEST_FIELD_SIZE (IMAGE_OS2_HEADER, ne_expver, 2)
1318 TEST_FIELD_ALIGN (IMAGE_OS2_HEADER, ne_expver, 2)
1319 TEST_FIELD_OFFSET(IMAGE_OS2_HEADER, ne_expver, 62)
1320 }
1321
1322 static void test_pack_IMAGE_RELOCATION(void)
1323 {
1324 /* IMAGE_RELOCATION (pack 2) */
1325 }
1326
1327 static void test_pack_IMAGE_RESOURCE_DATA_ENTRY(void)
1328 {
1329 /* IMAGE_RESOURCE_DATA_ENTRY */
1330 TEST_TYPE_SIZE (IMAGE_RESOURCE_DATA_ENTRY, 16)
1331 TEST_TYPE_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, 4)
1332 TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1333 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 4)
1334 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, OffsetToData, 0)
1335 TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1336 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1337 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Size, 4)
1338 TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
1339 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, CodePage, 4)
1340 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, CodePage, 8)
1341 TEST_FIELD_SIZE (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
1342 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DATA_ENTRY, Reserved, 4)
1343 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DATA_ENTRY, Reserved, 12)
1344 }
1345
1346 static void test_pack_IMAGE_RESOURCE_DIRECTORY(void)
1347 {
1348 /* IMAGE_RESOURCE_DIRECTORY */
1349 TEST_TYPE_SIZE (IMAGE_RESOURCE_DIRECTORY, 16)
1350 TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIRECTORY, 4)
1351 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1352 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, Characteristics, 4)
1353 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, Characteristics, 0)
1354 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1355 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1356 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, TimeDateStamp, 4)
1357 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
1358 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MajorVersion, 2)
1359 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MajorVersion, 8)
1360 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
1361 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, MinorVersion, 2)
1362 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, MinorVersion, 10)
1363 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1364 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 2)
1365 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfNamedEntries, 12)
1366 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1367 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 2)
1368 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY, NumberOfIdEntries, 14)
1369 }
1370
1371 static void test_pack_IMAGE_RESOURCE_DIRECTORY_ENTRY(void)
1372 {
1373 /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
1374 }
1375
1376 static void test_pack_IMAGE_RESOURCE_DIRECTORY_STRING(void)
1377 {
1378 /* IMAGE_RESOURCE_DIRECTORY_STRING */
1379 TEST_TYPE_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, 4)
1380 TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, 2)
1381 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
1382 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, Length, 2)
1383 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, Length, 0)
1384 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
1385 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 1)
1386 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIRECTORY_STRING, NameString, 2)
1387 }
1388
1389 static void test_pack_IMAGE_RESOURCE_DIR_STRING_U(void)
1390 {
1391 /* IMAGE_RESOURCE_DIR_STRING_U */
1392 TEST_TYPE_SIZE (IMAGE_RESOURCE_DIR_STRING_U, 4)
1393 TEST_TYPE_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, 2)
1394 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
1395 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, Length, 2)
1396 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, Length, 0)
1397 TEST_FIELD_SIZE (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1398 TEST_FIELD_ALIGN (IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1399 TEST_FIELD_OFFSET(IMAGE_RESOURCE_DIR_STRING_U, NameString, 2)
1400 }
1401
1402 static void test_pack_IMAGE_SECTION_HEADER(void)
1403 {
1404 /* IMAGE_SECTION_HEADER */
1405 TEST_FIELD_SIZE (IMAGE_SECTION_HEADER, Name, 8)
1406 TEST_FIELD_ALIGN (IMAGE_SECTION_HEADER, Name, 1)
1407 TEST_FIELD_OFFSET(IMAGE_SECTION_HEADER, Name, 0)
1408 }
1409
1410 static void test_pack_IMAGE_SEPARATE_DEBUG_HEADER(void)
1411 {
1412 /* IMAGE_SEPARATE_DEBUG_HEADER */
1413 TEST_TYPE_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, 48)
1414 TEST_TYPE_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, 4)
1415 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
1416 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Signature, 2)
1417 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Signature, 0)
1418 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1419 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1420 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Flags, 2)
1421 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
1422 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Machine, 2)
1423 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Machine, 4)
1424 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1425 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 2)
1426 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Characteristics, 6)
1427 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1428 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 4)
1429 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, TimeDateStamp, 8)
1430 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
1431 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 4)
1432 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, CheckSum, 12)
1433 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
1434 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 4)
1435 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ImageBase, 16)
1436 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
1437 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 4)
1438 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SizeOfImage, 20)
1439 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1440 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 4)
1441 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, NumberOfSections, 24)
1442 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1443 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 4)
1444 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, ExportedNamesSize, 28)
1445 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1446 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 4)
1447 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, DebugDirectorySize, 32)
1448 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1449 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 4)
1450 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, SectionAlignment, 36)
1451 TEST_FIELD_SIZE (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 8)
1452 TEST_FIELD_ALIGN (IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 4)
1453 TEST_FIELD_OFFSET(IMAGE_SEPARATE_DEBUG_HEADER, Reserved, 40)
1454 }
1455
1456 static void test_pack_IMAGE_SYMBOL(void)
1457 {
1458 /* IMAGE_SYMBOL (pack 2) */
1459 }
1460
1461 static void test_pack_IMAGE_THUNK_DATA(void)
1462 {
1463 /* IMAGE_THUNK_DATA */
1464 }
1465
1466 static void test_pack_IMAGE_TLS_DIRECTORY(void)
1467 {
1468 /* IMAGE_TLS_DIRECTORY */
1469 TEST_TYPE_SIZE (IMAGE_TLS_DIRECTORY, 40)
1470 TEST_TYPE_ALIGN (IMAGE_TLS_DIRECTORY, 8)
1471 }
1472
1473 static void test_pack_IMAGE_TLS_DIRECTORY32(void)
1474 {
1475 /* IMAGE_TLS_DIRECTORY32 */
1476 TEST_TYPE_SIZE (IMAGE_TLS_DIRECTORY32, 24)
1477 TEST_TYPE_ALIGN (IMAGE_TLS_DIRECTORY32, 4)
1478 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1479 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 4)
1480 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, StartAddressOfRawData, 0)
1481 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1482 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1483 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, EndAddressOfRawData, 4)
1484 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1485 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfIndex, 4)
1486 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfIndex, 8)
1487 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1488 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 4)
1489 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, AddressOfCallBacks, 12)
1490 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1491 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 4)
1492 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, SizeOfZeroFill, 16)
1493 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1494 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY32, Characteristics, 4)
1495 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY32, Characteristics, 20)
1496 }
1497
1498 static void test_pack_IMAGE_TLS_DIRECTORY64(void)
1499 {
1500 /* IMAGE_TLS_DIRECTORY64 */
1501 TEST_TYPE_SIZE (IMAGE_TLS_DIRECTORY64, 40)
1502 TEST_TYPE_ALIGN (IMAGE_TLS_DIRECTORY64, 8)
1503 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1504 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 8)
1505 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, StartAddressOfRawData, 0)
1506 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1507 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1508 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, EndAddressOfRawData, 8)
1509 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1510 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfIndex, 8)
1511 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfIndex, 16)
1512 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1513 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 8)
1514 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, AddressOfCallBacks, 24)
1515 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1516 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 4)
1517 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, SizeOfZeroFill, 32)
1518 TEST_FIELD_SIZE (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1519 TEST_FIELD_ALIGN (IMAGE_TLS_DIRECTORY64, Characteristics, 4)
1520 TEST_FIELD_OFFSET(IMAGE_TLS_DIRECTORY64, Characteristics, 36)
1521 }
1522
1523 static void test_pack_IMAGE_VXD_HEADER(void)
1524 {
1525 /* IMAGE_VXD_HEADER (pack 2) */
1526 TEST_TYPE_SIZE (IMAGE_VXD_HEADER, 196)
1527 TEST_TYPE_ALIGN (IMAGE_VXD_HEADER, 2)
1528 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_magic, 2)
1529 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_magic, 2)
1530 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_magic, 0)
1531 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_border, 1)
1532 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_border, 1)
1533 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_border, 2)
1534 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_worder, 1)
1535 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_worder, 1)
1536 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_worder, 3)
1537 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_level, 4)
1538 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_level, 2)
1539 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_level, 4)
1540 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cpu, 2)
1541 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cpu, 2)
1542 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cpu, 8)
1543 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_os, 2)
1544 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_os, 2)
1545 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_os, 10)
1546 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ver, 4)
1547 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ver, 2)
1548 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ver, 12)
1549 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mflags, 4)
1550 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mflags, 2)
1551 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mflags, 16)
1552 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_mpages, 4)
1553 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_mpages, 2)
1554 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_mpages, 20)
1555 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_startobj, 4)
1556 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_startobj, 2)
1557 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_startobj, 24)
1558 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_eip, 4)
1559 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_eip, 2)
1560 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_eip, 28)
1561 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_stackobj, 4)
1562 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_stackobj, 2)
1563 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_stackobj, 32)
1564 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_esp, 4)
1565 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_esp, 2)
1566 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_esp, 36)
1567 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesize, 4)
1568 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesize, 2)
1569 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesize, 40)
1570 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_lastpagesize, 4)
1571 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_lastpagesize, 2)
1572 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_lastpagesize, 44)
1573 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsize, 4)
1574 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsize, 2)
1575 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsize, 48)
1576 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fixupsum, 4)
1577 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fixupsum, 2)
1578 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fixupsum, 52)
1579 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsize, 4)
1580 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsize, 2)
1581 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsize, 56)
1582 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ldrsum, 4)
1583 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ldrsum, 2)
1584 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ldrsum, 60)
1585 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objtab, 4)
1586 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objtab, 2)
1587 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objtab, 64)
1588 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objcnt, 4)
1589 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objcnt, 2)
1590 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objcnt, 68)
1591 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_objmap, 4)
1592 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_objmap, 2)
1593 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_objmap, 72)
1594 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_itermap, 4)
1595 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_itermap, 2)
1596 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_itermap, 76)
1597 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrctab, 4)
1598 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrctab, 2)
1599 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrctab, 80)
1600 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_rsrccnt, 4)
1601 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_rsrccnt, 2)
1602 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_rsrccnt, 84)
1603 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_restab, 4)
1604 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_restab, 2)
1605 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_restab, 88)
1606 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_enttab, 4)
1607 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_enttab, 2)
1608 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_enttab, 92)
1609 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dirtab, 4)
1610 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dirtab, 2)
1611 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dirtab, 96)
1612 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_dircnt, 4)
1613 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_dircnt, 2)
1614 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_dircnt, 100)
1615 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_fpagetab, 4)
1616 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_fpagetab, 2)
1617 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_fpagetab, 104)
1618 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_frectab, 4)
1619 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_frectab, 2)
1620 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_frectab, 108)
1621 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmod, 4)
1622 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmod, 2)
1623 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmod, 112)
1624 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impmodcnt, 4)
1625 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impmodcnt, 2)
1626 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impmodcnt, 116)
1627 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_impproc, 4)
1628 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_impproc, 2)
1629 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_impproc, 120)
1630 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_pagesum, 4)
1631 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_pagesum, 2)
1632 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_pagesum, 124)
1633 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_datapage, 4)
1634 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_datapage, 2)
1635 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_datapage, 128)
1636 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_preload, 4)
1637 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_preload, 2)
1638 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_preload, 132)
1639 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nrestab, 4)
1640 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nrestab, 2)
1641 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nrestab, 136)
1642 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_cbnrestab, 4)
1643 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_cbnrestab, 2)
1644 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_cbnrestab, 140)
1645 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_nressum, 4)
1646 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_nressum, 2)
1647 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_nressum, 144)
1648 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_autodata, 4)
1649 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_autodata, 2)
1650 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_autodata, 148)
1651 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuginfo, 4)
1652 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuginfo, 2)
1653 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuginfo, 152)
1654 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_debuglen, 4)
1655 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_debuglen, 2)
1656 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_debuglen, 156)
1657 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instpreload, 4)
1658 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instpreload, 2)
1659 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instpreload, 160)
1660 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_instdemand, 4)
1661 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_instdemand, 2)
1662 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_instdemand, 164)
1663 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_heapsize, 4)
1664 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_heapsize, 2)
1665 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_heapsize, 168)
1666 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_res3, 12)
1667 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_res3, 1)
1668 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_res3, 172)
1669 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winresoff, 4)
1670 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winresoff, 2)
1671 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winresoff, 184)
1672 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_winreslen, 4)
1673 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_winreslen, 2)
1674 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_winreslen, 188)
1675 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_devid, 2)
1676 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_devid, 2)
1677 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_devid, 192)
1678 TEST_FIELD_SIZE (IMAGE_VXD_HEADER, e32_ddkver, 2)
1679 TEST_FIELD_ALIGN (IMAGE_VXD_HEADER, e32_ddkver, 2)
1680 TEST_FIELD_OFFSET(IMAGE_VXD_HEADER, e32_ddkver, 194)
1681 }
1682
1683 static void test_pack_IO_COUNTERS(void)
1684 {
1685 /* IO_COUNTERS (pack 8) */
1686 TEST_TYPE_SIZE (IO_COUNTERS, 48)
1687 TEST_TYPE_ALIGN (IO_COUNTERS, 8)
1688 TEST_FIELD_SIZE (IO_COUNTERS, ReadOperationCount, 8)
1689 TEST_FIELD_ALIGN (IO_COUNTERS, ReadOperationCount, 8)
1690 TEST_FIELD_OFFSET(IO_COUNTERS, ReadOperationCount, 0)
1691 TEST_FIELD_SIZE (IO_COUNTERS, WriteOperationCount, 8)
1692 TEST_FIELD_ALIGN (IO_COUNTERS, WriteOperationCount, 8)
1693 TEST_FIELD_OFFSET(IO_COUNTERS, WriteOperationCount, 8)
1694 TEST_FIELD_SIZE (IO_COUNTERS, OtherOperationCount, 8)
1695 TEST_FIELD_ALIGN (IO_COUNTERS, OtherOperationCount, 8)
1696 TEST_FIELD_OFFSET(IO_COUNTERS, OtherOperationCount, 16)
1697 TEST_FIELD_SIZE (IO_COUNTERS, ReadTransferCount, 8)
1698 TEST_FIELD_ALIGN (IO_COUNTERS, ReadTransferCount, 8)
1699 TEST_FIELD_OFFSET(IO_COUNTERS, ReadTransferCount, 24)
1700 TEST_FIELD_SIZE (IO_COUNTERS, WriteTransferCount, 8)
1701 TEST_FIELD_ALIGN (IO_COUNTERS, WriteTransferCount, 8)
1702 TEST_FIELD_OFFSET(IO_COUNTERS, WriteTransferCount, 32)
1703 TEST_FIELD_SIZE (IO_COUNTERS, OtherTransferCount, 8)
1704 TEST_FIELD_ALIGN (IO_COUNTERS, OtherTransferCount, 8)
1705 TEST_FIELD_OFFSET(IO_COUNTERS, OtherTransferCount, 40)
1706 }
1707
1708 static void test_pack_LANGID(void)
1709 {
1710 /* LANGID */
1711 TEST_TYPE_SIZE (LANGID, 2)
1712 TEST_TYPE_ALIGN (LANGID, 2)
1713 TEST_TYPE_UNSIGNED(LANGID)
1714 }
1715
1716 static void test_pack_LARGE_INTEGER(void)
1717 {
1718 /* LARGE_INTEGER */
1719 }
1720
1721 static void test_pack_LCID(void)
1722 {
1723 /* LCID */
1724 TEST_TYPE_SIZE (LCID, 4)
1725 TEST_TYPE_ALIGN (LCID, 4)
1726 TEST_TYPE_UNSIGNED(LCID)
1727 }
1728
1729 static void test_pack_LIST_ENTRY(void)
1730 {
1731 /* LIST_ENTRY */
1732 TEST_TYPE_SIZE (LIST_ENTRY, 16)
1733 TEST_TYPE_ALIGN (LIST_ENTRY, 8)
1734 TEST_FIELD_SIZE (LIST_ENTRY, Flink, 8)
1735 TEST_FIELD_ALIGN (LIST_ENTRY, Flink, 8)
1736 TEST_FIELD_OFFSET(LIST_ENTRY, Flink, 0)
1737 TEST_FIELD_SIZE (LIST_ENTRY, Blink, 8)
1738 TEST_FIELD_ALIGN (LIST_ENTRY, Blink, 8)
1739 TEST_FIELD_OFFSET(LIST_ENTRY, Blink, 8)
1740 }
1741
1742 static void test_pack_LONG(void)
1743 {
1744 /* LONG */
1745 TEST_TYPE_SIZE (LONG, 4)
1746 TEST_TYPE_ALIGN (LONG, 4)
1747 TEST_TYPE_SIGNED(LONG)
1748 }
1749
1750 static void test_pack_LONGLONG(void)
1751 {
1752 /* LONGLONG */
1753 TEST_TYPE_SIZE (LONGLONG, 8)
1754 TEST_TYPE_ALIGN (LONGLONG, 8)
1755 TEST_TYPE_SIGNED(LONGLONG)
1756 }
1757
1758 static void test_pack_LUID(void)
1759 {
1760 /* LUID */
1761 TEST_TYPE_SIZE (LUID, 8)
1762 TEST_TYPE_ALIGN (LUID, 4)
1763 TEST_FIELD_SIZE (LUID, LowPart, 4)
1764 TEST_FIELD_ALIGN (LUID, LowPart, 4)
1765 TEST_FIELD_OFFSET(LUID, LowPart, 0)
1766 TEST_FIELD_SIZE (LUID, HighPart, 4)
1767 TEST_FIELD_ALIGN (LUID, HighPart, 4)
1768 TEST_FIELD_OFFSET(LUID, HighPart, 4)
1769 }
1770
1771 static void test_pack_LUID_AND_ATTRIBUTES(void)
1772 {
1773 /* LUID_AND_ATTRIBUTES (pack 4) */
1774 TEST_TYPE_SIZE (LUID_AND_ATTRIBUTES, 12)
1775 TEST_TYPE_ALIGN (LUID_AND_ATTRIBUTES, 4)
1776 TEST_FIELD_SIZE (LUID_AND_ATTRIBUTES, Luid, 8)
1777 TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Luid, 4)
1778 TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Luid, 0)
1779 TEST_FIELD_SIZE (LUID_AND_ATTRIBUTES, Attributes, 4)
1780 TEST_FIELD_ALIGN (LUID_AND_ATTRIBUTES, Attributes, 4)
1781 TEST_FIELD_OFFSET(LUID_AND_ATTRIBUTES, Attributes, 8)
1782 }
1783
1784 static void test_pack_MEMORY_BASIC_INFORMATION(void)
1785 {
1786 /* MEMORY_BASIC_INFORMATION */
1787 TEST_TYPE_SIZE (MEMORY_BASIC_INFORMATION, 48)
1788 TEST_TYPE_ALIGN (MEMORY_BASIC_INFORMATION, 8)
1789 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, BaseAddress, 8)
1790 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, BaseAddress, 8)
1791 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, BaseAddress, 0)
1792 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1793 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1794 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationBase, 8)
1795 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1796 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, AllocationProtect, 4)
1797 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, AllocationProtect, 16)
1798 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, RegionSize, 8)
1799 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, RegionSize, 8)
1800 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, RegionSize, 24)
1801 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, State, 4)
1802 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, State, 4)
1803 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, State, 32)
1804 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, Protect, 4)
1805 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Protect, 4)
1806 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Protect, 36)
1807 TEST_FIELD_SIZE (MEMORY_BASIC_INFORMATION, Type, 4)
1808 TEST_FIELD_ALIGN (MEMORY_BASIC_INFORMATION, Type, 4)
1809 TEST_FIELD_OFFSET(MEMORY_BASIC_INFORMATION, Type, 40)
1810 }
1811
1812 static void test_pack_MESSAGE_RESOURCE_BLOCK(void)
1813 {
1814 /* MESSAGE_RESOURCE_BLOCK */
1815 TEST_TYPE_SIZE (MESSAGE_RESOURCE_BLOCK, 12)
1816 TEST_TYPE_ALIGN (MESSAGE_RESOURCE_BLOCK, 4)
1817 TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, LowId, 4)
1818 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, LowId, 4)
1819 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, LowId, 0)
1820 TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, HighId, 4)
1821 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, HighId, 4)
1822 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, HighId, 4)
1823 TEST_FIELD_SIZE (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1824 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 4)
1825 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_BLOCK, OffsetToEntries, 8)
1826 }
1827
1828 static void test_pack_MESSAGE_RESOURCE_DATA(void)
1829 {
1830 /* MESSAGE_RESOURCE_DATA */
1831 TEST_TYPE_SIZE (MESSAGE_RESOURCE_DATA, 16)
1832 TEST_TYPE_ALIGN (MESSAGE_RESOURCE_DATA, 4)
1833 TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1834 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, NumberOfBlocks, 4)
1835 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, NumberOfBlocks, 0)
1836 TEST_FIELD_SIZE (MESSAGE_RESOURCE_DATA, Blocks, 12)
1837 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_DATA, Blocks, 4)
1838 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_DATA, Blocks, 4)
1839 }
1840
1841 static void test_pack_MESSAGE_RESOURCE_ENTRY(void)
1842 {
1843 /* MESSAGE_RESOURCE_ENTRY */
1844 TEST_TYPE_SIZE (MESSAGE_RESOURCE_ENTRY, 6)
1845 TEST_TYPE_ALIGN (MESSAGE_RESOURCE_ENTRY, 2)
1846 TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Length, 2)
1847 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Length, 2)
1848 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Length, 0)
1849 TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Flags, 2)
1850 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Flags, 2)
1851 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Flags, 2)
1852 TEST_FIELD_SIZE (MESSAGE_RESOURCE_ENTRY, Text, 1)
1853 TEST_FIELD_ALIGN (MESSAGE_RESOURCE_ENTRY, Text, 1)
1854 TEST_FIELD_OFFSET(MESSAGE_RESOURCE_ENTRY, Text, 4)
1855 }
1856
1857 static void test_pack_NT_TIB(void)
1858 {
1859 /* NT_TIB */
1860 TEST_FIELD_SIZE (NT_TIB, ExceptionList, 8)
1861 TEST_FIELD_ALIGN (NT_TIB, ExceptionList, 8)
1862 TEST_FIELD_OFFSET(NT_TIB, ExceptionList, 0)
1863 TEST_FIELD_SIZE (NT_TIB, StackBase, 8)
1864 TEST_FIELD_ALIGN (NT_TIB, StackBase, 8)
1865 TEST_FIELD_OFFSET(NT_TIB, StackBase, 8)
1866 TEST_FIELD_SIZE (NT_TIB, StackLimit, 8)
1867 TEST_FIELD_ALIGN (NT_TIB, StackLimit, 8)
1868 TEST_FIELD_OFFSET(NT_TIB, StackLimit, 16)
1869 TEST_FIELD_SIZE (NT_TIB, SubSystemTib, 8)
1870 TEST_FIELD_ALIGN (NT_TIB, SubSystemTib, 8)
1871 TEST_FIELD_OFFSET(NT_TIB, SubSystemTib, 24)
1872 }
1873
1874 static void test_pack_OBJECT_TYPE_LIST(void)
1875 {
1876 /* OBJECT_TYPE_LIST */
1877 TEST_TYPE_SIZE (OBJECT_TYPE_LIST, 16)
1878 TEST_TYPE_ALIGN (OBJECT_TYPE_LIST, 8)
1879 TEST_FIELD_SIZE (OBJECT_TYPE_LIST, Level, 2)
1880 TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Level, 2)
1881 TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Level, 0)
1882 TEST_FIELD_SIZE (OBJECT_TYPE_LIST, Sbz, 2)
1883 TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, Sbz, 2)
1884 TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, Sbz, 2)
1885 TEST_FIELD_SIZE (OBJECT_TYPE_LIST, ObjectType, 8)
1886 TEST_FIELD_ALIGN (OBJECT_TYPE_LIST, ObjectType, 8)
1887 TEST_FIELD_OFFSET(OBJECT_TYPE_LIST, ObjectType, 8)
1888 }
1889
1890 static void test_pack_PACCESS_ALLOWED_ACE(void)
1891 {
1892 /* PACCESS_ALLOWED_ACE */
1893 TEST_TYPE_SIZE (PACCESS_ALLOWED_ACE, 8)
1894 TEST_TYPE_ALIGN (PACCESS_ALLOWED_ACE, 8)
1895 TEST_TARGET_SIZE (PACCESS_ALLOWED_ACE, 12)
1896 TEST_TARGET_ALIGN(PACCESS_ALLOWED_ACE, 4)
1897 }
1898
1899 static void test_pack_PACCESS_DENIED_ACE(void)
1900 {
1901 /* PACCESS_DENIED_ACE */
1902 TEST_TYPE_SIZE (PACCESS_DENIED_ACE, 8)
1903 TEST_TYPE_ALIGN (PACCESS_DENIED_ACE, 8)
1904 TEST_TARGET_SIZE (PACCESS_DENIED_ACE, 12)
1905 TEST_TARGET_ALIGN(PACCESS_DENIED_ACE, 4)
1906 }
1907
1908 static void test_pack_PACCESS_TOKEN(void)
1909 {
1910 /* PACCESS_TOKEN */
1911 TEST_TYPE_SIZE (PACCESS_TOKEN, 8)
1912 TEST_TYPE_ALIGN (PACCESS_TOKEN, 8)
1913 }
1914
1915 static void test_pack_PACE_HEADER(void)
1916 {
1917 /* PACE_HEADER */
1918 TEST_TYPE_SIZE (PACE_HEADER, 8)
1919 TEST_TYPE_ALIGN (PACE_HEADER, 8)
1920 TEST_TARGET_SIZE (PACE_HEADER, 4)
1921 TEST_TARGET_ALIGN(PACE_HEADER, 2)
1922 }
1923
1924 static void test_pack_PACL(void)
1925 {
1926 /* PACL */
1927 TEST_TYPE_SIZE (PACL, 8)
1928 TEST_TYPE_ALIGN (PACL, 8)
1929 TEST_TARGET_SIZE (PACL, 8)
1930 TEST_TARGET_ALIGN(PACL, 2)
1931 }
1932
1933 static void test_pack_PACL_REVISION_INFORMATION(void)
1934 {
1935 /* PACL_REVISION_INFORMATION */
1936 TEST_TYPE_SIZE (PACL_REVISION_INFORMATION, 8)
1937 TEST_TYPE_ALIGN (PACL_REVISION_INFORMATION, 8)
1938 TEST_TARGET_SIZE (PACL_REVISION_INFORMATION, 4)
1939 TEST_TARGET_ALIGN(PACL_REVISION_INFORMATION, 4)
1940 }
1941
1942 static void test_pack_PACL_SIZE_INFORMATION(void)
1943 {
1944 /* PACL_SIZE_INFORMATION */
1945 TEST_TYPE_SIZE (PACL_SIZE_INFORMATION, 8)
1946 TEST_TYPE_ALIGN (PACL_SIZE_INFORMATION, 8)
1947 TEST_TARGET_SIZE (PACL_SIZE_INFORMATION, 12)
1948 TEST_TARGET_ALIGN(PACL_SIZE_INFORMATION, 4)
1949 }
1950
1951 static void test_pack_PCCH(void)
1952 {
1953 /* PCCH */
1954 TEST_TYPE_SIZE (PCCH, 8)
1955 TEST_TYPE_ALIGN (PCCH, 8)
1956 TEST_TARGET_SIZE (PCCH, 1)
1957 TEST_TARGET_ALIGN(PCCH, 1)
1958 }
1959
1960 static void test_pack_PCH(void)
1961 {
1962 /* PCH */
1963 TEST_TYPE_SIZE (PCH, 8)
1964 TEST_TYPE_ALIGN (PCH, 8)
1965 TEST_TARGET_SIZE (PCH, 1)
1966 TEST_TARGET_ALIGN(PCH, 1)
1967 }
1968
1969 static void test_pack_PCSTR(void)
1970 {
1971 /* PCSTR */
1972 TEST_TYPE_SIZE (PCSTR, 8)
1973 TEST_TYPE_ALIGN (PCSTR, 8)
1974 TEST_TARGET_SIZE (PCSTR, 1)
1975 TEST_TARGET_ALIGN(PCSTR, 1)
1976 }
1977
1978 static void test_pack_PCWCH(void)
1979 {
1980 /* PCWCH */
1981 TEST_TYPE_SIZE (PCWCH, 8)
1982 TEST_TYPE_ALIGN (PCWCH, 8)
1983 TEST_TARGET_SIZE (PCWCH, 2)
1984 TEST_TARGET_ALIGN(PCWCH, 2)
1985 }
1986
1987 static void test_pack_PCWSTR(void)
1988 {
1989 /* PCWSTR */
1990 TEST_TYPE_SIZE (PCWSTR, 8)
1991 TEST_TYPE_ALIGN (PCWSTR, 8)
1992 TEST_TARGET_SIZE (PCWSTR, 2)
1993 TEST_TARGET_ALIGN(PCWSTR, 2)
1994 }
1995
1996 static void test_pack_PEXCEPTION_POINTERS(void)
1997 {
1998 /* PEXCEPTION_POINTERS */
1999 TEST_TYPE_SIZE (PEXCEPTION_POINTERS, 8)
2000 TEST_TYPE_ALIGN (PEXCEPTION_POINTERS, 8)
2001 TEST_TARGET_SIZE (PEXCEPTION_POINTERS, 16)
2002 TEST_TARGET_ALIGN(PEXCEPTION_POINTERS, 8)
2003 }
2004
2005 static void test_pack_PEXCEPTION_RECORD(void)
2006 {
2007 /* PEXCEPTION_RECORD */
2008 TEST_TYPE_SIZE (PEXCEPTION_RECORD, 8)
2009 TEST_TYPE_ALIGN (PEXCEPTION_RECORD, 8)
2010 TEST_TARGET_SIZE (PEXCEPTION_RECORD, 152)
2011 TEST_TARGET_ALIGN(PEXCEPTION_RECORD, 8)
2012 }
2013
2014 static void test_pack_PFPO_DATA(void)
2015 {
2016 /* PFPO_DATA */
2017 TEST_TYPE_SIZE (PFPO_DATA, 8)
2018 TEST_TYPE_ALIGN (PFPO_DATA, 8)
2019 TEST_TARGET_SIZE (PFPO_DATA, 16)
2020 TEST_TARGET_ALIGN(PFPO_DATA, 4)
2021 }
2022
2023 static void test_pack_PGENERIC_MAPPING(void)
2024 {
2025 /* PGENERIC_MAPPING */
2026 TEST_TYPE_SIZE (PGENERIC_MAPPING, 8)
2027 TEST_TYPE_ALIGN (PGENERIC_MAPPING, 8)
2028 TEST_TARGET_SIZE (PGENERIC_MAPPING, 16)
2029 TEST_TARGET_ALIGN(PGENERIC_MAPPING, 4)
2030 }
2031
2032 static void test_pack_PHANDLE(void)
2033 {
2034 /* PHANDLE */
2035 TEST_TYPE_SIZE (PHANDLE, 8)
2036 TEST_TYPE_ALIGN (PHANDLE, 8)
2037 TEST_TARGET_SIZE (PHANDLE, 8)
2038 TEST_TARGET_ALIGN(PHANDLE, 8)
2039 }
2040
2041 static void test_pack_PIMAGE_ARCHIVE_MEMBER_HEADER(void)
2042 {
2043 /* PIMAGE_ARCHIVE_MEMBER_HEADER */
2044 TEST_TYPE_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 8)
2045 TEST_TYPE_ALIGN (PIMAGE_ARCHIVE_MEMBER_HEADER, 8)
2046 TEST_TARGET_SIZE (PIMAGE_ARCHIVE_MEMBER_HEADER, 60)
2047 TEST_TARGET_ALIGN(PIMAGE_ARCHIVE_MEMBER_HEADER, 1)
2048 }
2049
2050 static void test_pack_PIMAGE_AUX_SYMBOL(void)
2051 {
2052 /* PIMAGE_AUX_SYMBOL */
2053 TEST_TYPE_SIZE (PIMAGE_AUX_SYMBOL, 8)
2054 TEST_TYPE_ALIGN (PIMAGE_AUX_SYMBOL, 8)
2055 }
2056
2057 static void test_pack_PIMAGE_BASE_RELOCATION(void)
2058 {
2059 /* PIMAGE_BASE_RELOCATION */
2060 TEST_TYPE_SIZE (PIMAGE_BASE_RELOCATION, 8)
2061 TEST_TYPE_ALIGN (PIMAGE_BASE_RELOCATION, 8)
2062 TEST_TARGET_SIZE (PIMAGE_BASE_RELOCATION, 8)
2063 TEST_TARGET_ALIGN(PIMAGE_BASE_RELOCATION, 4)
2064 }
2065
2066 static void test_pack_PIMAGE_BOUND_FORWARDER_REF(void)
2067 {
2068 /* PIMAGE_BOUND_FORWARDER_REF */
2069 TEST_TYPE_SIZE (PIMAGE_BOUND_FORWARDER_REF, 8)
2070 TEST_TYPE_ALIGN (PIMAGE_BOUND_FORWARDER_REF, 8)
2071 TEST_TARGET_SIZE (PIMAGE_BOUND_FORWARDER_REF, 8)
2072 TEST_TARGET_ALIGN(PIMAGE_BOUND_FORWARDER_REF, 4)
2073 }
2074
2075 static void test_pack_PIMAGE_BOUND_IMPORT_DESCRIPTOR(void)
2076 {
2077 /* PIMAGE_BOUND_IMPORT_DESCRIPTOR */
2078 TEST_TYPE_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2079 TEST_TYPE_ALIGN (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2080 TEST_TARGET_SIZE (PIMAGE_BOUND_IMPORT_DESCRIPTOR, 8)
2081 TEST_TARGET_ALIGN(PIMAGE_BOUND_IMPORT_DESCRIPTOR, 4)
2082 }
2083
2084 static void test_pack_PIMAGE_COFF_SYMBOLS_HEADER(void)
2085 {
2086 /* PIMAGE_COFF_SYMBOLS_HEADER */
2087 TEST_TYPE_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 8)
2088 TEST_TYPE_ALIGN (PIMAGE_COFF_SYMBOLS_HEADER, 8)
2089 TEST_TARGET_SIZE (PIMAGE_COFF_SYMBOLS_HEADER, 32)
2090 TEST_TARGET_ALIGN(PIMAGE_COFF_SYMBOLS_HEADER, 4)
2091 }
2092
2093 static void test_pack_PIMAGE_DATA_DIRECTORY(void)
2094 {
2095 /* PIMAGE_DATA_DIRECTORY */
2096 TEST_TYPE_SIZE (PIMAGE_DATA_DIRECTORY, 8)
2097 TEST_TYPE_ALIGN (PIMAGE_DATA_DIRECTORY, 8)
2098 TEST_TARGET_SIZE (PIMAGE_DATA_DIRECTORY, 8)
2099 TEST_TARGET_ALIGN(PIMAGE_DATA_DIRECTORY, 4)
2100 }
2101
2102 static void test_pack_PIMAGE_DEBUG_DIRECTORY(void)
2103 {
2104 /* PIMAGE_DEBUG_DIRECTORY */
2105 TEST_TYPE_SIZE (PIMAGE_DEBUG_DIRECTORY, 8)
2106 TEST_TYPE_ALIGN (PIMAGE_DEBUG_DIRECTORY, 8)
2107 TEST_TARGET_SIZE (PIMAGE_DEBUG_DIRECTORY, 28)
2108 TEST_TARGET_ALIGN(PIMAGE_DEBUG_DIRECTORY, 4)
2109 }
2110
2111 static void test_pack_PIMAGE_DEBUG_MISC(void)
2112 {
2113 /* PIMAGE_DEBUG_MISC */
2114 TEST_TYPE_SIZE (PIMAGE_DEBUG_MISC, 8)
2115 TEST_TYPE_ALIGN (PIMAGE_DEBUG_MISC, 8)
2116 TEST_TARGET_SIZE (PIMAGE_DEBUG_MISC, 16)
2117 TEST_TARGET_ALIGN(PIMAGE_DEBUG_MISC, 4)
2118 }
2119
2120 static void test_pack_PIMAGE_DOS_HEADER(void)
2121 {
2122 /* PIMAGE_DOS_HEADER */
2123 TEST_TYPE_SIZE (PIMAGE_DOS_HEADER, 8)
2124 TEST_TYPE_ALIGN (PIMAGE_DOS_HEADER, 8)
2125 TEST_TARGET_SIZE (PIMAGE_DOS_HEADER, 64)
2126 TEST_TARGET_ALIGN(PIMAGE_DOS_HEADER, 2)
2127 }
2128
2129 static void test_pack_PIMAGE_EXPORT_DIRECTORY(void)
2130 {
2131 /* PIMAGE_EXPORT_DIRECTORY */
2132 TEST_TYPE_SIZE (PIMAGE_EXPORT_DIRECTORY, 8)
2133 TEST_TYPE_ALIGN (PIMAGE_EXPORT_DIRECTORY, 8)
2134 TEST_TARGET_SIZE (PIMAGE_EXPORT_DIRECTORY, 40)
2135 TEST_TARGET_ALIGN(PIMAGE_EXPORT_DIRECTORY, 4)
2136 }
2137
2138 static void test_pack_PIMAGE_FILE_HEADER(void)
2139 {
2140 /* PIMAGE_FILE_HEADER */
2141 TEST_TYPE_SIZE (PIMAGE_FILE_HEADER, 8)
2142 TEST_TYPE_ALIGN (PIMAGE_FILE_HEADER, 8)
2143 TEST_TARGET_SIZE (PIMAGE_FILE_HEADER, 20)
2144 TEST_TARGET_ALIGN(PIMAGE_FILE_HEADER, 4)
2145 }
2146
2147 static void test_pack_PIMAGE_FUNCTION_ENTRY(void)
2148 {
2149 /* PIMAGE_FUNCTION_ENTRY */
2150 TEST_TYPE_SIZE (PIMAGE_FUNCTION_ENTRY, 8)
2151 TEST_TYPE_ALIGN (PIMAGE_FUNCTION_ENTRY, 8)
2152 TEST_TARGET_SIZE (PIMAGE_FUNCTION_ENTRY, 12)
2153 TEST_TARGET_ALIGN(PIMAGE_FUNCTION_ENTRY, 4)
2154 }
2155
2156 static void test_pack_PIMAGE_IMPORT_BY_NAME(void)
2157 {
2158 /* PIMAGE_IMPORT_BY_NAME */
2159 TEST_TYPE_SIZE (PIMAGE_IMPORT_BY_NAME, 8)
2160 TEST_TYPE_ALIGN (PIMAGE_IMPORT_BY_NAME, 8)
2161 TEST_TARGET_SIZE (PIMAGE_IMPORT_BY_NAME, 4)
2162 TEST_TARGET_ALIGN(PIMAGE_IMPORT_BY_NAME, 2)
2163 }
2164
2165 static void test_pack_PIMAGE_IMPORT_DESCRIPTOR(void)
2166 {
2167 /* PIMAGE_IMPORT_DESCRIPTOR */
2168 TEST_TYPE_SIZE (PIMAGE_IMPORT_DESCRIPTOR, 8)
2169 TEST_TYPE_ALIGN (PIMAGE_IMPORT_DESCRIPTOR, 8)
2170 }
2171
2172 static void test_pack_PIMAGE_LINENUMBER(void)
2173 {
2174 /* PIMAGE_LINENUMBER */
2175 TEST_TYPE_SIZE (PIMAGE_LINENUMBER, 8)
2176 TEST_TYPE_ALIGN (PIMAGE_LINENUMBER, 8)
2177 }
2178
2179 static void test_pack_PIMAGE_LOAD_CONFIG_DIRECTORY(void)
2180 {
2181 /* PIMAGE_LOAD_CONFIG_DIRECTORY */
2182 TEST_TYPE_SIZE (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
2183 TEST_TYPE_ALIGN (PIMAGE_LOAD_CONFIG_DIRECTORY, 8)
2184 }
2185
2186 static void test_pack_PIMAGE_NT_HEADERS(void)
2187 {
2188 /* PIMAGE_NT_HEADERS */
2189 TEST_TYPE_SIZE (PIMAGE_NT_HEADERS, 8)
2190 TEST_TYPE_ALIGN (PIMAGE_NT_HEADERS, 8)
2191 }
2192
2193 static void test_pack_PIMAGE_NT_HEADERS32(void)
2194 {
2195 /* PIMAGE_NT_HEADERS32 */
2196 TEST_TYPE_SIZE (PIMAGE_NT_HEADERS32, 8)
2197 TEST_TYPE_ALIGN (PIMAGE_NT_HEADERS32, 8)
2198 TEST_TARGET_SIZE (PIMAGE_NT_HEADERS32, 248)
2199 TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS32, 4)
2200 }
2201
2202 static void test_pack_PIMAGE_NT_HEADERS64(void)
2203 {
2204 /* PIMAGE_NT_HEADERS64 */
2205 TEST_TYPE_SIZE (PIMAGE_NT_HEADERS64, 8)
2206 TEST_TYPE_ALIGN (PIMAGE_NT_HEADERS64, 8)
2207 TEST_TARGET_SIZE (PIMAGE_NT_HEADERS64, 264)
2208 TEST_TARGET_ALIGN(PIMAGE_NT_HEADERS64, 8)
2209 }
2210
2211 static void test_pack_PIMAGE_OPTIONAL_HEADER(void)
2212 {
2213 /* PIMAGE_OPTIONAL_HEADER */
2214 TEST_TYPE_SIZE (PIMAGE_OPTIONAL_HEADER, 8)
2215 TEST_TYPE_ALIGN (PIMAGE_OPTIONAL_HEADER, 8)
2216 }
2217
2218 static void test_pack_PIMAGE_OPTIONAL_HEADER32(void)
2219 {
2220 /* PIMAGE_OPTIONAL_HEADER32 */
2221 TEST_TYPE_SIZE (PIMAGE_OPTIONAL_HEADER32, 8)
2222 TEST_TYPE_ALIGN (PIMAGE_OPTIONAL_HEADER32, 8)
2223 TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER32, 224)
2224 TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER32, 4)
2225 }
2226
2227 static void test_pack_PIMAGE_OPTIONAL_HEADER64(void)
2228 {
2229 /* PIMAGE_OPTIONAL_HEADER64 */
2230 TEST_TYPE_SIZE (PIMAGE_OPTIONAL_HEADER64, 8)
2231 TEST_TYPE_ALIGN (PIMAGE_OPTIONAL_HEADER64, 8)
2232 TEST_TARGET_SIZE (PIMAGE_OPTIONAL_HEADER64, 240)
2233 TEST_TARGET_ALIGN(PIMAGE_OPTIONAL_HEADER64, 8)
2234 }
2235
2236 static void test_pack_PIMAGE_OS2_HEADER(void)
2237 {
2238 /* PIMAGE_OS2_HEADER */
2239 TEST_TYPE_SIZE (PIMAGE_OS2_HEADER, 8)
2240 TEST_TYPE_ALIGN (PIMAGE_OS2_HEADER, 8)
2241 TEST_TARGET_SIZE (PIMAGE_OS2_HEADER, 64)
2242 TEST_TARGET_ALIGN(PIMAGE_OS2_HEADER, 2)
2243 }
2244
2245 static void test_pack_PIMAGE_RELOCATION(void)
2246 {
2247 /* PIMAGE_RELOCATION */
2248 TEST_TYPE_SIZE (PIMAGE_RELOCATION, 8)
2249 TEST_TYPE_ALIGN (PIMAGE_RELOCATION, 8)
2250 }
2251
2252 static void test_pack_PIMAGE_RESOURCE_DATA_ENTRY(void)
2253 {
2254 /* PIMAGE_RESOURCE_DATA_ENTRY */
2255 TEST_TYPE_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 8)
2256 TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DATA_ENTRY, 8)
2257 TEST_TARGET_SIZE (PIMAGE_RESOURCE_DATA_ENTRY, 16)
2258 TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DATA_ENTRY, 4)
2259 }
2260
2261 static void test_pack_PIMAGE_RESOURCE_DIRECTORY(void)
2262 {
2263 /* PIMAGE_RESOURCE_DIRECTORY */
2264 TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY, 8)
2265 TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY, 8)
2266 TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY, 16)
2267 TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY, 4)
2268 }
2269
2270 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_ENTRY(void)
2271 {
2272 /* PIMAGE_RESOURCE_DIRECTORY_ENTRY */
2273 TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 8)
2274 TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY_ENTRY, 8)
2275 }
2276
2277 static void test_pack_PIMAGE_RESOURCE_DIRECTORY_STRING(void)
2278 {
2279 /* PIMAGE_RESOURCE_DIRECTORY_STRING */
2280 TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 8)
2281 TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIRECTORY_STRING, 8)
2282 TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIRECTORY_STRING, 4)
2283 TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIRECTORY_STRING, 2)
2284 }
2285
2286 static void test_pack_PIMAGE_RESOURCE_DIR_STRING_U(void)
2287 {
2288 /* PIMAGE_RESOURCE_DIR_STRING_U */
2289 TEST_TYPE_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 8)
2290 TEST_TYPE_ALIGN (PIMAGE_RESOURCE_DIR_STRING_U, 8)
2291 TEST_TARGET_SIZE (PIMAGE_RESOURCE_DIR_STRING_U, 4)
2292 TEST_TARGET_ALIGN(PIMAGE_RESOURCE_DIR_STRING_U, 2)
2293 }
2294
2295 static void test_pack_PIMAGE_SECTION_HEADER(void)
2296 {
2297 /* PIMAGE_SECTION_HEADER */
2298 TEST_TYPE_SIZE (PIMAGE_SECTION_HEADER, 8)
2299 TEST_TYPE_ALIGN (PIMAGE_SECTION_HEADER, 8)
2300 }
2301
2302 static void test_pack_PIMAGE_SEPARATE_DEBUG_HEADER(void)
2303 {
2304 /* PIMAGE_SEPARATE_DEBUG_HEADER */
2305 TEST_TYPE_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 8)
2306 TEST_TYPE_ALIGN (PIMAGE_SEPARATE_DEBUG_HEADER, 8)
2307 TEST_TARGET_SIZE (PIMAGE_SEPARATE_DEBUG_HEADER, 48)
2308 TEST_TARGET_ALIGN(PIMAGE_SEPARATE_DEBUG_HEADER, 4)
2309 }
2310
2311 static void test_pack_PIMAGE_SYMBOL(void)
2312 {
2313 /* PIMAGE_SYMBOL */
2314 TEST_TYPE_SIZE (PIMAGE_SYMBOL, 8)
2315 TEST_TYPE_ALIGN (PIMAGE_SYMBOL, 8)
2316 }
2317
2318 static void test_pack_PIMAGE_THUNK_DATA(void)
2319 {
2320 /* PIMAGE_THUNK_DATA */
2321 TEST_TYPE_SIZE (PIMAGE_THUNK_DATA, 8)
2322 TEST_TYPE_ALIGN (PIMAGE_THUNK_DATA, 8)
2323 }
2324
2325 static void test_pack_PIMAGE_TLS_CALLBACK(void)
2326 {
2327 /* PIMAGE_TLS_CALLBACK */
2328 TEST_TYPE_SIZE (PIMAGE_TLS_CALLBACK, 8)
2329 TEST_TYPE_ALIGN (PIMAGE_TLS_CALLBACK, 8)
2330 }
2331
2332 static void test_pack_PIMAGE_TLS_DIRECTORY(void)
2333 {
2334 /* PIMAGE_TLS_DIRECTORY */
2335 TEST_TYPE_SIZE (PIMAGE_TLS_DIRECTORY, 8)
2336 TEST_TYPE_ALIGN (PIMAGE_TLS_DIRECTORY, 8)
2337 }
2338
2339 static void test_pack_PIMAGE_VXD_HEADER(void)
2340 {
2341 /* PIMAGE_VXD_HEADER */
2342 TEST_TYPE_SIZE (PIMAGE_VXD_HEADER, 8)
2343 TEST_TYPE_ALIGN (PIMAGE_VXD_HEADER, 8)
2344 TEST_TARGET_SIZE (PIMAGE_VXD_HEADER, 196)
2345 TEST_TARGET_ALIGN(PIMAGE_VXD_HEADER, 2)
2346 }
2347
2348 static void test_pack_PIO_COUNTERS(void)
2349 {
2350 /* PIO_COUNTERS */
2351 TEST_TYPE_SIZE (PIO_COUNTERS, 8)
2352 TEST_TYPE_ALIGN (PIO_COUNTERS, 8)
2353 TEST_TARGET_SIZE (PIO_COUNTERS, 48)
2354 TEST_TARGET_ALIGN(PIO_COUNTERS, 8)
2355 }
2356
2357 static void test_pack_PISECURITY_DESCRIPTOR(void)
2358 {
2359 /* PISECURITY_DESCRIPTOR */
2360 TEST_TYPE_SIZE (PISECURITY_DESCRIPTOR, 8)
2361 TEST_TYPE_ALIGN (PISECURITY_DESCRIPTOR, 8)
2362 TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR, 40)
2363 TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR, 8)
2364 }
2365
2366 static void test_pack_PISECURITY_DESCRIPTOR_RELATIVE(void)
2367 {
2368 /* PISECURITY_DESCRIPTOR_RELATIVE */
2369 TEST_TYPE_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 8)
2370 TEST_TYPE_ALIGN (PISECURITY_DESCRIPTOR_RELATIVE, 8)
2371 TEST_TARGET_SIZE (PISECURITY_DESCRIPTOR_RELATIVE, 20)
2372 TEST_TARGET_ALIGN(PISECURITY_DESCRIPTOR_RELATIVE, 4)
2373 }
2374
2375 static void test_pack_PISID(void)
2376 {
2377 /* PISID */
2378 TEST_TYPE_SIZE (PISID, 8)
2379 TEST_TYPE_ALIGN (PISID, 8)
2380 TEST_TARGET_SIZE (PISID, 12)
2381 TEST_TARGET_ALIGN(PISID, 4)
2382 }
2383
2384 static void test_pack_PLARGE_INTEGER(void)
2385 {
2386 /* PLARGE_INTEGER */
2387 TEST_TYPE_SIZE (PLARGE_INTEGER, 8)
2388 TEST_TYPE_ALIGN (PLARGE_INTEGER, 8)
2389 }
2390
2391 static void test_pack_PLIST_ENTRY(void)
2392 {
2393 /* PLIST_ENTRY */
2394 TEST_TYPE_SIZE (PLIST_ENTRY, 8)
2395 TEST_TYPE_ALIGN (PLIST_ENTRY, 8)
2396 TEST_TARGET_SIZE (PLIST_ENTRY, 16)
2397 TEST_TARGET_ALIGN(PLIST_ENTRY, 8)
2398 }
2399
2400 static void test_pack_PLUID(void)
2401 {
2402 /* PLUID */
2403 TEST_TYPE_SIZE (PLUID, 8)
2404 TEST_TYPE_ALIGN (PLUID, 8)
2405 TEST_TARGET_SIZE (PLUID, 8)
2406 TEST_TARGET_ALIGN(PLUID, 4)
2407 }
2408
2409 static void test_pack_PLUID_AND_ATTRIBUTES(void)
2410 {
2411 /* PLUID_AND_ATTRIBUTES */
2412 TEST_TYPE_SIZE (PLUID_AND_ATTRIBUTES, 8)
2413 TEST_TYPE_ALIGN (PLUID_AND_ATTRIBUTES, 8)
2414 TEST_TARGET_SIZE (PLUID_AND_ATTRIBUTES, 12)
2415 TEST_TARGET_ALIGN(PLUID_AND_ATTRIBUTES, 4)
2416 }
2417
2418 static void test_pack_PMEMORY_BASIC_INFORMATION(void)
2419 {
2420 /* PMEMORY_BASIC_INFORMATION */
2421 TEST_TYPE_SIZE (PMEMORY_BASIC_INFORMATION, 8)
2422 TEST_TYPE_ALIGN (PMEMORY_BASIC_INFORMATION, 8)
2423 TEST_TARGET_SIZE (PMEMORY_BASIC_INFORMATION, 48)
2424 TEST_TARGET_ALIGN(PMEMORY_BASIC_INFORMATION, 8)
2425 }
2426
2427 static void test_pack_PMESSAGE_RESOURCE_BLOCK(void)
2428 {
2429 /* PMESSAGE_RESOURCE_BLOCK */
2430 TEST_TYPE_SIZE (PMESSAGE_RESOURCE_BLOCK, 8)
2431 TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_BLOCK, 8)
2432 TEST_TARGET_SIZE (PMESSAGE_RESOURCE_BLOCK, 12)
2433 TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_BLOCK, 4)
2434 }
2435
2436 static void test_pack_PMESSAGE_RESOURCE_DATA(void)
2437 {
2438 /* PMESSAGE_RESOURCE_DATA */
2439 TEST_TYPE_SIZE (PMESSAGE_RESOURCE_DATA, 8)
2440 TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_DATA, 8)
2441 TEST_TARGET_SIZE (PMESSAGE_RESOURCE_DATA, 16)
2442 TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_DATA, 4)
2443 }
2444
2445 static void test_pack_PMESSAGE_RESOURCE_ENTRY(void)
2446 {
2447 /* PMESSAGE_RESOURCE_ENTRY */
2448 TEST_TYPE_SIZE (PMESSAGE_RESOURCE_ENTRY, 8)
2449 TEST_TYPE_ALIGN (PMESSAGE_RESOURCE_ENTRY, 8)
2450 TEST_TARGET_SIZE (PMESSAGE_RESOURCE_ENTRY, 6)
2451 TEST_TARGET_ALIGN(PMESSAGE_RESOURCE_ENTRY, 2)
2452 }
2453
2454 static void test_pack_PNT_TIB(void)
2455 {
2456 /* PNT_TIB */
2457 TEST_TYPE_SIZE (PNT_TIB, 8)
2458 TEST_TYPE_ALIGN (PNT_TIB, 8)
2459 }
2460
2461 static void test_pack_POBJECT_TYPE_LIST(void)
2462 {
2463 /* POBJECT_TYPE_LIST */
2464 TEST_TYPE_SIZE (POBJECT_TYPE_LIST, 8)
2465 TEST_TYPE_ALIGN (POBJECT_TYPE_LIST, 8)
2466 TEST_TARGET_SIZE (POBJECT_TYPE_LIST, 16)
2467 TEST_TARGET_ALIGN(POBJECT_TYPE_LIST, 8)
2468 }
2469
2470 static void test_pack_PPRIVILEGE_SET(void)
2471 {
2472 /* PPRIVILEGE_SET */
2473 TEST_TYPE_SIZE (PPRIVILEGE_SET, 8)
2474 TEST_TYPE_ALIGN (PPRIVILEGE_SET, 8)
2475 TEST_TARGET_SIZE (PPRIVILEGE_SET, 20)
2476 TEST_TARGET_ALIGN(PPRIVILEGE_SET, 4)
2477 }
2478
2479 static void test_pack_PRIVILEGE_SET(void)
2480 {
2481 /* PRIVILEGE_SET */
2482 TEST_TYPE_SIZE (PRIVILEGE_SET, 20)
2483 TEST_TYPE_ALIGN (PRIVILEGE_SET, 4)
2484 TEST_FIELD_SIZE (PRIVILEGE_SET, PrivilegeCount, 4)
2485 TEST_FIELD_ALIGN (PRIVILEGE_SET, PrivilegeCount, 4)
2486 TEST_FIELD_OFFSET(PRIVILEGE_SET, PrivilegeCount, 0)
2487 TEST_FIELD_SIZE (PRIVILEGE_SET, Control, 4)
2488 TEST_FIELD_ALIGN (PRIVILEGE_SET, Control, 4)
2489 TEST_FIELD_OFFSET(PRIVILEGE_SET, Control, 4)
2490 TEST_FIELD_SIZE (PRIVILEGE_SET, Privilege, 12)
2491 TEST_FIELD_ALIGN (PRIVILEGE_SET, Privilege, 4)
2492 TEST_FIELD_OFFSET(PRIVILEGE_SET, Privilege, 8)
2493 }
2494
2495 static void test_pack_PRLIST_ENTRY(void)
2496 {
2497 /* PRLIST_ENTRY */
2498 TEST_TYPE_SIZE (PRLIST_ENTRY, 8)
2499 TEST_TYPE_ALIGN (PRLIST_ENTRY, 8)
2500 TEST_TARGET_SIZE (PRLIST_ENTRY, 16)
2501 TEST_TARGET_ALIGN(PRLIST_ENTRY, 8)
2502 }
2503
2504 static void test_pack_PRTL_CRITICAL_SECTION(void)
2505 {
2506 /* PRTL_CRITICAL_SECTION */
2507 TEST_TYPE_SIZE (PRTL_CRITICAL_SECTION, 8)
2508 TEST_TYPE_ALIGN (PRTL_CRITICAL_SECTION, 8)
2509 TEST_TARGET_SIZE (PRTL_CRITICAL_SECTION, 40)
2510 TEST_TARGET_ALIGN(PRTL_CRITICAL_SECTION, 8)
2511 }
2512
2513 static void test_pack_PRTL_CRITICAL_SECTION_DEBUG(void)
2514 {
2515 /* PRTL_CRITICAL_SECTION_DEBUG */
2516 TEST_TYPE_SIZE (PRTL_CRITICAL_SECTION_DEBUG, 8)
2517 TEST_TYPE_ALIGN (PRTL_CRITICAL_SECTION_DEBUG, 8)
2518 }
2519
2520 static void test_pack_PRTL_OSVERSIONINFOEXW(void)
2521 {
2522 /* PRTL_OSVERSIONINFOEXW */
2523 TEST_TYPE_SIZE (PRTL_OSVERSIONINFOEXW, 8)
2524 TEST_TYPE_ALIGN (PRTL_OSVERSIONINFOEXW, 8)
2525 TEST_TARGET_SIZE (PRTL_OSVERSIONINFOEXW, 284)
2526 TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOEXW, 4)
2527 }
2528
2529 static void test_pack_PRTL_OSVERSIONINFOW(void)
2530 {
2531 /* PRTL_OSVERSIONINFOW */
2532 TEST_TYPE_SIZE (PRTL_OSVERSIONINFOW, 8)
2533 TEST_TYPE_ALIGN (PRTL_OSVERSIONINFOW, 8)
2534 TEST_TARGET_SIZE (PRTL_OSVERSIONINFOW, 276)
2535 TEST_TARGET_ALIGN(PRTL_OSVERSIONINFOW, 4)
2536 }
2537
2538 static void test_pack_PRTL_RESOURCE_DEBUG(void)
2539 {
2540 /* PRTL_RESOURCE_DEBUG */
2541 TEST_TYPE_SIZE (PRTL_RESOURCE_DEBUG, 8)
2542 TEST_TYPE_ALIGN (PRTL_RESOURCE_DEBUG, 8)
2543 }
2544
2545 static void test_pack_PSECURITY_DESCRIPTOR(void)
2546 {
2547 /* PSECURITY_DESCRIPTOR */
2548 TEST_TYPE_SIZE (PSECURITY_DESCRIPTOR, 8)
2549 TEST_TYPE_ALIGN (PSECURITY_DESCRIPTOR, 8)
2550 }
2551
2552 static void test_pack_PSECURITY_QUALITY_OF_SERVICE(void)
2553 {
2554 /* PSECURITY_QUALITY_OF_SERVICE */
2555 TEST_TYPE_SIZE (PSECURITY_QUALITY_OF_SERVICE, 8)
2556 TEST_TYPE_ALIGN (PSECURITY_QUALITY_OF_SERVICE, 8)
2557 }
2558
2559 static void test_pack_PSID(void)
2560 {
2561 /* PSID */
2562 TEST_TYPE_SIZE (PSID, 8)
2563 TEST_TYPE_ALIGN (PSID, 8)
2564 }
2565
2566 static void test_pack_PSID_IDENTIFIER_AUTHORITY(void)
2567 {
2568 /* PSID_IDENTIFIER_AUTHORITY */
2569 TEST_TYPE_SIZE (PSID_IDENTIFIER_AUTHORITY, 8)
2570 TEST_TYPE_ALIGN (PSID_IDENTIFIER_AUTHORITY, 8)
2571 TEST_TARGET_SIZE (PSID_IDENTIFIER_AUTHORITY, 6)
2572 TEST_TARGET_ALIGN(PSID_IDENTIFIER_AUTHORITY, 1)
2573 }
2574
2575 static void test_pack_PSINGLE_LIST_ENTRY(void)
2576 {
2577 /* PSINGLE_LIST_ENTRY */
2578 TEST_TYPE_SIZE (PSINGLE_LIST_ENTRY, 8)
2579 TEST_TYPE_ALIGN (PSINGLE_LIST_ENTRY, 8)
2580 TEST_TARGET_SIZE (PSINGLE_LIST_ENTRY, 8)
2581 TEST_TARGET_ALIGN(PSINGLE_LIST_ENTRY, 8)
2582 }
2583
2584 static void test_pack_PSTR(void)
2585 {
2586 /* PSTR */
2587 TEST_TYPE_SIZE (PSTR, 8)
2588 TEST_TYPE_ALIGN (PSTR, 8)
2589 TEST_TARGET_SIZE (PSTR, 1)
2590 TEST_TARGET_ALIGN(PSTR, 1)
2591 }
2592
2593 static void test_pack_PSYSTEM_ALARM_ACE(void)
2594 {
2595 /* PSYSTEM_ALARM_ACE */
2596 TEST_TYPE_SIZE (PSYSTEM_ALARM_ACE, 8)
2597 TEST_TYPE_ALIGN (PSYSTEM_ALARM_ACE, 8)
2598 TEST_TARGET_SIZE (PSYSTEM_ALARM_ACE, 12)
2599 TEST_TARGET_ALIGN(PSYSTEM_ALARM_ACE, 4)
2600 }
2601
2602 static void test_pack_PSYSTEM_AUDIT_ACE(void)
2603 {
2604 /* PSYSTEM_AUDIT_ACE */
2605 TEST_TYPE_SIZE (PSYSTEM_AUDIT_ACE, 8)
2606 TEST_TYPE_ALIGN (PSYSTEM_AUDIT_ACE, 8)
2607 TEST_TARGET_SIZE (PSYSTEM_AUDIT_ACE, 12)
2608 TEST_TARGET_ALIGN(PSYSTEM_AUDIT_ACE, 4)
2609 }
2610
2611 static void test_pack_PTOKEN_GROUPS(void)
2612 {
2613 /* PTOKEN_GROUPS */
2614 TEST_TYPE_SIZE (PTOKEN_GROUPS, 8)
2615 TEST_TYPE_ALIGN (PTOKEN_GROUPS, 8)
2616 TEST_TARGET_SIZE (PTOKEN_GROUPS, 24)
2617 TEST_TARGET_ALIGN(PTOKEN_GROUPS, 8)
2618 }
2619
2620 static void test_pack_PTOKEN_PRIVILEGES(void)
2621 {
2622 /* PTOKEN_PRIVILEGES */
2623 TEST_TYPE_SIZE (PTOKEN_PRIVILEGES, 8)
2624 TEST_TYPE_ALIGN (PTOKEN_PRIVILEGES, 8)
2625 TEST_TARGET_SIZE (PTOKEN_PRIVILEGES, 16)
2626 TEST_TARGET_ALIGN(PTOKEN_PRIVILEGES, 4)
2627 }
2628
2629 static void test_pack_PTOKEN_USER(void)
2630 {
2631 /* PTOKEN_USER */
2632 TEST_TYPE_SIZE (PTOKEN_USER, 8)
2633 TEST_TYPE_ALIGN (PTOKEN_USER, 8)
2634 TEST_TARGET_SIZE (PTOKEN_USER, 16)
2635 TEST_TARGET_ALIGN(PTOKEN_USER, 8)
2636 }
2637
2638 static void test_pack_PULARGE_INTEGER(void)
2639 {
2640 /* PULARGE_INTEGER */
2641 TEST_TYPE_SIZE (PULARGE_INTEGER, 8)
2642 TEST_TYPE_ALIGN (PULARGE_INTEGER, 8)
2643 }
2644
2645 static void test_pack_PVECTORED_EXCEPTION_HANDLER(void)
2646 {
2647 /* PVECTORED_EXCEPTION_HANDLER */
2648 TEST_TYPE_SIZE (PVECTORED_EXCEPTION_HANDLER, 8)
2649 TEST_TYPE_ALIGN (PVECTORED_EXCEPTION_HANDLER, 8)
2650 }
2651
2652 static void test_pack_PVOID(void)
2653 {
2654 /* PVOID */
2655 TEST_TYPE_SIZE (PVOID, 8)
2656 TEST_TYPE_ALIGN (PVOID, 8)
2657 }
2658
2659 static void test_pack_PWCH(void)
2660 {
2661 /* PWCH */
2662 TEST_TYPE_SIZE (PWCH, 8)
2663 TEST_TYPE_ALIGN (PWCH, 8)
2664 TEST_TARGET_SIZE (PWCH, 2)
2665 TEST_TARGET_ALIGN(PWCH, 2)
2666 }
2667
2668 static void test_pack_PWSTR(void)
2669 {
2670 /* PWSTR */
2671 TEST_TYPE_SIZE (PWSTR, 8)
2672 TEST_TYPE_ALIGN (PWSTR, 8)
2673 TEST_TARGET_SIZE (PWSTR, 2)
2674 TEST_TARGET_ALIGN(PWSTR, 2)
2675 }
2676
2677 static void test_pack_RTL_CRITICAL_SECTION(void)
2678 {
2679 /* RTL_CRITICAL_SECTION */
2680 TEST_TYPE_SIZE (RTL_CRITICAL_SECTION, 40)
2681 TEST_TYPE_ALIGN (RTL_CRITICAL_SECTION, 8)
2682 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, DebugInfo, 8)
2683 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, DebugInfo, 8)
2684 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, DebugInfo, 0)
2685 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockCount, 4)
2686 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockCount, 4)
2687 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockCount, 8)
2688 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, RecursionCount, 4)
2689 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, RecursionCount, 4)
2690 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, RecursionCount, 12)
2691 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, OwningThread, 8)
2692 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, OwningThread, 8)
2693 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, OwningThread, 16)
2694 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2695 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, LockSemaphore, 8)
2696 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, LockSemaphore, 24)
2697 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION, SpinCount, 8)
2698 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION, SpinCount, 8)
2699 TEST_FIELD_OFFSET(RTL_CRITICAL_SECTION, SpinCount, 32)
2700 }
2701
2702 static void test_pack_RTL_CRITICAL_SECTION_DEBUG(void)
2703 {
2704 /* RTL_CRITICAL_SECTION_DEBUG */
2705 TEST_FIELD_SIZE (RTL_CRITICAL_SECTION_DEBUG, Type, 2)
2706 TEST_FIELD_ALIGN (RTL_CRITICAL_SECTION_DEBUG, Type, 2)