title: How can I find the full path of a DLL without actually calling LoadLibrary?
body: <p>If I call <code>LoadLibrary("foo.dll")</code>, it will look in various locations on the system, choose the best match, and load that library. I would like to find the full path to this file <em>before</em> actually loading it. Is there a simple way to do this? My google-fu has thus far failed me, but it seems intuitive there is some function to do this. My current solution is to actually call <code>LoadLibraryEx</code> with the <code>LOAD_LIBRARY_AS_DATAFILE</code> flag, then <code>GetModuleFileName</code> on the result; after this I assume I would have to release the library and reload it without this flag, but this seems like a roundabout method.  Is there a better way? <code>ResolvePathFromDllName</code> perhaps?</p>