Author: ekohl
Date: Sat Apr 23 10:52:01 2011
New Revision: 51437
URL:
http://svn.reactos.org/svn/reactos?rev=51437&view=rev
Log:
[CLASS2]
Prepare ReactOS for the change from the ancient 32 sectors / 64 tracks disk layout (used
until Windows NT4) to the modern 63 sectors / 255 tracks disk layout (used since Windows
2000).
Modified:
trunk/reactos/drivers/storage/class/class2/class2.c
Modified: trunk/reactos/drivers/storage/class/class2/class2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/clas…
==============================================================================
--- trunk/reactos/drivers/storage/class/class2/class2.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/class2/class2.c [iso-8859-1] Sat Apr 23 10:52:01
2011
@@ -27,6 +27,14 @@
#define INQUIRY_DATA_SIZE 2048
#define START_UNIT_TIMEOUT 30
+
+/* Disk layout used by Windows NT4 and earlier versions. */
+#define DEFAULT_SECTORS_PER_TRACK 32
+#define DEFAULT_TRACKS_PER_CYLINDER 64
+
+/* Disk layout used by Windows 2000 and later versions. */
+//#define DEFAULT_SECTORS_PER_TRACK 63
+//#define DEFAULT_TRACKS_PER_CYLINDER 255
NTSTATUS
NTAPI
@@ -798,7 +806,7 @@
// Calculate number of cylinders.
//
- deviceExtension->DiskGeometry->Geometry.Cylinders.QuadPart =
(LONGLONG)((lastSector + 1)/(32 * 64));
+ deviceExtension->DiskGeometry->Geometry.Cylinders.QuadPart =
(LONGLONG)((lastSector + 1)/(DEFAULT_SECTORS_PER_TRACK * DEFAULT_TRACKS_PER_CYLINDER));
deviceExtension->PartitionLength.QuadPart =
(deviceExtension->PartitionLength.QuadPart <<
deviceExtension->SectorShift);
@@ -821,16 +829,16 @@
}
//
- // Assume sectors per track are 32;
- //
-
- deviceExtension->DiskGeometry->Geometry.SectorsPerTrack = 32;
-
- //
- // Assume tracks per cylinder (number of heads) is 64.
- //
-
- deviceExtension->DiskGeometry->Geometry.TracksPerCylinder = 64;
+ // Assume sectors per track are DEFAULT_SECTORS_PER_TRACK;
+ //
+
+ deviceExtension->DiskGeometry->Geometry.SectorsPerTrack =
DEFAULT_SECTORS_PER_TRACK;
+
+ //
+ // Assume tracks per cylinder (number of heads) is DEFAULT_TRACKS_PER_CYLINDER.
+ //
+
+ deviceExtension->DiskGeometry->Geometry.TracksPerCylinder =
DEFAULT_TRACKS_PER_CYLINDER;
}
if (status == STATUS_VERIFY_REQUIRED) {