网站首页  词典首页

请输入您要查询的函数:

 

术语 setdlldirectory
释义 SetDllDirectory
语法:
C++
BOOL WINAPI SetDllDirectory(
__in_opt LPCTSTR lpPathName
);
SetDllDirectory功能
添加一个目录搜索路径用于定位应用程序的DLL。
参数
lpPathName [中,可选]
该目录添加到搜索路径。如果这个参数是一个空字符串(""),调用删除从默认的DLL的搜索顺序当前目录。如果该参数为NULL,则函数还原默认的搜索顺序。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该SetDllDirectory功能影响的所有后续调用LoadLibrary和LoadLibraryEx函数。它也有效地禁用安全的DLL搜索模式,同时在指定的目录中的搜索路径。
在调用SetDllDirectory,该DLL的搜索路径是:
该目录由该应用程序加载。
由lpPathName参数指定的目录。
该系统目录。使用GetSystemDirectory函数获得这个目录的路径。这个目录的名称是System32。
16位系统目录。没有函数获得这个目录的路径,但它是搜索。该目录的名称是系统。
Windows目录。使用GetWindowsDirectory函数获得这个目录的路径。
即是在PATH环境变量中列出的目录。
要恢复到默认的搜索路径LoadLibrary及LoadLibraryEx,请与NULL SetDllDirectory使用。这也恢复安全的DLL搜索模式的基础上SafeDllSearchMode注册表值。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0502或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持clientWindows SP1的Vista中,Windows XP的
最低支持serverWindows服务器2003
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesSetDllDirectoryW(Unicode)和SetDllDirectoryA(ANSI)的
参见
动态链接库搜索顺序
GetDllDirectory
GetSystemDirectory
GetWindowsDirectory
调用LoadLibrary
LoadLibraryEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetDllDirectory Function
Adds a directory to the search path used to locate DLLs for the application.
Syntax
C++
BOOL WINAPI SetDllDirectory(
__in_opt LPCTSTR lpPathName
);
Parameters
lpPathName [in, optional]
The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is NULL, the function restores the default search order.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The SetDllDirectory function affects all subsequent calls to the LoadLibrary and LoadLibraryEx functions. It also effectively disables safe DLL search mode while the specified directory is in the search path.
After calling SetDllDirectory, the DLL search path is:
The directory from which the application loaded.
The directory specified by the lpPathName parameter.
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
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.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
To revert to the default search path used by LoadLibrary and LoadLibraryEx, call SetDllDirectory with NULL. This also restores safe DLL search mode based on the SafeDllSearchMode registry value.
To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows Vista, Windows XP with SP1
Minimum supported serverWindows Server 2003
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesSetDllDirectoryW (Unicode) and SetDllDirectoryA (ANSI)
See Also
Dynamic-Link Library Search Order
GetDllDirectory
GetSystemDirectory
GetWindowsDirectory
LoadLibrary
LoadLibraryEx
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686203(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2025/1/9 3:57:35