Dynamic-Link Library Search Order(dll搜索顺序)

本文介绍了DLL的搜索顺序,特别是在SafeDllSearchMode开启和关闭时的区别。当开启时,系统目录是搜索路径的一部分;关闭时,当前工作目录被优先考虑。此外,还提到了SetDllDirectory函数的影响、隐式加载的DLL搜索限制以及manifest文件在控制DLL加载中的作用。重点讨论了已加载DLL的优先级和已知DLLs的情况。
摘要由CSDN通过智能技术生成

在项目从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:

  1. The directory from which the application loaded.(程序目录)
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.(system目录)
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值