From 35e02ae8ce23bf6519d7c2568460d2154f4a02d5 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 18 Jan 2016 12:20:49 +0000 Subject: [PATCH] [ms-sys] upgrade ms-sys to v2.5.2 --- src/ms-sys/.msvc/ms-sys.vcxproj | 2 ++ src/ms-sys/.msvc/ms-sys.vcxproj.filters | 6 +++++ src/ms-sys/br.c | 34 +++++++++++++++++-------- src/ms-sys/inc/br.h | 5 +++- src/ms-sys/inc/libintl.h | 9 +++++++ src/ms-sys/inc/nls.h | 17 +++++++++++++ src/rufus.rc | 10 ++++---- 7 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 src/ms-sys/inc/libintl.h create mode 100644 src/ms-sys/inc/nls.h diff --git a/src/ms-sys/.msvc/ms-sys.vcxproj b/src/ms-sys/.msvc/ms-sys.vcxproj index 34df5193..3f9c38b1 100644 --- a/src/ms-sys/.msvc/ms-sys.vcxproj +++ b/src/ms-sys/.msvc/ms-sys.vcxproj @@ -46,6 +46,7 @@ + @@ -59,6 +60,7 @@ + diff --git a/src/ms-sys/.msvc/ms-sys.vcxproj.filters b/src/ms-sys/.msvc/ms-sys.vcxproj.filters index 945108d4..dbc6b582 100644 --- a/src/ms-sys/.msvc/ms-sys.vcxproj.filters +++ b/src/ms-sys/.msvc/ms-sys.vcxproj.filters @@ -137,6 +137,12 @@ Header Files + + Header Files + + + Header Files + diff --git a/src/ms-sys/br.c b/src/ms-sys/br.c index b6116faf..c6239de9 100644 --- a/src/ms-sys/br.c +++ b/src/ms-sys/br.c @@ -18,6 +18,7 @@ #include #include "file.h" +#include "nls.h" #include "br.h" unsigned long ulBytesPerSector = 512; @@ -42,6 +43,28 @@ int write_windows_disk_signature(FILE *fp, uint32_t tWDS) return write_data(fp, 0x1b8, &tWDS, 4); } /* write_windows_disk_signature */ +uint16_t read_mbr_copy_protect_bytes(FILE *fp) +{ + uint16_t tOut; + if(!read_data(fp, 0x1bc, &tOut, 2)) + return 0xffff; + return tOut; +} /* read_mbr_copy_protect_bytes */ + +const char *read_mbr_copy_protect_bytes_explained(FILE *fp) +{ + uint16_t t = read_mbr_copy_protect_bytes(fp); + switch(t) + { + case 0: + return _("not copy protected"); + case 0x5a5a: + return _("copy protected"); + default: + return _("unknown value"); + } +} /* read_mbr_copy_protect_bytes_explained */ + int is_br(FILE *fp) { /* A "file" is probably some kind of boot record if it contains the magic @@ -189,17 +212,6 @@ int is_zero_mbr(FILE *fp) /* Don't bother to check 55AA signature */ } /* is_zero_mbr */ -int is_zero_mbr_with_other_windows_disk_signature(FILE *fp) -{ - #include "mbr_zero.h" - - return - (!contains_data(fp, 0x0, mbr_zero_0x0, sizeof(mbr_zero_0x0))) && - contains_data(fp, 0x0, mbr_zero_0x0, 0x1b8); - contains_data(fp, 0x1bc, mbr_zero_0x0, 2); - /* Don't bother to check 55AA signature */ -} /* is_zero_mbr_with_other_windows_disk_signature */ - int is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp) { #include "mbr_zero.h" diff --git a/src/ms-sys/inc/br.h b/src/ms-sys/inc/br.h index 554b229f..16cdedb1 100644 --- a/src/ms-sys/inc/br.h +++ b/src/ms-sys/inc/br.h @@ -13,6 +13,10 @@ uint32_t read_windows_disk_signature(FILE *fp); /* Sets a new Windows Disk Signature to MBR */ int write_windows_disk_signature(FILE *fp, uint32_t tWDS); +/* Reads copy protect bytes after Windows Disk Signature from MBR */ +uint16_t read_mbr_copy_protect_bytes(FILE *fp); +const char *read_mbr_copy_protect_bytes_explained(FILE *fp); + /* returns TRUE if the file has a boot record, otherwise FALSE. The file position will change when this function is called! */ int is_br(FILE *fp); @@ -77,7 +81,6 @@ int is_syslinux_gpt_mbr(FILE *fp); /* returns TRUE if the file has a zeroed master boot record, otherwise FALSE.The file position will change when this function is called! */ int is_zero_mbr(FILE *fp); -int is_zero_mbr_with_other_windows_disk_signature(FILE *fp); int is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp); /* Writes a dos master boot record to a file, returns TRUE on success, otherwise diff --git a/src/ms-sys/inc/libintl.h b/src/ms-sys/inc/libintl.h new file mode 100644 index 00000000..be953585 --- /dev/null +++ b/src/ms-sys/inc/libintl.h @@ -0,0 +1,9 @@ +#ifndef LIBINTL_H +#define LIBINTL_H + +/* This file is only supposed to be used on systems which doesn't have a + builtin libintl.h and which also miss gnu gettext */ + +#define NO_LIBINTL_OR_GETTEXT + +#endif diff --git a/src/ms-sys/inc/nls.h b/src/ms-sys/inc/nls.h new file mode 100644 index 00000000..be46a2ec --- /dev/null +++ b/src/ms-sys/inc/nls.h @@ -0,0 +1,17 @@ +#ifndef NLS_H +#define NLS_H + +#include + +#ifdef NO_LIBINTL_OR_GETTEXT +#define _(String) (String) +#else +#define _(String) gettext(String) +#endif +#define gettext_noop(String) (String) +#define N_(String) gettext_noop(String) + +/* Init Native language support */ +void nls_init(void); + +#endif diff --git a/src/rufus.rc b/src/rufus.rc index bf6a9418..7b9b8f60 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 242, 376 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 2.7.835" +CAPTION "Rufus 2.7.836" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -320,8 +320,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,7,835,0 - PRODUCTVERSION 2,7,835,0 + FILEVERSION 2,7,836,0 + PRODUCTVERSION 2,7,836,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -338,13 +338,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.7.835" + VALUE "FileVersion", "2.7.836" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.7.835" + VALUE "ProductVersion", "2.7.836" END END BLOCK "VarFileInfo"