mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[CLASS2]: Set DiskSize member of deviceExtension->DiskGeometry in ScsiClassReadDriveCapacity(). Consolidate code and comment for setting media capacity in bytes. CORE-17166
This commit is contained in:
parent
a3669fdef7
commit
b338fb7beb
1 changed files with 7 additions and 6 deletions
|
@ -827,20 +827,20 @@ Retry:
|
|||
DebugPrint((2,"SCSI ScsiClassReadDriveCapacity: Number of Sectors is %d\n",
|
||||
lastSector + 1));
|
||||
|
||||
//
|
||||
// Calculate media capacity in bytes.
|
||||
//
|
||||
|
||||
deviceExtension->PartitionLength.QuadPart = (LONGLONG)(lastSector + 1);
|
||||
|
||||
//
|
||||
// Calculate number of cylinders.
|
||||
//
|
||||
|
||||
deviceExtension->DiskGeometry->Geometry.Cylinders.QuadPart = (LONGLONG)((lastSector + 1)/(DEFAULT_SECTORS_PER_TRACK * DEFAULT_TRACKS_PER_CYLINDER));
|
||||
|
||||
//
|
||||
// Calculate media capacity in bytes.
|
||||
//
|
||||
|
||||
deviceExtension->PartitionLength.QuadPart = (LONGLONG)(lastSector + 1);
|
||||
deviceExtension->PartitionLength.QuadPart =
|
||||
(deviceExtension->PartitionLength.QuadPart << deviceExtension->SectorShift);
|
||||
deviceExtension->DiskGeometry->DiskSize.QuadPart = deviceExtension->PartitionLength.QuadPart;
|
||||
|
||||
if (DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) {
|
||||
|
||||
|
@ -903,6 +903,7 @@ Retry:
|
|||
deviceExtension->DiskGeometry->Geometry.BytesPerSector = 512;
|
||||
deviceExtension->SectorShift = 9;
|
||||
deviceExtension->PartitionLength.QuadPart = (LONGLONG) 0;
|
||||
deviceExtension->DiskGeometry->DiskSize.QuadPart = (LONGLONG) 0;
|
||||
|
||||
if (DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue