Windows path searching in LoadLibrary with manifest
Asked Answered
T

2

4

If you call LoadLibrary without a path (e.g., LoadLibrary("whatever.dll"), Windows will generally follow its standard search algorithm, the same one it uses to find EXEs.

My question is this: suppose that an application manifest specifies specifies a particular version of a system DLL, say, comctl32.dll 6.0. In that case, will LoadLibrary("comctl32.dll") go immediately to the correct side-by-side folder, or does it still perform some kind of search?

Tailback answered 30/9, 2008 at 18:17 Comment(0)
O
6

From Microsoft:

Applications can control the location from which a DLL is loaded by specifying a full path, using DLL redirection, or by using a manifest. If none of these methods are used, the system searches for the DLL at load time as described in this topic.

So yes, if a manifest is present, it will directly go to the SxS folder.

Oysterman answered 30/9, 2008 at 18:26 Comment(0)
D
0

To probe the loader when having troubles with missing libraries, you can use the "sxstrace" feature. www.codeproject.com/KB/DLL/QueryAssemblyIdentities.aspx gives some details about the dependencies between manifest and WinSxs.

Disulfiram answered 13/9, 2010 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.