From fd093127d24d0843ad34fc05a710f0faf59d424a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 12 Jan 2017 11:47:28 +0000 Subject: [PATCH] [enum] add workaround for the lousy ASMedia USB 3.0 stack * This occurs on Windows 7 with the ASMedia proprietary USB 3.0 controller drivers. --- src/dev.c | 13 +++++++++---- src/rufus.rc | 10 +++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/dev.c b/src/dev.c index 3c37433a..7cbd22d6 100644 --- a/src/dev.c +++ b/src/dev.c @@ -92,9 +92,15 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop goto out; } - props->vid = conn_info.DeviceDescriptor.idVendor; - props->pid = conn_info.DeviceDescriptor.idProduct; - props->speed = conn_info.Speed + 1; + // Some poorly written proprietary Windows 7 USB 3.0 controller drivers (ASMedia) + // have a screwed up implementation of IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX that succeeds + // but returns zeroed data => Add a workaround so that we don't lose our VID:PID... + if ((conn_info.DeviceDescriptor.idVendor != 0) || (conn_info.DeviceDescriptor.idProduct != 0)) { + props->vid = conn_info.DeviceDescriptor.idVendor; + props->pid = conn_info.DeviceDescriptor.idProduct; + props->speed = conn_info.Speed + 1; + r = TRUE; + } // In their great wisdom, Microsoft decided to BREAK the USB speed report between Windows 7 and Windows 8 if (nWindowsVersion >= WINDOWS_8) { @@ -111,7 +117,6 @@ static BOOL GetUSBProperties(char* parent_path, char* device_id, usb_device_prop props->is_LowerSpeed = TRUE; } } - r = TRUE; out: safe_closehandle(handle); diff --git a/src/rufus.rc b/src/rufus.rc index b3525175..cb80b19b 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.12.1018" +CAPTION "Rufus 2.12.1019" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -334,8 +334,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,12,1018,0 - PRODUCTVERSION 2,12,1018,0 + FILEVERSION 2,12,1019,0 + PRODUCTVERSION 2,12,1019,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -352,13 +352,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.12.1018" + VALUE "FileVersion", "2.12.1019" 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.12.1018" + VALUE "ProductVersion", "2.12.1019" END END BLOCK "VarFileInfo"