- 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:
Alex Ionescu 2006-12-03 08:08:08 +00:00
parent cd31c14fe5
commit 58fad00c6d
2 changed files with 3 additions and 0 deletions

View file

@ -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;

View file

@ -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) |