Export (0) Print
Expand All
4 out of 7 rated this helpful - Rate this topic

GetVolumePathNamesForVolumeName function

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

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{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\".

lpszVolumePathNames [out]

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.

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

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

TechnologySupported

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

FileAPI.h (include Windows.h);
WinBase.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP (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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.