mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[NTOS:FSTUB] Clear the whole partition table in FstubCreateDiskRaw (#9124)
FstubCreateDiskRaw is supposed to wipe the MBR when it makes a RAW disk. Before this fix, that function only cleared the first of the 4 partition entries, so one entry (16 bytes) instead of the whole table (64). As a consequence, the wiped MBR written back to disk still had entries 2, 3 and 4 sitting there with old data, and those came back as ghost/garbage partitions.
This commit is contained in:
@@ -487,7 +487,7 @@ FstubCreateDiskRaw(IN PDEVICE_OBJECT DeviceObject)
|
||||
/* Only zero useful stuff */
|
||||
MasterBootRecord = (PMASTER_BOOT_RECORD)Disk->Buffer;
|
||||
MasterBootRecord->Signature = 0;
|
||||
RtlZeroMemory(MasterBootRecord->PartitionTable, sizeof(PARTITION_TABLE_ENTRY));
|
||||
RtlZeroMemory(MasterBootRecord->PartitionTable, sizeof(PARTITION_TABLE_ENTRY) * NUM_PARTITION_TABLE_ENTRIES);
|
||||
MasterBootRecord->MasterBootRecordMagic = 0;
|
||||
|
||||
/* Write back that destroyed MBR */
|
||||
|
||||
Reference in New Issue
Block a user