[NPFS] Fix querying FileAllInformation.

This commit is contained in:
Thomas Faber 2020-06-23 10:15:24 +02:00
parent 21e9e2baa5
commit 67592f9750
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
2 changed files with 3 additions and 4 deletions

View file

@ -433,7 +433,7 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
case FileAllInformation: case FileAllInformation:
Length -= 12; Length -= sizeof(FILE_ACCESS_INFORMATION) + sizeof(FILE_MODE_INFORMATION) + sizeof(FILE_ALIGNMENT_INFORMATION);
AllInfo = (PFILE_ALL_INFORMATION)Buffer; AllInfo = (PFILE_ALL_INFORMATION)Buffer;
NpQueryBasicInfo(Ccb, &AllInfo->BasicInformation, &Length); NpQueryBasicInfo(Ccb, &AllInfo->BasicInformation, &Length);
NpQueryStandardInfo(Ccb, &AllInfo->StandardInformation, &Length, NamedPipeEnd); NpQueryStandardInfo(Ccb, &AllInfo->StandardInformation, &Length, NamedPipeEnd);
@ -441,7 +441,6 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
NpQueryEaInfo(Ccb, &AllInfo->EaInformation, &Length); NpQueryEaInfo(Ccb, &AllInfo->EaInformation, &Length);
NpQueryPositionInfo(Ccb, &AllInfo->PositionInformation, &Length, NamedPipeEnd); NpQueryPositionInfo(Ccb, &AllInfo->PositionInformation, &Length, NamedPipeEnd);
Status = NpQueryNameInfo(Ccb, &AllInfo->NameInformation, &Length); Status = NpQueryNameInfo(Ccb, &AllInfo->NameInformation, &Length);
Length += 96;
break; break;
case FileEaInformation: case FileEaInformation:
@ -453,7 +452,7 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
break; break;
} }
Irp->IoStatus.Information = IoStack->Parameters.Read.Length - Length; Irp->IoStatus.Information = IoStack->Parameters.QueryFile.Length - Length;
return Status; return Status;
} }

View file

@ -604,7 +604,7 @@ NpTransceive(IN PDEVICE_OBJECT DeviceObject,
NewIrp->Tail.Overlay.Thread = Irp->Tail.Overlay.Thread; NewIrp->Tail.Overlay.Thread = Irp->Tail.Overlay.Thread;
NewIrp->IoStatus.Information = BytesWritten; NewIrp->IoStatus.Information = BytesWritten;
IoStack->Parameters.Read.Length = BytesWritten; IoStack->Parameters.Write.Length = BytesWritten;
IoStack->MajorFunction = IRP_MJ_WRITE; IoStack->MajorFunction = IRP_MJ_WRITE;
if (BytesWritten > 0) NewIrp->Flags = IRP_DEALLOCATE_BUFFER | IRP_BUFFERED_IO; if (BytesWritten > 0) NewIrp->Flags = IRP_DEALLOCATE_BUFFER | IRP_BUFFERED_IO;