https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67592f97503a45a719c0623b0c65b95ea12bbaab

commit 67592f97503a45a719c0623b0c65b95ea12bbaab
Author:     Thomas Faber <[email protected]>
AuthorDate: Tue Jun 23 10:15:24 2020 +0200
Commit:     Thomas Faber <[email protected]>
CommitDate: Wed Jun 24 09:04:05 2020 +0200

    [NPFS] Fix querying FileAllInformation.
---
 drivers/filesystems/npfs/fileinfo.c | 5 ++---
 drivers/filesystems/npfs/fsctrl.c   | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/filesystems/npfs/fileinfo.c 
b/drivers/filesystems/npfs/fileinfo.c
index dd87ac75d55..56789a22a3e 100644
--- a/drivers/filesystems/npfs/fileinfo.c
+++ b/drivers/filesystems/npfs/fileinfo.c
@@ -433,7 +433,7 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
 
         case FileAllInformation:
 
-            Length -= 12;
+            Length -= sizeof(FILE_ACCESS_INFORMATION) + 
sizeof(FILE_MODE_INFORMATION) + sizeof(FILE_ALIGNMENT_INFORMATION);
             AllInfo = (PFILE_ALL_INFORMATION)Buffer;
             NpQueryBasicInfo(Ccb, &AllInfo->BasicInformation, &Length);
             NpQueryStandardInfo(Ccb, &AllInfo->StandardInformation, &Length, 
NamedPipeEnd);
@@ -441,7 +441,6 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
             NpQueryEaInfo(Ccb, &AllInfo->EaInformation, &Length);
             NpQueryPositionInfo(Ccb, &AllInfo->PositionInformation, &Length, 
NamedPipeEnd);
             Status = NpQueryNameInfo(Ccb, &AllInfo->NameInformation, &Length);
-            Length += 96;
             break;
 
         case FileEaInformation:
@@ -453,7 +452,7 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
             break;
     }
 
-    Irp->IoStatus.Information = IoStack->Parameters.Read.Length - Length;
+    Irp->IoStatus.Information = IoStack->Parameters.QueryFile.Length - Length;
     return Status;
 }
 
diff --git a/drivers/filesystems/npfs/fsctrl.c 
b/drivers/filesystems/npfs/fsctrl.c
index d9ff6c846ee..0c93c8ad1cf 100644
--- a/drivers/filesystems/npfs/fsctrl.c
+++ b/drivers/filesystems/npfs/fsctrl.c
@@ -604,7 +604,7 @@ NpTransceive(IN PDEVICE_OBJECT DeviceObject,
         NewIrp->Tail.Overlay.Thread = Irp->Tail.Overlay.Thread;
         NewIrp->IoStatus.Information = BytesWritten;
 
-        IoStack->Parameters.Read.Length = BytesWritten;
+        IoStack->Parameters.Write.Length = BytesWritten;
         IoStack->MajorFunction = IRP_MJ_WRITE;
 
         if (BytesWritten > 0) NewIrp->Flags = IRP_DEALLOCATE_BUFFER | 
IRP_BUFFERED_IO;

Reply via email to