1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[ms-sys] upgrade ms-sys to v2.5.2

This commit is contained in:
Pete Batard 2016-01-18 12:20:49 +00:00
parent 8ca9866179
commit 35e02ae8ce
7 changed files with 66 additions and 17 deletions

View file

@ -46,6 +46,7 @@
<ClInclude Include="..\inc\fat32.h" />
<ClInclude Include="..\inc\file.h" />
<ClInclude Include="..\inc\label_11_char.h" />
<ClInclude Include="..\inc\libintl.h" />
<ClInclude Include="..\inc\mbr_2000.h" />
<ClInclude Include="..\inc\mbr_95b.h" />
<ClInclude Include="..\inc\mbr_dos.h" />
@ -59,6 +60,7 @@
<ClInclude Include="..\inc\mbr_vista.h" />
<ClInclude Include="..\inc\mbr_win7.h" />
<ClInclude Include="..\inc\mbr_zero.h" />
<ClInclude Include="..\inc\nls.h" />
<ClInclude Include="..\inc\ntfs.h" />
<ClInclude Include="..\inc\partition_info.h" />
</ItemGroup>

View file

@ -137,6 +137,12 @@
<ClInclude Include="..\inc\mbr_grub2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\nls.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\inc\libintl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\br.c">

View file

@ -18,6 +18,7 @@
#include <stdio.h>
#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"

View file

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

9
src/ms-sys/inc/libintl.h Normal file
View file

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

17
src/ms-sys/inc/nls.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef NLS_H
#define NLS_H
#include <libintl.h>
#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

View file

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