mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[ui] fix percent not being displayed on slow format
This commit is contained in:
		
							parent
							
								
									996d4254b3
								
							
						
					
					
						commit
						1b02181f74
					
				
					 5 changed files with 15 additions and 15 deletions
				
			
		|  | @ -46,7 +46,7 @@ | ||||||
| 
 | 
 | ||||||
| extern StrArray DriveId, DriveName, DriveLabel, DriveHub; | extern StrArray DriveId, DriveName, DriveLabel, DriveHub; | ||||||
| extern uint32_t DrivePort[MAX_DRIVES]; | extern uint32_t DrivePort[MAX_DRIVES]; | ||||||
| extern BOOL enable_HDDs, use_fake_units, enable_vmdk, usb_debug, list_non_usb_removable_drives, is_me; | extern BOOL enable_HDDs, use_fake_units, enable_vmdk, usb_debug, list_non_usb_removable_drives, its_a_me_mario; | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * Get the VID, PID and current device speed |  * Get the VID, PID and current device speed | ||||||
|  | @ -782,7 +782,7 @@ BOOL GetDevices(DWORD devnum) | ||||||
| 				static_strcpy(str, "????:????");	// Couldn't figure VID:PID
 | 				static_strcpy(str, "????:????");	// Couldn't figure VID:PID
 | ||||||
| 			} else { | 			} else { | ||||||
| 				// because I don't want to end up erasing this specific device of mine by accident
 | 				// because I don't want to end up erasing this specific device of mine by accident
 | ||||||
| 				if (is_me && (props.vid == 0x0525) && (props.pid == 0x622b)) | 				if (its_a_me_mario && (props.vid == 0x0525) && (props.pid == 0x622b)) | ||||||
| 					continue; | 					continue; | ||||||
| 				static_sprintf(str, "%04X:%04X", props.vid, props.pid); | 				static_sprintf(str, "%04X:%04X", props.vid, props.pid); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  | @ -104,7 +104,7 @@ out: | ||||||
|  */ |  */ | ||||||
| static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, DWORD Action, PVOID pData) | static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, DWORD Action, PVOID pData) | ||||||
| { | { | ||||||
| 	DWORD* percent; | 	char percent_str[8]; | ||||||
| 	if (IS_ERROR(FormatStatus)) | 	if (IS_ERROR(FormatStatus)) | ||||||
| 		return FALSE; | 		return FALSE; | ||||||
| 
 | 
 | ||||||
|  | @ -112,9 +112,9 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command, | ||||||
| 
 | 
 | ||||||
| 	switch(Command) { | 	switch(Command) { | ||||||
| 	case FCC_PROGRESS: | 	case FCC_PROGRESS: | ||||||
| 		percent = (DWORD*)pData; | 		static_sprintf(percent_str, "%lu%%", *((DWORD*)pData)); | ||||||
| 		PrintInfo(0, MSG_217, 1.0f * (*percent)); | 		PrintInfo(0, MSG_217, percent_str); | ||||||
| 		UpdateProgress(OP_FORMAT, 1.0f * (*percent)); | 		UpdateProgress(OP_FORMAT, 1.0f * (*((DWORD*)pData))); | ||||||
| 		break; | 		break; | ||||||
| 	case FCC_STRUCTURE_PROGRESS:	// No progress on quick format
 | 	case FCC_STRUCTURE_PROGRESS:	// No progress on quick format
 | ||||||
| 		if (task_number < nb_steps[actual_fs_type] - 1) { | 		if (task_number < nb_steps[actual_fs_type] - 1) { | ||||||
|  |  | ||||||
|  | @ -103,7 +103,7 @@ HWND hDeviceList, hPartitionScheme, hTargetSystem, hFileSystem, hClusterSize, hL | ||||||
| HWND hLogDialog = NULL, hProgress = NULL, hDiskID; | HWND hLogDialog = NULL, hProgress = NULL, hDiskID; | ||||||
| HANDLE dialog_handle = NULL; | HANDLE dialog_handle = NULL; | ||||||
| BOOL is_x86_32, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE; | BOOL is_x86_32, use_own_c32[NB_OLD_C32] = { FALSE, FALSE }, mbr_selected_by_user = FALSE; | ||||||
| BOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, is_me = FALSE; | BOOL op_in_progress = TRUE, right_to_left_mode = FALSE, has_uefi_csm = FALSE, its_a_me_mario = FALSE; | ||||||
| BOOL enable_HDDs = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE; | BOOL enable_HDDs = FALSE, enable_ntfs_compression = FALSE, no_confirmation_on_cancel = FALSE, lock_drive = TRUE; | ||||||
| BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32, usb_debug; | BOOL advanced_mode_device, advanced_mode_format, allow_dual_uefi_bios, detect_fakes, enable_vmdk, force_large_fat32, usb_debug; | ||||||
| BOOL use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE; | BOOL use_fake_units, preserve_timestamps = FALSE, fast_zeroing = FALSE, app_changed_size = FALSE; | ||||||
|  | @ -2901,7 +2901,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine | ||||||
| 	// PS: You know that official MSDN documentation for SetDllDirectory() that explicitly
 | 	// PS: You know that official MSDN documentation for SetDllDirectory() that explicitly
 | ||||||
| 	// indicates that "If the parameter is an empty string (""), the call removes the current
 | 	// indicates that "If the parameter is an empty string (""), the call removes the current
 | ||||||
| 	// directory from the default DLL search order"? Yeah, that doesn't work. At all.
 | 	// directory from the default DLL search order"? Yeah, that doesn't work. At all.
 | ||||||
| 	// Still, we invoke it, for platforms where the following call might not work...
 | 	// Still, we invoke it, for platforms where the following call might actually work...
 | ||||||
| 	SetDllDirectoryA(""); | 	SetDllDirectoryA(""); | ||||||
| 
 | 
 | ||||||
| 	// Also, even if you use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32), you're
 | 	// Also, even if you use SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32), you're
 | ||||||
|  | @ -2924,7 +2924,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine | ||||||
| 		pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); | 		pfSetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32); | ||||||
| 
 | 
 | ||||||
| 	uprintf("*** " APPLICATION_NAME " init ***\n"); | 	uprintf("*** " APPLICATION_NAME " init ***\n"); | ||||||
| 	is_me = GetUserNameA((char*)(uintptr_t)& u, &size) && (u == 7104878); | 	its_a_me_mario = GetUserNameA((char*)(uintptr_t)&u, &size) && (u == 7104878); | ||||||
| 	// coverity[pointless_string_compare]
 | 	// coverity[pointless_string_compare]
 | ||||||
| 	is_x86_32 = (strcmp(APPLICATION_ARCH, "x86") == 0); | 	is_x86_32 = (strcmp(APPLICATION_ARCH, "x86") == 0); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | ||||||
| IDD_DIALOG DIALOGEX 12, 12, 232, 326 | IDD_DIALOG DIALOGEX 12, 12, 232, 326 | ||||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||||
| EXSTYLE WS_EX_ACCEPTFILES | EXSTYLE WS_EX_ACCEPTFILES | ||||||
| CAPTION "Rufus 3.9.1581" | CAPTION "Rufus 3.9.1582" | ||||||
| FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | ||||||
| BEGIN | BEGIN | ||||||
|     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP |     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP | ||||||
|  | @ -394,8 +394,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 3,9,1581,0 |  FILEVERSION 3,9,1582,0 | ||||||
|  PRODUCTVERSION 3,9,1581,0 |  PRODUCTVERSION 3,9,1582,0 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -413,13 +413,13 @@ BEGIN | ||||||
|             VALUE "Comments", "https://rufus.ie" |             VALUE "Comments", "https://rufus.ie" | ||||||
|             VALUE "CompanyName", "Akeo Consulting" |             VALUE "CompanyName", "Akeo Consulting" | ||||||
|             VALUE "FileDescription", "Rufus" |             VALUE "FileDescription", "Rufus" | ||||||
|             VALUE "FileVersion", "3.9.1581" |             VALUE "FileVersion", "3.9.1582" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" | ||||||
|             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" |             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" | ||||||
|             VALUE "OriginalFilename", "rufus-3.9.exe" |             VALUE "OriginalFilename", "rufus-3.9.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "3.9.1581" |             VALUE "ProductVersion", "3.9.1582" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								src/ui.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								src/ui.c
									
										
									
									
									
								
							|  | @ -1251,7 +1251,7 @@ void UpdateProgress(int op, float percent) | ||||||
| 		pos = (int)((previous_end + ((slot_end[op + 1] - previous_end) * (percent / 100.0f))) / 100.0f * MAX_PROGRESS); | 		pos = (int)((previous_end + ((slot_end[op + 1] - previous_end) * (percent / 100.0f))) / 100.0f * MAX_PROGRESS); | ||||||
| 	} | 	} | ||||||
| 	if (pos > MAX_PROGRESS) { | 	if (pos > MAX_PROGRESS) { | ||||||
| 		duprintf("UpdateProgress(%d): rounding error - pos %d is greater than %d\n", op, pos, MAX_PROGRESS); | 		duprintf("UpdateProgress(%d): rounding error - pos %d is greater than %d", op, pos, MAX_PROGRESS); | ||||||
| 		pos = MAX_PROGRESS; | 		pos = MAX_PROGRESS; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue