#ifndef _NTIOAPI_H
/**
* The NtQueryInformationFile routine returns various kinds of information about a file object.
*
* \param FileHandle A handle to the file object representing the file or directory.
* \param 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 FileInformation.
* \param FileInformation Pointer to a caller-allocated buffer into which the routine writes the requested information about the file object.
* \param Length The size, in bytes, of the buffer pointed to by FileInformation.
* \param FileInformationClass Specifies the type of information to be returned about the file, in the buffer that FileInformation points to.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntqueryinformationfile
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryInformationFile(
_In_ HANDLE FileHandle,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_writes_bytes_(Length) PVOID FileInformation,
_In_ ULONG Length,
_In_ FILE_INFORMATION_CLASS FileInformationClass
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryInformationFile(
_In_ HANDLE FileHandle,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_writes_bytes_(Length) PVOID FileInformation,
_In_ ULONG Length,
_In_ FILE_INFORMATION_CLASS FileInformationClass
);
View code on GitHub
This function is documented in Windows Driver Kit here and here.
(Also available in Microsoft 2000 DDK)
HANDLE
to File Object.
Completion status of call.
Caller's allocated buffer for result data.
Length of FileInformation
buffer, in bytes.
Enumerated information class. See FILE_INFORMATION_CLASS
for detailed information about usage.