From f0047986e7e1eedf06973871dd28a10bbc6ba815 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 9 Sep 2021 22:20:57 +0200 Subject: [PATCH] [dev] add support for intel NUC card readers * Also make sure that cards larger than 200 GB are not listed by default. --- res/appstore/Package.appxmanifest | 2 +- src/dev.c | 9 +++++++-- src/hdd_vs_ufd.h | 1 + src/rufus.h | 1 + src/rufus.rc | 10 +++++----- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/res/appstore/Package.appxmanifest b/res/appstore/Package.appxmanifest index dc919d22..31807a8b 100644 --- a/res/appstore/Package.appxmanifest +++ b/res/appstore/Package.appxmanifest @@ -11,7 +11,7 @@ + Version="3.16.1819.0" /> Rufus diff --git a/src/dev.c b/src/dev.c index 62eaae65..fb4c45b7 100644 --- a/src/dev.c +++ b/src/dev.c @@ -450,7 +450,7 @@ BOOL GetDevices(DWORD devnum) // Also http://www.carrona.org/dvrref.php. NB: All members from this list should have // been reported as enumerators by Rufus, when Enum Debug is enabled. "SD", "PCISTOR", "RTSOR", "JMCR", "JMCF", "RIMMPTSK", "RIMSPTSK", "RISD", "RIXDPTSK", - "TI21SONY", "ESD7SK", "ESM7SK", "O2MD", "O2SD", "VIACR" + "TI21SONY", "ESD7SK", "ESM7SK", "O2MD", "O2SD", "VIACR", "GLREADER" }; // Oh, and we also have card devices (e.g. 'SCSI\DiskO2Micro_SD_...') under the SCSI enumerator... const char* scsi_disk_prefix = "SCSI\\Disk"; @@ -636,7 +636,7 @@ BOOL GetDevices(DWORD devnum) uuprintf("Processing '%s' device:", buffer); if ((!props.is_USB) && (!props.is_SCSI)) { - uuprintf(" Disabled by policy"); + uuprintf(" Unsupported or disabled by policy"); continue; } @@ -889,6 +889,11 @@ BOOL GetDevices(DWORD devnum) uprintf("NOTE: You can enable the listing of Hard Drives under 'advanced drive properties'"); safe_free(devint_detail_data); break; + } else if ((!enable_HDDs) && (props.is_CARD) && (GetDriveSize(drive_index) > MAX_DEFAULT_LIST_CARD_SIZE * GB)) { + uprintf("Device eliminated because it was detected as a card larger than %d GB", MAX_DEFAULT_LIST_CARD_SIZE); + uprintf("To use such a card, check 'List USB Hard Drives' under 'advanced drive properties'"); + safe_free(devint_detail_data); + break; } // Windows 10 19H1 mounts a 'PortableBaseLayer' for its Windows Sandbox feature => unlist those if (safe_strcmp(label, windows_sandbox_vhd_label) == 0) { diff --git a/src/hdd_vs_ufd.h b/src/hdd_vs_ufd.h index 54c2ec62..2740b573 100644 --- a/src/hdd_vs_ufd.h +++ b/src/hdd_vs_ufd.h @@ -91,6 +91,7 @@ static str_score_t str_adjust[] = { { "Gadget", -10 }, { "Flash", -10 }, { "HDD", +20 }, + { "SDXC", +10 }, { "SSD", +20 } }; diff --git a/src/rufus.h b/src/rufus.h index 3258c3ff..80f85771 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -75,6 +75,7 @@ #define MAX_PARTITIONS 16 // Maximum number of partitions we handle #define MAX_ESP_TOGGLE 8 // Maximum number of entries we record to toggle GPT ESP back and forth #define MAX_ISO_TO_ESP_SIZE 512 // Maximum size we allow for the ISO → ESP option (in MB) +#define MAX_DEFAULT_LIST_CARD_SIZE 200 // Size above which we don't list a card without enable HDD or Alt-F (in GB) #define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34) #define MAX_WININST 4 // Max number of install[.wim|.esd] we can handle on an image #define MBR_UEFI_MARKER 0x49464555 // 'U', 'E', 'F', 'I', as a 32 bit little endian longword diff --git a/src/rufus.rc b/src/rufus.rc index 3cc12933..70966489 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.16.1818" +CAPTION "Rufus 3.16.1819" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,16,1818,0 - PRODUCTVERSION 3,16,1818,0 + FILEVERSION 3,16,1819,0 + PRODUCTVERSION 3,16,1819,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.16.1818" + VALUE "FileVersion", "3.16.1819" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.16.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.16.1818" + VALUE "ProductVersion", "3.16.1819" END END BLOCK "VarFileInfo"