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

GetVolumeNameForVolumeMountPoint function

Retrieves a volume GUID path for the volume that is associated with the specified volume mount point ( drive letter, volume GUID path, or mounted folder).

Syntax


BOOL WINAPI GetVolumeNameForVolumeMountPoint(
  _In_   LPCTSTR lpszVolumeMountPoint,
  _Out_  LPTSTR lpszVolumeName,
  _In_   DWORD cchBufferLength
);

Parameters

lpszVolumeMountPoint [in]

A pointer to a string that contains the path of a mounted folder (for example, "Y:\MountX\") or a drive letter (for example, "X:\"). The string must end with a trailing backslash ('\').

lpszVolumeName [out]

A pointer to a string that receives the volume GUID path. This path is of the form "\\?\Volume{GUID}\" where GUID is a GUID that identifies the volume. If there is more than one volume GUID path for the volume, only the first one in the mount manager's cache is returned.

cchBufferLength [in]

The length of the output buffer, in TCHARs. A reasonable size for the buffer to accommodate the largest possible volume GUID path is 50 characters.

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.

Remarks

Use GetVolumeNameForVolumeMountPoint to obtain a volume GUID path for use with functions such as SetVolumeMountPoint and FindFirstVolumeMountPoint that require a volume GUID path as an input parameter. For more information about volume GUID paths, see Naming A Volume.

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)

No

 

SMB does not support volume management functions.

Mount points aren't supported by ReFS volumes.

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

GetVolumeNameForVolumeMountPointW (Unicode) and GetVolumeNameForVolumeMountPointA (ANSI)

See also

DeleteVolumeMountPoint
GetVolumePathName
SetVolumeMountPoint
Volume Management Functions
Mounted Folders

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.