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