Added default disk geometry.

svn path=/trunk/; revision=2763
This commit is contained in:
Eric Kohl 2002-03-22 20:32:36 +00:00
parent a613171558
commit 270385e857

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: cdrom.c,v 1.4 2002/03/20 20:00:07 ekohl Exp $ /* $Id: cdrom.c,v 1.5 2002/03/22 20:32:36 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -409,6 +409,7 @@ CdromClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject,
DiskDeviceExtension->LockCount = 0; DiskDeviceExtension->LockCount = 0;
DiskDeviceExtension->DeviceNumber = DeviceNumber; DiskDeviceExtension->DeviceNumber = DeviceNumber;
DiskDeviceExtension->PortDeviceObject = PortDeviceObject; DiskDeviceExtension->PortDeviceObject = PortDeviceObject;
DiskDeviceExtension->PhysicalDevice = DiskDeviceObject;
/* FIXME: Not yet! Will cause pointer corruption! */ /* FIXME: Not yet! Will cause pointer corruption! */
// DiskDeviceExtension->PortCapabilities = PortCapabilities; // DiskDeviceExtension->PortCapabilities = PortCapabilities;
@ -444,28 +445,23 @@ CdromClassCreateDeviceObject(IN PDRIVER_OBJECT DriverObject,
/* Read the drive's capacity */ /* Read the drive's capacity */
Status = ScsiClassReadDriveCapacity(DiskDeviceObject); Status = ScsiClassReadDriveCapacity(DiskDeviceObject);
#if 0 if (!NT_SUCCESS(Status) ||
if (!NT_SUCCESS(Status) && DiskDeviceExtension->DiskGeometry->BytesPerSector == 0)
(DiskDeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) == 0)
{ {
DPRINT1("Failed to retrieve drive capacity!\n"); /* Set ISO9660 defaults */
return(STATUS_SUCCESS); DiskDeviceExtension->DiskGeometry->BytesPerSector = 2048;
DiskDeviceExtension->SectorShift = 11;
DiskDeviceExtension->PartitionLength.QuadPart = (ULONGLONG)0x7fffffff;
} }
else else
{ {
/* Clear the verify flag for non-removable media drives. */ /* Make sure the BytesPerSector value is a power of 2 */
DiskDeviceObject->Flags &= ~DO_VERIFY_VOLUME; // DiskDeviceExtension->DiskGeometry->BytesPerSector = 2048;
}
#endif
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to retrieve drive capacity!\n");
return(STATUS_SUCCESS);
} }
DPRINT("SectorSize: %lu\n", DiskDeviceExtension->DiskGeometry->BytesPerSector); DPRINT("SectorSize: %lu\n", DiskDeviceExtension->DiskGeometry->BytesPerSector);
/* FIXME: initialize media change support */
DPRINT("CdromClassCreateDeviceObjects() done\n"); DPRINT("CdromClassCreateDeviceObjects() done\n");