本文介绍了LoadLibrary A在哪里查找文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My code uses LoadLibraryA("someDLL.dll"); What is the path it starts searching for the file someDLL.dll?And another question : is LoadLibraryA function case-sensitive?I mean if I have SomeDLL.dll it will not load it?

推荐答案

MSDN Library文章指定启用 SafeDllSearchMode 时的桌面应用程序的搜索顺序,这是Windows XP SP2的默认值: p>

The MSDN Library article Dynamic-Link Library Search Order specifies the search order for desktop applications when SafeDllSearchMode is enabled, which is the default starting with Windows XP SP2:


  1. 应用程序加载的目录。

  2. 系统目录。使用GetSystemDirectory函数获取此目录的路径。

  3. 16位系统目录。没有获取此目录的路径的功能,但它被搜索。

  4. Windows目录。使用GetWindowsDirectory函数获取此目录的路径。

  5. 当前目录。

  6. PATH环境变量中列出的目录。请注意,这不包括由App Paths注册表项指定的每个应用程序路径。计算DLL搜索路径时不会使用App Paths键。

  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.


这篇关于LoadLibrary A在哪里查找文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 10:03