[bb] bad blocks check improvement

* Use a default block size of 128 KB (can speed up read operations)
* Reorganise patterns to suit different types of NAND cells (SLC, MLC and TLC)
* Only run fake drive test on first pass
* Also update rufus-next to 3.2
This commit is contained in:
Pete Batard 2018-06-28 16:25:13 +01:00
parent d4a4506b16
commit 2d262df8f3
12 changed files with 121 additions and 94 deletions

View file

@ -1783,6 +1783,7 @@ DWORD WINAPI FormatThread(void* param)
if (IsChecked(IDC_BAD_BLOCKS)) {
do {
int sel = ComboBox_GetCurSel(hNBPasses);
// create a log file for bad blocks report. Since %USERPROFILE% may
// have localized characters, we use the UTF-8 API.
userdir = getenvU("USERPROFILE");
@ -1801,8 +1802,8 @@ DWORD WINAPI FormatThread(void* param)
fflush(log_fd);
}
if (!BadBlocks(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize,
ComboBox_GetCurSel(hNBPasses)+1, &report, log_fd)) {
if (!BadBlocks(hPhysicalDrive, SelectedDrive.DiskSize, (sel >= 2) ? 4 : sel +1,
(sel < 2) ? 0 : sel - 2, &report, log_fd)) {
uprintf("Bad blocks: Check failed.\n");
if (!IS_ERROR(FormatStatus))
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_BADBLOCKS_FAILURE);