windows加载dll时,搜索的路径顺序

dll查找的路径顺序如下:

a. 应用程序所在目录;

b. 系统目录。 GetSystemDirectory 返回的目录,通常是系统盘\Windows\System32;

c. 16位系统目录。该项只是为了向前兼容的处理,可以不考虑;

d. Windows目录。 GetWindowsDirectory 返回的目录,通常是系统盘 \Windows ;

e. 当前目录。GetCurrentDirectory返回的目录;

f. 环境变量PATH中所有目录。

如果"安全DLL查找模式"被禁用,查找顺序如下:

a. 应用程序所在目录;

b. 当前目录。GetCurrentDirectory返回的目录;

c. 系统目录。 GetSystemDirectory 返回的目录,通常是系统盘\Windows\System32;

d. 16位系统目录。该项只是为了向前兼容的处理,可以不考虑;

e. Windows目录。 GetWindowsDirectory 返回的目录,通常是系统盘 \Windows ;

f. 环境变量PATH中所有目录。

转载于:如何找到windows加载dll时,搜索的路径顺序

猜你喜欢

转载自blog.csdn.net/m0_60352504/article/details/120070816