From 3a150ddeda60be4282ac77e2c06cf0e82736900c Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 11 Aug 2017 11:43:37 +0100 Subject: [PATCH] [core] add support for more non-USB card readers * Closes #994 --- src/dev.c | 11 ++++++++++- src/rufus.rc | 10 +++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/dev.c b/src/dev.c index c4568677..7ad8802e 100644 --- a/src/dev.c +++ b/src/dev.c @@ -305,6 +305,7 @@ BOOL GetDevices(DWORD devnum) char letter_name[] = " (?:)"; char drive_name[] = "?:\\"; char uefi_togo_check[] = "?:\\EFI\\Rufus\\ntfs_x64.efi"; + char scsi_card_name_copy[16]; BOOL r = FALSE, found = FALSE, post_backslash; HDEVINFO dev_info = NULL; SP_DEVINFO_DATA dev_info_data; @@ -490,7 +491,15 @@ BOOL GetDevices(DWORD devnum) // Additional detection for SCSI card readers if ((!props.is_CARD) && (safe_strnicmp(buffer, scsi_disk_prefix, sizeof(scsi_disk_prefix)-1) == 0)) { for (j = 0; j < ARRAYSIZE(scsi_card_name); j++) { - if (safe_strstr(buffer, scsi_card_name[j]) != NULL) { + static_strcpy(scsi_card_name_copy, scsi_card_name[j]); + if (safe_strstr(buffer, scsi_card_name_copy) != NULL) { + props.is_CARD = TRUE; + break; + } + // Also test for "_SD&" instead of "_SD_" and so on to allow for devices like + // "SCSI\DiskRicoh_Storage_SD&REV_3.0" to be detected. + scsi_card_name_copy[strlen(scsi_card_name_copy) - 1] = '&'; + if (safe_strstr(buffer, scsi_card_name_copy) != NULL) { props.is_CARD = TRUE; break; } diff --git a/src/rufus.rc b/src/rufus.rc index 15c14e25..7235ef20 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.17.1175" +CAPTION "Rufus 2.17.1176" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -366,8 +366,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,17,1175,0 - PRODUCTVERSION 2,17,1175,0 + FILEVERSION 2,17,1176,0 + PRODUCTVERSION 2,17,1176,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -384,13 +384,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.17.1175" + VALUE "FileVersion", "2.17.1176" 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.17.1175" + VALUE "ProductVersion", "2.17.1176" END END BLOCK "VarFileInfo"