[ui] fix disabling of Quick Format checkbox

* Closes #1211
* Also fix MBR analysis report displayed each time the user changes boot selection
This commit is contained in:
Pete Batard 2018-10-03 19:14:40 +02:00
parent 204908f8e0
commit 790b188b3d
6 changed files with 30 additions and 28 deletions

View file

@ -635,7 +635,7 @@ const struct {int (*fn)(FILE *fp); char* str;} known_mbr[] = {
};
// Returns TRUE if the drive seems bootable, FALSE otherwise
BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName)
BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName, BOOL bSilent)
{
const char* mbr_name = "Master Boot Record";
FAKE_FD fake_fd = { 0 };
@ -646,17 +646,17 @@ BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName)
set_bytes_per_sector(SelectedDrive.SectorSize);
if (!is_br(fp)) {
uprintf("%s does not have an x86 %s", TargetName, mbr_name);
suprintf("%s does not have an x86 %s", TargetName, mbr_name);
return FALSE;
}
for (i=0; i<ARRAYSIZE(known_mbr); i++) {
if (known_mbr[i].fn(fp)) {
uprintf("%s has a %s %s", TargetName, known_mbr[i].str, mbr_name);
suprintf("%s has a %s %s", TargetName, known_mbr[i].str, mbr_name);
return TRUE;
}
}
uprintf("%s has an unknown %s", TargetName, mbr_name);
suprintf("%s has an unknown %s", TargetName, mbr_name);
return TRUE;
}
@ -784,7 +784,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
suprintf("Partition type: MBR, NB Partitions: %d", SelectedDrive.nPartitions);
SelectedDrive.has_mbr_uefi_marker = (DriveLayout->Mbr.Signature == MBR_UEFI_MARKER);
suprintf("Disk ID: 0x%08X %s", DriveLayout->Mbr.Signature, SelectedDrive.has_mbr_uefi_marker?"(UEFI target)":"");
AnalyzeMBR(hPhysical, "Drive");
AnalyzeMBR(hPhysical, "Drive", bSilent);
}
for (i=0; i<DriveLayout->PartitionCount; i++) {
isUefiNtfs = FALSE;