diff --git a/src/iso.c b/src/iso.c index 05b627ed..4064715b 100644 --- a/src/iso.c +++ b/src/iso.c @@ -58,10 +58,10 @@ static const char* psz_extract_dir; static const char* bootmgr_name = "bootmgr"; static const char* ldlinux_name = "ldlinux.sys"; static const char* isolinux_name[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.conf"}; -static const char* vesamenu_name = "vesamenu.c32"; static const char* pe_dirname[] = { "/i386", "/minint" }; static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" }; -static int64_t old_vesamenu_threshold = 145000; +static const char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES; +static const int64_t old_c32_threshold[NB_OLD_C32] = OLD_C32_THRESHOLD; static uint8_t i_joliet_level = 0; static uint64_t total_blocks, nb_blocks; static BOOL scan_only = FALSE; @@ -102,7 +102,7 @@ static void log_handler (cdio_log_level_t level, const char *message) * Scan and set ISO properties * Returns true if the the current file does not need to be processed further */ -static __inline BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_cfg, BOOL* is_old_vesamenu, +static __inline BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_cfg, BOOL* is_old_c32, int64_t i_file_length, const char* psz_basename, const char* psz_fullpath) { size_t i, j; @@ -114,10 +114,11 @@ static __inline BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_ *is_syslinux_cfg = TRUE; } - // Check for an old vesamenu.c32 file anywhere - *is_old_vesamenu = FALSE; - if ((safe_stricmp(psz_basename, vesamenu_name) == 0) && (i_file_length <= old_vesamenu_threshold)) { - *is_old_vesamenu = TRUE; + // Check for an old incompatible c32 file anywhere + for (i=0; i= FOUR_GIGABYTES) iso_report.has_4GB_file = TRUE; // Compute projected size needed @@ -161,7 +164,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha { HANDLE file_handle = NULL; DWORD buf_size, wr_size; - BOOL r, is_syslinux_cfg, is_old_vesamenu; + BOOL r, is_syslinux_cfg, is_old_c32[NB_OLD_C32]; int i_length; size_t i, nul_pos; char* psz_fullpath = NULL; @@ -195,7 +198,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha } } else { i_file_length = udf_get_file_length(p_udf_dirent); - if (check_iso_props(psz_path, &is_syslinux_cfg, &is_old_vesamenu, i_file_length, psz_basename, psz_fullpath)) { + if (check_iso_props(psz_path, &is_syslinux_cfg, is_old_c32, i_file_length, psz_basename, psz_fullpath)) { safe_free(psz_fullpath); continue; } @@ -207,13 +210,17 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha SetWindowTextU(hISOFileName, psz_fullpath); // Remove the appended size for extraction psz_fullpath[nul_pos] = 0; - if (is_old_vesamenu && use_own_vesamenu) { - if (CopyFileA("vesamenu.c32", psz_fullpath, FALSE)) { - uprintf(" Replaced with local version\n"); - continue; + for (i=0; isize; - if (check_iso_props(psz_path, &is_syslinux_cfg, &is_old_vesamenu, i_file_length, psz_basename, psz_fullpath)) { + if (check_iso_props(psz_path, &is_syslinux_cfg, is_old_c32, i_file_length, psz_basename, psz_fullpath)) { continue; } // Replace slashes with backslashes and append the size to the path for UI display @@ -322,13 +329,17 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path) // ISO9660 cannot handle backslashes for (i=0; i=r) && ((wline[i] == L'\r') || (wline[i] == L'\n'))) diff --git a/src/rufus.c b/src/rufus.c index 14cabee5..85375bbf 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -103,7 +103,7 @@ float fScale = 1.0f; int default_fs; HWND hDeviceList, hCapacity, hFileSystem, hClusterSize, hLabel, hDOSType, hNBPasses, hLog = NULL; HWND hISOProgressDlg = NULL, hLogDlg = NULL, hISOProgressBar, hISOFileName, hDiskID; -BOOL use_own_vesamenu = FALSE, detect_fakes = TRUE, mbr_selected_by_user = FALSE; +BOOL use_own_c32[NB_OLD_C32] = {FALSE, FALSE}, detect_fakes = TRUE, mbr_selected_by_user = FALSE; BOOL iso_op_in_progress = FALSE, format_op_in_progress = FALSE; int dialog_showing = 0; uint16_t rufus_version[4]; @@ -1247,7 +1247,9 @@ DWORD WINAPI ISOScanThread(LPVOID param) { int i; FILE* fd; - const char* vesamenu_filename = "vesamenu.c32"; + const char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES; + const char* new_c32_url[NB_OLD_C32] = NEW_C32_URL; + char msg[1024], msg_title[32]; if (iso_path == NULL) goto out; @@ -1258,10 +1260,14 @@ DWORD WINAPI ISOScanThread(LPVOID param) safe_free(iso_path); goto out; } - uprintf("ISO label: '%s'\r\n size: %lld bytes, 4GB:%c, bootmgr:%c, winpe:%c (/minint:%c), isolinux:%c, old vesa:%c\n", - iso_report.label, iso_report.projected_size, iso_report.has_4GB_file?'Y':'N', - iso_report.has_bootmgr?'Y':'N', IS_WINPE(iso_report.winpe)?'Y':'N', (iso_report.uses_minint)?'Y':'N', - iso_report.has_isolinux?'Y':'N', iso_report.has_old_vesamenu?'Y':'N'); + uprintf("ISO label: '%s'\r\n Size: %lld bytes\r\n Has a >4GB file: %s\r\n Uses Bootmgr: %s\r\n Uses WinPE: %s%s\r\n Uses isolinux: %s\n", + iso_report.label, iso_report.projected_size, iso_report.has_4GB_file?"Yes":"No", iso_report.has_bootmgr?"Yes":"No", + IS_WINPE(iso_report.winpe)?"Yes":"No", (iso_report.uses_minint)?" (with /minint)":"", iso_report.has_isolinux?"Yes":"No"); + if (iso_report.has_isolinux) { + for (i=0; i