#ifndef _NTIOAPI_H
/**
* The NtQueryVolumeInformationFile routine retrieves information about the volume associated with a given file, directory, storage device, or volume.
*
* \param[in] FileHandle A handle to the file, directory, storage device, or volume for which volume information is being requested.
* \param[out] IoStatusBlock A pointer to an IO_STATUS_BLOCK structure that receives the final completion status, and the number of bytes written to the buffer pointed to by FsInformation.
* \param[out] FsInformation A pointer to a caller-allocated buffer that receives the desired information about the volume.
* \param[in] Length The size, in bytes, of the buffer pointed to by FsInformation.
* \param[in] FsInformationClass The type of information to be returned about the volume.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryvolumeinformationfile
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryVolumeInformationFile(
_In_ HANDLE FileHandle,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_writes_bytes_(Length) PVOID FsInformation,
_In_ ULONG Length,
_In_ FSINFOCLASS FsInformationClass
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryVolumeInformationFile(
_In_ HANDLE FileHandle,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_writes_bytes_(Length) PVOID FsInformation,
_In_ ULONG Length,
_In_ FSINFOCLASS FsInformationClass
);
View code on GitHub
This function is documented in Windows Driver Kit here, here, and here.
HANDLE
to File Object.
IO result of call.
Caller's allocated buffer for output data.
Length of FileSystemInformation
buffer, in bytes.
Information class described in FS_INFORMATION_CLASS
topic.
NtQueryVolumeInformationFile
gives information about volume (device) containing file specified as FileHandle
parameter.