Hi,
Does anybody have experience with querying FILE_INTERNAL_INFORMATION with
ZwQueryVolumeInformationFile to get the file reference number of a file,
i.e.:
status = ZwQueryVolumeInformationFile( fileHandle, &ioStatusBlock, fileInfo,
sizeof(FILE_INTERNAL_INFORMATION), FileInternalInformation );
I am trying to execute this command on an NTFS volume on XP SP2, but I just
can’t make it work.
First, I tried to set the Length parameter to
sizeof(FILE_INTERNAL_INFORMATION) as shown above, but then I got a
PAGE_FAULT_BEYOND_END_OF_ALLOCATION bugcheck.
Next, I allocated a 1000 bytes buffer, just to see what would happen. The
command succeeded (both status == STATUS_SUCCESS and ioStatusBlock.Status ==
STATUS_SUCCESS), but fileInfo->IndexNumber (file reference number) was 0 and
ioStatusBlock.Information (number of bytes written) was 0x30. This is really
strange, since sizeof(FILE_INTERNAL_INFORMATION) == 8.
It is just as if I get other information than what I ask for.
When I try to query other information, e.g. FILE_FS_ATTRIBUTE_INFORMATION,
it works perfectly.
I have tried different combinations of arguments to ZwCreateFile when I open
the file handle, but the result is always the same. Can anybody tell me what
I am doing wrong?
Thanks,
Carsten Schmidt