Is DbgHelp.dll built-in to Windows? Can I rely on it being there?
Asked Answered
C

2

11

I use Jochen Kalmbach's StackWalker class from CodeProject, to produce a stacktrace when an exception occurs in my DLL.

It relies on DbgHelp.dll

Is DbgHelp.dll built-in to Windows Vista, WS2008, Windows 7?

I know about The Debugging Tools for Windows from Microsoft, and I'm aware that DbgHelp.dll ships in that package. But I also found DbgHelp.dll in %windir%\system32 on my machine.


If it is not installed by default, is there a way for me to redistribute it with debug builds of my DLL ?

Cabrilla answered 25/10, 2009 at 2:12 Comment(0)
C
10

Microsoft says:

"The DbgHelp library is implemented by DbgHelp.dll. This DLL is included in the operating system."

Note that the version currently included with Debugging Tools for Windows may not be the same version that is included with the operating system.

Cindiecindra answered 25/10, 2009 at 2:14 Comment(1)
This is partly true, from what I have been able to tell, it is not bundled with NT 4/Windows 2000 but since XP/Server 2003 I haven't had a problem with any missing DLLs but it's worth to remember. If it is missing you can always download and install the debugging tools on that machine and it will work. This is what I've had to do in the past with Windows 2000 to debug smaller issues.Cymry
S
2

It's generally best to ship dbghelp.dll with your application to ensure you get the version you're expecting anyway. I believe that it's redistributable for this very reason.

However, it's worth remembering that the debug runtime library is not redistributable. Your debug builds must still be (in VC++ terms) "release" builds.

Scofield answered 25/10, 2009 at 2:49 Comment(2)
Still it depends on msvcrt.dll (without indication of version in the filename), so it is not as distributable as in "standalone".Monastery
Note that as per go.microsoft.com/fwlink/?LinkId=294840 you cannot ship the dbghelp & co DLLs themselves, but rather the .msi, "unmodified, as a package" that includes said DLLs: Program Files\Windows Kits\8.1\Debuggers\Redist\X86 Debuggers and Tools-x86_en-us.msi Program Files\Windows Kits\8.1\Debuggers\Redist\X64 Debuggers and Tools-x64_en-us.msi.Steer

© 2022 - 2024 — McMap. All rights reserved.