mirror of
https://github.com/reactos/reactos.git
synced 2024-08-23 19:58:25 +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);
|
||||
Srb->DataBuffer = DataBuffer;
|
||||
|
||||
RtlZeroMemory(DataBuffer, sizeof(READ_CAPACITY_DATA));
|
||||
IoCallDriver (DeviceExtension->PortDeviceObject,
|
||||
SubIrp);
|
||||
return;
|
||||
|
|
|
@ -1772,6 +1772,7 @@ ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
|
|||
}
|
||||
|
||||
RtlZeroMemory(&Srb, sizeof(SCSI_REQUEST_BLOCK));
|
||||
RtlZeroMemory(CapacityBuffer, sizeof(READ_CAPACITY_DATA));
|
||||
|
||||
Srb.CdbLength = 10;
|
||||
Srb.TimeOutValue = DeviceExtension->TimeOutValue;
|
||||
|
@ -1787,6 +1788,7 @@ TryAgain:
|
|||
FALSE);
|
||||
DPRINT("Status: %lx\n", Status);
|
||||
DPRINT("Srb: %p\n", &Srb);
|
||||
if (CapacityBuffer->BytesPerBlock == 0) Status = STATUS_NOT_SUPPORTED;
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
SectorSize = (((PUCHAR)&CapacityBuffer->BytesPerBlock)[0] << 24) |
|
||||
|
|
Loading…
Reference in a new issue