mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-18 17:14:41 -04:00
[core] fix handling of BFD drives
* A BFD (Big Floppy Disk) is a disk that isn't actually partitioned, but where the first data sector starts at sector 0 * Closes #814
This commit is contained in:
parent
2b0cc9349f
commit
d9a928f5bc
3 changed files with 25 additions and 15 deletions
|
@ -826,6 +826,10 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
|
|||
// with GPT drives that contain a lot of small partitions) we try not not to clear
|
||||
// sectors further than the lowest partition already residing on the disk.
|
||||
num_sectors_to_clear = min(SelectedDrive.FirstDataSector, (DWORD)((add1MB ? 2048 : 0) + MAX_SECTORS_TO_CLEAR));
|
||||
// Special case for big floppy disks (FirstDataSector = 0)
|
||||
if (num_sectors_to_clear < 4)
|
||||
num_sectors_to_clear = (DWORD)((add1MB ? 2048 : 0) + MAX_SECTORS_TO_CLEAR);
|
||||
|
||||
uprintf("Erasing %d sectors", num_sectors_to_clear);
|
||||
for (i=0; i<num_sectors_to_clear; i++) {
|
||||
if ((IS_ERROR(FormatStatus)) || (write_sectors(hPhysicalDrive, SectorSize, i, 1, pBuf) != SectorSize)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue