[KS] KsQueryInformationFile(): Fallback to IRP if FastIO failed

Or, if it succeeded, return the actual NTSTATUS, not an unrelated BOOLEAN.

Addendum to commit 4725a4fd9c (r42117).

CORE-16618
This commit is contained in:
Serge Gautherie 2020-01-07 16:49:26 +01:00 committed by Victor Perevertkin
parent 7405dc36b6
commit b326312d52

View file

@ -367,17 +367,31 @@ KsQueryInformationFile(
if (FileInformationClass == FileBasicInformation)
{
/* use FastIoQueryBasicInfo routine */
if (FastIoDispatch->FastIoQueryBasicInfo)
if (FastIoDispatch->FastIoQueryBasicInfo != NULL &&
FastIoDispatch->FastIoQueryBasicInfo(
FileObject,
TRUE,
(PFILE_BASIC_INFORMATION)FileInformation,
&IoStatusBlock,
DeviceObject))
{
return FastIoDispatch->FastIoQueryBasicInfo(FileObject, TRUE, (PFILE_BASIC_INFORMATION)FileInformation, &IoStatusBlock, DeviceObject);
/* request was handled */
return IoStatusBlock.Status;
}
}
else if (FileInformationClass == FileStandardInformation)
{
/* use FastIoQueryStandardInfo routine */
if (FastIoDispatch->FastIoQueryStandardInfo)
if (FastIoDispatch->FastIoQueryStandardInfo != NULL &&
FastIoDispatch->FastIoQueryStandardInfo(
FileObject,
TRUE,
(PFILE_STANDARD_INFORMATION)FileInformation,
&IoStatusBlock,
DeviceObject))
{
return FastIoDispatch->FastIoQueryStandardInfo(FileObject, TRUE, (PFILE_STANDARD_INFORMATION)FileInformation, &IoStatusBlock, DeviceObject);
/* request was handled */
return IoStatusBlock.Status;
}
}
}