您的位置:首页 > 其它

使用LoadLibrary函数装载一个DLL文件,没有指定文件路径,那么操作系统搜索DLL文件的策略如下

2016-02-17 15:36 363 查看
程序中调用LoadLibrary函数装载一个DLL文件,没有指定文件路径,那么Windows操作系统搜索DLL文件的顺序如下:

MSDN中说得很明白:

1.The directory where the executable module for the current process is located.

进程的所在目录

2.The current directory.

当前目录

3.The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.

Windows系统目录

4.The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.

Windows目录

5.The directories listed in the PATH environment variable.

Path环境变量中的目录

当一个DLL文件被装入内存后,其他应用程序不必再重复装入同名的DLL(不论要装入的DLL存放在什么位置)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: