diff --git a/src/drive.c b/src/drive.c index 6cc8f84f..b6928c5f 100644 --- a/src/drive.c +++ b/src/drive.c @@ -126,7 +126,7 @@ static HANDLE GetHandle(char* Path, BOOL bWriteAccess, BOOL bLockDrive) if (Path == NULL) goto out; hDrive = CreateFileA(Path, GENERIC_READ|(bWriteAccess?GENERIC_WRITE:0), - FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + FILE_SHARE_READ|(bWriteAccess?FILE_SHARE_WRITE:0), NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hDrive == INVALID_HANDLE_VALUE) { uprintf("Could not open drive %s: %s\n", Path, WindowsErrorString()); goto out; @@ -1286,9 +1286,9 @@ BOOL InitializeDisk(HANDLE hDrive) uprintf("Could not refresh drive layout: %s\n", WindowsErrorString()); safe_closehandle(hDrive); return FALSE; -} + } -return TRUE; + return TRUE; } /* diff --git a/src/format.c b/src/format.c index 213627cc..8e271de1 100644 --- a/src/format.c +++ b/src/format.c @@ -1558,7 +1558,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, HANDLE hSourceImage) if (s) uprintf("write error: Wrote %d bytes, expected %d bytes", wSize, rSize); else - uprintf("write error: %s", WindowsErrorString()); + uprintf("write error at sector %d: %s", wb / SelectedDrive.SectorSize, WindowsErrorString()); if (i < WRITE_RETRIES - 1) { li.QuadPart = wb; uprintf(" RETRYING...\n"); @@ -1570,6 +1570,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, HANDLE hSourceImage) FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_WRITE_FAULT; goto out; } + Sleep(200); } if (i >= WRITE_RETRIES) goto out; } @@ -1714,7 +1715,7 @@ DWORD WINAPI FormatThread(void* param) // Note, Microsoft's way of cleaning partitions (IOCTL_DISK_CREATE_DISK, which is what we apply // in InitializeDisk) is *NOT ENOUGH* to reset a disk and can render it inoperable for partitioning // or formatting under Windows. See https://github.com/pbatard/rufus/issues/759 for details. - if (nWindowsVersion > WINDOWS_XP) { + if ((nWindowsVersion > WINDOWS_XP) && ((!IsChecked(IDC_BOOT)) || (bt != BT_IMG))) { if ((!ClearMBRGPT(hPhysicalDrive, SelectedDrive.DiskSize, SelectedDrive.SectorSize, use_large_fat32)) || (!InitializeDisk(hPhysicalDrive))) { uprintf("Could not reset partitions\n"); @@ -2151,6 +2152,7 @@ DWORD WINAPI SaveImageThread(void* param) FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_WRITE_FAULT; goto out; } + Sleep(200); } if (i >= WRITE_RETRIES) goto out; } diff --git a/src/rufus.c b/src/rufus.c index bce234b0..a3023ae2 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -3154,7 +3154,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine uprintf("Could not get AutoMount status"); automount = TRUE; // So that we don't try to change its status on exit } else if (!automount) { - uprintf("AutoMount was detected as disabled - temporary re-enabling it"); + uprintf("AutoMount was detected as disabled - temporarily re-enabling it"); if (!SetAutoMount(TRUE)) uprintf("Failed to enable AutoMount"); } diff --git a/src/rufus.rc b/src/rufus.rc index 4753752c..a8872b7d 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 242, 376 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 2.12.1059" +CAPTION "Rufus 2.12.1060" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -334,8 +334,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,12,1059,0 - PRODUCTVERSION 2,12,1059,0 + FILEVERSION 2,12,1060,0 + PRODUCTVERSION 2,12,1060,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -352,13 +352,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.12.1059" + VALUE "FileVersion", "2.12.1060" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2017 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.12.1059" + VALUE "ProductVersion", "2.12.1060" END END BLOCK "VarFileInfo"