Changeset 2726


Ignore:
Timestamp:
06/27/12 03:17:18 (2 years ago)
Author:
lowjoel
Message:

Allow disk erasure on super floppies (whole disk is one partition, no MBR, no partition table.) Fixes https://eraser.heidi.ie/forum/viewtopic.php?f=36&t=8852

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/DriveErasureTarget.cs

    r2609 r2726  
    230230                    stepProgress.Total = PhysicalDrive.Size; 
    231231                    PhysicalDrive.DeleteDriveLayout(); 
    232                     stream = PhysicalDrive.Open(FileAccess.ReadWrite, FileShare.ReadWrite); 
     232                    if (PhysicalDrive.Volumes.Count == 1) 
     233                    { 
     234                        //This could be a removable device where Windows sees an oversized floppy. 
     235                        stream = PhysicalDrive.Volumes[0].Open(FileAccess.ReadWrite, FileShare.ReadWrite); 
     236                    } 
     237                    else if (PhysicalDrive.Volumes.Count > 0) 
     238                    { 
     239                        throw new InvalidOperationException(S._("The partition table on the drive " + 
     240                            "could not be erased.")); 
     241                    } 
     242                    else 
     243                    { 
     244                        stream = PhysicalDrive.Open(FileAccess.ReadWrite, FileShare.ReadWrite); 
     245                    } 
    233246                } 
    234247                else 
Note: See TracChangeset for help on using the changeset viewer.