[core] only allow removable drives to be listed

* Our detection code, which is based on the HPUSBFW utility, allows fixed
  drives such as USB HDDs to be listed
* Since Rufus lacks extra precautions for fixed disks, this may result in
  people mistakenly formatting and HDD instead of a flash drive
* Until we have added HDD specific features (support for repartitioning or
  existing partitions, >32GB FAT32, etc.) we prefer playing it safe by
  not listing fixed disks.
* We will re-enable fixed disks when we feel enough safeties are in place
* Also fix an issue where ISO selection could crash if Rufus
  was compiled for Vista and later and update version to rufus-next
This commit is contained in:
Pete Batard 2012-02-24 18:46:02 +00:00
parent e0e974603c
commit 352a796eff
7 changed files with 23 additions and 21 deletions

View file

@ -101,7 +101,9 @@ HANDLE GetDriveHandle(DWORD DriveIndex, char* DriveLetter, BOOL bWriteAccess, BO
value there => Use GetDriveType() to filter out unwanted devices.
See https://github.com/pbatard/rufus/issues/32 for details. */
drive_type = GetDriveTypeA(drive);
if ((drive_type != DRIVE_REMOVABLE) && (drive_type != DRIVE_FIXED))
// NB: the HP utility allows drive_type == DRIVE_FIXED, which we don't really really want for now
// TODO: allow fixed drives after partitioning/preserving of existing partitions has been sorted out
if (drive_type != DRIVE_REMOVABLE)
continue;
safe_sprintf(logical_drive, sizeof(logical_drive), "\\\\.\\%c:", drive[0]);