Kernel32GetVolumeInformation Method
Retrieves information about the file system and volume associated with the specified root directory.
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 GetVolumeInformation(
string rootPathName,
StringBuilder volumeNameBuffer,
int volumeNameSize,
ref uint refVolumeSerialNumber,
ref int refMaximumComponentLength,
ref VolumeInformationFlags refFileSystemFlags,
StringBuilder fileSystemNameBuffer,
int fileSystemNameSize
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetVolumeInformation (
rootPathName As String,
volumeNameBuffer As StringBuilder,
volumeNameSize As Integer,
ByRef refVolumeSerialNumber As UInteger,
ByRef refMaximumComponentLength As Integer,
ByRef refFileSystemFlags As VolumeInformationFlags,
fileSystemNameBuffer As StringBuilder,
fileSystemNameSize As Integer
) As Boolean
Dim rootPathName As String
Dim volumeNameBuffer As StringBuilder
Dim volumeNameSize As Integer
Dim refVolumeSerialNumber As UInteger
Dim refMaximumComponentLength As Integer
Dim refFileSystemFlags As VolumeInformationFlags
Dim fileSystemNameBuffer As StringBuilder
Dim fileSystemNameSize As Integer
Dim returnValue As Boolean
returnValue = Kernel32.GetVolumeInformation(rootPathName,
volumeNameBuffer, volumeNameSize,
refVolumeSerialNumber, refMaximumComponentLength,
refFileSystemFlags, fileSystemNameBuffer,
fileSystemNameSize)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool GetVolumeInformation(
String^ rootPathName,
StringBuilder^ volumeNameBuffer,
int volumeNameSize,
unsigned int% refVolumeSerialNumber,
int% refMaximumComponentLength,
VolumeInformationFlags% refFileSystemFlags,
StringBuilder^ fileSystemNameBuffer,
int fileSystemNameSize
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetVolumeInformation :
rootPathName : string *
volumeNameBuffer : StringBuilder *
volumeNameSize : int *
refVolumeSerialNumber : uint32 byref *
refMaximumComponentLength : int byref *
refFileSystemFlags : VolumeInformationFlags byref *
fileSystemNameBuffer : StringBuilder *
fileSystemNameSize : int -> bool
No code example is currently available or this language may not be supported.
- rootPathName String
-
The root directory of the volume to be described.
If this parameter is , the root of the current directory is used.
- volumeNameBuffer StringBuilder
-
A buffer that receives the name of a specified volume.
The buffer size is specified by the volumeNameSize parameter.
- volumeNameSize Int32
-
The character length of the buffer specified in volumeNameBuffer parameter.
- refVolumeSerialNumber UInt32
-
A variable that receives the volume serial number.
This parameter can be if the serial number is not required.
- refMaximumComponentLength Int32
-
A variable that receives the maximum character length
of a file name component that a specified file system supports.
A file name component is the portion of a file name between backslashes.
- refFileSystemFlags VolumeInformationFlags
-
A variable that receives flags associated with the specified file system.
- fileSystemNameBuffer StringBuilder
-
A buffer that receives the name of the file system,
for example, the FAT file system or the NTFS file system.
The buffer size is specified by the fileSystemNameSize parameter.
- fileSystemNameSize Int32
-
The character length of the buffer specified in fileSystemNameBuffer parameter.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.