]> code.delx.au - refind/blobdiff - refind/lib.c
Fixed filesystem driver bugs.
[refind] / refind / lib.c
index cedf1a7a01009e240621874320a6cabdbccbfc33..7ee9c4c2cbe5458768eb893da99495b1c2ced934 100644 (file)
@@ -507,7 +507,7 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
     UINT8                   Buffer[SAMPLE_SIZE];
     UINTN                   i;
     MBR_PARTITION_INFO      *MbrTable;
-    BOOLEAN                 MbrTableFound;
+    BOOLEAN                 MbrTableFound = FALSE;
 
     Volume->HasBootCode = FALSE;
     Volume->OSIconName = NULL;
@@ -635,9 +635,13 @@ static VOID ScanVolumeBootcode(REFIT_VOLUME *Volume, BOOLEAN *Bootable)
         if (FindMem(Buffer, 512, "Press any key to restart", 24) >= 0)
             Volume->HasBootCode = FALSE;
 
+        // dummy FAT boot sector (created by iPartition)
+        if ((FindMem(Buffer, 512, "Medienfehler", 12) >= 0) &&
+            (FindMem(Buffer, 512, "Neustart: Taste dr\x81" "cken", 22) >= 0))
+            Volume->HasBootCode = FALSE;
+
         // check for MBR partition table
         if (*((UINT16 *)(Buffer + 510)) == 0xaa55) {
-            MbrTableFound = FALSE;
             MbrTable = (MBR_PARTITION_INFO *)(Buffer + 446);
             for (i = 0; i < 4; i++)
                 if (MbrTable[i].StartLBA && MbrTable[i].Size)
@@ -705,7 +709,7 @@ static CHAR16 *SizeInIEEEUnits(UINT64 SizeInBytes) {
       SPrint(TheValue, 255, L"%ld%s", SizeInIeee, Units);
    } // if
    return TheValue;
-} // CHAR16 *SizeInSIUnits()
+} // CHAR16 *SizeInIEEEUnits()
 
 // Return a name for the volume. Ideally this should be the label for the
 // filesystem it contains, but this function falls back to describing the