mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-29 22:15:21 -04:00
[core] add Super Floppy Disk support
This commit is contained in:
parent
65f5ccd28b
commit
c82842ce2a
4 changed files with 50 additions and 20 deletions
14
src/drive.c
14
src/drive.c
|
@ -703,7 +703,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
|
|||
PDRIVE_LAYOUT_INFORMATION_EX DriveLayout = (PDRIVE_LAYOUT_INFORMATION_EX)(void*)layout;
|
||||
char* volume_name;
|
||||
char tmp[256];
|
||||
DWORD i, j, big_floppy = FALSE;
|
||||
DWORD i, j, super_floppy_disk = FALSE;
|
||||
|
||||
if (FileSystemName == NULL)
|
||||
return FALSE;
|
||||
|
@ -768,7 +768,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
|
|||
if ((DriveLayout->PartitionEntry[0].Mbr.PartitionType != PARTITION_ENTRY_UNUSED) &&
|
||||
(DriveLayout->PartitionEntry[0].StartingOffset.QuadPart == 0LL)) {
|
||||
suprintf("Partition type: SFD (Super Floppy Disk) or Unpartitioned");
|
||||
big_floppy = TRUE;
|
||||
super_floppy_disk = TRUE;
|
||||
} else {
|
||||
suprintf("Partition type: MBR, NB Partitions: %d\n", SelectedDrive.nPartitions);
|
||||
SelectedDrive.has_mbr_uefi_marker = (DriveLayout->Mbr.Signature == MBR_UEFI_MARKER);
|
||||
|
@ -780,7 +780,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
|
|||
part_type = DriveLayout->PartitionEntry[i].Mbr.PartitionType;
|
||||
isUefiNtfs = (i == 1) && (part_type == 0xef) &&
|
||||
(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart <= 1*MB);
|
||||
suprintf("Partition %d%s:\n", i+(big_floppy?0:1), isUefiNtfs?" (UEFI:NTFS)":"");
|
||||
suprintf("Partition %d%s:\n", i+(super_floppy_disk?0:1), isUefiNtfs?" (UEFI:NTFS)":"");
|
||||
for (j=0; j<ARRAYSIZE(mbr_mountable); j++) {
|
||||
if (part_type == mbr_mountable[j]) {
|
||||
ret = TRUE;
|
||||
|
@ -789,7 +789,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
|
|||
}
|
||||
// NB: MinGW's gcc 4.9.2 broke "%lld" printout on XP so we use the inttypes.h "PRI##" qualifiers
|
||||
suprintf(" Type: %s (0x%02x)\r\n Size: %s (%" PRIi64 " bytes)\r\n Start Sector: %" PRIi64 ", Boot: %s",
|
||||
((part_type==0x07||big_floppy)&&(FileSystemName[0]!=0))?FileSystemName:GetPartitionType(part_type), big_floppy?0:part_type,
|
||||
((part_type==0x07||super_floppy_disk)&&(FileSystemName[0]!=0))?FileSystemName:GetPartitionType(part_type), super_floppy_disk?0:part_type,
|
||||
SizeToHumanReadable(DriveLayout->PartitionEntry[i].PartitionLength.QuadPart, TRUE, FALSE),
|
||||
DriveLayout->PartitionEntry[i].PartitionLength.QuadPart,
|
||||
DriveLayout->PartitionEntry[i].StartingOffset.QuadPart / SelectedDrive.SectorSize,
|
||||
|
@ -1078,7 +1078,7 @@ typedef struct _DRIVE_LAYOUT_INFORMATION_EX4 {
|
|||
*/
|
||||
BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker, uint8_t extra_partitions)
|
||||
{
|
||||
const char* PartitionTypeName[2] = { "MBR", "GPT" };
|
||||
const char* PartitionTypeName[] = { "MBR", "GPT", "SFD" };
|
||||
unsigned char* buffer;
|
||||
size_t uefi_ntfs_size = 0;
|
||||
CREATE_DISK CreateDisk = {PARTITION_STYLE_RAW, {{0}}};
|
||||
|
@ -1090,6 +1090,10 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
|
|||
|
||||
PrintInfoDebug(0, MSG_238, PartitionTypeName[partition_style]);
|
||||
|
||||
if (partition_style == PARTITION_STYLE_SFD)
|
||||
// Nothing to do
|
||||
return TRUE;
|
||||
|
||||
if (extra_partitions & XP_UEFI_NTFS) {
|
||||
uefi_ntfs_size = GetResourceSize(hMainInstance, MAKEINTRESOURCEA(IDR_UEFI_NTFS), _RT_RCDATA, "uefi-ntfs.img");
|
||||
if (uefi_ntfs_size == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue