[core] only allow removable drives to be listed

* Our detection code, which is based on the HPUSBFW utility, allows fixed
  drives such as USB HDDs to be listed
* Since Rufus lacks extra precautions for fixed disks, this may result in
  people mistakenly formatting and HDD instead of a flash drive
* Until we have added HDD specific features (support for repartitioning or
  existing partitions, >32GB FAT32, etc.) we prefer playing it safe by
  not listing fixed disks.
* We will re-enable fixed disks when we feel enough safeties are in place
* Also fix an issue where ISO selection could crash if Rufus
  was compiled for Vista and later and update version to rufus-next
This commit is contained in:
Pete Batard 2012-02-24 18:46:02 +00:00
parent e0e974603c
commit 352a796eff
7 changed files with 23 additions and 21 deletions

View File

@ -8,7 +8,7 @@ Features:
- Bad blocks check - Bad blocks check
- Modern UI, with UAC elevation for Windows Vista and later - Modern UI, with UAC elevation for Windows Vista and later
- Very small footprint, no installation required - Very small footprint, no installation required
- Fully Open Source (GPL v3) - 100% Free Source Software (GPL v3)
Compilation: Compilation:
Use either Visual Studio 2010, WDK (Windows Driver Kit) or MinGW and then Use either Visual Studio 2010, WDK (Windows Driver Kit) or MinGW and then

20
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for rufus 1.1.2. # Generated by GNU Autoconf 2.68 for rufus 1.1.3.
# #
# Report bugs to <https://github.com/pbatard/rufus/issues>. # Report bugs to <https://github.com/pbatard/rufus/issues>.
# #
@ -559,8 +559,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='rufus' PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus' PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='1.1.2' PACKAGE_VERSION='1.1.3'
PACKAGE_STRING='rufus 1.1.2' PACKAGE_STRING='rufus 1.1.3'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='http://rufus.akeo.ie' PACKAGE_URL='http://rufus.akeo.ie'
@ -1204,7 +1204,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures rufus 1.1.2 to adapt to many kinds of systems. \`configure' configures rufus 1.1.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1270,7 +1270,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of rufus 1.1.2:";; short | recursive ) echo "Configuration of rufus 1.1.3:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1363,7 +1363,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
rufus configure 1.1.2 rufus configure 1.1.3
generated by GNU Autoconf 2.68 generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc. Copyright (C) 2010 Free Software Foundation, Inc.
@ -1418,7 +1418,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 1.1.2, which was It was created by rufus $as_me 1.1.3, which was
generated by GNU Autoconf 2.68. Invocation command line was generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@ $ $0 $@
@ -2233,7 +2233,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='rufus' PACKAGE='rufus'
VERSION='1.1.2' VERSION='1.1.3'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -4091,7 +4091,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by rufus $as_me 1.1.2, which was This file was extended by rufus $as_me 1.1.3, which was
generated by GNU Autoconf 2.68. Invocation command line was generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -4145,7 +4145,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
rufus config.status 1.1.2 rufus config.status 1.1.3
configured by $0, generated by GNU Autoconf 2.68, configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -1,4 +1,4 @@
AC_INIT([rufus], [1.1.2], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie]) AC_INIT([rufus], [1.1.3], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])

View File

@ -101,7 +101,9 @@ HANDLE GetDriveHandle(DWORD DriveIndex, char* DriveLetter, BOOL bWriteAccess, BO
value there => Use GetDriveType() to filter out unwanted devices. value there => Use GetDriveType() to filter out unwanted devices.
See https://github.com/pbatard/rufus/issues/32 for details. */ See https://github.com/pbatard/rufus/issues/32 for details. */
drive_type = GetDriveTypeA(drive); drive_type = GetDriveTypeA(drive);
if ((drive_type != DRIVE_REMOVABLE) && (drive_type != DRIVE_FIXED)) // NB: the HP utility allows drive_type == DRIVE_FIXED, which we don't really really want for now
// TODO: allow fixed drives after partitioning/preserving of existing partitions has been sorted out
if (drive_type != DRIVE_REMOVABLE)
continue; continue;
safe_sprintf(logical_drive, sizeof(logical_drive), "\\\\.\\%c:", drive[0]); safe_sprintf(logical_drive, sizeof(logical_drive), "\\\\.\\%c:", drive[0]);

View File

@ -66,6 +66,7 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command,
case FCC_PROGRESS: case FCC_PROGRESS:
percent = (DWORD*)pData; percent = (DWORD*)pData;
PrintStatus(0, FALSE, "Formatting: %d%% completed.", *percent); PrintStatus(0, FALSE, "Formatting: %d%% completed.", *percent);
// uprintf("%d percent completed.\n", *percent);
UpdateProgress(OP_FORMAT, 1.0f * (*percent)); UpdateProgress(OP_FORMAT, 1.0f * (*percent));
break; break;
case FCC_STRUCTURE_PROGRESS: // No progress on quick format case FCC_STRUCTURE_PROGRESS: // No progress on quick format
@ -667,7 +668,6 @@ DWORD WINAPI FormatThread(LPVOID param)
} }
if (IsChecked(IDC_SET_ICON)) if (IsChecked(IDC_SET_ICON))
SetAutorun(drive_name); SetAutorun(drive_name);
UpdateProgress(OP_DOS, -1.0f);
// Issue another complete remount before we exit, to ensure we're clean // Issue another complete remount before we exit, to ensure we're clean
RemountVolume(drive_name[0]); RemountVolume(drive_name[0]);
} }

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 289 IDD_DIALOG DIALOGEX 12, 12, 206, 289
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.1.2.143" CAPTION "Rufus v1.1.3.144"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,248,50,14 DEFPUSHBUTTON "Start",IDC_START,94,248,50,14
@ -73,7 +73,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL, CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
"SysLink",WS_TABSTOP,46,47,114,9 "SysLink",WS_TABSTOP,46,47,114,9
LTEXT "Version 1.1.2 (Build 143)",IDC_STATIC,46,19,78,8 LTEXT "Version 1.1.3 (Build 144)",IDC_STATIC,46,19,78,8
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
@ -223,8 +223,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,2,143 FILEVERSION 1,1,3,144
PRODUCTVERSION 1,1,2,143 PRODUCTVERSION 1,1,3,144
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -241,13 +241,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "akeo.ie" VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.1.2.143" VALUE "FileVersion", "1.1.3.144"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.1.2.143" VALUE "ProductVersion", "1.1.3.144"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -331,7 +331,7 @@ char* FileDialog(BOOL save, char* path, char* filename, char* ext, char* ext_des
#if (_WIN32_WINNT >= 0x0600) // Vista and later #if (_WIN32_WINNT >= 0x0600) // Vista and later
HRESULT hr = FALSE; HRESULT hr = FALSE;
IFileDialog *pfd; IFileDialog *pfd = NULL;
IShellItem *psiResult; IShellItem *psiResult;
COMDLG_FILTERSPEC filter_spec[2]; COMDLG_FILTERSPEC filter_spec[2];
char* ext_filter; char* ext_filter;