Kernel32GetVolumePathNamesForVolumeName Method

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

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 GetVolumePathNamesForVolumeName(
	string volumeName,
	StringBuilder volumePathNames,
	uint bufferLength,
	out uint refReturnLength
)

Parameters

volumeName  String
A volume GUID path for the volume.

A volume GUID path is of the form "\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".

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

bufferLength  UInt32
The length of the volumePathNames buffer, including all NULL characters.

If the buffer is not large enough to hold the complete list, the error code is ERROR_MORE_DATA and the refReturnLength parameter receives the required buffer size.

refReturnLength  UInt32
If the call is successful, this parameter is the number of characters copied to the volumePathNames buffer.

Otherwise, this parameter is the size of the buffer required to hold the complete list.

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