Kernel32GetVolumeInformation Method

Retrieves information about the file system and volume associated with the specified root directory.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: 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
)

Parameters

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.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also