Skip to content

Commit

Permalink
[core] relax the rule for exclusive write access
Browse files Browse the repository at this point in the history
* If we can't get a write handle for more than 5 seconds, retry with FILE_SHARE_WRITE
* This is a partial revert of 2f81e4f, in order to address #924.
  • Loading branch information
pbatard committed Apr 9, 2017
1 parent 2417ea7 commit 854620d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/rufus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 854620d

Please sign in to comment.