* Add cheat mode for MBR selection (Alt-M)
* fix NTFS default for WinPE
* fix Clang warnings
This commit is contained in:
Pete Batard 2012-03-27 23:31:58 +01:00
parent db76e396fd
commit b397889ab6
3 changed files with 24 additions and 14 deletions

View File

@ -31,6 +31,7 @@
#include <malloc.h>
#include <errno.h>
#include <direct.h>
#include <ctype.h>
#include <cdio/cdio.h>
#include <cdio/logging.h>
@ -520,7 +521,7 @@ out:
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 @@ try_iso:
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);

View File

@ -408,7 +408,7 @@ static void SetFSFromISO(void)
} else if (fs_mask & (1<<FS_FAT16)) {
selected_fs = FS_FAT16;
}
} else if (iso_report.has_bootmgr) {
} else if ((iso_report.has_bootmgr) || (IS_WINPE(iso_report.winpe))) {
if (fs_mask & (1<<FS_NTFS)) {
selected_fs = FS_NTFS;
}
@ -1532,6 +1532,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
HANDLE mutex = NULL;
HWND hDlg = NULL;
MSG msg;
BOOL mbr_shown = FALSE;
uprintf("*** RUFUS INIT ***\n");
@ -1591,6 +1592,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
existing_key = FALSE;
continue;
}
// Alt M => 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);
}

View File

@ -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 "<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.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"