[MOUNTMGR] Fix QueryPointsFromMemory and make it working
authorPierre Schweitzer <pierre@reactos.org>
Thu, 5 Sep 2019 06:28:56 +0000 (08:28 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 5 Sep 2019 06:36:19 +0000 (08:36 +0200)
Select the current stack location for output buffer
And set output size so that buffer gets properly copied to caller

drivers/filters/mountmgr/point.c

index d9a468f..d63ec3a 100644 (file)
@@ -332,12 +332,13 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
     }
 
     /* Now, ensure output buffer can hold everything */
     }
 
     /* Now, ensure output buffer can hold everything */
-    Stack = IoGetNextIrpStackLocation(Irp);
+    Stack = IoGetCurrentIrpStackLocation(Irp);
     MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
 
     /* Ensure we set output to let user reallocate! */
     MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSize;
     MountPoints->NumberOfMountPoints = TotalSymLinks;
     MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
 
     /* Ensure we set output to let user reallocate! */
     MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSize;
     MountPoints->NumberOfMountPoints = TotalSymLinks;
+    Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSize;
 
     if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
     {
 
     if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
     {