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.

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