mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[core] fix MBR cleanup regression
* Commit 9dc045a701 introduced a regression on account that we didn't set the
  file pointer to 0 before clearing the disk.
* This leads to the MBR not being properly cleared, with the result that Windows may in turn
  produce errors when trying to repartition the disk.
* Fix this by making sure we do invoke SetFilePointerEx() before calling WriteFileWithRetry().
* Also set rufus-next to 3.17
* Also fix a MinGW warning
			
			
This commit is contained in:
		
							parent
							
								
									0b618f3de7
								
							
						
					
					
						commit
						d8a2c29a67
					
				
					 7 changed files with 25 additions and 22 deletions
				
			
		
							
								
								
									
										20
									
								
								configure
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								configure
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,6 @@ | ||||||
| #! /bin/sh | #! /bin/sh | ||||||
| # Guess values for system-dependent variables and create Makefiles. | # Guess values for system-dependent variables and create Makefiles. | ||||||
| # Generated by GNU Autoconf 2.71 for rufus 3.16. | # Generated by GNU Autoconf 2.71 for rufus 3.17. | ||||||
| # | # | ||||||
| # Report bugs to <https://github.com/pbatard/rufus/issues>. | # Report bugs to <https://github.com/pbatard/rufus/issues>. | ||||||
| # | # | ||||||
|  | @ -611,8 +611,8 @@ MAKEFLAGS= | ||||||
| # Identity of this package. | # Identity of this package. | ||||||
| PACKAGE_NAME='rufus' | PACKAGE_NAME='rufus' | ||||||
| PACKAGE_TARNAME='rufus' | PACKAGE_TARNAME='rufus' | ||||||
| PACKAGE_VERSION='3.16' | PACKAGE_VERSION='3.17' | ||||||
| PACKAGE_STRING='rufus 3.16' | PACKAGE_STRING='rufus 3.17' | ||||||
| PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' | PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' | ||||||
| PACKAGE_URL='https://rufus.ie' | PACKAGE_URL='https://rufus.ie' | ||||||
| 
 | 
 | ||||||
|  | @ -1268,7 +1268,7 @@ if test "$ac_init_help" = "long"; then | ||||||
|   # Omit some internal or obsolete options to make the list less imposing. |   # 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. |   # This message is too long to be a string in the A/UX 3.1 sh. | ||||||
|   cat <<_ACEOF |   cat <<_ACEOF | ||||||
| \`configure' configures rufus 3.16 to adapt to many kinds of systems. | \`configure' configures rufus 3.17 to adapt to many kinds of systems. | ||||||
| 
 | 
 | ||||||
| Usage: $0 [OPTION]... [VAR=VALUE]... | Usage: $0 [OPTION]... [VAR=VALUE]... | ||||||
| 
 | 
 | ||||||
|  | @ -1335,7 +1335,7 @@ fi | ||||||
| 
 | 
 | ||||||
| if test -n "$ac_init_help"; then | if test -n "$ac_init_help"; then | ||||||
|   case $ac_init_help in |   case $ac_init_help in | ||||||
|      short | recursive ) echo "Configuration of rufus 3.16:";; |      short | recursive ) echo "Configuration of rufus 3.17:";; | ||||||
|    esac |    esac | ||||||
|   cat <<\_ACEOF |   cat <<\_ACEOF | ||||||
| 
 | 
 | ||||||
|  | @ -1427,7 +1427,7 @@ fi | ||||||
| test -n "$ac_init_help" && exit $ac_status | test -n "$ac_init_help" && exit $ac_status | ||||||
| if $ac_init_version; then | if $ac_init_version; then | ||||||
|   cat <<\_ACEOF |   cat <<\_ACEOF | ||||||
| rufus configure 3.16 | rufus configure 3.17 | ||||||
| generated by GNU Autoconf 2.71 | generated by GNU Autoconf 2.71 | ||||||
| 
 | 
 | ||||||
| Copyright (C) 2021 Free Software Foundation, Inc. | Copyright (C) 2021 Free Software Foundation, Inc. | ||||||
|  | @ -1503,7 +1503,7 @@ cat >config.log <<_ACEOF | ||||||
| This file contains any messages produced by compilers while | This file contains any messages produced by compilers while | ||||||
| running configure, to aid debugging if configure makes a mistake. | running configure, to aid debugging if configure makes a mistake. | ||||||
| 
 | 
 | ||||||
| It was created by rufus $as_me 3.16, which was | It was created by rufus $as_me 3.17, which was | ||||||
| generated by GNU Autoconf 2.71.  Invocation command line was | generated by GNU Autoconf 2.71.  Invocation command line was | ||||||
| 
 | 
 | ||||||
|   $ $0$ac_configure_args_raw |   $ $0$ac_configure_args_raw | ||||||
|  | @ -2767,7 +2767,7 @@ fi | ||||||
| 
 | 
 | ||||||
| # Define the identity of the package. | # Define the identity of the package. | ||||||
|  PACKAGE='rufus' |  PACKAGE='rufus' | ||||||
|  VERSION='3.16' |  VERSION='3.17' | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h | printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h | ||||||
|  | @ -5205,7 +5205,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | ||||||
| # report actual input values of CONFIG_FILES etc. instead of their | # report actual input values of CONFIG_FILES etc. instead of their | ||||||
| # values after options handling. | # values after options handling. | ||||||
| ac_log=" | ac_log=" | ||||||
| This file was extended by rufus $as_me 3.16, which was | This file was extended by rufus $as_me 3.17, which was | ||||||
| generated by GNU Autoconf 2.71.  Invocation command line was | generated by GNU Autoconf 2.71.  Invocation command line was | ||||||
| 
 | 
 | ||||||
|   CONFIG_FILES    = $CONFIG_FILES |   CONFIG_FILES    = $CONFIG_FILES | ||||||
|  | @ -5261,7 +5261,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ | ||||||
| cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | ||||||
| ac_cs_config='$ac_cs_config_escaped' | ac_cs_config='$ac_cs_config_escaped' | ||||||
| ac_cs_version="\\ | ac_cs_version="\\ | ||||||
| rufus config.status 3.16 | rufus config.status 3.17 | ||||||
| configured by $0, generated by GNU Autoconf 2.71, | configured by $0, generated by GNU Autoconf 2.71, | ||||||
|   with options \\"\$ac_cs_config\\" |   with options \\"\$ac_cs_config\\" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| AC_INIT([rufus], [3.16], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) | AC_INIT([rufus], [3.17], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) | ||||||
| AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) | AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) | ||||||
| AC_CONFIG_SRCDIR([src/rufus.c]) | AC_CONFIG_SRCDIR([src/rufus.c]) | ||||||
| AC_CONFIG_MACRO_DIR([m4]) | AC_CONFIG_MACRO_DIR([m4]) | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
|   <Identity |   <Identity | ||||||
|     Name="19453.net.Rufus" |     Name="19453.net.Rufus" | ||||||
|     Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740" |     Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740" | ||||||
|     Version="3.16.1837.0" /> |     Version="3.17.1838.0" /> | ||||||
| 
 | 
 | ||||||
|   <Properties> |   <Properties> | ||||||
|     <DisplayName>Rufus</DisplayName> |     <DisplayName>Rufus</DisplayName> | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| @echo off | @echo off | ||||||
| setlocal EnableExtensions DisableDelayedExpansion | setlocal EnableExtensions DisableDelayedExpansion | ||||||
| set VERSION=3.16 | set VERSION=3.17 | ||||||
| 
 | 
 | ||||||
| del /q *.appx >NUL 2>&1 | del /q *.appx >NUL 2>&1 | ||||||
| del /q *.appxbundle >NUL 2>&1 | del /q *.appxbundle >NUL 2>&1 | ||||||
|  |  | ||||||
|  | @ -739,6 +739,9 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi | ||||||
| 		FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_NOT_ENOUGH_MEMORY; | 		FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_NOT_ENOUGH_MEMORY; | ||||||
| 		goto out; | 		goto out; | ||||||
| 	} | 	} | ||||||
|  | 	liFilePointer.QuadPart = 0ULL; | ||||||
|  | 	if (!SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) || (liFilePointer.QuadPart != 0ULL)) | ||||||
|  | 		uprintf("Warning: Could not reset disk position"); | ||||||
| 	if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * num_sectors_to_clear), NULL, WRITE_RETRIES)) | 	if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * num_sectors_to_clear), NULL, WRITE_RETRIES)) | ||||||
| 		goto out; | 		goto out; | ||||||
| 	CHECK_FOR_USER_CANCEL; | 	CHECK_FOR_USER_CANCEL; | ||||||
|  | @ -1852,8 +1855,8 @@ DWORD WINAPI FormatThread(void* param) | ||||||
| { | { | ||||||
| 	int r; | 	int r; | ||||||
| 	BOOL ret, use_large_fat32, windows_to_go, actual_lock_drive = lock_drive; | 	BOOL ret, use_large_fat32, windows_to_go, actual_lock_drive = lock_drive; | ||||||
| 	// Windows 11 and VDS (which I suspect is what fmifs.dll's FormatEx() is now calling behind the
 | 	// Windows 11 and VDS (which I suspect is what fmifs.dll's FormatEx() is now calling behind the scenes)
 | ||||||
| 	// scenes) require us to unlock the physical drive to format the drive, else access denied is re
 | 	// require us to unlock the physical drive to format the drive, else access denied is returned.
 | ||||||
| 	BOOL need_logical = FALSE, must_unlock_physical = (use_vds || nWindowsVersion >= WINDOWS_11); | 	BOOL need_logical = FALSE, must_unlock_physical = (use_vds || nWindowsVersion >= WINDOWS_11); | ||||||
| 	DWORD cr, DriveIndex = (DWORD)(uintptr_t)param, ClusterSize, Flags; | 	DWORD cr, DriveIndex = (DWORD)(uintptr_t)param, ClusterSize, Flags; | ||||||
| 	HANDLE hPhysicalDrive = INVALID_HANDLE_VALUE; | 	HANDLE hPhysicalDrive = INVALID_HANDLE_VALUE; | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								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.16.1837" | CAPTION "Rufus 3.17.1838" | ||||||
| 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 | ||||||
|  | @ -395,8 +395,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 3,16,1837,0 |  FILEVERSION 3,17,1838,0 | ||||||
|  PRODUCTVERSION 3,16,1837,0 |  PRODUCTVERSION 3,17,1838,0 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -414,13 +414,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.16.1837" |             VALUE "FileVersion", "3.17.1838" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011-2021 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.16.exe" |             VALUE "OriginalFilename", "rufus-3.17.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "3.16.1837" |             VALUE "ProductVersion", "3.17.1838" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
|  | @ -310,7 +310,7 @@ static const char* GetEdition(DWORD ProductType) | ||||||
| 	case 0x000000BD: return "Lite"; | 	case 0x000000BD: return "Lite"; | ||||||
| 	case 0xABCDABCD: return "(Unlicensed)"; | 	case 0xABCDABCD: return "(Unlicensed)"; | ||||||
| 	default: | 	default: | ||||||
| 		static_sprintf(unknown_edition_str, "(Unknown Edition 0x%02X)", ProductType); | 		static_sprintf(unknown_edition_str, "(Unknown Edition 0x%02X)", (uint32_t)ProductType); | ||||||
| 		return unknown_edition_str; | 		return unknown_edition_str; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue