Changeset 46274 in vbox for trunk/src/VBox/Runtime/include/internal
- Timestamp:
- May 26, 2013 10:40:09 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86013
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/ldrPE.h
r46266 r46274 210 210 211 211 /* For .DBG files. */ 212 #define IMAGE_SEPARATE_DEBUG_SIGNATURE UINT16_C(0x4944) 213 212 #define IMAGE_SEPARATE_DEBUG_SIGNATURE UINT16_C(0x4944) 213 214 #define IMAGE_SIZE_OF_SYMBOL 18 215 #define IMAGE_SIZE_OF_SYMBOL_EX 20 216 217 #define IMAGE_SYM_UNDEFINED INT16_C(0) 218 #define IMAGE_SYM_ABSOLUTE INT16_C(-1) 219 #define IMAGE_SYM_DEBUG INT16_C(-2) 220 221 #define IMAGE_SYM_CLASS_END_OF_FUNCTION UINT8_C(0xff) /* -1 */ 222 #define IMAGE_SYM_CLASS_NULL UINT8_C(0) 223 #define IMAGE_SYM_CLASS_AUTOMATIC UINT8_C(1) 224 #define IMAGE_SYM_CLASS_EXTERNAL UINT8_C(2) 225 #define IMAGE_SYM_CLASS_STATIC UINT8_C(3) 226 #define IMAGE_SYM_CLASS_REGISTER UINT8_C(4) 227 #define IMAGE_SYM_CLASS_EXTERNAL_DEF UINT8_C(5) 228 #define IMAGE_SYM_CLASS_LABEL UINT8_C(6) 229 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL UINT8_C(7) 230 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT UINT8_C(8) 231 #define IMAGE_SYM_CLASS_ARGUMENT UINT8_C(9) 232 #define IMAGE_SYM_CLASS_STRUCT_TAG UINT8_C(10) 233 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION UINT8_C(11) 234 #define IMAGE_SYM_CLASS_UNION_TAG UINT8_C(12) 235 #define IMAGE_SYM_CLASS_TYPE_DEFINITION UINT8_C(13) 236 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC UINT8_C(14) 237 #define IMAGE_SYM_CLASS_ENUM_TAG UINT8_C(15) 238 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM UINT8_C(16) 239 #define IMAGE_SYM_CLASS_REGISTER_PARAM UINT8_C(17) 240 #define IMAGE_SYM_CLASS_BIT_FIELD UINT8_C(18) 241 #define IMAGE_SYM_CLASS_FAR_EXTERNAL UINT8_C(68) 242 #define IMAGE_SYM_CLASS_BLOCK UINT8_C(100) 243 #define IMAGE_SYM_CLASS_FUNCTION UINT8_C(101) 244 #define IMAGE_SYM_CLASS_END_OF_STRUCT UINT8_C(102) 245 #define IMAGE_SYM_CLASS_FILE UINT8_C(103) 246 #define IMAGE_SYM_CLASS_SECTION UINT8_C(104) 247 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL UINT8_C(105) 248 #define IMAGE_SYM_CLASS_CLR_TOKEN UINT8_C(107) 249 250 251 #define IMAGE_SYM_TYPE_NULL UINT16_C(0x0000) 252 #define IMAGE_SYM_TYPE_VOID UINT16_C(0x0001) 253 #define IMAGE_SYM_TYPE_CHAR UINT16_C(0x0002) 254 #define IMAGE_SYM_TYPE_SHORT UINT16_C(0x0003) 255 #define IMAGE_SYM_TYPE_INT UINT16_C(0x0004) 256 #define IMAGE_SYM_TYPE_LONG UINT16_C(0x0005) 257 #define IMAGE_SYM_TYPE_FLOAT UINT16_C(0x0006) 258 #define IMAGE_SYM_TYPE_DOUBLE UINT16_C(0x0007) 259 #define IMAGE_SYM_TYPE_STRUCT UINT16_C(0x0008) 260 #define IMAGE_SYM_TYPE_UNION UINT16_C(0x0009) 261 #define IMAGE_SYM_TYPE_ENUM UINT16_C(0x000a) 262 #define IMAGE_SYM_TYPE_MOE UINT16_C(0x000b) 263 #define IMAGE_SYM_TYPE_BYTE UINT16_C(0x000c) 264 #define IMAGE_SYM_TYPE_WORD UINT16_C(0x000d) 265 #define IMAGE_SYM_TYPE_UINT UINT16_C(0x000e) 266 #define IMAGE_SYM_TYPE_DWORD UINT16_C(0x000f) 267 #define IMAGE_SYM_TYPE_PCODE UINT16_C(0x8000) 268 269 #define IMAGE_SYM_DTYPE_NULL UINT16_C(0x0) 270 #define IMAGE_SYM_DTYPE_POINTER UINT16_C(0x1) 271 #define IMAGE_SYM_DTYPE_FUNCTION UINT16_C(0x2) 272 #define IMAGE_SYM_DTYPE_ARRAY UINT16_C(0x3) 273 274 275 #define N_BTMASK UINT16_C(0x000f) 276 #define N_TMASK UINT16_C(0x0030) 277 #define N_TMASK1 UINT16_C(0x00c0) 278 #define N_TMASK2 UINT16_C(0x00f0) 279 #define N_BTSHFT 4 280 #define N_TSHIFT 2 281 282 #define BTYPE(a_Type) ( (a_Type) & N_BTMASK ) 283 #define ISPTR(a_Type) ( ((a_Type) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT) ) 284 #define ISFCN(a_Type) ( ((a_Type) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT) ) 285 #define ISARY(a_Type) ( ((a_Type) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT) ) 286 #define ISTAG(a_StorageClass) ( (a_StorageClass) == IMAGE_SYM_CLASS_STRUCT_TAG \ 287 || (a_StorageClass) == IMAGE_SYM_CLASS_UNION_TAG \ 288 || (a_StorageClass) == IMAGE_SYM_CLASS_ENUM_TAG ) 214 289 215 290 … … 532 607 533 608 609 610 611 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 612 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 613 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 614 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 615 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 616 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 617 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 618 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 619 /* WARNING! NO MORE PRAGMA PACK 4 from here on. Assert size of all new types. */ 620 #pragma pack() 621 622 623 624 625 534 626 /** The header of a .DBG file (NT4). */ 535 627 typedef struct _IMAGE_SEPARATE_DEBUG_HEADER … … 549 641 uint32_t Reserved[2]; /**< 0x28 */ 550 642 } IMAGE_SEPARATE_DEBUG_HEADER; /* size: 0x30 */ 643 AssertCompileSize(IMAGE_SEPARATE_DEBUG_HEADER, 0x30); 551 644 typedef IMAGE_SEPARATE_DEBUG_HEADER *PIMAGE_SEPARATE_DEBUG_HEADER; 552 645 typedef IMAGE_SEPARATE_DEBUG_HEADER const *PCIMAGE_SEPARATE_DEBUG_HEADER; 553 646 554 647 648 typedef struct _IMAGE_COFF_SYMBOLS_HEADER 649 { 650 uint32_t NumberOfSymbols; 651 uint32_t LvaToFirstSymbol; 652 uint32_t NumberOfLinenumbers; 653 uint32_t LvaToFirstLinenumber; 654 uint32_t RvaToFirstByteOfCode; 655 uint32_t RvaToLastByteOfCode; 656 uint32_t RvaToFirstByteOfData; 657 uint32_t RvaToLastByteOfData; 658 } IMAGE_COFF_SYMBOLS_HEADER; 659 AssertCompileSize(IMAGE_COFF_SYMBOLS_HEADER, 0x20); 660 typedef IMAGE_COFF_SYMBOLS_HEADER *PIMAGE_COFF_SYMBOLS_HEADER; 661 typedef IMAGE_COFF_SYMBOLS_HEADER const *PCIMAGE_COFF_SYMBOLS_HEADER; 662 663 664 #pragma pack(2) 665 typedef struct _IMAGE_LINENUMBER 666 { 667 union 668 { 669 uint32_t VirtualAddress; 670 uint32_t SymbolTableIndex; 671 } Type; 672 uint16_t Linenumber; 673 } IMAGE_LINENUMBER; 555 674 #pragma pack() 675 AssertCompileSize(IMAGE_LINENUMBER, 6); 676 typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER; 677 typedef IMAGE_LINENUMBER const *PCIMAGE_LINENUMBER; 678 679 680 #pragma pack(2) 681 typedef struct _IMAGE_SYMBOL 682 { 683 union 684 { 685 uint8_t ShortName[8]; 686 struct 687 { 688 uint32_t Short; 689 uint32_t Long; 690 } Name; 691 uint32_t LongName[2]; 692 } N; 693 694 uint32_t Value; 695 int16_t SectionNumber; 696 uint16_t Type; 697 uint8_t StorageClass; 698 uint8_t NumberOfAuxSymbols; 699 } IMAGE_SYMBOL; 700 #pragma pack() 701 AssertCompileSize(IMAGE_SYMBOL, IMAGE_SIZE_OF_SYMBOL); 702 typedef IMAGE_SYMBOL *PIMAGE_SYMBOL; 703 typedef IMAGE_SYMBOL const *PCIMAGE_SYMBOL; 704 705 706 #pragma pack(2) 707 typedef struct IMAGE_AUX_SYMBOL_TOKEN_DEF 708 { 709 uint8_t bAuxType; 710 uint8_t bReserved; 711 uint32_t SymbolTableIndex; 712 uint8_t rgbReserved[12]; 713 } IMAGE_AUX_SYMBOL_TOKEN_DEF; 714 #pragma pack() 715 AssertCompileSize(IMAGE_AUX_SYMBOL_TOKEN_DEF, IMAGE_SIZE_OF_SYMBOL); 716 typedef IMAGE_AUX_SYMBOL_TOKEN_DEF *PIMAGE_AUX_SYMBOL_TOKEN_DEF; 717 typedef IMAGE_AUX_SYMBOL_TOKEN_DEF const *PCIMAGE_AUX_SYMBOL_TOKEN_DEF; 718 719 720 #pragma pack(1) 721 typedef union _IMAGE_AUX_SYMBOL 722 { 723 struct 724 { 725 uint32_t TagIndex; 726 union 727 { 728 struct 729 { 730 uint16_t Linenumber; 731 uint16_t Size; 732 } LnSz; 733 } Misc; 734 union 735 { 736 struct 737 { 738 uint32_t PointerToLinenumber; 739 uint32_t PointerToNextFunction; 740 } Function; 741 struct 742 { 743 uint16_t Dimension[4]; 744 } Array; 745 } FcnAry; 746 uint16_t TvIndex; 747 } Sym; 748 749 struct 750 { 751 uint8_t Name[IMAGE_SIZE_OF_SYMBOL]; 752 } File; 753 754 struct 755 { 756 uint32_t Length; 757 uint16_t NumberOfRelocations; 758 uint16_t NumberOfLinenumbers; 759 uint32_t CheckSum; 760 uint16_t Number; 761 uint8_t Selection; 762 uint8_t bReserved; 763 uint16_t HighNumber; 764 } Section; 765 766 IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef; 767 struct 768 { 769 uint32_t crc; 770 uint8_t rgbReserved[14]; 771 } CRC; 772 } IMAGE_AUX_SYMBOL; 773 #pragma pack() 774 AssertCompileSize(IMAGE_AUX_SYMBOL, IMAGE_SIZE_OF_SYMBOL); 775 typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL; 776 typedef IMAGE_AUX_SYMBOL const *PCIMAGE_AUX_SYMBOL; 777 778 779 780 typedef struct _IMAGE_SYMBOL_EX 781 { 782 union 783 { 784 uint8_t ShortName[8]; 785 struct 786 { 787 uint32_t Short; 788 uint32_t Long; 789 } Name; 790 uint32_t LongName[2]; 791 } N; 792 793 uint32_t Value; 794 int32_t SectionNumber; /* The difference from IMAGE_SYMBOL */ 795 uint16_t Type; 796 uint8_t StorageClass; 797 uint8_t NumberOfAuxSymbols; 798 } IMAGE_SYMBOL_EX; 799 AssertCompileSize(IMAGE_SYMBOL_EX, IMAGE_SIZE_OF_SYMBOL_EX); 800 typedef IMAGE_SYMBOL_EX *PIMAGE_SYMBOL_EX; 801 typedef IMAGE_SYMBOL_EX const *PCIMAGE_SYMBOL_EX; 802 803 804 typedef union _IMAGE_AUX_SYMBOL_EX 805 { 806 struct 807 { 808 uint32_t WeakDefaultSymIndex; 809 uint32_t WeakSearchType; 810 uint8_t rgbReserved[12]; 811 } Sym; 812 813 struct 814 { 815 uint8_t Name[IMAGE_SIZE_OF_SYMBOL_EX]; 816 } File; 817 818 struct 819 { 820 uint32_t Length; 821 uint16_t NumberOfRelocations; 822 uint16_t NumberOfLinenumbers; 823 uint32_t CheckSum; 824 uint16_t Number; 825 uint8_t Selection; 826 uint8_t bReserved; 827 uint16_t HighNumber; 828 uint8_t rgbReserved[2]; 829 } Section; 830 831 IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef; 832 833 struct 834 { 835 uint32_t crc; 836 uint8_t rgbReserved[16]; 837 } CRC; 838 } IMAGE_AUX_SYMBOL_EX; 839 #pragma pack() 840 AssertCompileSize(IMAGE_AUX_SYMBOL_EX, IMAGE_SIZE_OF_SYMBOL_EX); 841 typedef IMAGE_AUX_SYMBOL_EX *PIMAGE_AUX_SYMBOL_EX; 842 typedef IMAGE_AUX_SYMBOL_EX const *PCIMAGE_AUX_SYMBOL_EX; 843 556 844 557 845 #endif
Note:
See TracChangeset
for help on using the changeset viewer.