I am facing a weird behaviour of DbGHelp API and I cannot even find a theory of explanation. I have some PDB file (for a DLL; downloaded from Internet) and I am looking for a specific symbol within the PDB file. I try four options for doing this:
- A fresh pre-built downloaded copy of TYPEINFODUMP;
- A copy of TYPEINGODUMP I downloaded and built by myself year and a half ago (built on Windows 8.1 with Visual Studio 10 and Windows SDK 7.0);
- The same sources as in #2 but rebuilt now (Windows 10 with Visual Studion 10 and Windows SDK 7.0);
- My own code: a pretty trivial sequence of SymInitialize(), SymLoadModule64() and SymEnumSymbols() (built on Windows 10 with Visual Studion 10 and Windows SDK 7.0).
All these options are used on Windows 10, and the same dbghelp.dll is loaded by all of them (checked; 10.0.14321.1024) except option #1 (it brings its own copy of dbghelp.dll version 6.3.0017.0).
Now, the required symbol is found in all cases. Nevertheless, options #1, #3 and #4 report this symbol with TypeIndex=0, Size=0 and Tag=SymTagPublicSymbol, which is incorrect. Only option #2 reports the symbol with TypeIndex=2, Size=295 and Tag=SymTagFunction, which is correct indeed. All my attempts to fetch the correct symbol information with some code (mine or not) compiled now ended with nothing. Only TYPEINFODUMP I built some time ago brings correct result. I am absolutely despaired. Is there any logical explanation for this situation? What I might miss?