Retrieves a list of drive letters and volume GUID paths for the specified volume.
For more information about volume GUID paths, see
Naming a File or Directory.
Syntax
BOOL WINAPI GetVolumePathNamesForVolumeName(
__in LPCTSTR lpszVolumeName,
__out LPTSTR lpszVolumePathNames,
__in DWORD cchBufferLength,
__out PDWORD lpcchReturnLength
);
Parameters
- lpszVolumeName [in]
-
A volume GUID path for the volume. A volume GUID path is of the form "\\?\Volume{GUID}\" where GUID is a GUID that identifies the volume.
- lpszVolumePathNames [out]
-
A pointer to a buffer that receives the list of drive letters and volume GUID paths. The list is an array of null-terminated strings terminated by an additional NULL character. If the buffer is not large enough to hold the complete list, the buffer holds as much of the list as possible.
- cchBufferLength [in]
-
The length of the lpszVolumePathNames buffer, in TCHARs, including all NULL characters.
- lpcchReturnLength [out]
-
If the call is successful, this parameter is the number of TCHARs copied to the lpszVolumePathNames buffer. Otherwise, this parameter is the size of the buffer required to hold the complete list, in TCHARs.
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. If the buffer is not large enough to hold the complete list, the error code is ERROR_MORE_DATA and the lpcchReturnLength parameter receives the required buffer size.
Remarks
To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0501 or later. For more information, see
Using the Windows Headers.
Examples
For an example, see Displaying Volume Paths.
Requirements
| Minimum supported client | Windows XP |
| Minimum supported server | Windows Server 2003 |
| Header | WinBase.h (include Windows.h) |
| Library | Kernel32.lib |
| DLL | Kernel32.dll |
| Unicode and ANSI names | GetVolumePathNamesForVolumeNameW (Unicode) and GetVolumePathNamesForVolumeNameA (ANSI) |
See Also
- Volume Management Functions
- Mounted Folders
Send comments about this topic to Microsoft
Build date: 10/22/2009