Kernel32GetVolumePathName Method

Retrieves the volume mount point where the specified path is mounted.

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 GetVolumePathName(
	string fileName,
	StringBuilder volumePathName,
	uint bufferLength
)

Parameters

fileName  String
A pointer to the input path string. Both absolute and relative file and directory names, for example "..", are acceptable in this path.

If you specify a relative directory or file name without a volume qualifier, GetVolumePathName(String, StringBuilder, UInt32) returns the drive letter of the boot volume.

If this parameter is an empty string, "", the function fails but the last error is set to ERROR_SUCCESS.

volumePathName  StringBuilder
A pointer to a string that receives the volume mount point for the input path.
bufferLength  UInt32
The length of the output buffer.

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