- Timestamp:
- Oct 6, 2018 7:58:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/formats/lx.h
r74639 r74644 35 35 #include <iprt/assertcompile.h> 36 36 37 RT_C_DECLS_BEGIN 37 38 38 39 #ifndef IMAGE_OS2_SIGNATURE_LX … … 41 42 #endif 42 43 43 #pragma pack(1) /** @todo mostly unnecessary. */44 44 45 45 /** … … 47 47 * This structure is exactly 196 bytes long. 48 48 */ 49 struct e32_exe49 typedef struct e32_exe 50 50 { 51 51 uint8_t e32_magic[2]; … … 125 125 uint32_t e32_stacksize; 126 126 uint8_t e32_res3[20]; 127 } ;127 } e32_exe; 128 128 AssertCompileSize(struct e32_exe, 196); 129 129 … … 198 198 /** @} */ 199 199 200 200 201 /** @name Relocations (aka Fixups). 201 202 * @{ */ 202 typedef union _offset203 typedef union r32_offset 203 204 { 204 205 uint16_t offset16; 205 206 uint32_t offset32; 206 } offset; 207 } r32_offset; 208 AssertCompileSize(r32_offset, 4); 207 209 208 210 /** A relocation. 209 211 * @remark this structure isn't very usable since LX relocations comes in too many size variations. 210 212 */ 211 struct r32_rlc 213 #pragma pack(1) 214 typedef struct r32_rlc 212 215 { 213 216 uint8_t nr_stype; … … 218 221 union targetid 219 222 { 220 offsetintref;223 r32_offset intref; 221 224 union extfixup 222 225 { 223 offsetproc;226 r32_offset proc; 224 227 uint32_t ord; 225 228 } extref; … … 227 230 { 228 231 uint16_t entry; 229 offsetaddval;232 r32_offset addval; 230 233 } addfix; 231 234 } r32_target; 232 235 uint16_t r32_srccount; 233 236 uint16_t r32_chain; 234 }; 237 } r32_rlc; 238 #pragma pack() 239 AssertCompileSize(r32_rlc, 16); 235 240 236 241 /** @name Some attempt at size constanstants. … … 283 288 284 289 /** The Object Table Entry. */ 285 struct o32_obj290 typedef struct o32_obj 286 291 { 287 292 /** The size of the object. */ … … 297 302 /** Reserved */ 298 303 uint32_t o32_reserved; 299 }; 304 } o32_obj; 305 AssertCompileSize(o32_obj, 24); 300 306 301 307 /** @name o32_flags … … 343 349 344 350 /** A Object Page Map Entry. */ 345 struct o32_map351 typedef struct o32_map 346 352 { 347 353 /** The file offset of the page. */ … … 351 357 /** Per page flags describing how the page is encoded in the file. */ 352 358 uint16_t o32_pageflags; 353 }; 359 } o32_map; 360 AssertCompileSize(o32_map, 8); 354 361 355 362 /** @name o32 o32_pageflags … … 372 379 373 380 /** Iteration Record format (RLE compressed page). */ 374 struct LX_Iter 381 #pragma pack(1) 382 typedef struct LX_Iter 375 383 { 376 384 /** Number of iterations. */ … … 380 388 /** The bytes. */ 381 389 uint8_t LX_Iterdata; 382 }; 390 } LX_Iter; 391 #pragma pack() 392 AssertCompileSize(LX_Iter, 5); 383 393 384 394 /** @} */ … … 386 396 387 397 /** A Resource Table Entry */ 388 struct rsrc32 398 #pragma pack(1) 399 typedef struct rsrc32 389 400 { 390 401 /** Resource Type. */ … … 398 409 /** Offset of the resource that within the object. */ 399 410 uint32_t offset; 400 }; 411 } rsrc32; 412 #pragma pack() 413 AssertCompileSize(rsrc32, 14); 401 414 402 415 … … 406 419 /** Entry bundle. 407 420 * Header descripting up to 255 entries that follows immediatly after this structure. */ 408 struct b32_bundle421 typedef struct b32_bundle 409 422 { 410 423 /** The number of entries. */ … … 414 427 /** The index of the object containing these entry points. */ 415 428 uint16_t b32_obj; 416 }; 429 } b32_bundle; 430 AssertCompileSize(b32_bundle, 4); 417 431 418 432 /** @name b32_type … … 434 448 435 449 /** Entry point. */ 436 struct e32_entry 450 #pragma pack(1) 451 typedef struct e32_entry 437 452 { 438 453 /** Entry point flags */ … … 441 456 { 442 457 /** ENTRY16 or ENTRY32. */ 443 offsete32_offset;458 r32_offset e32_offset; 444 459 /** GATE16 */ 445 460 struct scallgate … … 459 474 } e32_fwd; 460 475 } e32_variant; 461 }; 476 } e32_entry; 477 #pragma pack() 462 478 463 479 /** @name e32_flags … … 481 497 /** @} */ 482 498 483 #pragma pack() 499 500 RT_C_DECLS_END 484 501 485 502 #endif
Note:
See TracChangeset
for help on using the changeset viewer.