Kernel32GetVolumePathNamesForVolumeName Method
Retrieves a list of drive letters and mounted folder paths for the specified volume.
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 GetVolumePathNamesForVolumeName(
string volumeName,
StringBuilder volumePathNames,
uint bufferLength,
out uint refReturnLength
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetVolumePathNamesForVolumeName (
volumeName As String,
volumePathNames As StringBuilder,
bufferLength As UInteger,
<OutAttribute> ByRef refReturnLength As UInteger
) As Boolean
Dim volumeName As String
Dim volumePathNames As StringBuilder
Dim bufferLength As UInteger
Dim refReturnLength As UInteger
Dim returnValue As Boolean
returnValue = Kernel32.GetVolumePathNamesForVolumeName(volumeName,
volumePathNames, bufferLength, refReturnLength)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool GetVolumePathNamesForVolumeName(
String^ volumeName,
StringBuilder^ volumePathNames,
unsigned int bufferLength,
[OutAttribute] unsigned int% refReturnLength
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetVolumePathNamesForVolumeName :
volumeName : string *
volumePathNames : StringBuilder *
bufferLength : uint32 *
refReturnLength : uint32 byref -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.