I'm writing a device driver that is loaded by a 3rd-party driver. I need a way to determine the name of the 3rd-party driver that is loading my device driver (for debug purposes).
For example, GetModuleFileName
will provide me the name of the executable. I'd like instead to be able to get the DLL names.
The stack trace may be one of the following:
(a)
app0.exe
abc.dll <- detect "abc"
common.dll
my.dll
(b)
app1.exe
xyz.dll <- detect "xyz"
common.dll
my.dll
(c)
app2.exe
common.dll
my.dll
p.s. - I only need a method for C++ \ Windows