From 854620d0ba8eeac91c9869e2504bbff9e7a43387 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 9 Apr 2017 21:05:10 +0100 Subject: [PATCH] [core] relax the rule for exclusive write access * If we can't get a write handle for more than 5 seconds, retry with FILE_SHARE_WRITE * This is a partial revert of 2f81e4f177a3603f6a29b11e3f8b7721728e232c, in order to address #924. --- src/drive.c | 9 ++++----- src/rufus.rc | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/drive.c b/src/drive.c index 26e4311b..49687cb3 100644 --- a/src/drive.c +++ b/src/drive.c @@ -57,7 +57,6 @@ const GUID PARTITION_SYSTEM_GUID = * Globals */ RUFUS_DRIVE_INFO SelectedDrive; -extern BOOL lock_drive; /* * The following methods get or set the AutoMount setting (which is different from AutoRun) @@ -148,10 +147,10 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr break; if (i == 0) { uprintf("Waiting for access..."); - } else if (!lock_drive && bWriteAccess && !bWriteShare && (i > (2*DRIVE_ACCESS_RETRIES)/3)) { - // If we can't seem to get a hold of the drive for a long time, - // and Alt-, is enabled, make a last ditch effort with FILE_SHARE_WRITE... - uprintf("Can't access %s - Retrying with write sharing enabled..."); + } else if (bWriteAccess && !bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) { + // If we can't seem to get a hold of the drive for some time, + // try to enable FILE_SHARE_WRITE... + uprintf("Warning: Could not obtain exclusive rights. Retrying with write sharing enabled..."); bWriteShare = TRUE; } Sleep(DRIVE_ACCESS_TIMEOUT / DRIVE_ACCESS_RETRIES); diff --git a/src/rufus.rc b/src/rufus.rc index c4624d03..b41ac9df 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.14.1084" +CAPTION "Rufus 2.14.1085" 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,14,1084,0 - PRODUCTVERSION 2,14,1084,0 + FILEVERSION 2,14,1085,0 + PRODUCTVERSION 2,14,1085,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.14.1084" + VALUE "FileVersion", "2.14.1085" 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.14.1084" + VALUE "ProductVersion", "2.14.1085" END END BLOCK "VarFileInfo"