From: John Hodge Date: Tue, 8 Nov 2011 06:36:25 +0000 (+0800) Subject: Modules/ATA - Fixed not catching extended parition errors properly X-Git-Tag: rel0.14~133 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=afecea0c9d7c44c35d53d7f7e534f444b7cb067d;p=tpg%2Facess2.git Modules/ATA - Fixed not catching extended parition errors properly --- diff --git a/Modules/Storage/ATA/mbr.c b/Modules/Storage/ATA/mbr.c index bfb488a1..09ca55d6 100644 --- a/Modules/Storage/ATA/mbr.c +++ b/Modules/Storage/ATA/mbr.c @@ -36,7 +36,7 @@ void ATA_ParseMBR(int Disk, tMBR *MBR) ) { if( MBR->Parts[i].SystemID == 0xF || MBR->Parts[i].SystemID == 5 ) { - LOG("Extended Partition"); + LOG("Extended Partition at 0x%llx", MBR->Parts[i].LBAStart); if(extendedLBA != 0) { Warning("Disk %i has multiple extended partitions, ignoring rest", Disk); continue; @@ -44,7 +44,7 @@ void ATA_ParseMBR(int Disk, tMBR *MBR) extendedLBA = MBR->Parts[i].LBAStart; continue; } - LOG("Primary Partition"); + LOG("Primary Partition at 0x%llx", MBR->Parts[i].LBAStart); gATA_Disks[Disk].NumPartitions ++; continue; @@ -54,7 +54,7 @@ void ATA_ParseMBR(int Disk, tMBR *MBR) while(extendedLBA != 0) { extendedLBA = ATA_MBR_int_ReadExt(Disk, extendedLBA, &base, &len); - if( extendedLBA == 0xFFFFFFFF ) return ; + if( extendedLBA == -1 ) break; gATA_Disks[Disk].NumPartitions ++; } LOG("gATA_Disks[Disk].NumPartitions = %i", gATA_Disks[Disk].NumPartitions); @@ -101,6 +101,7 @@ void ATA_ParseMBR(int Disk, tMBR *MBR) while(extendedLBA != 0) { extendedLBA = ATA_MBR_int_ReadExt(Disk, extendedLBA, &base, &len); + if(extendedLBA == -1) break; ATA_int_MakePartition( &gATA_Disks[Disk].Partitions[j], Disk, k, base, len );