RemoveDllDirectory function

Removes a directory that was added to the process DLL search path by using AddDllDirectory.

Syntax

BOOL RemoveDllDirectory(
  DLL_DIRECTORY_COOKIE Cookie
);

Parameters

Cookie

The cookie returned by AddDllDirectory when the directory was added to the search path.

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

After RemoveDllDirectory returns, the cookie is no longer valid and should not be used.

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

Requirements

   
Windows version Windows 8 [desktop apps only],KB2533623 on Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008 Windows Server 2012 [desktop apps only]
Target Platform Windows
Header libloaderapi.h (include Windows.h)
DLL Kernel32.dll