#ifndef _NTIOAPI_H
/**
* The FILE_ID_INFORMATION structure contains the identification information returned by
* NtQueryInformationFile with FileIdInformation (59).
* \remarks This is a query-only information class. The buffer must be at least 24 bytes; the I/O manager
* probes user-mode buffers with 4-byte alignment. The structure has 8-byte alignment under default packing.
* VolumeSerialNumber is at offset 0x00 and the 16-byte FileId is at offset 0x08; the total size is 0x18 bytes.
* Compare both the volume serial number and the complete 128-bit file identifier when comparing file identities.
* The file system defines the identifier. The FileInternal and low/high-part members are overlapping views
* of its bytes, not additional returned fields; interpreting FileInternal as the FileInternalInformation result
* requires knowledge of the target file system.
* \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-file_id_information
*/
typedef struct _FILE_ID_INFORMATION
{
ULONGLONG VolumeSerialNumber; // Serial number of the volume containing the file.
union
{
FILE_ID_128 FileId; // Complete 128-bit identifier generated by the file system.
struct
{
union
{
FILE_INTERNAL_INFORMATION FileInternal; // rev: overlays FileId.Identifier[0..7].
LONGLONG FileIdLowPart; // rev: overlays FileId.Identifier[0..7].
} DUMMYUNIONNAME;
LONGLONG FileIdHighPart; // rev: overlays FileId.Identifier[8..15].
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
} FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
View code on GitHub// ntifs.h
typedef struct _FILE_ID_INFORMATION {
ULONGLONG VolumeSerialNumber;
FILE_ID_128 FileId;
} FILE_ID_INFORMATION, *PFILE_ID_INFORMATION;
View the official Windows Driver Kit DDI referenceThis structure is documented in Windows Driver Kit.
FILE_ID_INFORMATION is used to query file identification information.
VolumeSerialNumberSerial number of the volume where the file is located.
FileId128-bit value that uniquely identifies the file within the given volume. This identifier is generated by the file system. For file systems that do not support a 128-bit file ID, this field must be set to 0, and must be ignored.