Windows path searching in LoadLibrary with manifest

心已入冬 提交于 2019-12-01 06:09:47

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/154281/windows-path-searching-in-loadlibrary-with-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!