GetLongPathName

[This is preliminary documentation and subject to change.]

The GetLongPathName function converts the specified path to its long form. If no long path is found, this function simply returns the specified name.

DWORD GetLongPathName(
  LPCTSTR lpszShortPath, 
  LPTSTR lpszLongPath, 
  DWORD cchBuffer
);
 

Parameters

lpszShortPath
Pointer to a null-terminated path to be converted.
lpszLongPath
Pointer to the buffer to receive the long path. You can use the same buffer you used for the lpszShortPath parameter.
cchBuffer
Specifies the size of the buffer, in characters.

Return Values

If the function succeeds, the return value is the length of the string copied to the lpszLongPath parameter, in characters. This length does not include the terminating null character.

If lpszLongPath is too small, the function returns the size of the buffer required to hold the long path, in characters.

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

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98 or later.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

File I/O Overview, File Functions, GetShortPathName