[USETUP]
authorCameron Gutman <aicommander@gmail.com>
Thu, 26 Jan 2012 18:27:21 +0000 (18:27 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 26 Jan 2012 18:27:21 +0000 (18:27 +0000)
- Allow removable media to be selected as an installation target
- Fix broken unpartitioned space calculation if the first partition starts below the disk's track size (such as a 1MB aligned partition)

svn path=/trunk/; revision=55215

reactos/base/setup/usetup/partlist.c

index 229a167..0fd6fbb 100644 (file)
@@ -374,7 +374,8 @@ ScanForUnpartitionedDiskSpace (PDISKENTRY DiskEntry)
           PartEntry->PartInfo[j].StartingOffset.QuadPart -
           (LastStartingOffset + LastPartitionLength);
 
-          if (LastUnusedPartitionLength >= DiskEntry->CylinderSize)
+          if (PartEntry->PartInfo[j].StartingOffset.QuadPart > (LastStartingOffset + LastPartitionLength) &&
+              LastUnusedPartitionLength >= DiskEntry->CylinderSize)
           {
             DPRINT ("Unpartitioned disk space %I64u\n", LastUnusedPartitionLength);
 
@@ -718,7 +719,8 @@ AddDiskToList (HANDLE FileHandle,
     return;
   }
 
-  if (DiskGeometry.MediaType != FixedMedia)
+  if (DiskGeometry.MediaType != FixedMedia &&
+      DiskGeometry.MediaType != RemovableMedia)
   {
     return;
   }