mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
- Fix bug 1764 reported by alexvlas.
svn path=/trunk/; revision=23622
This commit is contained in:
parent
233e643648
commit
baf87a4cfb
1 changed files with 24 additions and 10 deletions
|
@ -1067,6 +1067,7 @@ IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject,
|
|||
PEXTENDED_DEVOBJ_EXTENSION DeviceExtension;
|
||||
PVPB Vpb;
|
||||
KIRQL OldIrql;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Make sure there's a VPB */
|
||||
if (!FileSystemDeviceObject->Vpb) return STATUS_INVALID_PARAMETER;
|
||||
|
@ -1079,21 +1080,34 @@ IoGetDiskDeviceObject(IN PDEVICE_OBJECT FileSystemDeviceObject,
|
|||
|
||||
/* Make sure this one has a VPB too */
|
||||
Vpb = DeviceExtension->Vpb;
|
||||
if (!Vpb) return STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* Make sure that it's mounted */
|
||||
if ((!Vpb->ReferenceCount) || (Vpb->Flags & VPB_MOUNTED))
|
||||
if (Vpb)
|
||||
{
|
||||
/* It's not, so return failure */
|
||||
return STATUS_VOLUME_DISMOUNTED;
|
||||
}
|
||||
/* Make sure that it's mounted */
|
||||
if ((Vpb->ReferenceCount) &&
|
||||
(Vpb->Flags & VPB_MOUNTED))
|
||||
{
|
||||
/* Return the Disk Device Object */
|
||||
*DiskDeviceObject = Vpb->RealDevice;
|
||||
|
||||
/* Return the Disk Device Object */
|
||||
*DiskDeviceObject = Vpb->RealDevice;
|
||||
/* Reference it and return success */
|
||||
ObReferenceObject(Vpb->RealDevice);
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's not, so return failure */
|
||||
return STATUS_VOLUME_DISMOUNTED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Fail */
|
||||
Status = STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* Release the lock */
|
||||
IoReleaseVpbSpinLock(OldIrql);
|
||||
return STATUS_SUCCESS;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue