我的代码使用 LoadLibraryA("someDLL.dll");它开始搜索文件 someDLL.dll 的路径是什么?另一个问题:LoadLibraryA 函数是否区分大小写?我的意思是如果我有 SomeDLL.dll,它不会加载它?
最佳答案
MSDN 库文章 Dynamic-Link Library Search Order指定启用 SafeDllSearchMode 时桌面应用程序的搜索顺序,这是从 Windows XP SP2 开始的默认设置:
- The directory from which the application loaded.
- The system directory. Use the GetSystemDirectory function to get the path of this directory.
- 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 GetWindowsDirectory function to get the path of this directory.
- The current directory.
- 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/