mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:35:41 +00:00
Check for removable media and Partition length is 0, for DiskClassCheckReadWrite.
svn path=/trunk/; revision=13768
This commit is contained in:
parent
2e93c2f4d9
commit
ab1066da6a
1 changed files with 16 additions and 0 deletions
|
@ -406,10 +406,26 @@ DiskClassCheckReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
return(STATUS_INVALID_PARAMETER);
|
return(STATUS_INVALID_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
EndingOffset.QuadPart = IrpStack->Parameters.Read.ByteOffset.QuadPart +
|
EndingOffset.QuadPart = IrpStack->Parameters.Read.ByteOffset.QuadPart +
|
||||||
IrpStack->Parameters.Read.Length;
|
IrpStack->Parameters.Read.Length;
|
||||||
|
|
||||||
|
|
||||||
|
DPRINT("Ending %I64d, and RealEnding %I64d! PartSize %I64d\n",EndingOffset.QuadPart,
|
||||||
|
DeviceExtension->PartitionLength.QuadPart,
|
||||||
|
DeviceExtension->PartitionLength.QuadPart /
|
||||||
|
DeviceExtension->DiskGeometry->BytesPerSector);
|
||||||
|
|
||||||
|
if ((DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) &&
|
||||||
|
(DeviceExtension->DiskGeometry->MediaType == RemovableMedia))
|
||||||
|
{
|
||||||
|
/* Assume if removable media and if Partition length is 0, Partition not built yet! */
|
||||||
|
if (DeviceExtension->PartitionLength.QuadPart == 0)
|
||||||
|
return(STATUS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
if (EndingOffset.QuadPart > DeviceExtension->PartitionLength.QuadPart)
|
if (EndingOffset.QuadPart > DeviceExtension->PartitionLength.QuadPart)
|
||||||
{
|
{
|
||||||
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
|
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue