gpt4 book ai didi

c++ - LoadLibrary A 在哪里寻找文件?

转载 作者:可可西里 更新时间:2023-11-01 11:08:42 24 4
gpt4 key购买 nike

我的代码使用 LoadLibraryA("someDLL.dll");它开始搜索文件 someDLL.dll 的路径是什么?另一个问题:LoadLibraryA 函数是否区分大小写?我的意思是如果我有 SomeDLL.dll,它不会加载它?

最佳答案

MSDN 库文章 Dynamic-Link Library Search Order指定启用 SafeDllSearchMode 时桌面应用程序的搜索顺序,这是从 Windows XP SP2 开始的默认设置:

  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  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 GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

关于c++ - LoadLibrary A 在哪里寻找文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14031749/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com