LoadLibraryEx() 中更改的搜索路径 (LOAD_WITH_ALTERED_SEARCH_PATH) 是什么

What is the altered search path (LOAD_WITH_ALTERED_SEARCH_PATH) in LoadLibraryEx()

LoadLibraryEx() 的文档实际上并未解释更改后的搜索路径是什么。在 LOAD_WITH_ALTERED_SEARCH_PATH 标志的 table 条目中它说 "see the Remarks section",但在备注部分它只说这个标志导致 LoadLibraryEx() 使用改变的搜索路径。

但它并没有在任何地方解释改变后的搜索路径实际上是什么。

我终于找到了解释,但它位于 LoadLibraryEx() 文档链接到的页面中 - Dynamic-Link Library Search Order

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.

因此标准从*.exe 目录开始,而更改从*.dll 目录开始。

But it doesn't explain anywhere what the altered search path actually is.

事实并非如此。 documentation 你 link 在备注部分解释了这一点:

Searching for DLLs and Dependencies

The search path is the set of directories that are searched for a DLL. The LoadLibraryEx function can search for a DLL using a standard search path or an altered search path, or it can use a process-specific search path established with the SetDefaultDllDirectories and AddDllDirectory functions. For a list of directories and the order in which they are searched, see Dynamic-Link Library Search Order.

按照该段末尾的 link 了解详细信息。您确实需要阅读所有文档,一直到页面底部。