full pathname of loaded dll

Is it possible to determine the full pathname of a dll from the dll itself when it is loaded?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

vinniewConnect With a Mentor Commented:
I'm sure it is.

Look at the documentation for GetModuleFileName().

Also, you can look at listdlls.exe from www.ntinternals.com for how to get that from outside the process. (look at the exports).

pswannAuthor Commented:
We were using GetModulefilename() but unfortunately we were passing the wrong HMODULE (dllname.hmodule) rather than a call to GetModuleHandle().

An example of its use and where we can get a valid HMODULE from would have been useful.
All Courses

From novice to tech pro — start learning today.