From 201843dbf359e4323b7cef593f48ef0c2cc3a213 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 8 Jun 2014 18:02:03 +0100 Subject: [PATCH] v1.4.9 (build 506) * Fix listing of drives on Windows XP and Windows Vista (Could not allocate Device ID list) * Closes #343 --- ChangeLog.txt | 5 ++++- configure | 20 ++++++++++---------- configure.ac | 2 +- src/rufus.rc | 12 ++++++------ src/usb.c | 13 ++++++++----- src/usb.h | 1 + 6 files changed, 30 insertions(+), 23 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 30444019..f80835c8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,7 @@ -o Version 1.4.8 (2014.06.??) +o Version 1.4.9 (2014.06.08) [BUGFIX RELEASE] + Fix listing of drives for Windows XP and Windows Vista (reported by Alex Andrews) + +o Version 1.4.8 (2014.06.03) Add KolibriOS ISO support Add Arabic translation, courtesy of عمر الصمد Add Croatian translation, courtesy of Dario Komar diff --git a/configure b/configure index 9ca50685..f4f4b141 100644 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for rufus 1.4.8. +# Generated by GNU Autoconf 2.68 for rufus 1.4.9. # # Report bugs to . # @@ -560,8 +560,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rufus' PACKAGE_TARNAME='rufus' -PACKAGE_VERSION='1.4.8' -PACKAGE_STRING='rufus 1.4.8' +PACKAGE_VERSION='1.4.9' +PACKAGE_STRING='rufus 1.4.9' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_URL='http://rufus.akeo.ie' @@ -1203,7 +1203,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures rufus 1.4.8 to adapt to many kinds of systems. +\`configure' configures rufus 1.4.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1269,7 +1269,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rufus 1.4.8:";; + short | recursive ) echo "Configuration of rufus 1.4.9:";; esac cat <<\_ACEOF @@ -1357,7 +1357,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rufus configure 1.4.8 +rufus configure 1.4.9 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1412,7 +1412,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rufus $as_me 1.4.8, which was +It was created by rufus $as_me 1.4.9, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2227,7 +2227,7 @@ fi # Define the identity of the package. PACKAGE='rufus' - VERSION='1.4.8' + VERSION='1.4.9' cat >>confdefs.h <<_ACEOF @@ -4140,7 +4140,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rufus $as_me 1.4.8, which was +This file was extended by rufus $as_me 1.4.9, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4194,7 +4194,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -rufus config.status 1.4.8 +rufus config.status 1.4.9 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index aa750e2d..eefd96ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([rufus], [1.4.8], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie]) +AC_INIT([rufus], [1.4.9], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/rufus.rc b/src/rufus.rc index d38a92a3..42d648d1 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 329 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rufus 1.4.8.505" +CAPTION "Rufus 1.4.9.506" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -165,7 +165,7 @@ END RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL -CAPTION "Rufus 1.4.8.505" +CAPTION "Rufus 1.4.9.506" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -428,8 +428,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,8,505 - PRODUCTVERSION 1,4,8,505 + FILEVERSION 1,4,9,506 + PRODUCTVERSION 1,4,9,506 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -446,13 +446,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.8.505" + VALUE "FileVersion", "1.4.9.506" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.4.8.505" + VALUE "ProductVersion", "1.4.9.506" END END BLOCK "VarFileInfo" diff --git a/src/usb.c b/src/usb.c index 060275be..fbeba0b9 100644 --- a/src/usb.c +++ b/src/usb.c @@ -126,7 +126,7 @@ BOOL GetUSBDevices(DWORD devnum) PSP_DEVICE_INTERFACE_DETAIL_DATA_A devint_detail_data; DEVINST parent_inst, device_inst; DWORD size, i, j, k, datatype, drive_index; - ULONG list_size[ARRAYSIZE(storage_name)], full_list_size; + ULONG list_size[ARRAYSIZE(storage_name)] = { 0 }, full_list_size, ulFlags; HANDLE hDrive; LONG maxwidth = 0; int s, score, drive_number; @@ -191,11 +191,14 @@ BOOL GetUSBDevices(DWORD devnum) // Build a single list of Device IDs from all the storage enumerators we know of full_list_size = 0; + ulFlags = CM_GETIDLIST_FILTER_SERVICE; + if (nWindowsVersion >= WINDOWS_7) + ulFlags |= CM_GETIDLIST_FILTER_PRESENT; for (s=0; s 1) { - CM_Get_Device_ID_ListA(storage_name[s], &devid_list[i], list_size[s], - CM_GETIDLIST_FILTER_SERVICE|CM_GETIDLIST_FILTER_PRESENT); // + if (CM_Get_Device_ID_ListA(storage_name[s], &devid_list[i], list_size[s], ulFlags) != CR_SUCCESS) + continue; // The list_size is sometimes larger than required thus we need to find the real end for (i += list_size[s]; i > 2; i--) { if ((devid_list[i-2] != '\0') && (devid_list[i-1] == '\0') && (devid_list[i] == '\0')) diff --git a/src/usb.h b/src/usb.h index 19d3fd43..7c4db245 100644 --- a/src/usb.h +++ b/src/usb.h @@ -49,6 +49,7 @@ typedef CHAR *DEVINSTID_A; #define CR_SUCCESS 0x00000000 #define CR_NO_SUCH_DEVNODE 0x0000000D #define CM_GETIDLIST_FILTER_SERVICE 0x00000002 +// /!\ The following flag is only available on Windows 7 or later! #define CM_GETIDLIST_FILTER_PRESENT 0x00000100 #define CM_DRP_ADDRESS 0x0000001D