[misc] fix issues with unpartitioned drives and bad blocks reports

* Listing an unpartitioned could result in all controls besides
  drive selection dropdown being blank
* The bad blocks report was not displaying the right values
* Also update version to Rufus next
This commit is contained in:
Pete Batard 2014-03-29 00:42:49 +00:00
parent 027d0d7c3a
commit b343d9b86d
8 changed files with 64 additions and 58 deletions

View file

@ -1315,12 +1315,12 @@ DWORD WINAPI FormatThread(void* param)
_unlink(logfile);
goto out;
}
uprintf("Bad Blocks: Check completed, %u bad block%s found. (%d/%d/%d errors)\n",
uprintf("Bad Blocks: Check completed, %d bad block%s found. (%d/%d/%d errors)\n",
report.bb_count, (report.bb_count==1)?"":"s",
report.num_read_errors, report.num_write_errors, report.num_corruption_errors);
r = IDOK;
if (report.bb_count) {
bb_msg = lmprintf(MSG_011, report.num_read_errors, report.num_write_errors,
bb_msg = lmprintf(MSG_011, report.bb_count, report.num_read_errors, report.num_write_errors,
report.num_corruption_errors);
fprintf(log_fd, bb_msg);
GetLocalTime(&lt);

View file

@ -397,8 +397,6 @@ static BOOL SetDriveInfo(int ComboIndex)
SelectedDrive.DeviceNumber = (DWORD)ComboBox_GetItemData(hDeviceList, ComboIndex);
SelectedDrive.nPartitions = GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_type, sizeof(fs_type));
if (SelectedDrive.nPartitions == 0)
return FALSE;
if (!DefineClusterSizes()) {
uprintf("No file system is selectable for this drive\n");

View file

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 1.4.6.444"
CAPTION "Rufus 1.4.7.445"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 1.4.6.444"
CAPTION "Rufus 1.4.7.445"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -427,8 +427,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,6,444
PRODUCTVERSION 1,4,6,444
FILEVERSION 1,4,7,445
PRODUCTVERSION 1,4,7,445
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -445,13 +445,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.6.444"
VALUE "FileVersion", "1.4.7.445"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.4.6.444"
VALUE "ProductVersion", "1.4.7.445"
END
END
BLOCK "VarFileInfo"

View file

@ -196,6 +196,7 @@ char* SizeToHumanReadable(uint64_t size, BOOL log, BOOL fake_units)
const char* _StrError(DWORD error_code)
{
if ( (!IS_ERROR(error_code)) || (SCODE_CODE(error_code) == ERROR_SUCCESS)) {
// TODO: this message is wrong!
return lmprintf(MSG_044);
}
if (SCODE_FACILITY(error_code) != FACILITY_STORAGE) {