GetVolumePathNamesForVolumeNameW function (fileapi.h)

Retrieves a list of drive letters and mounted folder paths for the specified volume.

Syntax

BOOL GetVolumePathNamesForVolumeNameW(
  [in]  LPCWSTR lpszVolumeName,
  [out] LPWCH   lpszVolumePathNames,
  [in]  DWORD   cchBufferLength,
  [out] PDWORD  lpcchReturnLength
);

Parameters

[in] lpszVolumeName

A volume GUID path for the volume. A volume GUID path is of the form "\\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\".

[out] lpszVolumePathNames

A pointer to a buffer that receives the list of drive letters and mounted folder 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.

[in] cchBufferLength

The length of the lpszVolumePathNames buffer, in WCHARs, including all NULL characters.

[out] lpcchReturnLength

If the call is successful, this parameter is the number of WCHARs copied to the lpszVolumePathNames buffer. Otherwise, this parameter is the size of the buffer required to hold the complete list, in WCHARs.

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

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol No
SMB 3.0 Transparent Failover (TFO) No
SMB 3.0 with Scale-out File Shares (SO) No
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes
 

SMB does not support volume management functions.

Examples

For an example, see Displaying Volume Paths.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header fileapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Mounted Folders

Volume Management Functions