Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
4.9 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. symdef.h
  5. Abstract:
  6. SYM file structures header
  7. Revision History:
  8. Brijesh Krishnaswami (brijeshk) - 04/29/99 - Created
  9. ********************************************************************/
  10. #ifndef _SYMDEF_H
  11. #define _SYMDEF_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif // __cplusplus
  15. // SYM File Structures
  16. #pragma pack(1) // pack all data structures declared here
  17. // For each map within a symbol file (MAPDEF)
  18. struct mapdef_s {
  19. unsigned short md_spmap; // 16 bit SEG ptr to next map (0 if end)
  20. unsigned char md_abstype; // 8 bit map/abs sym flags
  21. unsigned char md_pad; // 8 bit pad
  22. unsigned short md_segentry; // 16 bit entry point segment value
  23. unsigned short md_cabs; // 16 bit count of constants in map
  24. unsigned short md_pabsoff; // 16 bit ptr to constant offsets
  25. unsigned short md_cseg; // 16 bit count of segments in map
  26. unsigned short md_spseg; // 16 bit SEG ptr to segment chain
  27. unsigned char md_cbnamemax; // 8 bit maximum symbol name length
  28. unsigned char md_cbname; // 8 bit symbol table name length
  29. unsigned char md_achname[1]; // <n> name of symbol table (.sym )
  30. };
  31. //#define CBMAPDEF FIELDOFFSET(struct mapdef_s, md_achname)
  32. struct endmap_s {
  33. unsigned short em_spmap; // end of map chain (SEG ptr 0)
  34. unsigned char em_rel; // release
  35. unsigned char em_ver; // version
  36. };
  37. // For each segment/group within a symbol table: (SEGDEF)
  38. struct segdef_s {
  39. unsigned short gd_spsegnext; // 16 bit SEG ptr to next segdef (0 if end),
  40. // relative to mapdef
  41. unsigned short gd_csym; // 16 bit count of symbols in sym list
  42. unsigned short gd_psymoff; // 16 bit ptr to symbol offsets array,
  43. // 16 bit SEG ptr if MSF_BIG_GROUP set,
  44. // either relative to segdef
  45. unsigned short gd_lsa; // 16 bit Load Segment address
  46. unsigned short gd_in0; // 16 bit instance 0 physical address
  47. unsigned short gd_in1; // 16 bit instance 1 physical address
  48. unsigned short gd_in2; // 16 bit instance 2 physical address
  49. unsigned char gd_type; // 16 or 32 bit symbols in group
  50. unsigned char gd_pad; // pad byte to fill space for gd_in3
  51. unsigned short gd_spline; // 16 bit SEG ptr to linedef,
  52. // relative to mapdef
  53. unsigned char gd_fload; // 8 bit boolean 0 if seg not loaded
  54. unsigned char gd_curin; // 8 bit current instance
  55. unsigned char gd_cbname; // 8 bit Segment name length
  56. unsigned char gd_achname[1]; // <n> name of segment or group
  57. };
  58. // values for md_abstype, gd_type
  59. #define MSF_32BITSYMS 0x01 // 32-bit symbols
  60. #define MSF_ALPHASYMS 0x02 // symbols sorted alphabetically, too
  61. // values for gd_type only
  62. #define MSF_BIGSYMDEF 0x04 // bigger than 64K of symdefs
  63. // values for md_abstype only
  64. #define MSF_ALIGN32 0x10 // 2MEG max symbol file, 32 byte alignment
  65. #define MSF_ALIGN64 0x20 // 4MEG max symbol file, 64 byte alignment
  66. #define MSF_ALIGN128 0x30 // 8MEG max symbol file, 128 byte alignment
  67. #define MSF_ALIGN_MASK 0x30
  68. // Followed by a list of SYMDEF's..
  69. // for each symbol within a segment/group: (SYMDEF)
  70. struct symdef16_s {
  71. unsigned short sd_val; // 16 bit symbol addr or const
  72. unsigned char sd_cbname; // 8 bit symbol name length
  73. unsigned char sd_achname[1]; // <n> symbol name
  74. };
  75. struct symdef_s {
  76. unsigned long sd_lval; // 32 bit symbol addr or const
  77. unsigned char sd_cbname; // 8 bit symbol name length
  78. unsigned char sd_achname[1]; // <n> symbol name
  79. };
  80. #pragma pack() // stop packing
  81. typedef struct mapdef_s MAPDEF;
  82. typedef struct segdef_s SEGDEF;
  83. // SYM file info for open files
  84. typedef struct _osf {
  85. WCHAR szwName[MAX_PATH]; // file name
  86. WCHAR szwVersion[MAX_PATH]; // version
  87. DWORD dwCheckSum; // checksum
  88. HANDLE hfFile; // file handle
  89. ULONG ulFirstSeg; // first section's offset
  90. int nSeg; // number of sections
  91. DWORD dwCurSection; // section for which symbol defintion ptrs are already available
  92. BYTE* psCurSymDefPtrs; // pointer to array of symbol defintion offsets
  93. } OPENFILE;
  94. #define MAXOPENFILES 10
  95. #define MAX_NAME 256
  96. #ifdef __cplusplus
  97. }
  98. #endif // __cplusplus
  99. #endif