The function GetFileInformationByHandle gives us a structure with the values nFileIndexHigh and nFileIndexLow which comprise of a fileIndex.
What is this number? Is it the same as the USN?
Is there a way to get this fileIndex of a file without opening it (any other method except GetFileInformationByHandle)?
You can use ZwQueryDirectoryFile with
FileObjectIdInformation,FileIdBothDirectoryInformation,FileIdFullDirectoryInformationto query for object ID information for the files in a directory. In the case you have to open only the directory having the file and not the file itself. It can be useful for example if the file is opened for exclusive access or of cause if you has no permission to open a file and not have or want not use backup privilege.UPDATED: The following test example
produce on my computer as the output: