From b854f70baef3a64c475bf2ab17dc2aed97a07d43 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 5 Aug 2015 22:36:22 +0100 Subject: [PATCH] [misc] fix MinGW-w64 compilation issues * Closes #553 --- src/rufus.c | 3 +++ src/rufus.rc | 10 +++++----- src/usb.c | 10 +++++----- src/vhd.c | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index c42b4639..6045cce5 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -68,6 +68,9 @@ #ifndef DBT_CUSTOMEVENT #define DBT_CUSTOMEVENT 0x8006 #endif +#ifndef ERROR_FILE_TOO_LARGE +#define ERROR_FILE_TOO_LARGE 223 +#endif struct { HIMAGELIST himl; diff --git a/src/rufus.rc b/src/rufus.rc index 9b4b4f02..40dab405 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,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 -CAPTION "Rufus 2.3.694" +CAPTION "Rufus 2.3.695" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -298,8 +298,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,3,694,0 - PRODUCTVERSION 2,3,694,0 + FILEVERSION 2,3,695,0 + PRODUCTVERSION 2,3,695,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -316,13 +316,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.3.694" + VALUE "FileVersion", "2.3.695" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.3.694" + VALUE "ProductVersion", "2.3.695" END END BLOCK "VarFileInfo" diff --git a/src/usb.c b/src/usb.c index 8b4044de..3bea222e 100644 --- a/src/usb.c +++ b/src/usb.c @@ -306,7 +306,7 @@ BOOL GetUSBDevices(DWORD devnum) // we might have an extra vendor driver in between (e.g. "ASUS USB 3.0 Boost Storage Driver" // for UASP devices in ASUS "Turbo Mode" or "Apple Mobile Device USB Driver" for iPods) // so try to see if we can match the grandparent. - if ( ((uint32_t)htab_devid.table[j].data == 0) + if ( ((uintptr_t)htab_devid.table[j].data == 0) && (CM_Get_Parent(&grandparent_inst, parent_inst, 0) == CR_SUCCESS) && (CM_Get_Device_IDA(grandparent_inst, str, MAX_PATH, 0) == CR_SUCCESS) ) { device_id = str; @@ -315,8 +315,8 @@ BOOL GetUSBDevices(DWORD devnum) if (usb_debug) uprintf(" Matched with (GP) ID[%03d]: %s", j, device_id); } - if ((uint32_t)htab_devid.table[j].data > 0) - GetUSBProperties(dev_if_path.String[(uint32_t)htab_devid.table[j].data], device_id, &props); + if ((uintptr_t)htab_devid.table[j].data > 0) + GetUSBProperties(dev_if_path.String[(uintptr_t)htab_devid.table[j].data], device_id, &props); if (usb_debug) uprintf(" Props VID:PID = %04X:%04X", props.vid, props.pid); @@ -446,8 +446,8 @@ BOOL GetUSBDevices(DWORD devnum) } // We have multiple volumes assigned to the same device (multiple partitions) // If that is the case, use "Multiple Volumes" instead of the label - safe_strcpy(entry_msg, sizeof(entry_msg), ((drive_letters[0] != 0) && (drive_letters[1] != 0))? - lmprintf(MSG_047):label); + safe_strcpy(entry_msg, sizeof(entry_msg), (((drive_letters[0] != 0) && (drive_letters[1] != 0))? + lmprintf(MSG_047):label)); for (k=0, remove_drive=0; drive_letters[k] && (!remove_drive); k++) { // Append all the drive letters we detected letter_name[2] = drive_letters[k]; diff --git a/src/vhd.c b/src/vhd.c index e0693dc7..fe33cf84 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -157,7 +157,7 @@ BOOL AppendVHDFooter(const char* vhd_path) footer->features = bswap_uint32(VHD_FOOTER_FEATURES_RESERVED); footer->file_format_version = bswap_uint32(VHD_FOOTER_FILE_FORMAT_V1_0); footer->data_offset = bswap_uint64(VHD_FOOTER_DATA_OFFSET_FIXED_DISK); - footer->timestamp = bswap_uint32(_time32(NULL) - SECONDS_SINCE_JAN_1ST_2000); + footer->timestamp = bswap_uint32((uint32_t)(_time64(NULL) - SECONDS_SINCE_JAN_1ST_2000)); memcpy(footer->creator_app, creator_app, sizeof(creator_app)); footer->creator_version = bswap_uint32((rufus_version[0]<<16)|rufus_version[1]); memcpy(footer->creator_host_os, creator_os, sizeof(creator_os));