where is LoadLibrary A looking for the file?

后端 未结 2 437
没有蜡笔的小新
没有蜡笔的小新 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条回答
  •  -上瘾入骨i
    2021-01-21 15:54

    LoadlLibrary article specifies search order in Remarks:

    If lpFileName does not include a path and there is more than one loaded module with the same base name and extension, the function returns a handle to the module that was loaded first.

    If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file. [...]

    For more information on the DLL search order, see Dynamic-Link Library Search Order.

    File names are not case sensitive, so NTFS and FAT file names are. It is the fundamental rule to not assume case sensitivity:

    Naming Conventions

    The following fundamental rules enable applications to create and process valid names for files and directories, regardless of the file system: [...]

    Do not assume case sensitivity.

提交回复
热议问题