From fdcb17aa7ae000070d4fa8613d5615f5365f1f69 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 22 Jan 2015 22:31:34 +0000 Subject: [PATCH] [misc] pocketful of enhancement and fixes - part 3 * Add Windows To Go tooltips * Set UEFI:TOGO partition type to EFI System Partition * Improve apply-image progress report * Fix MBR analysis for 4k disks * Do not select Rufus MBR for Windows To Go --- res/localization/rufus.loc | 4 ++- src/drive.c | 18 +++++++--- src/format.c | 9 +++-- src/rufus.c | 11 ++++++- src/rufus.h | 2 +- src/rufus.rc | 16 ++++----- src/sys_types.h | 1 + src/vhd.c | 67 +++++++++++++++++++++++++++++++++++--- 8 files changed, 105 insertions(+), 23 deletions(-) diff --git a/res/localization/rufus.loc b/res/localization/rufus.loc index 6ef80e6c..170f9d41 100644 --- a/res/localization/rufus.loc +++ b/res/localization/rufus.loc @@ -419,6 +419,8 @@ t MSG_196 "IMPORTANT: THIS DRIVE USES A NONSTANDARD SECTOR SIZE!!\n\n" t MSG_197 "Nonstandard sector size detected" t MSG_198 "Windows To Go can only be installed on a GPT partitioned drive if it has " "the FIXED attribute set. The current drive was not detected as FIXED." +t MSG_199 "Choose this if you want to INSTALL Windows, on a different disk." +t MSG_200 "Choose this if you want to RUN Windows, from the USB." # Status messages - these messages will appear on the status bar t MSG_201 "Cancelling - Please wait..." @@ -507,7 +509,7 @@ t MSG_263 "Use PROPER size units" t MSG_264 "Deleting directory '%s'" t MSG_265 "VMWare disk detection" t MSG_266 "Dual UEFI/BIOS mode" -t MSG_267 "Applying Windows image: %d%% completed" +t MSG_267 "Applying Windows image: %0.1f%% completed" t MSG_268 "Applying Windows image..." ################################################################################ diff --git a/src/drive.c b/src/drive.c index 1bb15399..1e5f5800 100644 --- a/src/drive.c +++ b/src/drive.c @@ -589,8 +589,10 @@ BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName) int i; fake_fd._ptr = (char*)hPhysicalDrive; - // Must be set to 512, as we also use this method for images and we may not have a target UFD yet - fake_fd._bufsiz = 512; + fake_fd._bufsiz = SelectedDrive.Geometry.BytesPerSector; + // Might need correction, as we use this method for images and we may not have a target UFD yet + if (fake_fd._bufsiz < 512) + fake_fd._bufsiz = 512; if (!is_br(&fake_fd)) { uprintf("%s does not have an x86 %s\n", TargetName, mbr_name); @@ -726,7 +728,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys for (i=0; iPartitionCount; i++) { if (DriveLayout->PartitionEntry[i].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) { part_type = DriveLayout->PartitionEntry[i].Mbr.PartitionType; - isUefiTogo = (i == 1) && (part_type == 0x01) && + isUefiTogo = (i == 1) && (part_type == 0xef) && (DriveLayout->PartitionEntry[i].PartitionLength.QuadPart == uefi_togo_size); suprintf("Partition %d%s:\n", i+1, isUefiTogo?" (UEFI:TOGO)":""); for (j=0; j