mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-29 14:05:22 -04:00
[core] work around a Windows bug that may render a disk inaccessible on cleanup
* The root of the issue is that Windows IOCTL_DISK_CREATE_DISK does not properly zero all of the MBR/GPT/PBR structure with PARTITION_STYLE_RAW (which is what diskpart uses to clean a disk), and leaves plenty of partition artefacts behind. * This means that, when an image with complex partitioning has been applied, such as Chromium/ChromeOS, you may end up with a drive that can not be repartitioned or reformatted in Windows (and this is completely independent of whether Rufus was used to perform these operations - For instance you will get the same issue if you use Win32DiskImager and diskpart + clean). * The only option left for users then is to reset/repartition their drives in Linux or some other OS, as Windows' VDS becomes incapacitated to handle the drive, as the problem persists independently of reset/re-plug/Windows platform being used. * To work around this, we ensure that we zero the MBR/GPT/PBR sectors BEFORE calling IOCTL_DISK_CREATE_DISK. * Also move zeroing of the drive before partition reset. * Closes #759
This commit is contained in:
parent
935679dd85
commit
258a4f7ca0
4 changed files with 25 additions and 23 deletions
|
@ -1247,8 +1247,8 @@ BOOL RefreshDriveLayout(HANDLE hDrive)
|
|||
return r;
|
||||
}
|
||||
|
||||
/* Delete the disk partition table */
|
||||
BOOL DeletePartitions(HANDLE hDrive)
|
||||
/* Initialize disk for partitioning */
|
||||
BOOL InitializeDisk(HANDLE hDrive)
|
||||
{
|
||||
BOOL r;
|
||||
DWORD size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue