mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[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:
parent
e0e974603c
commit
352a796eff
7 changed files with 23 additions and 21 deletions
|
@ -101,7 +101,9 @@ HANDLE GetDriveHandle(DWORD DriveIndex, char* DriveLetter, BOOL bWriteAccess, BO
|
|||
value there => Use GetDriveType() to filter out unwanted devices.
|
||||
See https://github.com/pbatard/rufus/issues/32 for details. */
|
||||
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;
|
||||
|
||||
safe_sprintf(logical_drive, sizeof(logical_drive), "\\\\.\\%c:", drive[0]);
|
||||
|
|
|
@ -66,6 +66,7 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command,
|
|||
case FCC_PROGRESS:
|
||||
percent = (DWORD*)pData;
|
||||
PrintStatus(0, FALSE, "Formatting: %d%% completed.", *percent);
|
||||
// uprintf("%d percent completed.\n", *percent);
|
||||
UpdateProgress(OP_FORMAT, 1.0f * (*percent));
|
||||
break;
|
||||
case FCC_STRUCTURE_PROGRESS: // No progress on quick format
|
||||
|
@ -667,7 +668,6 @@ DWORD WINAPI FormatThread(LPVOID param)
|
|||
}
|
||||
if (IsChecked(IDC_SET_ICON))
|
||||
SetAutorun(drive_name);
|
||||
UpdateProgress(OP_DOS, -1.0f);
|
||||
// Issue another complete remount before we exit, to ensure we're clean
|
||||
RemountVolume(drive_name[0]);
|
||||
}
|
||||
|
|
12
src/rufus.rc
12
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 206, 289
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "Rufus v1.1.2.143"
|
||||
CAPTION "Rufus v1.1.3.144"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,94,248,50,14
|
||||
|
@ -73,7 +73,7 @@ BEGIN
|
|||
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,
|
||||
"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
|
||||
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
|
||||
|
@ -223,8 +223,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,1,2,143
|
||||
PRODUCTVERSION 1,1,2,143
|
||||
FILEVERSION 1,1,3,144
|
||||
PRODUCTVERSION 1,1,3,144
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -241,13 +241,13 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "akeo.ie"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "1.1.2.143"
|
||||
VALUE "FileVersion", "1.1.3.144"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||
VALUE "OriginalFilename", "rufus.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "1.1.2.143"
|
||||
VALUE "ProductVersion", "1.1.3.144"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -331,7 +331,7 @@ char* FileDialog(BOOL save, char* path, char* filename, char* ext, char* ext_des
|
|||
|
||||
#if (_WIN32_WINNT >= 0x0600) // Vista and later
|
||||
HRESULT hr = FALSE;
|
||||
IFileDialog *pfd;
|
||||
IFileDialog *pfd = NULL;
|
||||
IShellItem *psiResult;
|
||||
COMDLG_FILTERSPEC filter_spec[2];
|
||||
char* ext_filter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue