-1

I am trying to use DbgHelp to find the address of some symbols. I want to be able to use the symbols available on Microsoft's public server. I have the search path set with SymSetSearchPath as "cache*C:\\symbols\\;srv*http://msdl.microsoft.com/download/symbols/". With the path set like this, calling SymFromName will result in an ERROR_MOD_NOT_FOUND [126] error.

I have both symsrv.dll and symsrv.ini in the same directory as dbghelp.dll.

No network connection seems to happen while monitoring the program with ProcMon.

Using a previously populated SymSrv local folder works, for example, "cache*C:\\symbols\\;srv*C:\\symsrv\\".

Any suggestions?

user4581301
  • 33,082
  • 7
  • 33
  • 54
bananabr
  • 147
  • 11
  • The sympath looks correct, it sounds like symsrv.dll can't be loaded. So it's most likely the dll loading path issue. Try copying both dbghelp.dll and symsrv.dll into the same directory as the .exe you are running and see if it still happens. – Shane Powell Apr 28 '23 at 20:23
  • I just learned that if I run a reverse proxy on localhost pointing to msdl.microsoft.com, then the following search path will work "srv*http://localhost/download/symbols". Any idea why pointing to msdl.microsoft.com directly would not work? – bananabr May 01 '23 at 21:03
  • If a reverse proxy works then the problem has nothing to do with symsrv.dll but something to do with your envoirment. So this is not a programming problem. You will have to investigate networking issues. Like use wireshark to see what is actually happening on the network, try disabling firewalls, try disabling virus checkers, etc. – Shane Powell May 02 '23 at 18:32
  • The same happens on a freshly installed VM running on a different workstation. Still investigating. Are there any requirements for the symsrv.ini file? – bananabr May 02 '23 at 21:43
  • This really points to being a "network" issue then. I don't normally a symcrv.ini file at all. – Shane Powell May 02 '23 at 23:57

1 Answers1

0

It turns out the answer to my question was already posted at ERROR_WINHTTP_NAME_NOT_RESOLVED when using dbghelp as a service. I was trying to run my code as SYSTEM, and for that, I was using psexec. Using dbghelp.dll version 6.3.9600.16384 and symsrv.dll version 6.3.9600.17298 with the DBGHELP_WININET set to 1 fixed the problem.

bananabr
  • 147
  • 11