}
/* 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;
+ Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalSize;
if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
{
+ Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
+
return STATUS_BUFFER_OVERFLOW;
}
}
/* Get output buffer */
- Stack = IoGetNextIrpStackLocation(Irp);
+ Stack = IoGetCurrentIrpStackLocation(Irp);
MountPoints = (PMOUNTMGR_MOUNT_POINTS)Irp->AssociatedIrp.SystemBuffer;
/* Compute output length */
/* Give length to allow reallocation */
MountPoints->Size = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalLength;
MountPoints->NumberOfMountPoints = 1;
+ Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS) + TotalLength;
if (MountPoints->Size > Stack->Parameters.DeviceIoControl.OutputBufferLength)
{
+ Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
+
return STATUS_BUFFER_OVERFLOW;
}