[badblocks] use 0x55 and 0xAA for less than 2 passes checks

* Should be more effective at detecting errors than 0x00 and 0xFF.
This commit is contained in:
Pete Batard 2020-11-10 17:24:52 +00:00
parent f8c951f3d7
commit 9c71ac25d5
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 14 additions and 12 deletions

View file

@ -1810,8 +1810,7 @@ DWORD WINAPI FormatThread(void* param)
fflush(log_fd);
}
if (!BadBlocks(hPhysicalDrive, SelectedDrive.DiskSize, (sel >= 2) ? 4 : sel +1,
(sel < 2) ? 0 : sel - 2, &report, log_fd)) {
if (!BadBlocks(hPhysicalDrive, SelectedDrive.DiskSize, (sel >= 2) ? 4 : sel +1, sel, &report, log_fd)) {
uprintf("Bad blocks: Check failed.");
if (!IS_ERROR(FormatStatus))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_BADBLOCKS_FAILURE);