使用LoadLibrary函數裝載一個DLL文件,沒有指定文件路徑,那麼操作系統搜索DLL文件的策略如下

程序中調用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存放在什麼位置)。





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章