home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / image / include / symcvt.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  3KB  |  96 lines

  1. /*++
  2.  
  3.  
  4. Copyright 1996 - 1997 Microsoft Corporation
  5.  
  6. Module Name:
  7.  
  8.     symcvt.h
  9.  
  10. Abstract:
  11.  
  12.     This file contains all of the type definitions and prototypes
  13.     necessary to access the symcvt library.
  14.  
  15. Environment:
  16.  
  17.     Win32, User Mode
  18.  
  19. --*/
  20.  
  21.  
  22. typedef struct tagPTRINFO {
  23.     DWORD                       size;
  24.     DWORD                       count;
  25.     PUCHAR                      ptr;
  26. } PTRINFO, *PPTRINFO;
  27.  
  28. typedef struct tagIMAGEPOINTERS {
  29.     char                        szName[MAX_PATH];
  30.     HANDLE                      hFile;
  31.     HANDLE                      hMap;
  32.     DWORD                       fsize;
  33.     PUCHAR                      fptr;
  34.     BOOLEAN                     fRomImage;
  35.     PIMAGE_DOS_HEADER           dosHdr;
  36.     PIMAGE_NT_HEADERS           ntHdr;
  37.     PIMAGE_ROM_HEADERS          romHdr;
  38.     PIMAGE_FILE_HEADER          fileHdr;
  39.     PIMAGE_OPTIONAL_HEADER      optHdr;
  40.     PIMAGE_SEPARATE_DEBUG_HEADER sepHdr;
  41.     int                         cDebugDir;
  42.     PIMAGE_DEBUG_DIRECTORY *    rgDebugDir;
  43.     PIMAGE_SECTION_HEADER       sectionHdrs;
  44.     PIMAGE_SECTION_HEADER       debugSection;
  45.     PIMAGE_SYMBOL               AllSymbols;
  46.     PUCHAR                      stringTable;
  47.     int                         numberOfSymbols;
  48.     int                         numberOfSections;
  49.     PCHAR *                     rgpbDebugSave;
  50. } IMAGEPOINTERS, *PIMAGEPOINTERS;
  51.  
  52. #define COFF_DIR(x)             ((x)->rgDebugDir[IMAGE_DEBUG_TYPE_COFF])
  53. #define CV_DIR(x)               ((x)->rgDebugDir[IMAGE_DEBUG_TYPE_CODEVIEW])
  54.  
  55. typedef struct _MODULEINFO {
  56.     DWORD               iMod;
  57.     DWORD               cb;
  58.     DWORD               SrcModule;
  59.     LPSTR               name;
  60. } MODULEINFO, *LPMODULEINFO;
  61.  
  62. typedef struct tagPOINTERS {
  63.     IMAGEPOINTERS               iptrs;         // input file pointers
  64.     IMAGEPOINTERS               optrs;         // output file pointers
  65.     PTRINFO                     pCvStart;      // start of cv info
  66.     PUCHAR                      pCvCurr;       // current cv pointer
  67.     PTRINFO                     pCvModules;    // module information
  68.     PTRINFO                     pCvSrcModules; // source module information
  69.     PTRINFO                     pCvPublics;    // publics information
  70.     PTRINFO                     pCvSegName;    // segment names
  71.     PTRINFO                     pCvSegMap;     // segment map
  72.     PTRINFO                     pCvSymHash;    // symbol hash table
  73.     PTRINFO                     pCvAddrSort;   // address sort table
  74.     LPMODULEINFO                pMi;
  75.     DWORD                       modcnt;
  76. } POINTERS, *PPOINTERS;
  77.  
  78. typedef  char *  (* CONVERTPROC) (HANDLE, char *);
  79.  
  80. #define align(_n)       ((4 - (( (DWORD)_n ) % 4 )) & 3)
  81.  
  82. #ifdef _SYMCVT_SOURCE_
  83. #define SYMCVTAPI
  84. #else
  85. #define SYMCVTAPI DECLSPEC_IMPORT
  86. #endif
  87.  
  88. PUCHAR  SYMCVTAPI ConvertSymbolsForImage( HANDLE, char * );
  89. BOOL    SYMCVTAPI ConvertCoffToCv( PPOINTERS p );
  90. BOOL    SYMCVTAPI ConvertSymToCv( PPOINTERS p );
  91. BOOL    SYMCVTAPI MapInputFile ( PPOINTERS p, HANDLE hFile, char *fname);
  92. BOOL    SYMCVTAPI UnMapInputFile ( PPOINTERS p );
  93. BOOL    SYMCVTAPI CalculateNtImagePointers( PIMAGEPOINTERS p );
  94.  
  95.  
  96.