mirror of
https://github.com/reactos/reactos.git
synced 2024-09-12 22:02:18 +00:00
- Clear capacity data buffer before reading it to avoid 0xCCCCCCCC values and manually set failure code if nobody filled it in (a hack, but I don't understand our pre-Nixon-era storage stack to "properly" fix it, so this is good enough and kills off the 0xCCCCCCCC byte non-paged pool allocations.
svn path=/trunk/; revision=25026
This commit is contained in:
parent
cd31c14fe5
commit
58fad00c6d
|
@ -1409,6 +1409,7 @@ CdromClassStartIo (IN PDEVICE_OBJECT DeviceObject,
|
||||||
MmBuildMdlForNonPagedPool (SubIrp->MdlAddress);
|
MmBuildMdlForNonPagedPool (SubIrp->MdlAddress);
|
||||||
Srb->DataBuffer = DataBuffer;
|
Srb->DataBuffer = DataBuffer;
|
||||||
|
|
||||||
|
RtlZeroMemory(DataBuffer, sizeof(READ_CAPACITY_DATA));
|
||||||
IoCallDriver (DeviceExtension->PortDeviceObject,
|
IoCallDriver (DeviceExtension->PortDeviceObject,
|
||||||
SubIrp);
|
SubIrp);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1772,6 +1772,7 @@ ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlZeroMemory(&Srb, sizeof(SCSI_REQUEST_BLOCK));
|
RtlZeroMemory(&Srb, sizeof(SCSI_REQUEST_BLOCK));
|
||||||
|
RtlZeroMemory(CapacityBuffer, sizeof(READ_CAPACITY_DATA));
|
||||||
|
|
||||||
Srb.CdbLength = 10;
|
Srb.CdbLength = 10;
|
||||||
Srb.TimeOutValue = DeviceExtension->TimeOutValue;
|
Srb.TimeOutValue = DeviceExtension->TimeOutValue;
|
||||||
|
@ -1787,6 +1788,7 @@ TryAgain:
|
||||||
FALSE);
|
FALSE);
|
||||||
DPRINT("Status: %lx\n", Status);
|
DPRINT("Status: %lx\n", Status);
|
||||||
DPRINT("Srb: %p\n", &Srb);
|
DPRINT("Srb: %p\n", &Srb);
|
||||||
|
if (CapacityBuffer->BytesPerBlock == 0) Status = STATUS_NOT_SUPPORTED;
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SectorSize = (((PUCHAR)&CapacityBuffer->BytesPerBlock)[0] << 24) |
|
SectorSize = (((PUCHAR)&CapacityBuffer->BytesPerBlock)[0] << 24) |
|
||||||
|
|
Loading…
Reference in a new issue