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).
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 GetVolumeNameForVolumeMountPoint(
string volumeMountPoint,
StringBuilder volumeName,
uint bufferLength
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetVolumeNameForVolumeMountPoint (
volumeMountPoint As String,
volumeName As StringBuilder,
bufferLength As UInteger
) As Boolean
Dim volumeMountPoint As String
Dim volumeName As StringBuilder
Dim bufferLength As UInteger
Dim returnValue As Boolean
returnValue = Kernel32.GetVolumeNameForVolumeMountPoint(volumeMountPoint,
volumeName, bufferLength)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool GetVolumeNameForVolumeMountPoint(
String^ volumeMountPoint,
StringBuilder^ volumeName,
unsigned int bufferLength
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetVolumeNameForVolumeMountPoint :
volumeMountPoint : string *
volumeName : StringBuilder *
bufferLength : uint32 -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.