Source code of Windows XP (NT5)
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.

1514 lines
53 KiB

  1. // Debug Information API
  2. // Copyright (C) 1993-1996, Microsoft Corp. All Rights Reserved.
  3. #pragma once
  4. #ifndef _VC_VER_INC
  5. #include "..\include\vcver.h"
  6. #endif
  7. #ifndef __PDB_INCLUDED__
  8. #define __PDB_INCLUDED__
  9. typedef int BOOL;
  10. typedef unsigned UINT;
  11. typedef unsigned char BYTE;
  12. typedef unsigned short WORD;
  13. typedef unsigned long DWORD;
  14. typedef unsigned __int64 DWORDLONG;
  15. typedef unsigned short USHORT;
  16. typedef unsigned long ULONG;
  17. typedef ULONG INTV; // interface version number
  18. typedef ULONG IMPV; // implementation version number
  19. typedef ULONG SIG; // unique (across PDB instances) signature
  20. typedef ULONG AGE; // no. of times this instance has been updated
  21. typedef const char* SZ_CONST; // const string
  22. typedef void * PV;
  23. typedef const void * PCV;
  24. #ifdef LNGNM
  25. #define LNGNM_CONST const
  26. #else // LNGNM
  27. #define LNGNM_CONST
  28. #endif // LNGNM
  29. #ifndef GUID_DEFINED
  30. #define GUID_DEFINED
  31. typedef struct _GUID { // size is 16
  32. DWORD Data1;
  33. WORD Data2;
  34. WORD Data3;
  35. BYTE Data4[8];
  36. } GUID;
  37. #endif // !GUID_DEFINED
  38. #ifndef _HRESULT_DEFINED
  39. #define _HRESULT_DEFINED
  40. typedef long HRESULT;
  41. #endif // !_HRESULT_DEFINED
  42. typedef GUID SIG70; // new to 7.0 are 16-byte guid-like signatures
  43. typedef SIG70 * PSIG70;
  44. typedef const SIG70 * PCSIG70;
  45. #ifndef _WCHAR_T_DEFINED
  46. typedef unsigned short wchar_t;
  47. #define _WCHAR_T_DEFINED
  48. #endif
  49. enum {
  50. #ifdef LNGNM
  51. PDBIntv70 = 20000406,
  52. PDBIntv70Dep = 20000301,
  53. #else
  54. PDBIntv70 = 20000301,
  55. #endif
  56. PDBIntv69 = 19990511,
  57. PDBIntv61 = 19980914,
  58. PDBIntv50a = 19970116,
  59. PDBIntv60 = PDBIntv50a,
  60. PDBIntv50 = 19960502,
  61. PDBIntv41 = 920924,
  62. #ifdef LNGNM
  63. PDBIntv = PDBIntv70, // Now we support both 50 & 60, 69 is only an intermediate version
  64. PDBIntvAlt = PDBIntv50,
  65. PDBIntvAlt2 = PDBIntv60,
  66. PDBIntvAlt3 = PDBIntv69,
  67. #else
  68. PDBIntvAlt = PDBIntv50, // Alternate (backward compatible) supported interface
  69. PDBIntvAlt2 = PDBIntv60, // Alternate (backward compatible) supported interface
  70. PDBIntvAlt3 = PDBIntv61,
  71. PDBIntv = PDBIntv69,
  72. #endif
  73. };
  74. enum {
  75. PDBImpvVC2 = 19941610,
  76. PDBImpvVC4 = 19950623,
  77. PDBImpvVC41 = 19950814,
  78. PDBImpvVC50 = 19960307,
  79. PDBImpvVC98 = 19970604,
  80. PDBImpvVC70 = 20000404,
  81. PDBImpvVC70Dep = 19990604, // deprecated vc70 implementation version
  82. #ifdef LNGNM
  83. PDBImpv = PDBImpvVC70,
  84. #else
  85. PDBImpv = PDBImpvVC98,
  86. #endif
  87. };
  88. enum {
  89. niNil = 0,
  90. PDB_MAX_PATH = 260,
  91. cbErrMax = 1024,
  92. };
  93. // cvinfo.h type index, intentionally typedef'ed here to check equivalence.
  94. typedef unsigned short CV_typ16_t;
  95. typedef unsigned long CV_typ_t;
  96. typedef unsigned long CV_pubsymflag_t; // must be same as CV_typ_t.
  97. typedef CV_typ_t TI; // PDB name for type index
  98. typedef CV_typ16_t TI16; // 16-bit version
  99. typedef unsigned long NI; // name index
  100. typedef TI * PTi;
  101. typedef TI16 * PTi16;
  102. typedef BYTE ITSM; // type server map index
  103. typedef ITSM* PITSM;
  104. typedef BOOL (__stdcall *PFNVALIDATEDEBUGINFOFILE) (const char * szFile, ULONG * errcode );
  105. typedef struct _tagSEARCHDEBUGINFO {
  106. DWORD cb; // doubles as version detection
  107. BOOL fMainDebugFile; // indicates "core" or "ancilliary" file
  108. // eg: main.exe has main.pdb and foo.lib->foo.pdb
  109. char * szMod; // exe/dll
  110. char * szLib; // lib if appropriate
  111. char * szObj; // object file
  112. char * *rgszTriedThese; // list of ones that were tried,
  113. // NULL terminated list of LSZ's
  114. char szValidatedFile[PDB_MAX_PATH];// output of validated filename,
  115. PFNVALIDATEDEBUGINFOFILE
  116. pfnValidateDebugInfoFile; // validation function
  117. char * szExe; // exe/dll
  118. } SEARCHDEBUGINFO, *PSEARCHDEBUGINFO;
  119. typedef BOOL ( __stdcall * PfnFindDebugInfoFile) ( PSEARCHDEBUGINFO );
  120. #define PdbInterface struct
  121. PdbInterface PDB; // program database
  122. PdbInterface DBI; // debug information within the PDB
  123. PdbInterface Mod; // a module within the DBI
  124. PdbInterface TPI; // type info within the DBI
  125. PdbInterface GSI; // global symbol info
  126. PdbInterface SO;
  127. PdbInterface Stream; // some named bytestream in the PDB
  128. PdbInterface StreamImage; // some memory mapped stream
  129. PdbInterface NameMap; // name mapping
  130. PdbInterface Enum; // generic enumerator
  131. PdbInterface EnumNameMap; // enumerate names within a NameMap
  132. PdbInterface EnumContrib; // enumerate contributions
  133. PdbInterface Dbg; // misc debug data (FPO, OMAP, etc)
  134. PdbInterface Src; // Src file data
  135. PdbInterface EnumSrc; // Src file enumerator
  136. PdbInterface SrcHash; // Src file hasher
  137. PdbInterface EnumLines;
  138. typedef PdbInterface PDB PDB;
  139. typedef PdbInterface DBI DBI;
  140. typedef PdbInterface Mod Mod;
  141. typedef PdbInterface TPI TPI;
  142. typedef PdbInterface GSI GSI;
  143. typedef PdbInterface SO SO;
  144. typedef PdbInterface Stream Stream;
  145. typedef PdbInterface StreamImage StreamImage;
  146. typedef PdbInterface NameMap NameMap;
  147. typedef PdbInterface Enum Enum;
  148. typedef PdbInterface EnumStreamNames EnumStreamNames;
  149. typedef PdbInterface EnumNameMap EnumNameMap;
  150. typedef PdbInterface EnumContrib EnumContrib;
  151. typedef PdbInterface WidenTi WidenTi;
  152. typedef PdbInterface Dbg Dbg;
  153. typedef PdbInterface EnumThunk EnumThunk;
  154. typedef PdbInterface Src Src;
  155. typedef PdbInterface EnumSrc EnumSrc;
  156. typedef PdbInterface SrcHash SrcHash;
  157. typedef SrcHash * PSrcHash;
  158. typedef long EC; // error code
  159. enum PDBErrors {
  160. EC_OK, // -, no problemo
  161. EC_USAGE, // -, invalid parameter or call order
  162. EC_OUT_OF_MEMORY, // -, out of RAM
  163. EC_FILE_SYSTEM, // "pdb name", can't write file, out of disk, etc.
  164. EC_NOT_FOUND, // "pdb name", PDB file not found
  165. EC_INVALID_SIG, // "pdb name", PDB::OpenValidate() and its clients only
  166. EC_INVALID_AGE, // "pdb name", PDB::OpenValidate() and its clients only
  167. EC_PRECOMP_REQUIRED, // "obj name", Mod::AddTypes() only
  168. EC_OUT_OF_TI, // "pdb name", TPI::QueryTiForCVRecord() only
  169. EC_NOT_IMPLEMENTED, // -
  170. EC_V1_PDB, // "pdb name", PDB::Open* only
  171. EC_FORMAT, // accessing pdb with obsolete format
  172. EC_LIMIT,
  173. EC_CORRUPT, // cv info corrupt, recompile mod
  174. EC_TI16, // no 16-bit type interface present
  175. EC_ACCESS_DENIED, // "pdb name", PDB file read-only
  176. EC_ILLEGAL_TYPE_EDIT, // trying to edit types in read-only mode
  177. EC_INVALID_EXECUTABLE, // not recogized as a valid executable
  178. EC_DBG_NOT_FOUND, // A required .DBG file was not found
  179. EC_NO_DEBUG_INFO, // No recognized debug info found
  180. EC_INVALID_EXE_TIMESTAMP, // Invalid timestamp on Openvalidate of exe
  181. EC_RESERVED, // RESERVED for future use
  182. EC_DEBUG_INFO_NOT_IN_PDB, // returned by OpenValidateX
  183. EC_MAX
  184. };
  185. #define pure = 0
  186. #ifndef PDBCALL
  187. #define PDBCALL __cdecl
  188. #endif
  189. #ifdef PDB_SERVER
  190. #define PDB_IMPORT_EXPORT(RTYPE) __declspec(dllexport) RTYPE PDBCALL
  191. #elif defined(PDB_LIBRARY)
  192. #define PDB_IMPORT_EXPORT(RTYPE) RTYPE PDBCALL
  193. #else
  194. #define PDB_IMPORT_EXPORT(RTYPE) __declspec(dllimport) RTYPE PDBCALL
  195. #endif
  196. #define PDBAPI PDB_IMPORT_EXPORT
  197. #ifndef IN
  198. #define IN /* in parameter, parameters are IN by default */
  199. #endif
  200. #ifndef OUT
  201. #define OUT /* out parameter */
  202. #endif
  203. // Type of callback arg to PDB::OpenValidate5
  204. enum POVC
  205. {
  206. povcNotifyDebugDir,
  207. povcNotifyOpenDBG,
  208. povcNotifyOpenPDB,
  209. povcNotifySymbolServerQuery,
  210. povcReadExecutableAt,
  211. povcReadExecutableAtRVA,
  212. };
  213. typedef int (PDBCALL *PDBCALLBACK)();
  214. typedef PDBCALLBACK (PDBCALL *PfnPDBQueryCallback)(void *pvClient, enum POVC povc);
  215. typedef void (PDBCALL *PfnPDBNotifyDebugDir)(void *pvClient, BOOL fExecutable, const struct _IMAGE_DEBUG_DIRECTORY *pdbgdir);
  216. typedef void (PDBCALL *PfnPDBNotifyOpenDBG)(void *pvClient, const wchar_t *wszDbgPath, enum PDBErrors ec, const wchar_t *wszError);
  217. typedef void (PDBCALL *PfnPDBNotifyOpenPDB)(void *pvClient, const wchar_t *wszPdbPath, enum PDBErrors ec, const wchar_t *wszError);
  218. typedef void (PDBCALL *PfnPDBNotifySymbolServerQuery)(void *pvClient, const char *szURL, HRESULT hr);
  219. typedef HRESULT (PDBCALL *PfnPDBReadExecutableAt)(void *pvClient, DWORDLONG fo, DWORD cb, void *pv);
  220. typedef HRESULT (PDBCALL *PfnPDBReadExecutableAtRVA)(void *pvClient, DWORD rva, DWORD cb, void *pv);
  221. // type of callback arg to PDB::GetRawBytes
  222. typedef BOOL (PDBCALL *PFNfReadPDBRawBytes)(const void *, long);
  223. // WidenTi interface needs a couple of structures to communicate info back
  224. // and forth.
  225. struct OffMap {
  226. ULONG offOld;
  227. ULONG offNew;
  228. };
  229. typedef struct OffMap OffMap;
  230. typedef OffMap * POffMap;
  231. struct SymConvertInfo {
  232. ULONG cbSyms; // size necessary for converting a block
  233. ULONG cSyms; // count of symbols, necessary to allocate
  234. // mpoffOldoffNew array.
  235. BYTE * pbSyms; // block of symbols (output side)
  236. OffMap * rgOffMap; // OffMap rgOffMap[cSyms]
  237. };
  238. typedef struct SymConvertInfo SymConvertInfo;
  239. enum { wtiSymsNB09 = 0, wtiSymsNB10 = 1 };
  240. // Filter values for PDBCopyTo
  241. enum {
  242. copyRemovePrivate = 0x00000001, // remove private debug information
  243. copyCreateNewSig = 0x00000002, // create new signature for target pdb
  244. };
  245. // PDBCopy callback signatures and function pointer types for PDB::CopyTo2 and CopyToW2
  246. //
  247. enum PCC {
  248. pccFilterPublics,
  249. };
  250. #if !defined(__cplusplus)
  251. typedef enum PCC PCC;
  252. #endif // __cplusplus
  253. typedef BOOL (PDBCALL *PDBCOPYCALLBACK)();
  254. typedef PDBCOPYCALLBACK (PDBCALL *PfnPDBCopyQueryCallback)(void *pvClientContext, PCC pcc);
  255. // Return (true, pszNewPublic==NULL) to keep the name as is,
  256. // (true, pszNewPublic!=NULL) changes name to pszNewPublic,
  257. // false to discard public entirely.
  258. //
  259. typedef BOOL (PDBCALL *PfnPDBCopyFilterPublics)(
  260. void * pvClientContext,
  261. DWORD dwFilterFlags,
  262. unsigned int offPublic,
  263. unsigned int sectPublic,
  264. unsigned int grfPublic, // see cvinfo.h, definition of CV_PUBSYMFLAGS_e and
  265. // CV_PUBSYMFLAGS give the format of this bitfield.
  266. const wchar_t * szPublic,
  267. wchar_t ** pszNewPublic
  268. );
  269. enum DBGTYPE {
  270. dbgtypeFPO,
  271. dbgtypeException, // deprecated
  272. dbgtypeFixup,
  273. dbgtypeOmapToSrc,
  274. dbgtypeOmapFromSrc,
  275. dbgtypeSectionHdr,
  276. #if !defined(VER60)
  277. dbgtypeTokenRidMap,
  278. dbgtypeXData,
  279. dbgtypePData,
  280. dbgtypeNewFPO,
  281. #endif
  282. dbgtypeMax // must be last!
  283. };
  284. typedef enum DBGTYPE DBGTYPE;
  285. // Linker data necessary for relinking an image. Record contains two SZ strings
  286. // off of the end of the record with two offsets from the base
  287. //
  288. enum VerLinkInfo {
  289. vliOne = 1,
  290. vliTwo = 2,
  291. vliCur = vliTwo,
  292. };
  293. struct LinkInfo {
  294. ULONG cb; // size of the whole record. computed as
  295. // sizeof(LinkInfo) + strlen(szCwd) + 1 +
  296. // strlen(szCommand) + 1
  297. ULONG ver; // version of this record (VerLinkInfo)
  298. ULONG offszCwd; // offset from base of this record to szCwd
  299. ULONG offszCommand; // offset from base of this record
  300. ULONG ichOutfile; // index of start of output file in szCommand
  301. ULONG offszLibs; // offset from base of this record to szLibs
  302. // The command includes the full path to the linker, the -re and -out:...
  303. // swithches.
  304. // A sample might look like the following:
  305. // "c:\program files\msdev\bin\link.exe -re -out:debug\foo.exe"
  306. // with ichOutfile being 48.
  307. // the -out switch is guaranteed to be the last item in the command line.
  308. #ifdef __cplusplus
  309. VerLinkInfo Ver() const {
  310. return VerLinkInfo(ver);
  311. }
  312. long Cb() const {
  313. return cb;
  314. }
  315. char * SzCwd() const {
  316. return (char *)((char *)(this) + offszCwd);
  317. }
  318. char * SzCommand() const {
  319. return (char *)((char *)(this) + offszCommand);
  320. }
  321. char * SzOutFile() const {
  322. return SzCommand() + ichOutfile;
  323. }
  324. LinkInfo() :
  325. cb(0), ver(vliCur), offszCwd(0), offszCommand(0), ichOutfile(0)
  326. {
  327. }
  328. char * SzLibs() const {
  329. return (char *)((char *)(this) + offszLibs);
  330. }
  331. #endif
  332. };
  333. #ifdef LNGNM
  334. #ifdef __cplusplus
  335. struct LinkInfoW : public LinkInfo
  336. {
  337. wchar_t* SzCwdW() const {
  338. return (wchar_t *)((wchar_t *)(this) + offszCwd);
  339. }
  340. wchar_t* SzCommandW() const {
  341. return (wchar_t *)((wchar_t *)(this) + offszCommand);
  342. }
  343. wchar_t* SzOutFileW() const {
  344. return SzCommandW() + ichOutfile;
  345. }
  346. wchar_t* SzLibsW() const {
  347. return (wchar_t *)((wchar_t *)(this) + offszLibs);
  348. }
  349. };
  350. #else
  351. typedef struct LinkInfo LinkInfoW;
  352. #endif // __cplusplus
  353. typedef LinkInfoW * PLinkInfoW;
  354. #endif // LNGNM
  355. typedef struct LinkInfo LinkInfo;
  356. typedef LinkInfo * PLinkInfo;
  357. //
  358. // Source (Src) info
  359. //
  360. // This is the source file server for virtual and real source code.
  361. // It is structured as an index on the object file name concatenated
  362. // with
  363. enum SrcVer {
  364. srcverOne = 19980827,
  365. };
  366. enum SrcCompress {
  367. srccompressNone,
  368. srccompressRLE,
  369. srccompressHuffman,
  370. srccompressLZ,
  371. };
  372. #ifdef LNGNM
  373. struct tagSrcHeader {
  374. #else
  375. struct SrcHeader {
  376. #endif
  377. unsigned long cb; // record length
  378. unsigned long ver; // header version
  379. unsigned long sig; // CRC of the data for uniqueness w/o full compare
  380. unsigned long cbSource; // count of bytes of the resulting source
  381. unsigned char srccompress;// compression algorithm used
  382. union {
  383. unsigned char grFlags;
  384. struct {
  385. unsigned char fVirtual : 1; // file is a virtual file (injected)
  386. unsigned char pad : 7; // must be zero
  387. };
  388. };
  389. #ifndef LNGNM
  390. unsigned char szNames[1]; // file names (szFile "\0" szObj "\0" szVirtual,
  391. // as in: "f.cpp" "\0" "f.obj" "\0" "*inj:1:f.obj")
  392. // in the case of non-virtual files, szVirtual is
  393. // the same as szFile.
  394. #endif
  395. };
  396. #ifdef LNGNM
  397. struct SrcHeader : public tagSrcHeader
  398. {
  399. unsigned char szNames[1]; // see comment above
  400. };
  401. struct SrcHeaderW : public tagSrcHeader
  402. {
  403. wchar_t szNames[1]; // see comment above
  404. };
  405. typedef struct SrcHeaderW SrcHeaderW;
  406. typedef SrcHeaderW * PSrcHeaderW;
  407. typedef const SrcHeaderW * PCSrcHeaderW;
  408. //cassert(offsetof(SrcHeader,szNames) == sizeof(tagSrcHeader));
  409. //cassert(offsetof(SrcHeaderW,szNames) == sizeof(tagSrcHeader));
  410. #endif // LNGNM
  411. typedef struct SrcHeader SrcHeader;
  412. typedef SrcHeader * PSrcHeader;
  413. typedef const SrcHeader * PCSrcHeader;
  414. // header used for storing the info and for output to clients who are reading
  415. //
  416. struct SrcHeaderOut {
  417. unsigned long cb; // record length
  418. unsigned long ver; // header version
  419. unsigned long sig; // CRC of the data for uniqueness w/o full compare
  420. unsigned long cbSource; // count of bytes of the resulting source
  421. unsigned long niFile;
  422. unsigned long niObj;
  423. unsigned long niVirt;
  424. unsigned char srccompress;// compression algorithm used
  425. union {
  426. unsigned char grFlags;
  427. struct {
  428. unsigned char fVirtual : 1; // file is a virtual file (injected)
  429. unsigned char pad : 7; // must be zero
  430. };
  431. };
  432. short sPad;
  433. union {
  434. void * pvReserved1;
  435. __int64 pv64Reserved2;
  436. };
  437. };
  438. typedef struct SrcHeaderOut SrcHeaderOut;
  439. typedef SrcHeaderOut * PSrcHeaderOut;
  440. typedef const SrcHeaderOut *PCSrcHeaderOut;
  441. struct SrcHeaderBlock {
  442. __int32 ver;
  443. __int32 cb;
  444. struct {
  445. DWORD dwLowDateTime;
  446. DWORD dwHighDateTime;
  447. } ft;
  448. __int32 age;
  449. BYTE rgbPad[44];
  450. };
  451. typedef struct SrcHeaderBlock SrcHeaderBlock;
  452. #ifdef __cplusplus
  453. struct IStream;
  454. // C++ Binding
  455. PdbInterface PDB { // program database
  456. enum {
  457. intv = PDBIntv,
  458. #if defined(LNGNM)
  459. intvVC70Dep = PDBIntv70Dep, // deprecated
  460. #endif
  461. intvAlt = PDBIntvAlt,
  462. intvAlt2 = PDBIntvAlt2,
  463. intvAlt3 = PDBIntvAlt3,
  464. };
  465. static PDBAPI(BOOL)
  466. OpenValidate(
  467. LNGNM_CONST char *szPDB,
  468. LNGNM_CONST char *szPath,
  469. LNGNM_CONST char *szMode,
  470. SIG sig,
  471. AGE age,
  472. OUT EC* pec,
  473. OUT char szError[cbErrMax],
  474. OUT PDB **pppdb);
  475. static PDBAPI(BOOL)
  476. OpenValidateEx(
  477. LNGNM_CONST char *szPDB,
  478. LNGNM_CONST char *szPathOrig,
  479. LNGNM_CONST char *szSearchPath,
  480. LNGNM_CONST char *szMode,
  481. SIG sig,
  482. AGE age,
  483. OUT EC *pec,
  484. OUT char szError[cbErrMax],
  485. OUT PDB **pppdb);
  486. static PDBAPI(BOOL)
  487. Open(
  488. LNGNM_CONST char *szPDB,
  489. LNGNM_CONST char *szMode,
  490. SIG sigInitial,
  491. OUT EC *pec,
  492. OUT char szError[cbErrMax],
  493. OUT PDB **pppdb);
  494. static PDBAPI(BOOL)
  495. OpenValidate2(
  496. LNGNM_CONST char *szPDB,
  497. LNGNM_CONST char *szPath,
  498. LNGNM_CONST char *szMode,
  499. SIG sig,
  500. AGE age,
  501. long cbPage,
  502. OUT EC *pec,
  503. OUT char szError[cbErrMax],
  504. OUT PDB **pppdb);
  505. static PDBAPI(BOOL)
  506. OpenValidateEx2(
  507. LNGNM_CONST char *szPDB,
  508. LNGNM_CONST char *szPathOrig,
  509. LNGNM_CONST char *szSearchPath,
  510. LNGNM_CONST char *szMode,
  511. SIG sig,
  512. AGE age,
  513. long cbPage,
  514. OUT EC* pec,
  515. OUT char szError[cbErrMax],
  516. OUT PDB **pppdb);
  517. static PDBAPI(BOOL)
  518. OpenEx(
  519. LNGNM_CONST char *szPDB,
  520. LNGNM_CONST char *szMode,
  521. SIG sigInitial,
  522. long cbPage,
  523. OUT EC *pec,
  524. OUT char szError[cbErrMax],
  525. OUT PDB **pppdb);
  526. static PDBAPI(BOOL)
  527. OpenValidate3(
  528. const char *szExecutable,
  529. const char *szSearchPath,
  530. OUT EC *pec,
  531. OUT char szError[cbErrMax],
  532. OUT char szDbgPath[PDB_MAX_PATH],
  533. OUT DWORD *pfo,
  534. OUT DWORD *pcb,
  535. OUT PDB **pppdb);
  536. static PDBAPI(BOOL)
  537. OpenValidate4(
  538. const wchar_t *wszPDB,
  539. const char *szMode,
  540. PCSIG70 pcsig70,
  541. SIG sig,
  542. AGE age,
  543. OUT EC *pec,
  544. OUT wchar_t *wszError,
  545. size_t cchErrMax,
  546. OUT PDB **pppdb);
  547. static PDBAPI(BOOL) OpenInStream(
  548. IStream *pIStream,
  549. const char *szMode,
  550. OUT EC *pec,
  551. OUT wchar_t *wszError,
  552. size_t cchErrMax,
  553. OUT PDB **pppdb);
  554. static PDBAPI(BOOL) ExportValidateInterface(INTV intv);
  555. static PDBAPI(BOOL) ExportValidateImplementation(IMPV impv);
  556. virtual INTV QueryInterfaceVersion() pure;
  557. virtual IMPV QueryImplementationVersion() pure;
  558. virtual EC QueryLastError(OUT char szError[cbErrMax]) pure;
  559. virtual char*QueryPDBName(OUT char szPDB[PDB_MAX_PATH]) pure;
  560. virtual SIG QuerySignature() pure;
  561. virtual AGE QueryAge() pure;
  562. virtual BOOL CreateDBI(const char* szTarget, OUT DBI** ppdbi) pure;
  563. virtual BOOL OpenDBI(const char* szTarget, const char* szMode, OUT DBI** ppdbi ) pure;
  564. virtual BOOL OpenTpi(const char* szMode, OUT TPI** pptpi) pure;
  565. virtual BOOL Commit() pure;
  566. virtual BOOL Close() pure;
  567. virtual BOOL OpenStream(const char* szStream, OUT Stream** ppstream) pure;
  568. virtual BOOL GetEnumStreamNameMap(OUT Enum** ppenum) pure;
  569. virtual BOOL GetRawBytes(PFNfReadPDBRawBytes fSnarfRawBytes) pure;
  570. virtual IMPV QueryPdbImplementationVersion() pure;
  571. virtual BOOL OpenDBIEx(const char* szTarget, const char* szMode, OUT DBI** ppdbi, PfnFindDebugInfoFile pfn=0) pure;
  572. virtual BOOL CopyTo(const char *szDst, DWORD dwCopyFilter, DWORD dwReserved) pure;
  573. //
  574. // support for source file data
  575. //
  576. virtual BOOL OpenSrc(OUT Src** ppsrc) pure;
  577. virtual EC QueryLastErrorExW(OUT wchar_t *wszError, size_t cchMax) pure;
  578. virtual wchar_t *QueryPDBNameExW(OUT wchar_t *wszPDB, size_t cchMax) pure;
  579. virtual BOOL QuerySignature2(PSIG70 psig70) pure;
  580. virtual BOOL CopyToW(const wchar_t *szDst, DWORD dwCopyFilter, DWORD dwReserved) pure;
  581. virtual BOOL fIsSZPDB() const pure;
  582. #ifdef LNGNM
  583. virtual BOOL OpenStreamW(const wchar_t * szStream, OUT Stream** ppstream) pure;
  584. #endif
  585. inline BOOL ValidateInterface()
  586. {
  587. return ExportValidateInterface(intv);
  588. }
  589. static PDBAPI(BOOL)
  590. Open2W(
  591. const wchar_t *wszPDB,
  592. const char *szMode,
  593. OUT EC *pec,
  594. OUT wchar_t *wszError,
  595. size_t cchErrMax,
  596. OUT PDB **pppdb);
  597. static PDBAPI(BOOL)
  598. OpenEx2W(
  599. const wchar_t *wszPDB,
  600. const char *szMode,
  601. long cbPage,
  602. OUT EC *pec,
  603. OUT wchar_t *wszError,
  604. size_t cchErrMax,
  605. OUT PDB **pppdb);
  606. static PDBAPI(BOOL)
  607. OpenValidate5(
  608. const wchar_t *wszExecutable,
  609. const wchar_t *wszSearchPath,
  610. void *pvClient,
  611. PfnPDBQueryCallback pfnQueryCallback,
  612. OUT EC *pec,
  613. OUT wchar_t *wszError,
  614. size_t cchErrMax,
  615. OUT PDB **pppdb);
  616. };
  617. // Review: a stream directory service would be more appropriate
  618. // than Stream::Delete, ...
  619. PdbInterface Stream {
  620. virtual long QueryCb() pure;
  621. virtual BOOL Read(long off, void* pvBuf, long* pcbBuf) pure;
  622. virtual BOOL Write(long off, void* pvBuf, long cbBuf) pure;
  623. virtual BOOL Replace(void* pvBuf, long cbBuf) pure;
  624. virtual BOOL Append(void* pvBuf, long cbBuf) pure;
  625. virtual BOOL Delete() pure;
  626. virtual BOOL Release() pure;
  627. virtual BOOL Read2(long off, void* pvBuf, long cbBuf) pure;
  628. virtual BOOL Truncate(long cb) pure;
  629. };
  630. PdbInterface StreamImage {
  631. static PDBAPI(BOOL) open(Stream* pstream, long cb, OUT StreamImage** ppsi);
  632. virtual long size() pure;
  633. virtual void* base() pure;
  634. virtual BOOL noteRead(long off, long cb, OUT void** ppv) pure;
  635. virtual BOOL noteWrite(long off, long cb, OUT void** ppv) pure;
  636. virtual BOOL writeBack() pure;
  637. virtual BOOL release() pure;
  638. };
  639. PdbInterface DBI { // debug information
  640. enum { intv = PDBIntv };
  641. virtual IMPV QueryImplementationVersion() pure;
  642. virtual INTV QueryInterfaceVersion() pure;
  643. virtual BOOL OpenMod(const char* szModule, const char* szFile, OUT Mod** ppmod) pure;
  644. virtual BOOL DeleteMod(const char* szModule) pure;
  645. virtual BOOL QueryNextMod(Mod* pmod, Mod** ppmodNext) pure;
  646. virtual BOOL OpenGlobals(OUT GSI **ppgsi) pure;
  647. virtual BOOL OpenPublics(OUT GSI **ppgsi) pure;
  648. virtual BOOL AddSec(USHORT isect, USHORT flags, long off, long cb) pure;
  649. virtual BOOL QueryModFromAddr(USHORT isect, long off, OUT Mod** ppmod,
  650. OUT USHORT* pisect, OUT long* poff, OUT long* pcb) pure;
  651. virtual BOOL QuerySecMap(OUT BYTE* pb, long* pcb) pure;
  652. virtual BOOL QueryFileInfo(OUT BYTE* pb, long* pcb) pure;
  653. virtual void DumpMods() pure;
  654. virtual void DumpSecContribs() pure;
  655. virtual void DumpSecMap() pure;
  656. virtual BOOL Close() pure;
  657. virtual BOOL AddThunkMap(long* poffThunkMap, unsigned nThunks, long cbSizeOfThunk,
  658. struct SO* psoSectMap, unsigned nSects,
  659. USHORT isectThunkTable, long offThunkTable) pure;
  660. virtual BOOL AddPublic(const char* szPublic, USHORT isect, long off) pure;
  661. virtual BOOL getEnumContrib(OUT Enum** ppenum) pure;
  662. virtual BOOL QueryTypeServer( ITSM itsm, OUT TPI** pptpi ) pure;
  663. virtual BOOL QueryItsmForTi( TI ti, OUT ITSM* pitsm ) pure;
  664. virtual BOOL QueryNextItsm( ITSM itsm, OUT ITSM *inext ) pure;
  665. virtual BOOL QueryLazyTypes() pure;
  666. virtual BOOL SetLazyTypes( BOOL fLazy ) pure; // lazy is default and can only be turned off
  667. virtual BOOL FindTypeServers( OUT EC* pec, OUT char szError[cbErrMax] ) pure;
  668. virtual void DumpTypeServers() pure;
  669. virtual BOOL OpenDbg(DBGTYPE dbgtype, OUT Dbg **ppdbg) pure;
  670. virtual BOOL QueryDbgTypes(OUT DBGTYPE *pdbgtype, OUT long* pcDbgtype) pure;
  671. // apis to support EnC work
  672. virtual BOOL QueryAddrForSec(OUT USHORT* pisect, OUT long* poff,
  673. USHORT imod, long cb, DWORD dwDataCrc, DWORD dwRelocCrc) pure;
  674. virtual BOOL QuerySupportsEC() pure;
  675. virtual BOOL QueryPdb( OUT PDB** pppdb ) pure;
  676. virtual BOOL AddLinkInfo(IN PLinkInfo ) pure;
  677. virtual BOOL QueryLinkInfo(PLinkInfo, OUT long * pcb) pure;
  678. // new to vc6
  679. virtual AGE QueryAge() const pure;
  680. virtual void * QueryHeader() const pure;
  681. virtual void FlushTypeServers() pure;
  682. virtual BOOL QueryTypeServerByPdb(const char* szPdb, OUT ITSM* pitsm) pure;
  683. #ifdef LNGNM // Long filename support
  684. virtual BOOL OpenModW(const wchar_t* szModule, const wchar_t* szFile, OUT Mod** ppmod) pure;
  685. virtual BOOL DeleteModW(const wchar_t* szModule) pure;
  686. virtual BOOL AddPublicW(const wchar_t* szPublic, USHORT isect, long off, CV_pubsymflag_t cvpsf =0) pure;
  687. virtual BOOL QueryTypeServerByPdbW( const wchar_t* szPdb, OUT ITSM* pitsm ) pure;
  688. virtual BOOL AddLinkInfoW(IN PLinkInfoW ) pure;
  689. virtual BOOL AddPublic2(const char* szPublic, USHORT isect, long off, CV_pubsymflag_t cvpsf =0) pure;
  690. virtual USHORT QueryMachineType() const pure;
  691. virtual void SetMachineType(USHORT wMachine) pure;
  692. virtual void RemoveDataForRva( ULONG rva, ULONG cb ) pure;
  693. #endif
  694. };
  695. PdbInterface Mod { // info for one module within DBI
  696. enum { intv = PDBIntv };
  697. virtual INTV QueryInterfaceVersion() pure;
  698. virtual IMPV QueryImplementationVersion() pure;
  699. virtual BOOL AddTypes(BYTE* pbTypes, long cb) pure;
  700. virtual BOOL AddSymbols(BYTE* pbSym, long cb) pure;
  701. virtual BOOL AddPublic(const char* szPublic, USHORT isect, long off) pure;
  702. virtual BOOL AddLines(const char* szSrc, USHORT isect, long offCon, long cbCon, long doff,
  703. USHORT lineStart, BYTE* pbCoff, long cbCoff) pure;
  704. virtual BOOL AddSecContrib(USHORT isect, long off, long cb, ULONG dwCharacteristics) pure;
  705. virtual BOOL QueryCBName(OUT long* pcb) pure;
  706. virtual BOOL QueryName(OUT char szName[PDB_MAX_PATH], OUT long* pcb) pure;
  707. virtual BOOL QuerySymbols(BYTE* pbSym, long* pcb) pure;
  708. virtual BOOL QueryLines(BYTE* pbLines, long* pcb) pure;
  709. virtual BOOL SetPvClient(void *pvClient) pure;
  710. virtual BOOL GetPvClient(OUT void** ppvClient) pure;
  711. virtual BOOL QueryFirstCodeSecContrib(OUT USHORT* pisect, OUT long* poff, OUT long* pcb, OUT ULONG* pdwCharacteristics) pure;
  712. //
  713. // Make all users of this api use the real one, as this is exactly what it was
  714. // supposed to query in the first place
  715. //
  716. #define QuerySecContrib QueryFirstCodeSecContrib
  717. virtual BOOL QueryImod(OUT USHORT* pimod) pure;
  718. virtual BOOL QueryDBI(OUT DBI** ppdbi) pure;
  719. virtual BOOL Close() pure;
  720. virtual BOOL QueryCBFile(OUT long* pcb) pure;
  721. virtual BOOL QueryFile(OUT char szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  722. virtual BOOL QueryTpi(OUT TPI** pptpi) pure; // return this Mod's Tpi
  723. // apis to support EnC work
  724. virtual BOOL AddSecContribEx(USHORT isect, long off, long cb, ULONG dwCharacteristics, DWORD dwDataCrc, DWORD dwRelocCrc) pure;
  725. virtual BOOL QueryItsm(OUT USHORT* pitsm) pure;
  726. virtual BOOL QuerySrcFile(OUT char szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  727. virtual BOOL QuerySupportsEC() pure;
  728. virtual BOOL QueryPdbFile(OUT char szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  729. virtual BOOL ReplaceLines(BYTE* pbLines, long cb) pure;
  730. #ifdef LNGNM
  731. // V7 line number support
  732. virtual bool GetEnumLines( EnumLines** ppenum ) pure;
  733. virtual bool QueryLineFlags( OUT DWORD* pdwFlags ) pure; // what data is present?
  734. virtual bool QueryFileNameInfo(
  735. IN DWORD fileId, // source file identifier
  736. OUT wchar_t* szFilename, // file name string
  737. IN OUT DWORD* pccFilename, // length of string
  738. OUT DWORD* pChksumType, // type of chksum
  739. OUT BYTE* pbChksum, // pointer to buffer for chksum data
  740. IN OUT DWORD* pcbChksum // number of bytes of chksum (in/out)
  741. ) pure;
  742. // Long filenames support
  743. virtual BOOL AddPublicW(const wchar_t* szPublic, USHORT isect, long off, CV_pubsymflag_t cvpsf =0) pure;
  744. virtual BOOL AddLinesW(const wchar_t* szSrc, USHORT isect, long offCon, long cbCon, long doff,
  745. ULONG lineStart, BYTE* pbCoff, long cbCoff) pure;
  746. virtual BOOL QueryNameW(OUT wchar_t szName[PDB_MAX_PATH], OUT long* pcb) pure;
  747. virtual BOOL QueryFileW(OUT wchar_t szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  748. virtual BOOL QuerySrcFileW(OUT wchar_t szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  749. virtual BOOL QueryPdbFileW(OUT wchar_t szFile[PDB_MAX_PATH], OUT long* pcb) pure;
  750. virtual BOOL AddPublic2(const char* szPublic, USHORT isect, long off, CV_pubsymflag_t cvpsf =0) pure;
  751. #endif
  752. };
  753. PdbInterface TPI { // type info
  754. enum { intv = PDBIntv };
  755. virtual INTV QueryInterfaceVersion() pure;
  756. virtual IMPV QueryImplementationVersion() pure;
  757. virtual BOOL QueryTi16ForCVRecord(BYTE* pb, OUT TI16* pti) pure;
  758. virtual BOOL QueryCVRecordForTi16(TI16 ti, OUT BYTE* pb, IN OUT long* pcb) pure;
  759. virtual BOOL QueryPbCVRecordForTi16(TI16 ti, OUT BYTE** ppb) pure;
  760. virtual TI16 QueryTi16Min() pure;
  761. virtual TI16 QueryTi16Mac() pure;
  762. virtual long QueryCb() pure;
  763. virtual BOOL Close() pure;
  764. virtual BOOL Commit() pure;
  765. virtual BOOL QueryTi16ForUDT(LNGNM_CONST char *sz, BOOL fCase, OUT TI16* pti) pure;
  766. virtual BOOL SupportQueryTiForUDT() pure;
  767. // the new versions that truly take 32-bit types
  768. virtual BOOL fIs16bitTypePool() pure;
  769. virtual BOOL QueryTiForUDT(LNGNM_CONST char *sz, BOOL fCase, OUT TI* pti) pure;
  770. virtual BOOL QueryTiForCVRecord(BYTE* pb, OUT TI* pti) pure;
  771. virtual BOOL QueryCVRecordForTi(TI ti, OUT BYTE* pb, IN OUT long* pcb) pure;
  772. virtual BOOL QueryPbCVRecordForTi(TI ti, OUT BYTE** ppb) pure;
  773. virtual TI QueryTiMin() pure;
  774. virtual TI QueryTiMac() pure;
  775. virtual BOOL AreTypesEqual( TI ti1, TI ti2 ) pure;
  776. virtual BOOL IsTypeServed( TI ti ) pure;
  777. #ifdef LNGNM
  778. virtual BOOL QueryTiForUDTW(const wchar_t *wcs, BOOL fCase, OUT TI* pti) pure;
  779. #endif
  780. };
  781. PdbInterface GSI {
  782. enum { intv = PDBIntv };
  783. virtual INTV QueryInterfaceVersion() pure;
  784. virtual IMPV QueryImplementationVersion() pure;
  785. virtual BYTE* NextSym(BYTE* pbSym) pure;
  786. virtual BYTE* HashSym(const char* szName, BYTE* pbSym) pure;
  787. virtual BYTE* NearestSym(USHORT isect, long off, OUT long* pdisp) pure; //currently only supported for publics
  788. virtual BOOL Close() pure;
  789. virtual BOOL getEnumThunk(USHORT isect, long off, OUT EnumThunk** ppenum) pure;
  790. virtual unsigned long OffForSym(BYTE *pbSym) pure;
  791. virtual BYTE* SymForOff(unsigned long off) pure;
  792. #ifdef LNGNM
  793. virtual BYTE* HashSymW(const wchar_t *wcsName, BYTE* pbSym) pure;
  794. #endif
  795. };
  796. PdbInterface NameMap {
  797. static PDBAPI(BOOL) open(PDB* ppdb, BOOL fWrite, OUT NameMap** ppnm);
  798. virtual BOOL close() pure;
  799. virtual BOOL reinitialize() pure;
  800. virtual BOOL getNi(const char* sz, OUT NI* pni) pure;
  801. virtual BOOL getName(NI ni, OUT const char** psz) pure;
  802. virtual BOOL getEnumNameMap(OUT Enum** ppenum) pure;
  803. virtual BOOL contains(const char* sz, OUT NI* pni) pure;
  804. virtual BOOL commit() pure;
  805. virtual BOOL isValidNi(NI ni) pure;
  806. #ifdef LNGNM
  807. virtual BOOL getNiW(const wchar_t* sz, OUT NI* pni) pure;
  808. virtual BOOL getNameW(NI ni, OUT wchar_t* szName, IN OUT size_t * pcch) pure;
  809. virtual BOOL containsW(const wchar_t *sz, OUT NI* pni) pure;
  810. #endif
  811. };
  812. #define __ENUM_INCLUDED__
  813. PdbInterface Enum {
  814. virtual void release() pure;
  815. virtual void reset() pure;
  816. virtual BOOL next() pure;
  817. };
  818. PdbInterface EnumNameMap : Enum {
  819. virtual void get(OUT const char** psz, OUT NI* pni) pure;
  820. };
  821. PdbInterface EnumContrib : Enum {
  822. virtual void get(OUT USHORT* pimod, OUT USHORT* pisect, OUT long* poff, OUT long* pcb, OUT ULONG* pdwCharacteristics) pure;
  823. virtual void getCrcs(OUT DWORD* pcrcData, OUT DWORD* pcrcReloc ) pure;
  824. virtual bool fUpdate(IN long off, IN long cb) pure;
  825. };
  826. PdbInterface EnumThunk: Enum {
  827. virtual void get( OUT USHORT* pisect, OUT long* poff, OUT long* pcb ) pure;
  828. };
  829. struct CV_Line_t;
  830. struct CV_Column_t;
  831. PdbInterface EnumLines: public Enum
  832. {
  833. //
  834. // Blocks of lines are always in offset order, lines within blocks are also ordered by offset
  835. //
  836. virtual bool getLines(
  837. OUT DWORD* fileId, // id for the filename
  838. OUT DWORD* poffset, // offset part of address
  839. OUT WORD* pseg, // segment part of address
  840. OUT DWORD* pcb, // count of bytes of code described by this block
  841. IN OUT DWORD* pcLines, // number of lines (in/out)
  842. OUT CV_Line_t* pLines // pointer to buffer for line info
  843. ) = 0;
  844. virtual bool getLinesColumns(
  845. OUT DWORD* fileId, // id for the filename
  846. OUT DWORD* poffset, // offset part of address
  847. OUT WORD* pseg, // segment part of address
  848. OUT DWORD* pcb, // count of bytes of code described by this block
  849. IN OUT DWORD* pcLines, // number of lines (in/out)
  850. OUT CV_Line_t* pLines, // pointer to buffer for line info
  851. OUT CV_Column_t*pColumns // pointer to buffer for column info
  852. ) = 0;
  853. };
  854. //
  855. // interface to use to widen type indices from 16 to 32 bits
  856. // and store the results in a new location.
  857. //
  858. PdbInterface WidenTi {
  859. public:
  860. static PDBAPI(BOOL)
  861. fCreate (
  862. WidenTi *&,
  863. unsigned cTypeInitialCache =256,
  864. BOOL fNB10Syms =wtiSymsNB09
  865. );
  866. virtual void
  867. release() pure;
  868. virtual BYTE /* TYPTYPE */ *
  869. pTypeWidenTi ( TI ti16, BYTE /* TYPTYPE */ * ) pure;
  870. virtual BYTE /* SYMTYPE */ *
  871. pSymWidenTi ( BYTE /* SYMTYPE */ * ) pure;
  872. virtual BOOL
  873. fTypeWidenTiNoCache ( BYTE * pbTypeDst, BYTE * pbTypeSrc, long & cbDst ) pure;
  874. virtual BOOL
  875. fSymWidenTiNoCache ( BYTE * pbSymDst, BYTE * pbSymSrc, long & cbDst ) pure;
  876. virtual BOOL
  877. fTypeNeedsWidening ( BYTE * pbType ) pure;
  878. virtual BOOL
  879. fSymNeedsWidening ( BYTE * pbSym ) pure;
  880. virtual BOOL
  881. freeRecord ( void * ) pure;
  882. // symbol block converters/query. symbols start at doff from pbSymIn,
  883. // converted symbols will go at sci.pbSyms + doff, cbSyms are all including
  884. // doff.
  885. virtual BOOL
  886. fQuerySymConvertInfo (
  887. SymConvertInfo & sciOut,
  888. BYTE * pbSym,
  889. long cbSym,
  890. int doff =0
  891. ) pure;
  892. virtual BOOL
  893. fConvertSymbolBlock (
  894. SymConvertInfo & sciOut,
  895. BYTE * pbSymIn,
  896. long cbSymIn,
  897. int doff =0
  898. ) pure;
  899. };
  900. // interface for managing Dbg data
  901. PdbInterface Dbg {
  902. // close Dbg Interface
  903. virtual BOOL Close() pure;
  904. // return number of elements (NOT bytes)
  905. virtual long QuerySize() pure;
  906. // reset enumeration index
  907. virtual void Reset() pure;
  908. // skip next celt elements (move enumeration index)
  909. virtual BOOL Skip(ULONG celt) pure;
  910. // query next celt elements into user-supplied buffer
  911. virtual BOOL QueryNext(ULONG celt, OUT void *rgelt) pure;
  912. // search for an element and fill in the entire struct given a field.
  913. // Only supported for the following debug types and fields:
  914. // DBG_FPO 'ulOffStart' field of FPO_DATA
  915. // DBG_FUNC 'StartingAddress' field of IMAGE_FUNCTION_ENTRY
  916. // DBG_OMAP 'rva' field of OMAP
  917. virtual BOOL Find(IN OUT void *pelt) pure;
  918. // remove debug data
  919. virtual BOOL Clear() pure;
  920. // append celt elements
  921. virtual BOOL Append(ULONG celt, const void *rgelt) pure;
  922. // replace next celt elements
  923. virtual BOOL ReplaceNext(ULONG celt, const void *rgelt) pure;
  924. };
  925. PdbInterface Src {
  926. // close and commit the changes (when open for write)
  927. virtual bool
  928. Close() pure;
  929. // add a source file or file-ette
  930. virtual bool
  931. Add(IN PCSrcHeader psrcheader, IN const void * pvData) pure;
  932. // remove a file or file-ette or all of the injected code for
  933. // one particular compiland (using the object file name)
  934. virtual bool
  935. Remove(IN SZ_CONST szFile) pure;
  936. // query and copy the header/control data to the output buffer
  937. virtual bool
  938. QueryByName(IN SZ_CONST szFile, OUT PSrcHeaderOut psrcheaderOut) const pure;
  939. // copy the file data (the size of the buffer is in the SrcHeaderOut
  940. // structure) to the output buffer.
  941. virtual bool
  942. GetData(IN PCSrcHeaderOut pcsrcheader, OUT void * pvData) const pure;
  943. // create an enumerator to traverse all of the files included
  944. // in the mapping.
  945. virtual bool
  946. GetEnum(OUT EnumSrc ** ppenum) const pure;
  947. // Get the header block (master header) of the Src data.
  948. // Includes age, time stamp, version, and size of the master stream
  949. virtual bool
  950. GetHeaderBlock(SrcHeaderBlock & shb) const pure;
  951. #ifdef LNGNM
  952. virtual bool RemoveW(IN wchar_t *wcsFile) pure;
  953. virtual bool QueryByNameW(IN wchar_t *wcsFile, OUT PSrcHeaderOut psrcheaderOut) const pure;
  954. virtual bool AddW(IN PCSrcHeaderW psrcheader, IN const void * pvData) pure;
  955. #endif
  956. };
  957. PdbInterface EnumSrc : Enum {
  958. virtual void get(OUT PCSrcHeaderOut * ppcsrcheader) pure;
  959. };
  960. PdbInterface SrcHash {
  961. // Various types we need
  962. //
  963. // Tri-state return type
  964. //
  965. enum TriState {
  966. tsYes,
  967. tsNo,
  968. tsMaybe,
  969. };
  970. // Hash identifier
  971. //
  972. enum HID {
  973. hidNone,
  974. hidMD5,
  975. hidMax,
  976. };
  977. // Define machine independent types for storage of HashID and size_t
  978. //
  979. typedef __int32 HashID_t;
  980. typedef unsigned __int32 CbHash_t;
  981. // Create a SrcHash object with the usual two-stage construction technique
  982. //
  983. static PDBAPI(bool)
  984. FCreateSrcHash(OUT PSrcHash &);
  985. // Accumulate more bytes into the hash
  986. //
  987. virtual bool
  988. FHashBuffer(IN PCV pvBuf, IN size_t cbBuf) pure;
  989. // Query the hash id
  990. //
  991. virtual HashID_t
  992. HashID() const pure;
  993. // Query the size of the hash
  994. //
  995. virtual CbHash_t
  996. CbHash() const pure;
  997. // Copy the hash bytes to the client buffer
  998. //
  999. virtual void
  1000. GetHash(OUT PV pvHash, IN CbHash_t cbHash) const pure;
  1001. // Verify the incoming hash against a target buffer of bytes
  1002. // returning a yes it matches, no it doesn't, or indeterminate.
  1003. //
  1004. virtual TriState
  1005. TsVerifyHash(
  1006. IN HID,
  1007. IN CbHash_t cbHash,
  1008. IN PCV pvHash,
  1009. IN size_t cbBuf,
  1010. IN PCV pvBuf
  1011. ) pure;
  1012. // Reset this object to pristine condition
  1013. //
  1014. virtual bool
  1015. FReset() pure;
  1016. // Close off and release this object
  1017. //
  1018. virtual void
  1019. Close() pure;
  1020. };
  1021. #endif // __cplusplus
  1022. // ANSI C Binding
  1023. #if __cplusplus
  1024. extern "C" {
  1025. #endif
  1026. typedef BOOL (PDBCALL *PfnPDBOpen)(
  1027. LNGNM_CONST char *,
  1028. LNGNM_CONST char *,
  1029. SIG,
  1030. EC *,
  1031. char [cbErrMax],
  1032. PDB **);
  1033. PDBAPI(BOOL)
  1034. PDBOpen(
  1035. LNGNM_CONST char *szPDB,
  1036. LNGNM_CONST char *szMode,
  1037. SIG sigInitial,
  1038. OUT EC *pec,
  1039. OUT char szError[cbErrMax],
  1040. OUT PDB **pppdb);
  1041. PDBAPI(BOOL)
  1042. PDBOpenEx(
  1043. LNGNM_CONST char *szPDB,
  1044. LNGNM_CONST char *szMode,
  1045. SIG sigInitial,
  1046. long cbPage,
  1047. OUT EC *pec,
  1048. OUT char szError[cbErrMax],
  1049. OUT PDB **pppdb);
  1050. PDBAPI(BOOL)
  1051. PDBOpen2W(
  1052. const wchar_t *wszPDB,
  1053. const char *szMode,
  1054. OUT EC *pec,
  1055. OUT wchar_t *wszError,
  1056. size_t cchErrMax,
  1057. OUT PDB **pppdb);
  1058. PDBAPI(BOOL)
  1059. PDBOpenEx2W(
  1060. const wchar_t *wszPDB,
  1061. const char *szMode,
  1062. long cbPage,
  1063. OUT EC *pec,
  1064. OUT wchar_t *wszError,
  1065. size_t cchErrMax,
  1066. OUT PDB **pppdb);
  1067. PDBAPI(BOOL)
  1068. PDBOpenValidate(
  1069. LNGNM_CONST char *szPDB,
  1070. LNGNM_CONST char *szPath,
  1071. LNGNM_CONST char *szMode,
  1072. SIG sig,
  1073. AGE age,
  1074. OUT EC* pec,
  1075. OUT char szError[cbErrMax],
  1076. OUT PDB **pppdb);
  1077. PDBAPI(BOOL)
  1078. PDBOpenValidateEx(
  1079. LNGNM_CONST char *szPDB,
  1080. LNGNM_CONST char *szPathOrig,
  1081. LNGNM_CONST char *szSearchPath,
  1082. LNGNM_CONST char *szMode,
  1083. SIG sig,
  1084. AGE age,
  1085. OUT EC *pec,
  1086. OUT char szError[cbErrMax],
  1087. OUT PDB **pppdb);
  1088. PDBAPI(BOOL)
  1089. PDBOpenValidate2(
  1090. LNGNM_CONST char *szPDB,
  1091. LNGNM_CONST char *szPath,
  1092. LNGNM_CONST char *szMode,
  1093. SIG sig,
  1094. AGE age,
  1095. long cbPage,
  1096. OUT EC *pec,
  1097. OUT char szError[cbErrMax],
  1098. OUT PDB **pppdb);
  1099. PDBAPI(BOOL)
  1100. PDBOpenValidateEx2(
  1101. LNGNM_CONST char *szPDB,
  1102. LNGNM_CONST char *szPathOrig,
  1103. LNGNM_CONST char *szSearchPath,
  1104. LNGNM_CONST char *szMode,
  1105. SIG sig,
  1106. AGE age,
  1107. long cbPage,
  1108. OUT EC* pec,
  1109. OUT char szError[cbErrMax],
  1110. OUT PDB **pppdb);
  1111. PDBAPI(BOOL)
  1112. PDBOpenValidate3(
  1113. const char *szExecutable,
  1114. const char *szSearchPath,
  1115. OUT EC *pec,
  1116. OUT char szError[cbErrMax],
  1117. OUT char szDbgPath[PDB_MAX_PATH],
  1118. OUT DWORD *pfo,
  1119. OUT DWORD *pcb,
  1120. OUT PDB **pppdb);
  1121. PDBAPI(BOOL)
  1122. PDBOpenValidate4(
  1123. const wchar_t *wszPDB,
  1124. const char *szMode,
  1125. PCSIG70 pcsig70,
  1126. SIG sig,
  1127. AGE age,
  1128. OUT EC *pec,
  1129. OUT wchar_t *wszError,
  1130. size_t cchErrMax,
  1131. OUT PDB **pppdb);
  1132. PDBAPI(BOOL)
  1133. PDBOpenValidate5(
  1134. const wchar_t *wszExecutable,
  1135. const wchar_t *wszSearchPath,
  1136. void *pvClient,
  1137. PfnPDBQueryCallback pfnQueryCallback,
  1138. OUT EC *pec,
  1139. OUT wchar_t *wszError,
  1140. size_t cchErrMax,
  1141. OUT PDB **pppdb);
  1142. // a dbi client should never call PDBExportValidateInterface directly - use PDBValidateInterface
  1143. PDBAPI(BOOL)
  1144. PDBExportValidateInterface(
  1145. INTV intv);
  1146. __inline BOOL PDBValidateInterface()
  1147. {
  1148. return PDBExportValidateInterface(PDBIntv);
  1149. }
  1150. typedef BOOL (PDBCALL *PfnPDBExportValidateInterface)(INTV);
  1151. __inline BOOL PDBValidateInterfacePfn(PfnPDBExportValidateInterface pfn)
  1152. {
  1153. return (*pfn)(PDBIntv);
  1154. }
  1155. PDBAPI(EC) PDBQueryLastError(PDB *ppdb, OUT char szError[cbErrMax]);
  1156. PDBAPI(INTV) PDBQueryInterfaceVersion(PDB* ppdb);
  1157. PDBAPI(IMPV) PDBQueryImplementationVersion(PDB* ppdb);
  1158. PDBAPI(char*) PDBQueryPDBName(PDB* ppdb, OUT char szPDB[PDB_MAX_PATH]);
  1159. PDBAPI(SIG) PDBQuerySignature(PDB* ppdb);
  1160. PDBAPI(AGE) PDBQueryAge(PDB* ppdb);
  1161. PDBAPI(BOOL) PDBCreateDBI(PDB* ppdb, const char* szTarget, OUT DBI** ppdbi);
  1162. PDBAPI(BOOL) PDBOpenDBIEx(PDB* ppdb, const char* szMode, const char* szTarget, OUT DBI** ppdbi, PfnFindDebugInfoFile pfn);
  1163. PDBAPI(BOOL) PDBOpenDBI(PDB* ppdb, const char* szMode, const char* szTarget, OUT DBI** ppdbi);
  1164. PDBAPI(BOOL) PDBOpenTpi(PDB* ppdb, const char* szMode, OUT TPI** pptpi);
  1165. PDBAPI(BOOL) PDBCommit(PDB* ppdb);
  1166. PDBAPI(BOOL) PDBClose(PDB* ppdb);
  1167. PDBAPI(BOOL) PDBOpenStream(PDB* ppdb, const char* szStream, OUT Stream** ppstream);
  1168. PDBAPI(BOOL) PDBCopyTo(PDB *ppdb, const char *szTargetPdb, DWORD dwCopyFilter, DWORD dwReserved);
  1169. PDBAPI(BOOL) PDBCopyToW(PDB *ppdb, const wchar_t *szTargetPdb, DWORD dwCopyFilter, DWORD dwReserved);
  1170. PDBAPI(BOOL) PDBfIsSZPDB(PDB *ppdb);
  1171. PDBAPI(BOOL) PDBCopyToW2(PDB *ppdb, const wchar_t *szTargetPdb, DWORD dwCopyFilter, PfnPDBCopyQueryCallback pfnCallBack, void * pvClientContext);
  1172. PDBAPI(INTV) DBIQueryInterfaceVersion(DBI* pdbi);
  1173. PDBAPI(IMPV) DBIQueryImplementationVersion(DBI* pdbi);
  1174. PDBAPI(BOOL) DBIOpenMod(DBI* pdbi, const char* szModule, const char* szFile, OUT Mod** ppmod);
  1175. PDBAPI(BOOL) DBIDeleteMod(DBI* pdbi, const char* szModule);
  1176. PDBAPI(BOOL) DBIQueryNextMod(DBI* pdbi, Mod* pmod, Mod** ppmodNext);
  1177. PDBAPI(BOOL) DBIOpenGlobals(DBI* pdbi, OUT GSI **ppgsi);
  1178. PDBAPI(BOOL) DBIOpenPublics(DBI* pdbi, OUT GSI **ppgsi);
  1179. PDBAPI(BOOL) DBIAddSec(DBI* pdbi, USHORT isect, USHORT flags, long off, long cb);
  1180. PDBAPI(BOOL) DBIAddPublic(DBI* pdbi, const char* szPublic, USHORT isect, long off);
  1181. PDBAPI(BOOL) DBIQueryModFromAddr(DBI* pdbi, USHORT isect, long off, OUT Mod** ppmod, OUT USHORT* pisect, OUT long* poff, OUT long* pcb);
  1182. PDBAPI(BOOL) DBIQuerySecMap(DBI* pdbi, OUT BYTE* pb, long* pcb);
  1183. PDBAPI(BOOL) DBIQueryFileInfo(DBI* pdbi, OUT BYTE* pb, long* pcb);
  1184. PDBAPI(BOOL) DBIQuerySupportsEC(DBI* pdbi);
  1185. PDBAPI(void) DBIDumpMods(DBI* pdbi);
  1186. PDBAPI(void) DBIDumpSecContribs(DBI* pdbi);
  1187. PDBAPI(void) DBIDumpSecMap(DBI* pdbi);
  1188. PDBAPI(BOOL) DBIClose(DBI* pdbi);
  1189. PDBAPI(BOOL) DBIAddThunkMap(DBI* pdbi, long* poffThunkMap, unsigned nThunks, long cbSizeOfThunk,
  1190. struct SO* psoSectMap, unsigned nSects, USHORT isectThunkTable, long offThunkTable);
  1191. PDBAPI(BOOL) DBIGetEnumContrib(DBI* pdbi, OUT Enum** ppenum);
  1192. PDBAPI(BOOL) DBIQueryTypeServer(DBI* pdbi, ITSM itsm, OUT TPI** pptpi );
  1193. PDBAPI(BOOL) DBIQueryItsmForTi(DBI* pdbi, TI ti, OUT ITSM* pitsm );
  1194. PDBAPI(BOOL) DBIQueryNextItsm(DBI* pdbi, ITSM itsm, OUT ITSM *inext );
  1195. PDBAPI(BOOL) DBIQueryLazyTypes(DBI* pdbi);
  1196. PDBAPI(BOOL) DBIFindTypeServers( DBI* pdbi, OUT EC* pec, OUT char szError[cbErrMax] );
  1197. PDBAPI(BOOL) DBIOpenDbg(DBI* pdbi, DBGTYPE dbgtype, OUT Dbg **ppdbg);
  1198. PDBAPI(BOOL) DBIQueryDbgTypes(DBI* pdbi, OUT DBGTYPE *pdbgtype, OUT long* pcDbgtype);
  1199. PDBAPI(BOOL) DBIAddLinkInfo(DBI* pdbi, IN PLinkInfo);
  1200. PDBAPI(BOOL) DBIQueryLinkInfo(DBI* pdbi, PLinkInfo, IN OUT long * pcb);
  1201. PDBAPI(INTV) ModQueryInterfaceVersion(Mod* pmod);
  1202. PDBAPI(IMPV) ModQueryImplementationVersion(Mod* pmod);
  1203. PDBAPI(BOOL) ModAddTypes(Mod* pmod, BYTE* pbTypes, long cb);
  1204. PDBAPI(BOOL) ModAddSymbols(Mod* pmod, BYTE* pbSym, long cb);
  1205. PDBAPI(BOOL) ModAddPublic(Mod* pmod, const char* szPublic, USHORT isect, long off);
  1206. PDBAPI(BOOL) ModAddLines(Mod* pmod, const char* szSrc, USHORT isect, long offCon, long cbCon, long doff,
  1207. USHORT lineStart, BYTE* pbCoff, long cbCoff);
  1208. PDBAPI(BOOL) ModAddSecContrib(Mod * pmod, USHORT isect, long off, long cb, ULONG dwCharacteristics);
  1209. PDBAPI(BOOL) ModQueryCBName(Mod* pmod, OUT long* pcb);
  1210. PDBAPI(BOOL) ModQueryName(Mod* pmod, OUT char szName[PDB_MAX_PATH], OUT long* pcb);
  1211. PDBAPI(BOOL) ModQuerySymbols(Mod* pmod, BYTE* pbSym, long* pcb);
  1212. PDBAPI(BOOL) ModQueryLines(Mod* pmod, BYTE* pbLines, long* pcb);
  1213. PDBAPI(BOOL) ModSetPvClient(Mod* pmod, void *pvClient);
  1214. PDBAPI(BOOL) ModGetPvClient(Mod* pmod, OUT void** ppvClient);
  1215. PDBAPI(BOOL) ModQuerySecContrib(Mod* pmod, OUT USHORT* pisect, OUT long* poff, OUT long* pcb, OUT ULONG* pdwCharacteristics);
  1216. PDBAPI(BOOL) ModQueryFirstCodeSecContrib(Mod* pmod, OUT USHORT* pisect, OUT long* poff, OUT long* pcb, OUT ULONG* pdwCharacteristics);
  1217. PDBAPI(BOOL) ModQueryImod(Mod* pmod, OUT USHORT* pimod);
  1218. PDBAPI(BOOL) ModQueryDBI(Mod* pmod, OUT DBI** ppdbi);
  1219. PDBAPI(BOOL) ModClose(Mod* pmod);
  1220. PDBAPI(BOOL) ModQueryCBFile(Mod* pmod, OUT long* pcb);
  1221. PDBAPI(BOOL) ModQueryFile(Mod* pmod, OUT char szFile[PDB_MAX_PATH], OUT long* pcb);
  1222. PDBAPI(BOOL) ModQuerySrcFile(Mod* pmod, OUT char szFile[PDB_MAX_PATH], OUT long* pcb);
  1223. PDBAPI(BOOL) ModQueryPdbFile(Mod* pmod, OUT char szFile[PDB_MAX_PATH], OUT long* pcb);
  1224. PDBAPI(BOOL) ModQuerySupportsEC(Mod* pmod);
  1225. PDBAPI(BOOL) ModQueryTpi(Mod* pmod, OUT TPI** pptpi);
  1226. PDBAPI(BOOL) ModReplaceLines(Mod* pmod, BYTE* pbLines, long cb);
  1227. PDBAPI(INTV) TypesQueryInterfaceVersion(TPI* ptpi);
  1228. PDBAPI(IMPV) TypesQueryImplementationVersion(TPI* ptpi);
  1229. // can't use the same api's for 32-bit TIs.
  1230. PDBAPI(BOOL) TypesQueryTiForCVRecordEx(TPI* ptpi, BYTE* pb, OUT TI* pti);
  1231. PDBAPI(BOOL) TypesQueryCVRecordForTiEx(TPI* ptpi, TI ti, OUT BYTE* pb, IN OUT long* pcb);
  1232. PDBAPI(BOOL) TypesQueryPbCVRecordForTiEx(TPI* ptpi, TI ti, OUT BYTE** ppb);
  1233. PDBAPI(TI) TypesQueryTiMinEx(TPI* ptpi);
  1234. PDBAPI(TI) TypesQueryTiMacEx(TPI* ptpi);
  1235. PDBAPI(long) TypesQueryCb(TPI* ptpi);
  1236. PDBAPI(BOOL) TypesClose(TPI* ptpi);
  1237. PDBAPI(BOOL) TypesCommit(TPI* ptpi);
  1238. PDBAPI(BOOL) TypesQueryTiForUDTEx(TPI* ptpi, LNGNM_CONST char *sz, BOOL fCase, OUT TI* pti);
  1239. PDBAPI(BOOL) TypesSupportQueryTiForUDT(TPI*);
  1240. PDBAPI(BOOL) TypesfIs16bitTypePool(TPI*);
  1241. // Map all old ones to new ones for new compilands.
  1242. #define TypesQueryTiForCVRecord TypesQueryTiForCVRecordEx
  1243. #define TypesQueryCVRecordForTi TypesQueryCVRecordForTiEx
  1244. #define TypesQueryPbCVRecordForTi TypesQueryPbCVRecordForTiEx
  1245. #define TypesQueryTiMin TypesQueryTiMinEx
  1246. #define TypesQueryTiMac TypesQueryTiMacEx
  1247. #define TypesQueryTiForUDT TypesQueryTiForUDTEx
  1248. PDBAPI(BOOL) TypesAreTypesEqual( TPI* ptpi, TI ti1, TI ti2 );
  1249. PDBAPI(BOOL) TypesIsTypeServed( TPI* ptpi, TI ti );
  1250. PDBAPI(BYTE*) GSINextSym (GSI* pgsi, BYTE* pbSym);
  1251. PDBAPI(BYTE*) GSIHashSym (GSI* pgsi, const char* szName, BYTE* pbSym);
  1252. PDBAPI(BYTE*) GSINearestSym (GSI* pgsi, USHORT isect, long off,OUT long* pdisp);//currently only supported for publics
  1253. PDBAPI(BOOL) GSIClose(GSI* pgsi);
  1254. PDBAPI(unsigned long) GSIOffForSym( GSI* pgsi, BYTE* pbSym );
  1255. PDBAPI(BYTE*) GSISymForOff( GSI* pgsi, unsigned long off );
  1256. PDBAPI(long) StreamQueryCb(Stream* pstream);
  1257. PDBAPI(BOOL) StreamRead(Stream* pstream, long off, void* pvBuf, long* pcbBuf);
  1258. PDBAPI(BOOL) StreamWrite(Stream* pstream, long off, void* pvBuf, long cbBuf);
  1259. PDBAPI(BOOL) StreamReplace(Stream* pstream, void* pvBuf, long cbBuf);
  1260. PDBAPI(BOOL) StreamAppend(Stream* pstream, void* pvBuf, long cbBuf);
  1261. PDBAPI(BOOL) StreamDelete(Stream* pstream);
  1262. PDBAPI(BOOL) StreamTruncate(Stream* pstream, long cb);
  1263. PDBAPI(BOOL) StreamRelease(Stream* pstream);
  1264. PDBAPI(BOOL) StreamImageOpen(Stream* pstream, long cb, OUT StreamImage** ppsi);
  1265. PDBAPI(void*) StreamImageBase(StreamImage* psi);
  1266. PDBAPI(long) StreamImageSize(StreamImage* psi);
  1267. PDBAPI(BOOL) StreamImageNoteRead(StreamImage* psi, long off, long cb, OUT void** ppv);
  1268. PDBAPI(BOOL) StreamImageNoteWrite(StreamImage* psi, long off, long cb, OUT void** ppv);
  1269. PDBAPI(BOOL) StreamImageWriteBack(StreamImage* psi);
  1270. PDBAPI(BOOL) StreamImageRelease(StreamImage* psi);
  1271. PDBAPI(BOOL) NameMapOpen(PDB* ppdb, BOOL fWrite, OUT NameMap** ppnm);
  1272. PDBAPI(BOOL) NameMapClose(NameMap* pnm);
  1273. PDBAPI(BOOL) NameMapReinitialize(NameMap* pnm);
  1274. PDBAPI(BOOL) NameMapGetNi(NameMap* pnm, const char* sz, OUT NI* pni);
  1275. PDBAPI(BOOL) NameMapGetName(NameMap* pnm, NI ni, OUT const char** psz);
  1276. PDBAPI(BOOL) NameMapGetEnumNameMap(NameMap* pnm, OUT Enum** ppenum);
  1277. PDBAPI(BOOL) NameMapCommit(NameMap* pnm);
  1278. PDBAPI(void) EnumNameMapRelease(EnumNameMap* penum);
  1279. PDBAPI(void) EnumNameMapReset(EnumNameMap* penum);
  1280. PDBAPI(BOOL) EnumNameMapNext(EnumNameMap* penum);
  1281. PDBAPI(void) EnumNameMapGet(EnumNameMap* penum, OUT const char** psz, OUT NI* pni);
  1282. PDBAPI(void) EnumContribRelease(EnumContrib* penum);
  1283. PDBAPI(void) EnumContribReset(EnumContrib* penum);
  1284. PDBAPI(BOOL) EnumContribNext(EnumContrib* penum);
  1285. PDBAPI(void) EnumContribGet(EnumContrib* penum, OUT USHORT* pimod, OUT USHORT* pisect, OUT long* poff, OUT long* pcb, OUT ULONG* pdwCharacteristics);
  1286. PDBAPI(void) EnumContribGetCrcs(EnumContrib* penum, OUT DWORD* pcrcData, OUT DWORD* pcrcReloc);
  1287. PDBAPI(BOOL) EnumContribfUpdate(EnumContrib* penum, IN long off, IN long cb);
  1288. PDBAPI(SIG) SigForPbCb(BYTE* pb, size_t cb, SIG sig);
  1289. PDBAPI(void) TruncStFromSz(char *stDst, const char *szSrc, size_t cbSrc);
  1290. PDBAPI(BOOL) DbgClose(Dbg *pdbg);
  1291. PDBAPI(long) DbgQuerySize(Dbg *pdbg);
  1292. PDBAPI(void) DbgReset(Dbg *pdbg);
  1293. PDBAPI(BOOL) DbgSkip(Dbg *pdbg, ULONG celt);
  1294. PDBAPI(BOOL) DbgQueryNext(Dbg *pdbg, ULONG celt, OUT void *rgelt);
  1295. PDBAPI(BOOL) DbgFind(Dbg *pdbg, IN OUT void *pelt);
  1296. PDBAPI(BOOL) DbgClear(Dbg *pdbg);
  1297. PDBAPI(BOOL) DbgAppend(Dbg *pdbg, ULONG celt, const void *rgelt);
  1298. PDBAPI(BOOL) DbgReplaceNext(Dbg *pdbg, ULONG celt, const void *rgelt);
  1299. #if __cplusplus
  1300. };
  1301. #endif
  1302. struct SO {
  1303. long off;
  1304. USHORT isect;
  1305. unsigned short pad;
  1306. };
  1307. #ifndef cbNil
  1308. #define cbNil ((long)-1)
  1309. #endif
  1310. #define tsNil ((TPI*)0)
  1311. #define tiNil ((TI)0)
  1312. #define imodNil ((USHORT)(-1))
  1313. #define pdbWrite "w"
  1314. #define pdbRead "r"
  1315. #define pdbGetTiOnly "i"
  1316. #define pdbGetRecordsOnly "c"
  1317. #define pdbFullBuild "f"
  1318. #define pdbTypeAppend "a"
  1319. #define pdbRepro "z"
  1320. #endif // __PDB_INCLUDED__