본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

AddDllDirectory

by i.got.it 2017. 3. 17.


Adds a directory to the process DLL search path.



  DLL_DIRECTORY_COOKIE  WINAPI AddDllDirectory(
  _In_ PCWSTR NewDirectory
);




Parameters

NewDirectory [in]

An absolute path to the directory to add to the search path. For example, to add the directory Dir2 to the process DLL search path, specify \Dir2. For more information about paths, see Naming Files, Paths, and Namespaces.

Return value

If the function succeeds, the return value is an opaque pointer that can be passed to RemoveDllDirectory to remove the DLL from the process DLL search path.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The AddDllDirectory function can be used to add any absolute path to the set of directories that are searched for a DLL. If SetDefaultDllDirectories is first called with LOAD_LIBRARY_SEARCH_USER_DIRS, directories specified with AddDllDirectory are added to the process DLL search path. Otherwise, directories specified with the AddDllDirectory function are used only for LoadLibraryEx function calls that specify LOAD_LIBRARY_SEARCH_USER_DIRS.

If AddDllDirectory is used to add more than one directory to the process DLL search path, the order in which those directories are searched is unspecified.

To remove a directory added with AddDllDirectory, use the RemoveDllDirectory function.

Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008:  To use this function in an application, call GetProcAddress to retrieve the function's address from Kernel32.dll. KB2533623 must be installed on the target platform.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Version

KB2533623 on Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008

Header

LibLoaderAPI.h (include Windows.h);
None on Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008

DLL

Kernel32.dll

 

 

from : https://msdn.microsoft.com/en-us/library/hh310513(v=vs.85).aspx


///1256.

댓글



 

비트코인




암호화폐       외환/나스닥/골드         암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)         프랍 트레이더 온라인 지원가능. MT4,MT5