[NTOSKRNL]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 3 Nov 2016 21:13:30 +0000 (21:13 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 3 Nov 2016 21:13:30 +0000 (21:13 +0000)
For now, disable broken code in FstubReadPartitionTableEFI(). In its current state, it wrongly assumes backup GPT is broken and thus attempts to fix main GPT (?!).
Furthermore, it appears Windows 2K3 doesn't perform such checks, nor such GPT rewritings in FstubReadPartitionTableEFI().

CORE-12261

svn path=/trunk/; revision=73112

reactos/ntoskrnl/fstub/fstubex.c

index d039e71..2ffced3 100644 (file)
@@ -963,8 +963,12 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
     ULONG NumberOfEntries;
     PEFI_PARTITION_HEADER EfiHeader;
     EFI_PARTITION_ENTRY PartitionEntry;
     ULONG NumberOfEntries;
     PEFI_PARTITION_HEADER EfiHeader;
     EFI_PARTITION_ENTRY PartitionEntry;
+#if 0
     BOOLEAN UpdatedPartitionTable = FALSE;
     ULONGLONG SectorsForPartitions, PartitionEntryLBA;
     BOOLEAN UpdatedPartitionTable = FALSE;
     ULONGLONG SectorsForPartitions, PartitionEntryLBA;
+#else
+    ULONGLONG PartitionEntryLBA;
+#endif
     PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx = NULL;
     ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
     PAGED_CODE();
     PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx = NULL;
     ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
     PAGED_CODE();
@@ -996,6 +1000,7 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
         return STATUS_INSUFFICIENT_RESOURCES;
     }
 
         return STATUS_INSUFFICIENT_RESOURCES;
     }
 
+#if 0
     if (!ReadBackupTable)
     {
         /* If we weren't ask to read backup table,
     if (!ReadBackupTable)
     {
         /* If we weren't ask to read backup table,
@@ -1015,6 +1020,7 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
             UpdatedPartitionTable = TRUE;
         }
     }
             UpdatedPartitionTable = TRUE;
         }
     }
+#endif
 
     DriveLayoutEx->PartitionStyle = PARTITION_STYLE_GPT;
     /* Translate LBA -> Offset */
 
     DriveLayoutEx->PartitionStyle = PARTITION_STYLE_GPT;
     /* Translate LBA -> Offset */
@@ -1083,12 +1089,14 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk,
     }
     DriveLayoutEx->PartitionCount = PartitionCount;
 
     }
     DriveLayoutEx->PartitionCount = PartitionCount;
 
+#if 0
     /* If we updated partition table using backup table, rewrite partition table */
     if (UpdatedPartitionTable)
     {
         IoWritePartitionTableEx(Disk->DeviceObject,
                                 DriveLayoutEx);
     }
     /* If we updated partition table using backup table, rewrite partition table */
     if (UpdatedPartitionTable)
     {
         IoWritePartitionTableEx(Disk->DeviceObject,
                                 DriveLayoutEx);
     }
+#endif
 
     /* Finally, return read data */
     *DriveLayout = DriveLayoutEx;
 
     /* Finally, return read data */
     *DriveLayout = DriveLayoutEx;