Use Uint32x32To64() function instead of ULONG * ULONG. Fixes partition length truncation.
authorAleksey Bragin <aleksey@reactos.org>
Thu, 16 Nov 2006 17:26:31 +0000 (17:26 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Thu, 16 Nov 2006 17:26:31 +0000 (17:26 +0000)
See issue #1871 for more details.

svn path=/trunk/; revision=24769

reactos/ntoskrnl/fstub/disksup.c

index 187dace..dca4fd2 100644 (file)
@@ -1583,7 +1583,8 @@ IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
                 /* Get the starting offset */\r
                 PartitionInfo->StartingOffset.QuadPart =\r
                     StartOffset +\r
                 /* Get the starting offset */\r
                 PartitionInfo->StartingOffset.QuadPart =\r
                     StartOffset +\r
-                    GET_STARTING_SECTOR(PartitionDescriptor) * SectorSize;\r
+                    UInt32x32To64(GET_STARTING_SECTOR(PartitionDescriptor),\r
+                    SectorSize);\r
 \r
                 /* Calculate the number of hidden sectors */\r
                 PartitionInfo->HiddenSectors = (PartitionInfo->\r
 \r
                 /* Calculate the number of hidden sectors */\r
                 PartitionInfo->HiddenSectors = (PartitionInfo->\r
@@ -1593,7 +1594,8 @@ IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
 \r
                 /* Get the partition length */\r
                 PartitionInfo->PartitionLength.QuadPart =\r
 \r
                 /* Get the partition length */\r
                 PartitionInfo->PartitionLength.QuadPart =\r
-                    GET_PARTITION_LENGTH(PartitionDescriptor) * SectorSize;\r
+                    UInt32x32To64(GET_PARTITION_LENGTH(PartitionDescriptor),\r
+                    SectorSize);\r
 \r
                 /* FIXME: REACTOS HACK */\r
                 PartitionInfo->PartitionNumber = i + 1;\r
 \r
                 /* FIXME: REACTOS HACK */\r
                 PartitionInfo->PartitionNumber = i + 1;\r
@@ -1637,8 +1639,9 @@ IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject,
             {\r
                 /* Get its offset */\r
                 Offset.QuadPart = VolumeOffset.QuadPart +\r
             {\r
                 /* Get its offset */\r
                 Offset.QuadPart = VolumeOffset.QuadPart +\r
-                                  GET_STARTING_SECTOR(PartitionDescriptor) *\r
-                                  SectorSize;\r
+                                  UInt32x32To64(\r
+                                     GET_STARTING_SECTOR(PartitionDescriptor),\r
+                                     SectorSize);\r
 \r
                 /* If this is a primary partition, this is the volume offset */\r
                 if (IsPrimary) VolumeOffset = Offset;\r
 \r
                 /* If this is a primary partition, this is the volume offset */\r
                 if (IsPrimary) VolumeOffset = Offset;\r