青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

woaidongmao

文章均收錄自他人博客,但不喜標(biāo)題前加-[轉(zhuǎn)貼],因其丑陋,見(jiàn)諒!~
隨筆 - 1469, 文章 - 0, 評(píng)論 - 661, 引用 - 0
數(shù)據(jù)加載中……

Dynamic-Link Library Search Order

 

http://msdn.microsoft.com/en-us/library/ms682586(v=vs.85).aspx

 

 

A system can contain multiple versions of the same dynamic-link library (DLL). Applications can control the location from which a DLL is loaded by specifying a full path, using DLL redirection, or by using a manifest. If none of these methods are used, the system searches for the DLL at load time as described in this topic.

If a DLL with dependencies is loaded by specifying a full path, the system searches for the DLL's dependent DLLs as if they were loaded with just their module names.

If a DLL with the same module name is already loaded in memory, the system checks only for redirection and a manifest before resolving to the loaded DLL, no matter which directory it is in. The system does not search for the DLL.

If the DLL is on the list of known DLLs for the version of Windows on which the application is running, the system uses its copy of the known DLL (and the known DLL's dependent DLLs, if any) instead of searching for the DLL. For a list of known DLLs, see the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs.

Standard Search Order

The DLL search order used by the system depends on whether safe DLL search mode is enabled or disabled.

Safe DLL search mode is enabled by default. To disable this feature, create the HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode registry value and set it to 0. Calling the SetDllDirectory function effectively disables SafeDllSearchMode while the specified directory is in the search path and changes the search order as described in this topic.

Windows XP and Windows 2000 with SP4:  Safe DLL search mode is disabled by default. To enable this feature, create the SafeDllSearchMode registry value and set it to 1. Safe DLL search mode is enabled by default starting with Windows XP with Service Pack 2 (SP2).

Windows 2000:  The SafeDllSearchMode value is not supported. The DLL search order is identical to the search order that occurs when safe DLL search mode is disabled. The SafeDllSearchMode value is supported starting with Windows 2000 with SP4.

If SafeDllSearchMode is enabled, the search order is as follows:

  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

If SafeDllSearchMode is disabled, the search order is as follows:

  1. The directory from which the application loaded.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  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. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
Alternate Search Order

The standard search order used by the system can be changed by calling the LoadLibraryEx function with LOAD_WITH_ALTERED_SEARCH_PATH. The standard search order can also be changed by calling the SetDllDirectory function.

Windows XP:  Changing the standard search order by calling SetDllDirectory is not supported until Windows XP with Service Pack 1 (SP1).

Windows 2000:  Changing the standard search order by calling SetDllDirectory is not supported.

If you specify an alternate search strategy, its behavior continues until all associated executable modules have been located. After the system starts processing DLL initialization routines, the system reverts to the standard search strategy.

The LoadLibraryEx function supports an alternate search order if the call specifies LOAD_WITH_ALTERED_SEARCH_PATH and the lpFileName parameter specifies an absolute path.

Note that the standard search strategy and the alternate search strategy specified by LoadLibraryEx with LOAD_WITH_ALTERED_SEARCH_PATH differ in just one way: The standard search begins in the calling application's directory, and the alternate search begins in the directory of the executable module that LoadLibraryEx is loading.

If SafeDllSearchMode is enabled, the alternate search order is as follows:

  1. The directory specified by lpFileName.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

If SafeDllSearchMode is disabled, the alternate search order is as follows:

  1. The directory specified by lpFileName.
  2. The current directory.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
  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. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

The SetDllDirectory function supports an alternate search order if the lpPathName parameter specifies a path. The alternate search order is as follows:

  1. The directory from which the application loaded.
  2. The directory specified by lpPathName.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
  4. The 16-bit 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. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

If the lpPathName parameter is an empty string, the call removes the current directory from the search order.

SetDllDirectory effectively disables safe DLL search mode while the specified directory is in the search path. To restore safe DLL search mode based on the SafeDllSearchMode registry value and restore the current directory to the search order, call SetDllDirectory with lpPathName as NULL.

Related Topics
Application Registration
Dynamic-Link Library Redirection
LoadLibrary
LoadLibraryEx
SetDllDirectory
Side-by-side Components

Send comments about this topic to Microsoft

Build date: 12/15/2010

Community Content Add

Annotations FAQ

How about the GAC?

From the above article, it does not seems the GAC is even searched. Is the GAC searched? When? $0 $0 $0The GAC is not searched.  Native DLLs should not be placed in the GAC.  Managed assemblies are loaded by .NET and don't use the same search order.  (Ben Voigt, Visual C++ MVP)$0$0$0 $0 $0

posted on 2011-04-27 16:08 肥仔 閱讀(464) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): Windows開(kāi)發(fā)

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产精品日韩在线一区| 欧美国产亚洲视频| 亚洲一区久久| 日韩天堂在线视频| 亚洲激情欧美| 裸体歌舞表演一区二区| 久久国产精品色婷婷| 亚洲综合另类| 一区在线播放| 国产一区二区三区久久久| 国产精品婷婷午夜在线观看| 欧美网站大全在线观看| 亚洲一区二区三区免费在线观看 | 一区二区在线看| 在线看国产一区| 亚洲欧洲一区二区三区在线观看 | 尤物视频一区二区| 亚洲欧洲视频| 中文国产成人精品| 先锋影音一区二区三区| 久久久久久久久蜜桃| 榴莲视频成人在线观看| 亚洲国产专区| 宅男噜噜噜66一区二区66| 午夜精品久久久久久久99樱桃 | 亚洲精品在线看| 亚洲一区二区欧美| 久久久久九九九九| 亚洲国产精品成人久久综合一区| 99精品视频一区二区三区| 亚洲欧美精品在线观看| 久久裸体视频| 欧美日韩精品二区第二页| 国产精品日韩在线观看| 一区二区三区在线观看欧美| 日韩亚洲国产欧美| 性久久久久久久久| 欧美va天堂va视频va在线| 亚洲伦理久久| 久久久久久高潮国产精品视| 欧美日韩成人综合| 国产在线视频不卡二| 日韩亚洲欧美一区| 久久久久久久一区| 亚洲九九精品| 久久精品国产亚洲精品| 欧美日韩一区二区视频在线 | 久久久噜噜噜久噜久久| 亚洲黄色在线| 欧美影片第一页| 欧美日韩视频在线一区二区| 韩国成人精品a∨在线观看| 一区二区日韩欧美| 蜜桃av一区二区三区| 亚洲一级二级| 欧美激情二区三区| 国语自产在线不卡| 亚洲午夜精品久久| 欧美激情综合| 欧美在线观看天堂一区二区三区| 欧美日韩1区| 亚洲激情视频在线播放| 久久成人国产| 在线视频中文亚洲| 欧美激情精品久久久久久| 国产一区二区三区免费观看| 亚洲专区国产精品| 亚洲精品1区2区| 久久爱另类一区二区小说| 国产精品久久久久久久9999| 亚洲精品在线视频观看| 牛人盗摄一区二区三区视频| 午夜精品电影| 国产精品久久福利| 一区二区欧美日韩视频| 欧美国产激情| 久久久久久夜精品精品免费| 国产午夜亚洲精品理论片色戒| 99视频超级精品| 亚洲电影欧美电影有声小说| 久久久99爱| 国内精品久久久久久久果冻传媒 | 亚洲国产高清一区二区三区| 久久久久久亚洲精品中文字幕| 国产一区二区高清不卡| 性做久久久久久| 中日韩高清电影网| 欧美日韩在线综合| 99pao成人国产永久免费视频| 欧美成人蜜桃| 久久综合色8888| 悠悠资源网亚洲青| 久久精品麻豆| 性色av一区二区三区在线观看| 国产精品久久久久久久久免费桃花 | 99re热这里只有精品视频| 欧美国产一区在线| 99天天综合性| 亚洲毛片在线观看| 欧美午夜美女看片| 亚洲香蕉成视频在线观看| 一本色道久久综合狠狠躁篇的优点| 欧美日韩国产91| 亚洲视频免费| 亚洲一级黄色片| 国产精品视频免费一区| 欧美一区日韩一区| 欧美专区亚洲专区| 激情综合久久| 欧美黄色免费| 欧美欧美天天天天操| 亚洲一区不卡| 午夜精品短视频| 狠狠久久综合婷婷不卡| 久久中文欧美| 欧美国产在线观看| 亚洲视频久久| 午夜精品视频在线观看| 怡红院av一区二区三区| 亚洲国产精品123| 欧美日韩亚洲一区二区三区在线 | 日韩系列欧美系列| 一本高清dvd不卡在线观看| 国产精品视频网| 久久久水蜜桃| 欧美二区在线播放| 亚洲欧美成人综合| 欧美一区二区三区在线看| 亚洲大胆人体视频| 亚洲另类视频| 国产日韩欧美在线观看| 免费成人黄色| 欧美三级电影网| 久久精品一区蜜桃臀影院| 久久亚洲国产成人| 亚洲午夜国产一区99re久久| 性做久久久久久免费观看欧美| 1000部精品久久久久久久久| 99re热这里只有精品视频| 国产日韩欧美精品在线| 欧美激情网友自拍| 国产精品美女在线观看| 你懂的亚洲视频| 国产精品a级| 欧美成人免费视频| 国产精品免费久久久久久| 女人香蕉久久**毛片精品| 欧美网站在线| 欧美r片在线| 国产精品―色哟哟| 亚洲成人在线网| 国产毛片一区二区| 亚洲国产一区在线观看| 国产一区在线看| 99在线|亚洲一区二区| 激情综合自拍| 亚洲制服av| 日韩一区二区高清| 久久成人国产| 亚洲欧美日韩在线播放| 欧美大胆成人| 久久综合久久美利坚合众国| 国产精品v亚洲精品v日韩精品| 欧美h视频在线| 国产日韩一级二级三级| 日韩亚洲一区在线播放| 亚洲国产精品一区二区www在线| 亚洲一区二区在| 亚洲作爱视频| 久久综合色8888| 久久久91精品国产一区二区三区 | 国产精品亚洲欧美| 亚洲精品免费在线| 亚洲国产精品v| 久久精品国产免费看久久精品| 亚洲欧美久久| 欧美日韩美女在线观看| 亚洲国产精品ⅴa在线观看 | 欧美一区二区三区免费观看视频 | 国产精品普通话对白| 91久久一区二区| 亚洲国产美国国产综合一区二区 | 国产午夜精品视频免费不卡69堂| 日韩一级大片在线| 亚洲人成网站精品片在线观看| 久久精品免费电影| 久久电影一区| 国产啪精品视频| 亚洲资源av| 亚洲女性裸体视频| 欧美午夜在线| 一本久道久久久| 亚洲午夜精品一区二区三区他趣 | av成人免费| 欧美伦理91i| 亚洲美女视频在线观看| 亚洲欧洲日产国产网站| 美女任你摸久久| 亚洲成在线观看| 亚洲免费精品|