[core] improve write retry handling

* Add a proper delay before retrying a write operation and increase retry count to 4
* Add retries when clearing boot records or when zeroing a drive
* Also improve log output from USB device reset
This commit is contained in:
Pete Batard 2018-06-13 19:23:24 +01:00
parent 3ba7c9eab0
commit 5ab67c03d6
6 changed files with 70 additions and 37 deletions

View file

@ -141,8 +141,10 @@ BOOL ResetDevice(int index)
return FALSE;
}
if (DriveHub.String[index] == NULL)
if (DriveHub.String[index] == NULL) {
uprintf("The device you are trying to reset does not appear to be a USB device...");
return FALSE;
}
LastReset = GetTickCount64();
@ -162,6 +164,7 @@ BOOL ResetDevice(int index)
uprintf(" Failed to cycle port: %s", WindowsErrorString());
goto out;
}
uprintf("Please wait for the device to re-appear...");
r = TRUE;
out: