Platform SDK: Files and I/O |
The GetVolumeNameForVolumeMountPoint function takes a volume mount point or root directory and returns the corresponding unique volume name.
BOOL GetVolumeNameForVolumeMountPoint( LPCTSTR lpszVolumeMountPoint, // volume mount point or directory LPTSTR lpszVolumeName, // volume name buffer DWORD cchBufferLength // size of volume name buffer );
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.
The lpszVolumeMountPoint input string may be a drive letter with appended backslash (\), such as "D:\". Alternatively, it may be a path to a volume mount point, again with appended backslash (\), such as "c:\mnt\edrive\".
Use GetVolumeNameForVolumeMountPoint to obtain unique volume names for use with other functions that work with volume mount points and volume mounting. For more information, see Unique Volume Names.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows 2000.
File Systems Overview, File System Functions, DeleteVolumeMountPoint, GetVolumePathName, SetVolumeMountPoint