where is LoadLibrary A looking for the file?

后端 未结 2 439
没有蜡笔的小新
没有蜡笔的小新 2021-01-21 15:30

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 i

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-21 16:18

    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. 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.

提交回复
热议问题