From 7ad71a34f85410f66c734300180853695ec14477 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 6 Sep 2015 17:47:39 +0100 Subject: [PATCH] [core] fix detection of some SanDisk Extreme UFDs * Also add a debug mode for troubleshooting user reports of HDDs vs UFDs * Closes #593 --- src/hdd_vs_ufd.h | 9 ++++++++- src/rufus.rc | 10 +++++----- src/usb.c | 13 +++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/hdd_vs_ufd.h b/src/hdd_vs_ufd.h index e730c8d9..9d1b091f 100644 --- a/src/hdd_vs_ufd.h +++ b/src/hdd_vs_ufd.h @@ -78,8 +78,15 @@ static str_score_t str_score[] = { { "TOSHIBA", 5 }, { "QUANTUM", 10 }, { "EXCELSTOR", 10 }, + { "ADATA", -15 }, { "CORSAIR", -15 }, + { "KINGMAX", -15 }, + { "KINGSTON", -15 }, + { "LEXAR", -15 }, { "MUSHKIN", -15 }, + { "PNY", -15 }, + { "SANDISK", -15 }, + { "TRANSCEND", -15 }, }; static str_score_t str_adjust[] = { @@ -147,7 +154,7 @@ static vid_score_t vid_score[] = { { 0x1516, -5 }, // CompUSA { 0x152d, 10 }, // JMicron { 0x1687, -5 }, // Kingmax - { 0x174c, 8 }, // ASMedia + { 0x174c, 3 }, // ASMedia (also used by SanDisk) { 0x1759, 8 }, // LucidPort { 0x18a5, -2 }, // Verbatim { 0x18ec, -5 }, // Arkmicro diff --git a/src/rufus.rc b/src/rufus.rc index 6e7179a5..61d63928 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,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 -CAPTION "Rufus 2.4.727" +CAPTION "Rufus 2.4.728" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -317,8 +317,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,4,727,0 - PRODUCTVERSION 2,4,727,0 + FILEVERSION 2,4,728,0 + PRODUCTVERSION 2,4,728,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -335,13 +335,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.4.727" + VALUE "FileVersion", "2.4.728" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.4.727" + VALUE "ProductVersion", "2.4.728" END END BLOCK "VarFileInfo" diff --git a/src/usb.c b/src/usb.c index 1025f5b8..c31789db 100644 --- a/src/usb.c +++ b/src/usb.c @@ -134,6 +134,14 @@ static __inline BOOL IsVHD(const char* buffer) return FALSE; } +/* For debugging user reports of HDDs vs UFDs */ +//#define FORCED_DEVICE +#ifdef FORCED_DEVICE +#define FORCED_VID 0x174C +#define FORCED_PID 0x3074 +#define FORCED_NAME "SanDisk Extreme USB Device" +#endif + /* * Refresh the list of USB devices */ @@ -356,6 +364,11 @@ BOOL GetUSBDevices(DWORD devnum) dev_if_path.String[(uintptr_t)htab_devid.table[j].data]); if (GetUSBProperties(dev_if_path.String[(uintptr_t)htab_devid.table[j].data], device_id, &props)) method_str = ""; +#ifdef FORCED_DEVICE + props.vid = FORCED_VID; + props.pid = FORCED_PID; + safe_strcpy(buffer, sizeof(buffer), FORCED_NAME); +#endif } break; }