Kernel32GetVolumeNameForVolumeMountPoint Method

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).

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool GetVolumeNameForVolumeMountPoint(
	string volumeMountPoint,
	StringBuilder volumeName,
	uint bufferLength
)

Parameters

volumeMountPoint  String
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 ('').

volumeName  StringBuilder
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.

bufferLength  UInt32
The length of the output buffer.

A reasonable size for the buffer to accommodate the largest possible volume GUID path is 50 characters.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also