From a472e96e87ca563d174a36729742a8d952a07716 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 3 Sep 2018 13:04:05 +0100 Subject: [PATCH] [misc] prevent unwanted device refreshes --- src/dev.c | 6 ++++++ src/rufus.rc | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/dev.c b/src/dev.c index 3b4d9acd..0f338886 100644 --- a/src/dev.c +++ b/src/dev.c @@ -321,6 +321,12 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save) */ BOOL GetDevices(DWORD devnum) { + // Make sure at least one second has elapsed since we last displayed devices + static ULONGLONG LastRefresh = 0; + if (GetTickCount64() < LastRefresh + 1000) + return FALSE; + LastRefresh = GetTickCount64(); + // List of USB storage drivers we know - list may be incomplete! const char* usbstor_name[] = { // Standard MS USB storage driver diff --git a/src/rufus.rc b/src/rufus.rc index e163c1a0..f37f6bf4 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.2.1387" +CAPTION "Rufus 3.2.1388" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -392,8 +392,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,2,1387,0 - PRODUCTVERSION 3,2,1387,0 + FILEVERSION 3,2,1388,0 + PRODUCTVERSION 3,2,1388,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -411,13 +411,13 @@ BEGIN VALUE "Comments", "https://akeo.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.2.1387" + VALUE "FileVersion", "3.2.1388" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus-3.2.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.2.1387" + VALUE "ProductVersion", "3.2.1388" END END BLOCK "VarFileInfo"