diff --git a/TODO b/TODO index 5258757f..254ce2d9 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ o create a report file with failed block details when bad blocks are found -o progress bar during quick format / partitioning / MS-DOS files copy o use the umount/remount trick to make the volume reappear post formatting o set keyboard according to locale in DOS o allow selection of one of the existing compatible volume (keep existing MBR) / full repartitioning (overwrite MBR) diff --git a/src/badblocks.c b/src/badblocks.c index 48248632..9d1ef0d9 100644 --- a/src/badblocks.c +++ b/src/badblocks.c @@ -361,9 +361,8 @@ static void print_status(void) percent = calc_percent((unsigned long) currently_testing, (unsigned long) num_blocks); percent = (percent/2.0f) + ((cur_op==OP_READ)? 50.0f : 0.0f); - PrintStatus(0, "BB PASS %d/%d(%c): %0.2f%% done. (%d/%d/%d errors)", + PrintStatus(0, "Bad Blocks: PASS %d/%d - %0.2f%% (%d/%d/%d errors)", cur_pattern, nr_pattern, - (cur_op==OP_READ)?'R':'W', percent, num_read_errors, num_write_errors, @@ -393,8 +392,8 @@ static void pattern_fill(unsigned char *buffer, unsigned int pattern, for (ptr = buffer; ptr < buffer + n; ptr++) { (*ptr) = rand() % (1 << (8 * sizeof(char))); } - PrintStatus(3500, "Testing with random pattern: "); - uprintf("Testing with random pattern: "); + PrintStatus(3500, "Bad Blocks: Testing with random pattern."); + uprintf("Bad Blocks: Testing with random pattern."); } else { bpattern[0] = 0; for (i = 0; i < sizeof(bpattern); i++) { @@ -411,8 +410,8 @@ static void pattern_fill(unsigned char *buffer, unsigned int pattern, else i--; } - PrintStatus(3500, "Testing with pattern 0x%02X", bpattern[i]); - uprintf("Testing with pattern 0x%02X", bpattern[i]); + PrintStatus(3500, "Bad Blocks: Testing with pattern 0x%02X.", bpattern[i]); + uprintf("Bad Blocks: Testing with pattern 0x%02X.", bpattern[i]); cur_pattern++; } } diff --git a/src/format.c b/src/format.c index 4dba22c2..de4a6dc8 100644 --- a/src/format.c +++ b/src/format.c @@ -47,7 +47,8 @@ badblocks_report report; static float format_percent = 0.0f; static int task_number = 0; /* Number of steps for each FS for FCC_STRUCTURE_PROGRESS */ -const int nb_steps[FS_MAX] = { 4, 4, 11, 9 }; +const int nb_steps[FS_MAX] = { 5, 5, 12, 10 }; +static int fs_index = 0; /* * FormatEx callback. Return FALSE to halt operations @@ -62,30 +63,30 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, case FCC_PROGRESS: // TODO: send this percentage to the status bar percent = (DWORD*)pData; - uprintf("%d percent completed.\n", *percent); - format_percent = 1.0f * (*percent); - UpdateProgress(OP_FORMAT_LONG, format_percent); + PrintStatus(0, "Formatting: %d%% completed.\n", *percent); +// uprintf("%d percent completed.\n", *percent); + UpdateProgress(OP_FORMAT, 1.0f * (*percent)); break; case FCC_STRUCTURE_PROGRESS: // No progress on quick format - uprintf("Format task %d/%d completed.\n", ++task_number, - nb_steps[ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem))]); - // TODO: figure out likely values - format_percent += 100.0f / (1.0f * nb_steps[ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem))]); - UpdateProgress(OP_FORMAT_QUICK, format_percent); + PrintStatus(0, "Creating file system: Task %d/%d completed.\n", ++task_number, nb_steps[fs_index]); + uprintf("Create FS: Task %d/%d completed.\n", task_number, nb_steps[fs_index]); + format_percent += 100.0f / (1.0f * nb_steps[fs_index]); + UpdateProgress(OP_CREATE_FS, format_percent); break; case FCC_DONE: + PrintStatus(0, "Creating file system: Task %d/%d completed.\n", nb_steps[fs_index], nb_steps[fs_index]); + uprintf("Create FS: Task %d/%d completed.\n", nb_steps[fs_index], nb_steps[fs_index]); + UpdateProgress(OP_CREATE_FS, 100.0f); if(*(BOOLEAN*)pData == FALSE) { uprintf("Error while formatting.\n"); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_GEN_FAILURE; } - UpdateProgress(OP_FORMAT_DONE, 100.0f); break; case FCC_DONE_WITH_STRUCTURE: // We get this message when formatting Small FAT16 // pData Seems to be a struct with at least one (32 BIT!!!) string pointer to the size in MB uprintf("Done with that sort of things: Action=%d pData=%0p\n", Action, pData); DumpBufferHex(pData, 8); uprintf("Volume size: %s MB\n", (char*)(LONG_PTR)(*(ULONG32*)pData)); - UpdateProgress(OP_FORMAT_DONE, 100.0f); break; case FCC_INCOMPATIBLE_FILE_SYSTEM: uprintf("Incompatible File System\n"); @@ -163,6 +164,7 @@ static BOOL FormatDrive(char DriveLetter) uprintf("Using cluster size: %d bytes\n", ComboBox_GetItemData(hClusterSize, ComboBox_GetCurSel(hClusterSize))); format_percent = 0.0f; task_number = 0; + fs_index = ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem)); pfFormatEx(wDriveRoot, SelectedDrive.Geometry.MediaType, wFSType, wLabel, IsChecked(IDC_QUICKFORMAT), (ULONG)ComboBox_GetItemData(hClusterSize, ComboBox_GetCurSel(hClusterSize)), FormatExCallback); diff --git a/src/rufus.c b/src/rufus.c index 6ea95f36..bc810b55 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -558,7 +558,8 @@ static BOOL GetUSBDevices(void) } IGNORE_RETVAL(ComboBox_SetCurSel(hDeviceList, 0)); SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_DEVICE, 0); - + SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_FILESYSTEM, + ComboBox_GetCurSel(hFileSystem)); return TRUE; } @@ -584,11 +585,10 @@ static void InitProgress(void) } nb_slots[OP_PARTITION] = 1; nb_slots[OP_FIX_MBR] = 1; - nb_slots[OP_FORMAT_QUICK] = + nb_slots[OP_CREATE_FS] = nb_steps[ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem))]; - nb_slots[OP_FORMAT_DONE] = 1; if (!IsChecked(IDC_QUICKFORMAT)) { - nb_slots[OP_FORMAT_LONG] = -1; + nb_slots[OP_FORMAT] = -1; } for (i=0; ihttps://github.com/pbatard/rufus",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.0.2 (Build 85)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.0.2 (Build 86)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -164,8 +164,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,2,85 - PRODUCTVERSION 1,0,2,85 + FILEVERSION 1,0,2,86 + PRODUCTVERSION 1,0,2,86 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -182,13 +182,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.0.2.85" + VALUE "FileVersion", "1.0.2.86" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.0.2.85" + VALUE "ProductVersion", "1.0.2.86" END END BLOCK "VarFileInfo"