From b397889ab68abfcb1cb740e820035bf6f0022805 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 27 Mar 2012 23:31:58 +0100 Subject: [PATCH] v1.1.6 (#161) * Add cheat mode for MBR selection (Alt-M) * fix NTFS default for WinPE * fix Clang warnings --- src/iso.c | 14 ++++++++------ src/rufus.c | 10 +++++++++- src/rufus.rc | 14 +++++++------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/iso.c b/src/iso.c index 924a7e138c6..66b0db48c19 100644 --- a/src/iso.c +++ b/src/iso.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -520,7 +521,7 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, bool scan) BOOL ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file) { size_t i; - ssize_t read; + ssize_t read_size; int64_t file_length; char buf[UDF_BLOCKSIZE]; DWORD buf_size, wr_size; @@ -558,18 +559,18 @@ BOOL ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file file_length = udf_get_file_length(p_udf_file); while (file_length > 0) { memset(buf, 0, UDF_BLOCKSIZE); - read = udf_read_block(p_udf_file, buf, 1); - if (read < 0) { + read_size = udf_read_block(p_udf_file, buf, 1); + if (read_size < 0) { uprintf("Error reading UDF file %s\n", iso_file); goto out; } - buf_size = (DWORD)MIN(file_length, read); + buf_size = (DWORD)MIN(file_length, read_size); s = WriteFile(file_handle, buf, buf_size, &wr_size, NULL); if ((!s) || (buf_size != wr_size)) { uprintf(" Error writing file %s: %s\n", dest_file, WindowsErrorString()); goto out; } - file_length -= read; + file_length -= read_size; } r = TRUE; goto out; @@ -608,7 +609,8 @@ BOOL ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file out: safe_closehandle(file_handle); - safe_free(p_statbuf->rr.psz_symlink); + if (p_statbuf != NULL) + safe_free(p_statbuf->rr.psz_symlink); safe_free(p_statbuf); if (p_udf_root != NULL) udf_dirent_free(p_udf_root); diff --git a/src/rufus.c b/src/rufus.c index d6d9902e2df..a4121602337 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -408,7 +408,7 @@ static void SetFSFromISO(void) } else if (fs_mask & (1< make Rufus MBR choice visible + if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'M')) { + mbr_shown = !mbr_shown; + ShowWindow(GetDlgItem(hDlg, IDC_RUFUS_MBR), mbr_shown?SW_SHOW:SW_HIDE); + existing_key = FALSE; + continue; + } TranslateMessage(&msg); DispatchMessage(&msg); } diff --git a/src/rufus.rc b/src/rufus.rc index 1926cbdfba1..1e30d0cb399 100644 --- a/src/rufus.rc +++ b/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.6.160" +CAPTION "Rufus v1.1.6.161" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,248,50,14 @@ -60,7 +60,7 @@ BEGIN COMBOBOX IDC_DOSTYPE,119,183,49,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "...",IDC_SELECT_ISO,171,182,22,14,BS_ICON PUSHBUTTON "Test",IDC_TEST,62,248,20,14,NOT WS_VISIBLE - CONTROL "Rufus MBR",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,173,44,10 + CONTROL "Rufus MBR",IDC_RUFUS_MBR,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,71,173,44,10 END IDD_ABOUTBOX DIALOGEX 0, 0, 287, 195 @@ -74,7 +74,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "http://rufus.akeo.ie",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.1.6 (Build 160)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.1.6 (Build 161)",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 @@ -225,8 +225,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,6,160 - PRODUCTVERSION 1,1,6,160 + FILEVERSION 1,1,6,161 + PRODUCTVERSION 1,1,6,161 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -243,13 +243,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.1.6.160" + VALUE "FileVersion", "1.1.6.161" 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.6.160" + VALUE "ProductVersion", "1.1.6.161" END END BLOCK "VarFileInfo"