Author: ion
Date: Sun Dec 3 11:08:08 2006
New Revision: 25026
URL:
http://svn.reactos.org/svn/reactos?rev=25026&view=rev
Log:
- 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.
Modified:
trunk/reactos/drivers/storage/cdrom/cdrom.c
trunk/reactos/drivers/storage/class2/class2.c
Modified: trunk/reactos/drivers/storage/cdrom/cdrom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/cdrom/cdro…
==============================================================================
--- trunk/reactos/drivers/storage/cdrom/cdrom.c (original)
+++ trunk/reactos/drivers/storage/cdrom/cdrom.c Sun Dec 3 11:08:08 2006
@@ -1409,6 +1409,7 @@
MmBuildMdlForNonPagedPool (SubIrp->MdlAddress);
Srb->DataBuffer = DataBuffer;
+ RtlZeroMemory(DataBuffer, sizeof(READ_CAPACITY_DATA));
IoCallDriver (DeviceExtension->PortDeviceObject,
SubIrp);
return;
Modified: trunk/reactos/drivers/storage/class2/class2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class2/cla…
==============================================================================
--- trunk/reactos/drivers/storage/class2/class2.c (original)
+++ trunk/reactos/drivers/storage/class2/class2.c Sun Dec 3 11:08:08 2006
@@ -1772,6 +1772,7 @@
}
RtlZeroMemory(&Srb, sizeof(SCSI_REQUEST_BLOCK));
+ RtlZeroMemory(CapacityBuffer, sizeof(READ_CAPACITY_DATA));
Srb.CdbLength = 10;
Srb.TimeOutValue = DeviceExtension->TimeOutValue;
@@ -1787,6 +1788,7 @@
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) |