From: Pierre Schweitzer Date: Thu, 3 Nov 2016 21:13:30 +0000 (+0000) Subject: [NTOSKRNL] X-Git-Tag: ReactOS-0.4.4-FOSDEM2017~417 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=ec670d6c255b34460a0f55285d36e814f7f836d3;hp=cfbf8660bcd7132c424abab2ae6cd044119966fb [NTOSKRNL] 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 --- diff --git a/reactos/ntoskrnl/fstub/fstubex.c b/reactos/ntoskrnl/fstub/fstubex.c index d039e718b1c..2ffced36d51 100644 --- a/reactos/ntoskrnl/fstub/fstubex.c +++ b/reactos/ntoskrnl/fstub/fstubex.c @@ -963,8 +963,12 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk, ULONG NumberOfEntries; PEFI_PARTITION_HEADER EfiHeader; EFI_PARTITION_ENTRY PartitionEntry; +#if 0 BOOLEAN UpdatedPartitionTable = FALSE; ULONGLONG SectorsForPartitions, PartitionEntryLBA; +#else + ULONGLONG PartitionEntryLBA; +#endif 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; } +#if 0 if (!ReadBackupTable) { /* If we weren't ask to read backup table, @@ -1015,6 +1020,7 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk, UpdatedPartitionTable = TRUE; } } +#endif DriveLayoutEx->PartitionStyle = PARTITION_STYLE_GPT; /* Translate LBA -> Offset */ @@ -1083,12 +1089,14 @@ FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk, } DriveLayoutEx->PartitionCount = PartitionCount; +#if 0 /* If we updated partition table using backup table, rewrite partition table */ if (UpdatedPartitionTable) { IoWritePartitionTableEx(Disk->DeviceObject, DriveLayoutEx); } +#endif /* Finally, return read data */ *DriveLayout = DriveLayoutEx;