2 out of 5 rated this helpful - Rate this topic

GetDllDirectory function

Applies to: desktop apps only

Retrieves the application-specific portion of the search path used to locate DLLs for the application.

Syntax

DWORD WINAPI GetDllDirectory(
  __in   DWORD nBufferLength,
  __out  LPTSTR lpBuffer
);

Parameters

nBufferLength [in]

The size of the output buffer, in characters.

lpBuffer [out]

A pointer to a buffer that receives the application-specific portion of the search path.

Return value

If the function succeeds, the return value is the length of the string copied to lpBuffer, in characters, not including the terminating null character. If the return value is greater than nBufferLength, it specifies the size of the buffer required for the path.

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

Remarks

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 client

Windows Vista, Windows XP with SP1

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

GetDllDirectoryW (Unicode) and GetDllDirectoryA (ANSI)

See also

Dynamic-Link Library Search Order
SetDllDirectory

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Windows Headers wrong?
Why require _WIN32_WINNT=0x0502? Shouldn't NTDDI_VERSION=NTDDI_WINXPSP1 (0x05010100) be sufficient?