Group: File System - Library: kernel32
Enumerating Volumes and Volume Mounting Points (NTFS)
BOOL GetVolumePathNamesForVolumeName(
LPCTSTR lpszVolumeName,
LPTSTR lpszVolumePathNames,
DWORD cchBufferLength,
PDWORD lpcchReturnLength
);
DECLARE INTEGER GetVolumePathNamesForVolumeName IN kernel32;
STRING lpszVolumeName,;
STRING @lpszVolumePathNames,;
LONG cchBufferLength,;
LONG @lpcchReturnLength
lpszVolumeName [in] Pointer to a string that specifies the volume name.
lpszVolumePathNames [out] Pointer to a buffer that receives the list of null-terminated volume path names.
cchBufferLength [in] Length of the lpszVolumePathNames buffer, in TCHARs.
lpcchReturnLength [out] If the call is successful, this parameter is the number of TCHARs copied to the lpszVolumePathNames buffer.
If the function succeeds, the return value is nonzero.
lpcchReturnLength -- allocate large buffer and rely on AT(Chr(0)+Chr(0), cBuffer) rather than on this parameter.
nBufsize=0
cBuffer = REPLICATE(CHR(0), 0x4000)
GetVolumePathNamesForVolumeName(;
"\\?\Volume{9da9a070-8130-11d6-bb8f-806d6172696f}\",;
@cBuffer, LEN(cBuffer), @nBufsize)
cBuffer = SUBSTR(cBuffer, 1, AT(CHR(0)+CHR(0), cBuffer))
* returns "A:\"