Revert freeldr back to revision 14697
[reactos.git] / reactos / boot / freeldr / freeldr / disk / partition.c
index 42d1f0a..4c1aa01 100644 (file)
@@ -28,8 +28,7 @@
 
 BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
 {
-       ULONG                   BootablePartitionCount = 0;
-       ULONG                   ActivePartition = 0;
+       ULONG                                   BootablePartitionCount = 0;
        MASTER_BOOT_RECORD      MasterBootRecord;
 
        // Read master boot record
@@ -42,22 +41,22 @@ BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY Parti
        if (MasterBootRecord.PartitionTable[0].BootIndicator == 0x80)
        {
                BootablePartitionCount++;
-               ActivePartition = 0;
+               BootPartition = 0;
        }
        if (MasterBootRecord.PartitionTable[1].BootIndicator == 0x80)
        {
                BootablePartitionCount++;
-               ActivePartition = 1;
+               BootPartition = 1;
        }
        if (MasterBootRecord.PartitionTable[2].BootIndicator == 0x80)
        {
                BootablePartitionCount++;
-               ActivePartition = 2;
+               BootPartition = 2;
        }
        if (MasterBootRecord.PartitionTable[3].BootIndicator == 0x80)
        {
                BootablePartitionCount++;
-               ActivePartition = 3;
+               BootPartition = 3;
        }
 
        // Make sure there was only one bootable partition
@@ -73,7 +72,7 @@ BOOL DiskGetActivePartitionEntry(ULONG DriveNumber, PPARTITION_TABLE_ENTRY Parti
        }
 
        // Copy the partition table entry
-       RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[ActivePartition], sizeof(PARTITION_TABLE_ENTRY));
+       RtlCopyMemory(PartitionTableEntry, &MasterBootRecord.PartitionTable[BootPartition], sizeof(PARTITION_TABLE_ENTRY));
 
        return TRUE;
 }