]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Check for RDB even if Windows reports as drive having single MBR partition.
authorToni Wilen <twilen@winuae.net>
Mon, 12 May 2025 17:46:20 +0000 (20:46 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 12 May 2025 17:46:20 +0000 (20:46 +0300)
od-win32/hardfile_win32.cpp

index 3074de68712d0396ff5eb0492279c1ecbef4759f..af691582d215cfb5eb94b68c92688dc3dbe5af3e 100644 (file)
@@ -3215,6 +3215,9 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR
                        int safepart = 0;
                        udi->dangerous = -6;
                        udi->readonly = readonly ? 2 : 0;
+                       if (dli->PartitionCount == 1 && dli->PartitionEntry[0].Mbr.PartitionType != 0x76 && dli->PartitionEntry[0].Mbr.PartitionType != 0x30) {
+                               goto checkrdb;
+                       }
                        write_log (_T("%d MBR partitions found\n"), dli->PartitionCount);
                        for (i = 0; i < dli->PartitionCount && (*index2) < MAX_FILESYSTEM_UNITS; i++) {
                                PARTITION_INFORMATION_EX *pi = &dli->PartitionEntry[i];
@@ -3298,6 +3301,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR
                        write_log (_T("no MBR partition table detected, checking for RDB\n"));
                }
        }
+checkrdb:
        if (udi->offset == 0 && udi->size) {
                udi->dangerous = safetycheck (hDevice, udi->device_path, 0, buffer, dg.BytesPerSector, udi->identity, udi->chsdetected);
                if (udi->dangerous > 0)