+ -
当前位置:首页 → 问答吧 → 关于winxp的dll搜索顺序

关于winxp的dll搜索顺序

时间:2011-12-09

来源:互联网

当前模块目录下的dll应该是最优先加载的吧


我把msvcrt.dll 复制到exe目录下,为什么他还是加载system32的那个版本?

作者: woncomp   发布时间: 2011-12-09

一般:

The directory from which the application loaded. 
The current directory. 
Windows 95/98: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory. 
Windows NT/ 2000: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32. 

Windows NT/ 2000: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM. 
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 
The directories that are listed in the PATH environment variable. 

有些系统的DLL会强制从系统目录下加载(安全缘故)

作者: agoago_2009   发布时间: 2011-12-09

一般:

1.The directory from which the application loaded.  
2.The current directory.  
3.Windows 95/98: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.  
Windows NT/ 2000: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.  

4. Windows NT/ 2000: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM. 
 
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.  
6. The directories that are listed in the PATH environment variable.  

有些系统的DLL会强制从系统目录下加载(安全缘故)

作者: agoago_2009   发布时间: 2011-12-09

谁跟你说当前目录优先加载的?
最优先是从内存映射过来,然后再是WINDOWS目录...,最后才是当前目录

作者: zhouzhipen   发布时间: 2011-12-09