* PROGRAMMER: Pierre Schweitzer (pierre.schweitzer@reactos.org)
*/
-/* INCLUDES *****************************************************************/
-
#include "mntmgr.h"
#define NDEBUG
FreePool(SymLink.Buffer);
MountMgrNotify(DeviceExtension);
- if (!DeviceInformation->Volume)
+ if (!DeviceInformation->ManuallyRegistered)
{
MountMgrNotifyNameChange(DeviceExtension, DeviceName, FALSE);
}
{
if (DeviceEntry == &(DeviceExtension->DeviceListHead))
{
- if (DeviceName.Buffer)
+ if (SymbolicName)
{
FreePool(DeviceName.Buffer);
}
}
/* 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;
}
/* Find back correct mount point */
if (UniqueId)
{
- if (!UniqueId->UniqueIdLength != DeviceInformation->UniqueId->UniqueIdLength)
+ if (UniqueId->UniqueIdLength != DeviceInformation->UniqueId->UniqueIdLength)
{
continue;
}
}
/* 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;
}