6

My managed .net application uses third party .net libraries, which use (via PInvoke) unmanaged dlls. I would like to find out, which dlls are loaded. I tried to use "Process Explorer" and "Dependency Walker", but I can only see the managed DLLs.

Gerhard
  • 1,342
  • 2
  • 12
  • 23

1 Answers1

11

Any debugger could do this (windbg for example) - but since it's a good chance you're packing Visual Studio I'll talk about how to do it in that

Attach the Visual Studio debugger to the application, remembering to select only the Native debugger as follows:

How to set debugger type to Native

Once you're attach, hit Debug -> Break and then press [CTRL] + [ALT] + [U] to bring up the Modules window (it's on the menu somewhere but I can't find it!) - here's an example shot from the Samsung Kies application my desktop (which uses WPF):

The modules list

In my case I enabled the Managed debugger too, and moved the process name to the start of the columns list for the purposes of that screenshot.

If the process name has : Native after it, then it's an unmanaged DLL (well, it could also be mixed-mode I suppose).

Note that all processes in Windows will always have a good long list of unmanaged DLLs loaded; because Windows is unmanaged at it's heart and is the ultimate host of the application.

But certainly you can use this list as a starting point and filter down from there.

Andras Zoltan
  • 41,961
  • 13
  • 104
  • 160