Kernel32GetVolumePathName Method
Retrieves the volume mount point where the specified path is mounted.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetVolumePathName (
fileName As String,
volumePathName As StringBuilder,
bufferLength As UInteger
) As Boolean
Dim fileName As String
Dim volumePathName As StringBuilder
Dim bufferLength As UInteger
Dim returnValue As Boolean
returnValue = Kernel32.GetVolumePathName(fileName,
volumePathName, bufferLength)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool GetVolumePathName(
String^ fileName,
StringBuilder^ volumePathName,
unsigned int bufferLength
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetVolumePathName :
fileName : string *
volumePathName : StringBuilder *
bufferLength : uint32 -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.