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