From d4c518a4aea43ee101f8ea1776ce56f416dd3802 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 28 Apr 2016 10:09:43 +0200 Subject: [PATCH] [misc] update UEFI:NTFS partition detection --- src/drive.c | 9 +++------ src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/drive.c b/src/drive.c index 95ce1b49..55c08124 100644 --- a/src/drive.c +++ b/src/drive.c @@ -57,7 +57,6 @@ const GUID PARTITION_SYSTEM_GUID = * Globals */ RUFUS_DRIVE_INFO SelectedDrive; -size_t uefi_ntfs_size = 0; /* * The following methods get or set the AutoMount setting (which is different from AutoRun) @@ -684,9 +683,6 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys if (hPhysical == INVALID_HANDLE_VALUE) return 0; - if (uefi_ntfs_size == 0) - uefi_ntfs_size = GetResourceSize(hMainInstance, MAKEINTRESOURCEA(IDR_UEFI_NTFS), _RT_RCDATA, "uefi-ntfs.img"); - r = DeviceIoControl(hPhysical, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, geometry, sizeof(geometry), &size, NULL); if (!r || size <= 0) { @@ -734,7 +730,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys if (DriveLayout->PartitionEntry[i].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) { part_type = DriveLayout->PartitionEntry[i].Mbr.PartitionType; isUefiNtfs = (i == 1) && (part_type == 0xef) && - (DriveLayout->PartitionEntry[i].PartitionLength.QuadPart == uefi_ntfs_size); + (DriveLayout->PartitionEntry[i].PartitionLength.QuadPart <= 1*MB); suprintf("Partition %d%s:\n", i+1, isUefiNtfs?" (UEFI:NTFS)":""); for (j=0; j