Kernel32GetLogicalDriveStrings Method
Fills a buffer with strings that specify valid drives in the system.
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 uint GetLogicalDriveStrings(
uint bufferLength,
StringBuilder buffer
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetLogicalDriveStrings (
bufferLength As UInteger,
buffer As StringBuilder
) As UInteger
Dim bufferLength As UInteger
Dim buffer As StringBuilder
Dim returnValue As UInteger
returnValue = Kernel32.GetLogicalDriveStrings(bufferLength,
buffer)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static unsigned int GetLogicalDriveStrings(
unsigned int bufferLength,
StringBuilder^ buffer
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetLogicalDriveStrings :
bufferLength : uint32 *
buffer : StringBuilder -> uint32
No code example is currently available or this language may not be supported.
- bufferLength UInt32
-
The maximum size of the buffer pointed to by buffer, in characters.
This size does not include the terminating null character.
If this parameter is zero, buffer is not used.
- buffer StringBuilder
-
A pointer to a buffer that receives a series of null-terminated strings,
one for each valid drive in the system, plus with an additional null character.
Each string is a device name.
UInt32
If the function succeeds, the return value is the length, in characters, of the strings copied to the buffer,
not including the terminating null character.
Note that an ANSI-ASCII null character uses one byte, but a Unicode (UTF-16) null character uses two bytes.
If the buffer is not large enough, the return value is greater than
bufferLength.
It is the size of the buffer required to hold the drive strings.
If the function fails, the return value is zero.