[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

20
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for rufus 3.1.
# Generated by GNU Autoconf 2.69 for rufus 3.2.
#
# Report bugs to <https://github.com/pbatard/rufus/issues>.
#
@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='3.1'
PACKAGE_STRING='rufus 3.1'
PACKAGE_VERSION='3.2'
PACKAGE_STRING='rufus 3.2'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='https://rufus.akeo.ie'
@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rufus 3.1 to adapt to many kinds of systems.
\`configure' configures rufus 3.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1294,7 +1294,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rufus 3.1:";;
short | recursive ) echo "Configuration of rufus 3.2:";;
esac
cat <<\_ACEOF
@ -1385,7 +1385,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rufus configure 3.1
rufus configure 3.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1440,7 +1440,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 3.1, which was
It was created by rufus $as_me 3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2303,7 +2303,7 @@ fi
# Define the identity of the package.
PACKAGE='rufus'
VERSION='3.1'
VERSION='3.2'
cat >>confdefs.h <<_ACEOF
@ -4481,7 +4481,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rufus $as_me 3.1, which was
This file was extended by rufus $as_me 3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -4535,7 +4535,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
rufus config.status 3.1
rufus config.status 3.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -1,4 +1,4 @@
AC_INIT([rufus], [3.1], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.akeo.ie])
AC_INIT([rufus], [3.2], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.akeo.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4])

View File

@ -8,7 +8,7 @@
for an interesting struggle, when you also happen to have a comma in one of the fields... -->
<Identity
Name="Rufus"
Version="3.1.1320.0"
Version="3.2.1320.0"
ProcessorArchitecture="x86"
Publisher='CN=Akeo Consulting, O=Akeo Consulting, STREET=24 Grey Rock, L=Milford, S=Co. Donegal, PostalCode=F92 D667, C=IE' />
<Properties>

View File

@ -1,5 +1,5 @@
@echo off
set VERSION=3.1
set VERSION=3.2
rem Make sure you don't have anything you don't want included in the package, as anything residing in the
rem current directory will be included, including any previous .appx, which makes for nice recursion...

View File

@ -15,7 +15,10 @@ content. PLEASE, do not just look at this Changelog when updating your
translation, but always use the English section of rufus.loc as your base.
For instance, MSG_114, that was introduced in v1.0.8 is MORE than one line!
o Version 1.0.23 (2018.??.??)
o Version 1.0.24 (2018.??.??)
- *NEW* MSG_087
o Version 1.0.23 (2018.03.27)
- All positioning ('m', 's') has now been removed as well as some controls, for the 3.0 UI redesign
- *NEW* IDS_DRIVE_PROPERTIES_TXT "Drive Properties"
- *NEW* IDS_BOOT_SELECTION_TXT "Boot selection"

View File

@ -208,7 +208,7 @@ t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS or UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d pass"
t MSG_035 "%d passes"
t MSG_035 "%d passes %s"
t MSG_036 "ISO Image"
t MSG_037 "Application"
t MSG_038 "Abort"
@ -277,6 +277,7 @@ t MSG_084 "This ISO image seems to use an obsolete version of '%s'.\n"
"'%s' exists there, it will be reused automatically."
t MSG_085 "Downloading '%s'"
t MSG_086 "No image selected"
t MSG_087 "for %s devices"
t MSG_088 "Image is too big"
t MSG_089 "The image is too big for the selected target."
t MSG_090 "Unsupported ISO"
@ -683,7 +684,7 @@ t MSG_032 "UEFI (بدون CSM)"
t MSG_033 "BIOS أو UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d تجاوز"
t MSG_035 "%d تجاوزات"
t MSG_035 "%d تجاوزات %s"
t MSG_036 "ISO صورة"
t MSG_037 "تطبيق"
t MSG_038 "توقف"
@ -1135,7 +1136,7 @@ t MSG_032 "UEFI (yox CSM)"
t MSG_033 "BIOS və ya UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Keçid"
t MSG_035 "%d Keçid"
t MSG_035 "%d Keçid %s"
t MSG_036 "ISO Əksi"
t MSG_037 "Proqram"
t MSG_038 "İmtina et"
@ -1582,7 +1583,7 @@ t MSG_030 "%s (Стандартно)"
#t MSG_033 "%s дялова схема за UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Пробег"
t MSG_035 "%d Пробега"
t MSG_035 "%d Пробега %s"
t MSG_036 "ISO образ"
t MSG_037 "Приложение"
t MSG_038 "Прекрати"
@ -2027,7 +2028,7 @@ t MSG_032 "UEFI (非 CSM)"
t MSG_033 "BIOS 或 UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d 遍"
t MSG_035 "%d 遍"
t MSG_035 "%d 遍 %s"
t MSG_036 "ISO 镜像"
t MSG_037 "程序"
t MSG_038 "中止"
@ -2470,7 +2471,7 @@ t MSG_032 "UEFI (無 CSM)"
t MSG_033 "BIOS 或 UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d 回"
t MSG_035 "%d 回"
t MSG_035 "%d 回 %s"
t MSG_036 "ISO 映像"
t MSG_037 "程式"
t MSG_038 "終止"
@ -2884,7 +2885,7 @@ t MSG_032 "UEFI (bez CSM)"
t MSG_033 "BIOS ili UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d prolaz"
t MSG_035 "%d prolaza"
t MSG_035 "%d prolaza %s"
t MSG_036 "ISO slika"
t MSG_037 "Aplikacija"
t MSG_038 "Prekini"
@ -3339,7 +3340,7 @@ t MSG_032 "UEFI (ne CSM)"
t MSG_033 "BIOS nebo UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d pokus"
t MSG_035 "%d pokusy"
t MSG_035 "%d pokusy %s"
t MSG_036 "Obraz ISO"
t MSG_037 "Aplikace"
t MSG_038 "Přerušit"
@ -3791,7 +3792,7 @@ t MSG_032 "UEFI (ikke CSM)"
t MSG_033 "BIOS eller UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d gennemløb"
t MSG_035 "%d gennemløb"
t MSG_035 "%d gennemløb %s"
t MSG_036 "ISO-image"
t MSG_037 "Applikation"
t MSG_038 "Annuller"
@ -4227,7 +4228,7 @@ t MSG_032 "UEFI (geen CSM)"
t MSG_033 "BIOS of UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Ronde"
t MSG_035 "%d Rondes"
t MSG_035 "%d Rondes %s"
t MSG_036 "ISO image"
t MSG_037 "Applicatie"
t MSG_038 "Afbreken"
@ -4665,7 +4666,7 @@ t MSG_032 "UEFI (ei-CSM)"
t MSG_033 "BIOS tai UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d testi"
t MSG_035 "%d testiä"
t MSG_035 "%d testiä %s"
t MSG_036 "ISO-kuva"
t MSG_037 "Sovellus"
t MSG_038 "Keskeytä"
@ -5103,7 +5104,7 @@ t MSG_031 "BIOS (ou UEFI-CSM)"
t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS ou UEFI"
t MSG_034 "%d passe"
t MSG_035 "%d passes"
t MSG_035 "%d passes %s"
t MSG_036 "Image ISO"
t MSG_037 "Application"
t MSG_038 "Annuler"
@ -5526,7 +5527,7 @@ t MSG_032 "UEFI (ohne CSM)"
t MSG_033 "BIOS oder UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Durchgang"
t MSG_035 "%d Durchgänge"
t MSG_035 "%d Durchgänge %s"
t MSG_036 "ISO-Abbild"
t MSG_037 "Programm"
t MSG_038 "Abbruch"
@ -5954,7 +5955,7 @@ t MSG_032 "UEFI (εκτός από CSM)"
t MSG_033 "BIOS ή UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Πέρασμα"
t MSG_035 "%d Περάσματα"
t MSG_035 "%d Περάσματα %s"
t MSG_036 "Είδωλο ISO"
t MSG_037 "Εφαρμογή"
t MSG_038 "Τερματισμός"
@ -6410,7 +6411,7 @@ t MSG_032 "UEFI (שאינו CSM)"
t MSG_033 "BIOS או UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "מעבר אחד"
t MSG_035 "%d מעברים"
t MSG_035 "%d מעברים %s"
t MSG_036 "קובץ ISO"
t MSG_037 "יישום"
t MSG_038 "ביטול"
@ -6887,7 +6888,7 @@ t MSG_032 "UEFI (nem CSM)"
t MSG_033 "BIOS vagy UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d vizsgálva"
t MSG_035 "%d vizsgálva"
t MSG_035 "%d vizsgálva %s"
t MSG_036 "ISO kép"
t MSG_037 "Alkalmazás"
t MSG_038 "Megszakít"
@ -7339,7 +7340,7 @@ t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS atau UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d kali uji"
t MSG_035 "%d kali uji"
t MSG_035 "%d kali uji %s"
t MSG_036 "ISO Image"
t MSG_037 "Aplikasi"
t MSG_038 "Batal"
@ -7787,7 +7788,7 @@ t MSG_031 "BIOS (o UEFI CSM)"
t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS o UEFI"
t MSG_034 "%d test"
t MSG_035 "%d test"
t MSG_035 "%d test %s"
t MSG_036 "Immagine ISO"
t MSG_037 "Applicazione"
t MSG_038 "Annulla"
@ -8227,7 +8228,7 @@ t MSG_032 "UEFI (CSM無効)"
t MSG_033 "BIOSまたはUEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d パス"
t MSG_035 "%d パス"
t MSG_035 "%d パス %s"
t MSG_036 "ISOイメージ"
t MSG_037 "アプリケーション"
t MSG_038 "中止"
@ -8696,7 +8697,7 @@ t MSG_032 "UEFI (CSM 지원 안 됨)"
t MSG_033 "BIOS 또는 UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "한번만 검사"
t MSG_035 "%d회 검사"
t MSG_035 "%d회 검사 %s"
t MSG_036 "ISO 이미지"
t MSG_037 "프로그램"
t MSG_038 "취소"
@ -9144,7 +9145,7 @@ t MSG_032 "BIOS (bez CSM)"
t MSG_033 "BIOS vai UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d mēģ."
t MSG_035 "%d mēģ."
t MSG_035 "%d mēģ. %s"
t MSG_036 "ISO virtuālais attēls"
t MSG_037 "Programma"
t MSG_038 "Pārtraukt"
@ -9594,7 +9595,7 @@ t MSG_032 "UEFI (ne CSM)"
t MSG_033 "BIOS arba UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d bandymas"
t MSG_035 "%d bandymai"
t MSG_035 "%d bandymai %s"
t MSG_036 "ISO atvaizdas"
t MSG_037 "Programa"
t MSG_038 "Nutraukti"
@ -10049,7 +10050,7 @@ t MSG_030 "%s (Lalai)"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d kali lulus"
t MSG_035 "%d kali lulus"
t MSG_035 "%d kali lulus %s"
t MSG_036 "Imej ISO"
t MSG_037 "Aplikasi"
t MSG_038 "Batal"
@ -10478,7 +10479,7 @@ t MSG_032 "UEFI (ikke CSM)"
t MSG_033 "BIOS eller UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Passering"
t MSG_035 "%d Passeringer"
t MSG_035 "%d Passeringer %s"
t MSG_036 "ISO-bilde"
t MSG_037 "Applikasjon"
t MSG_038 "Avbryt"
@ -10957,7 +10958,7 @@ t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS یا UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d گذره"
t MSG_035 "%d گذره"
t MSG_035 "%d گذره %s"
t MSG_036 "ایمیج ISO"
t MSG_037 "برنامه"
t MSG_038 "لغو"
@ -11425,7 +11426,7 @@ t MSG_032 "UEFI (bez CSM)"
t MSG_033 "BIOS lub UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Przebieg"
t MSG_035 "%d Przebiegi"
t MSG_035 "%d Przebiegi %s"
t MSG_036 "Obraz ISO"
t MSG_037 "Aplikacja"
t MSG_038 "Przerwij"
@ -11889,7 +11890,7 @@ t MSG_032 "UEFI (não CSM)"
t MSG_033 "BIOS ou UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d passo"
t MSG_035 "%d passos"
t MSG_035 "%d passos %s"
t MSG_036 "Imagem ISO"
t MSG_037 "Aplicativo"
t MSG_038 "Abortar"
@ -12362,7 +12363,7 @@ t MSG_032 "UEFI (não CSM)"
t MSG_033 "BIOS ou UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d passo"
t MSG_035 "%d passos"
t MSG_035 "%d passos %s"
t MSG_036 "Imagem ISO"
t MSG_037 "Aplicação"
t MSG_038 "Abortar"
@ -12806,7 +12807,7 @@ t MSG_031 "BIOS (sau UEFI-CSM)"
t MSG_032 "UEFI (non CSM)"
t MSG_033 "BIOS sau UEFI"
t MSG_034 "%d pas"
t MSG_035 "%d pași"
t MSG_035 "%d pași %s"
t MSG_036 "Imagine ISO"
t MSG_037 "Cerere"
t MSG_038 "Anulează"
@ -13231,7 +13232,7 @@ t MSG_032 "UEFI (non-CSM)"
t MSG_033 "BIOS или UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d проход"
t MSG_035 "%d прохода"
t MSG_035 "%d прохода %s"
t MSG_036 "ISO-образ"
t MSG_037 "Приложение"
t MSG_038 "Отменить"
@ -13673,7 +13674,7 @@ t MSG_030 "%s (Uobičajeno)"
#t MSG_033 "%s particijska šema za UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d sekvenca"
t MSG_035 "%d sekvence"
t MSG_035 "%d sekvence %s"
t MSG_036 "ISO datoteke"
t MSG_037 "Aplikacija"
t MSG_038 "Prekini"
@ -14120,7 +14121,7 @@ t MSG_032 "UEFI (bez CSM)"
t MSG_033 "BIOS alebo UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d pokus"
t MSG_035 "%d pokusy"
t MSG_035 "%d pokusy %s"
t MSG_036 "Obraz ISO"
t MSG_037 "Aplikácia"
t MSG_038 "Ukončiť"
@ -14574,7 +14575,7 @@ t MSG_032 "UEFI (brez CSM)"
t MSG_033 "BIOS ali UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d prehod"
t MSG_035 "%d prehoda/-i"
t MSG_035 "%d prehoda/-i %s"
t MSG_036 "sliko ISO"
t MSG_037 "Aplikacija"
t MSG_038 "Prekini"
@ -15008,7 +15009,7 @@ t MSG_032 "UEFI (no CSM)"
t MSG_033 "BIOS o UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d paso"
t MSG_035 "%d pasos"
t MSG_035 "%d pasos %s"
t MSG_036 "Imagen ISO"
t MSG_037 "Aplicación"
t MSG_038 "Abortar"
@ -15465,7 +15466,7 @@ t MSG_032 "UEFI (icke CSM)"
t MSG_033 "BIOS eller UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d gång"
t MSG_035 "%d gånger"
t MSG_035 "%d gånger %s"
t MSG_036 "ISO-avbild"
t MSG_037 "Program"
t MSG_038 "Avbryt"
@ -15924,7 +15925,7 @@ t MSG_032 "UEFI (ที่ไม่ใช่ CSM)"
t MSG_033 "BIOS หรือ UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d รอบ"
t MSG_035 "%d รอบ"
t MSG_035 "%d รอบ %s"
t MSG_036 "อิมเมจ ISO"
t MSG_037 "แอพพลิเคชั่น"
t MSG_038 "ยกเลิก"
@ -16391,7 +16392,7 @@ t MSG_032 "UEFI (CSM yok)"
t MSG_033 "BIOS ya da UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Geçiş"
t MSG_035 "%d Geçiş"
t MSG_035 "%d Geçiş %s"
t MSG_036 "ISO Yansıması"
t MSG_037 "Uygulama"
t MSG_038 "Vazgeç"
@ -16845,7 +16846,7 @@ t MSG_032 "UEFI (без CSM)"
t MSG_033 "BIOS чи UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d прохід"
t MSG_035 "%d проходи"
t MSG_035 "%d проходи %s"
t MSG_036 "ISO-образ"
t MSG_037 "Додаток"
t MSG_038 "Відмінити"
@ -17281,7 +17282,7 @@ t MSG_030 "%s (Mặc định)"
#t MSG_033 "Sắp xếp phân vùng %s cho UEFI"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "Qua %d lần"
t MSG_035 "Qua %d lần"
t MSG_035 "Qua %d lần %s"
t MSG_036 "Ảnh ISO"
t MSG_037 "Ứng dụng"
t MSG_038 "Huỷ bỏ"

View File

@ -7,7 +7,7 @@
*
* Copyright 1995, 1996, 1997, 1998, 1999 by Theodore Ts'o
* Copyright 1999 by David Beattie
* Copyright 2011-2016 by Pete Batard
* Copyright 2011-2018 by Pete Batard
*
* This file is based on the minix file system programs fsck and mkfs
* written and copyrighted by Linus Torvalds <Linus.Torvalds@cs.helsinki.fi>
@ -350,13 +350,14 @@ static void pattern_fill(unsigned char *buffer, unsigned int pattern,
unsigned char bpattern[sizeof(pattern)], *ptr;
if (pattern == (unsigned int) ~0) {
PrintInfo(3500, MSG_236);
srand((unsigned int)GetTickCount64());
for (ptr = buffer; ptr < buffer + n; ptr++) {
// coverity[dont_call]
(*ptr) = rand() % (1 << (8 * sizeof(char)));
}
PrintInfo(3500, MSG_236);
} else {
PrintInfo(3500, MSG_237, pattern);
bpattern[0] = 0;
for (i = 0; i < sizeof(bpattern); i++) {
if (pattern == 0)
@ -372,7 +373,6 @@ static void pattern_fill(unsigned char *buffer, unsigned int pattern,
else
i--;
}
PrintInfo(3500, MSG_237, bpattern[i]);
cur_pattern++;
}
}
@ -422,16 +422,22 @@ static int64_t do_write(HANDLE hDrive, unsigned char * buffer, uint64_t tryout,
}
static unsigned int test_rw(HANDLE hDrive, blk_t last_block, size_t block_size, blk_t first_block,
size_t blocks_at_once, int nb_passes)
size_t blocks_at_once, int pattern_type, int nb_passes)
{
const unsigned int pattern[BADLOCKS_PATTERN_TYPES][BADBLOCK_PATTERN_COUNT] =
{ BADBLOCK_PATTERN_SLC, BADCLOCK_PATTERN_MLC, BADBLOCK_PATTERN_TLC };
unsigned char *buffer = NULL, *read_buffer;
const unsigned int pattern[] = BADBLOCK_PATTERNS;
int i, pat_idx;
unsigned int bb_count = 0;
blk_t got, tryout, recover_block = ~0, *blk_id;
size_t id_offset;
if ((nb_passes < 1) || (nb_passes > 4)) {
if ((pattern_type < 0) || (pattern_type >= BADLOCKS_PATTERN_TYPES)) {
uprintf("%sInvalid pattern type\n", bb_prefix);
cancel_ops = -1;
return 0;
}
if ((nb_passes < 1) || (nb_passes > BADBLOCK_PATTERN_COUNT)) {
uprintf("%sInvalid number of passes\n", bb_prefix);
cancel_ops = -1;
return 0;
@ -446,26 +452,31 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, size_t block_size,
return 0;
}
uprintf("%sChecking from block %lu to %lu\n", bb_prefix,
(unsigned long) first_block, (unsigned long) last_block - 1);
uprintf("%sChecking from block %lu to %lu (1 block = %s)\n", bb_prefix,
(unsigned long) first_block, (unsigned long) last_block - 1,
SizeToHumanReadable(BADBLOCK_BLOCK_SIZE, FALSE, FALSE));
nr_pattern = nb_passes;
cur_pattern = 0;
for (pat_idx = 0; pat_idx < nb_passes; pat_idx++) {
srand((unsigned int)GetTickCount64());
if (cancel_ops) goto out;
if (cancel_ops)
goto out;
if (detect_fakes && (pat_idx == 0)) {
srand((unsigned int)GetTickCount64());
id_offset = rand() * (block_size - sizeof(blk_t)) / RAND_MAX;
uprintf("%sUsing offset %d for fake device check\n", bb_prefix, id_offset);
}
// coverity[dont_call]
id_offset = rand() * (block_size-sizeof(blk_t)) / RAND_MAX;
pattern_fill(buffer, pattern[pat_idx], blocks_at_once * block_size);
uprintf("%sUsing offset %d for fake device check\n", bb_prefix, id_offset);
pattern_fill(buffer, pattern[pattern_type][pat_idx], blocks_at_once * block_size);
num_blocks = last_block - 1;
currently_testing = first_block;
if (s_flag | v_flag)
uprintf("%sWriting test pattern 0x%02X\n", bb_prefix, pattern[pat_idx]);
uprintf("%sWriting test pattern 0x%02X\n", bb_prefix, pattern[pattern_type][pat_idx]);
cur_op = OP_WRITE;
tryout = blocks_at_once;
while (currently_testing < last_block) {
if (cancel_ops) goto out;
if (cancel_ops)
goto out;
if (max_bb && bb_count >= max_bb) {
if (s_flag || v_flag) {
uprintf(abort_msg);
@ -477,7 +488,7 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, size_t block_size,
}
if (currently_testing + tryout > last_block)
tryout = last_block - currently_testing;
if (detect_fakes) {
if (detect_fakes && (pat_idx == 0)) {
/* Add the block number at a fixed (random) offset during each pass to
allow for the detection of 'fake' media (eg. 2GB USB masquerading as 16GB) */
for (i=0; i<(int)blocks_at_once; i++) {
@ -525,7 +536,7 @@ static unsigned int test_rw(HANDLE hDrive, blk_t last_block, size_t block_size,
}
if (currently_testing + tryout > last_block)
tryout = last_block - currently_testing;
if (detect_fakes) {
if (detect_fakes && (pat_idx == 0)) {
for (i=0; i<(int)blocks_at_once; i++) {
blk_id = (blk_t*)(intptr_t)(buffer + id_offset+ i*block_size);
*blk_id = (blk_t)(currently_testing + i);
@ -563,11 +574,11 @@ out:
return bb_count;
}
BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, size_t block_size,
int nb_passes, badblocks_report *report, FILE* fd)
BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, int nb_passes,
int flash_type, badblocks_report *report, FILE* fd)
{
errcode_t error_code;
blk_t first_block = 0, last_block = disk_size/block_size;
blk_t last_block = disk_size / BADBLOCK_BLOCK_SIZE;
if (report == NULL) return FALSE;
num_read_errors = 0;
@ -589,7 +600,7 @@ BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, size_t block_size,
cancel_ops = 0;
/* use a timer to update status every second */
SetTimer(hMainDialog, TID_BADBLOCKS_UPDATE, 1000, alarm_intr);
report->bb_count = test_rw(hPhysicalDrive, last_block, block_size, first_block, BB_BLOCKS_AT_ONCE, nb_passes);
report->bb_count = test_rw(hPhysicalDrive, last_block, BADBLOCK_BLOCK_SIZE, 0, BB_BLOCKS_AT_ONCE, flash_type, nb_passes);
KillTimer(hMainDialog, TID_BADBLOCKS_UPDATE);
free(bb_list->list);
free(bb_list);

View File

@ -7,7 +7,7 @@
*
* Copyright 1995, 1996, 1997, 1998, 1999 by Theodore Ts'o
* Copyright 1999 by David Beattie
* Copyright 2011-2013 by Pete Batard
* Copyright 2011-2018 by Pete Batard
*
* This file is based on the minix file system programs fsck and mkfs
* written and copyrighted by Linus Torvalds <Linus.Torvalds@cs.helsinki.fi>
@ -55,5 +55,5 @@ typedef struct {
/*
* Shared prototypes
*/
BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, size_t block_size,
int test_type, badblocks_report *report, FILE* fd);
BOOL BadBlocks(HANDLE hPhysicalDrive, ULONGLONG disk_size, int nb_passes,
int flash_type, badblocks_report *report, FILE* fd);

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);

View File

@ -51,6 +51,7 @@
static const char* cmdline_hogger = "rufus.com";
static const char* FileSystemLabel[FS_MAX] = { "FAT", "FAT32", "NTFS", "UDF", "exFAT", "ReFS" };
static const char* flash_type[BADLOCKS_PATTERN_TYPES] = { "SLC", "MLC", "TLC" };
static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
static const char* vs_reg = "Software\\Microsoft\\VisualStudio";
// Number of steps for each FS for FCC_STRUCTURE_PROGRESS
@ -1164,9 +1165,12 @@ static __inline void MoveCtrlY(HWND hDlg, int nID, int vertical_shift) {
static void SetPassesTooltip(void)
{
const unsigned char pattern[] = BADBLOCK_PATTERNS;
CreateTooltip(hNBPasses, lmprintf(MSG_153 + ComboBox_GetCurSel(hNBPasses),
pattern[0], pattern[1], pattern[2], pattern[3]), -1);
const unsigned int pattern[BADLOCKS_PATTERN_TYPES][BADBLOCK_PATTERN_COUNT] =
{ BADBLOCK_PATTERN_SLC, BADCLOCK_PATTERN_MLC, BADBLOCK_PATTERN_TLC };
int sel = ComboBox_GetCurSel(hNBPasses);
int type = (sel < 2) ? 0 : sel - 2;
CreateTooltip(hNBPasses, lmprintf(MSG_153 + ((sel >= 2) ? 3 : sel),
pattern[type][0], pattern[type][1], pattern[type][2], pattern[type][3]), -1);
}
static void ResizeDialogs(int shift)
@ -2196,9 +2200,10 @@ static void GetHalfDropwdownWidth(HWND hDlg)
hw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_TARGET_SYSTEM), lmprintf(msg_id)).cx);
// Just in case, we also do the number of passes
for (i = 1; i <= 4; i++)
hw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_TARGET_SYSTEM),
lmprintf((i == 1) ? MSG_034 : MSG_035, i)).cx);
for (i = 1; i <= 5; i++) {
char* msg = (i == 1) ? lmprintf(MSG_034, 1) : lmprintf(MSG_035, (i == 2) ? 2 : 4, (i == 2) ? "" : lmprintf(MSG_087, flash_type[i - 3]));
hw = max(hw, GetTextSize(GetDlgItem(hDlg, IDC_TARGET_SYSTEM), msg).cx);
}
// Finally, we must ensure that we'll have enough space for the 2 checkbox controls
// that end up with a half dropdown
@ -2528,7 +2533,7 @@ static void InitDialog(HWND hDlg)
DWORD len;
HDC hDC;
int i, lfHeight;
char tmp[128], *token, *buf, *ext;
char tmp[128], *token, *buf, *ext, *msg;
static char* resource[2] = { MAKEINTRESOURCEA(IDR_SL_LDLINUX_V4_SYS), MAKEINTRESOURCEA(IDR_SL_LDLINUX_V6_SYS) };
#ifdef RUFUS_TEST
@ -2634,8 +2639,9 @@ static void InitDialog(HWND hDlg)
SendMessage(hProgress, PBM_SETRANGE, 0, (MAX_PROGRESS<<16) & 0xFFFF0000);
// Fill up the passes
for (i=0; i<4; i++) {
IGNORE_RETVAL(ComboBox_AddStringU(hNBPasses, lmprintf((i==0)?MSG_034:MSG_035, i+1)));
for (i = 1; i <= 5; i++) {
msg = (i == 1) ? lmprintf(MSG_034, 1) : lmprintf(MSG_035, (i == 2) ? 2 : 4, (i == 2) ? "" : lmprintf(MSG_087, flash_type[i - 3]));
IGNORE_RETVAL(ComboBox_AddStringU(hNBPasses, msg));
}
IGNORE_RETVAL(ComboBox_SetCurSel(hNBPasses, 0));
SetPassesTooltip();

View File

@ -67,7 +67,12 @@
#define MARQUEE_TIMER_REFRESH 10 // Time between progress bar marquee refreshes, in ms
#define FS_DEFAULT FS_FAT32
#define SINGLE_CLUSTERSIZE_DEFAULT 0x00000100
#define BADBLOCK_PATTERNS {0xaa, 0x55, 0xff, 0x00}
#define BADLOCKS_PATTERN_TYPES 3
#define BADBLOCK_PATTERN_COUNT 4
#define BADBLOCK_PATTERN_SLC {0x00, 0xff, 0x55, 0xaa}
#define BADCLOCK_PATTERN_MLC {0x00, 0xff, 0x33, 0xcc}
#define BADBLOCK_PATTERN_TLC {0x00, 0xff, 0x1c71c7, 0xe38e38}
#define BADBLOCK_BLOCK_SIZE (128 * 1024)
#define LARGE_FAT32_SIZE (32*1073741824LL) // Size at which we need to use fat32format
#define UDF_FORMAT_SPEED 3.1f // Speed estimate at which we expect UDF drives to be formatted (GB/s)
#define UDF_FORMAT_WARN 20 // Duration (in seconds) above which we warn about long UDF formatting times

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.1.1323"
CAPTION "Rufus 3.2.1324"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -389,8 +389,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,1,1323,0
PRODUCTVERSION 3,1,1323,0
FILEVERSION 3,2,1324,0
PRODUCTVERSION 3,2,1324,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -407,13 +407,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.1.1323"
VALUE "FileVersion", "3.2.1324"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.1.1323"
VALUE "ProductVersion", "3.2.1324"
END
END
BLOCK "VarFileInfo"