在项目从VS2010升级到VS2015过程中,遇到了一些dll的依赖问题,升级程序在appdata目录中,希望引用安装目录中的运行时库以及libcurl等功能依赖组件。复习了一下这块的资料作一下总结:
首先是SafeDllSearchMode的概念,是否开启的标志位于HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode
自windowsXP SP2开始默认开启
If SafeDllSearchMode is enabled, the search order is as follows:
- The directory from which the application loaded.(程序目录)
- The system directory. Use the GetSystemDirectory function to get the path of this directory.(system目录)
- The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the