34

I have a problem with my.xll addin when it loads on my clients PC. It crashes Excel at startup (possible because of missing dependent dlls).

I know it is possible to use dependency walker in profile mode to find out what dlls are loaded when the .exe runs. When I try that dependency walker hangs when profiling Excel, and I can’t find out why.

In a command window I ran this:

C:\Program Files (x86)\Windows Kits\8.1\Tools\x86>start /wait depends.exe /c /f:1 /pb /pp:1 /pg:1 /oc:d:\temp\Log.txt "C:\Program Files (x86)\Microsoft Office\Office14\excel.exe"

But it hangs. enter image description here

I am using dependency walker version 2.2.9600 x86, Windows 8.1 x86, office 2010 x86

I also tried to setup a VM machine with a clean install of win 8.1 and Office 2010 but XL does not crash on that machine when I load the .xll.

I works on another machine Windows 10 x64, office 2013 x64 and dependency walker x64. I can profile Excel.

Note: I ended up using Sysinternals Process Explorer instead. A bit more complicated but works.

Damian
  • 4,395
  • 4
  • 39
  • 67
  • You can also try Process Monitor and/or WinDbg, try to see what's being loaded or attempting to load right before the crash. Does the client's machine have the correct CRT installed? The one that your plugin was compiled against? – Chris O Nov 21 '16 at 12:19
  • I will try that and let you know. – Damian Nov 23 '16 at 06:51
  • What about: http://stackoverflow.com/questions/8832936/profiling-x86-executable-with-dependency-walker-hangs-on-windows-7-x64 – kirbyfan64sos Feb 20 '17 at 21:17
  • 3
    Regardless which .exe or .dll I am open with "Dependency Walker" it hangs (under Windows 10). As far I can remember it worked under Windows 7. – hfrmobile Oct 17 '19 at 09:19

3 Answers3

42

I'm currently on Windows 10 build 1809, and depends.exe hangs for every dll I try it with. The depends home page says "Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, Vista, 7, and 8" so I guess it's not supported.

Try Dependencies - An open-source modern Dependency Walker, it works fine for me.

Andrew Roberts
  • 573
  • 6
  • 7
18

Reconfigure module search order. Try to disable all except KnownDLLs and application directory and then open file to check. Dependency walker builds very large list of subdependencies and GUI elements hangs on this operation :( enter image description here

  • 3
    **2022:** +1 this should be the `accepted answer`! Nothing to install. No open source alternative required. Once configured as above, DW _opens as quickly as I remember it prior to these problems occurring_. You sir deserve a cookie! :) –  Jun 08 '22 at 05:33
  • Depends.exe doesn't hang for me if I remove the search for `The system's "PATH" environment variable directories`. If I remove the others shown above, then Depends.exe can't resolve common DLLs in C:\Windows\System32 like VCRUNTIME140.DLL, so it gives too many false positives. I've come to prefer the new open-source Dependencies utility because it's maintained, faster, and just works without having to apply workarounds every time. If Depends.exe can't even search the PATH now, then it's time to retire it. – Bill Menees Oct 16 '22 at 15:03
11

Microsoft has very slowly been adding modularization, versioning, and indirection to Windows OS API libraries.1 This effort started in Windows 7, but only in recent builds of Windows 10 has this initiative hit some of the core win32/kernel libraries that essentially all traditional Windows binaries link to and use.

Naïve dependency walkers will create a graph combinatorial explosion for themselves they try render the complete dependency graph without some extra logic to short-circuit this layer of indirection, or limit the depth of the graph search to be on-demand at a certain depth. If your program is relatively simple, depends.exe will eventually wake up and render the dependency graph for you, but it may take a few hours.

I don't know if the author of depends.exe intends to ever update it, but in the meantime, as Andrew pointed out in his answer, the lucasg/Dependencies project on GitHub seems to not suffer from the same problem.

Also see this SO post: Dependency Walker: missing dlls

Mike Clark
  • 10,027
  • 3
  • 40
  • 54