mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-28 13:44:15 -04:00
[core] Fix active MBR partition not being set
* Related to issue #128 * Also reported by Owen Yang
This commit is contained in:
parent
4da36fa321
commit
8e9777579b
2 changed files with 7 additions and 5 deletions
|
@ -569,6 +569,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
|
|||
|
||||
switch (partition_style) {
|
||||
case PARTITION_STYLE_MBR:
|
||||
DriveLayoutEx.PartitionEntry[0].Mbr.BootIndicator = TRUE;
|
||||
DriveLayoutEx.PartitionEntry[0].Mbr.HiddenSectors = SelectedDrive.Geometry.SectorsPerTrack;
|
||||
switch (file_system) {
|
||||
case FS_FAT16:
|
||||
|
@ -594,6 +595,7 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
|
|||
DriveLayoutEx.PartitionEntry[1].PartitionLength.QuadPart = SelectedDrive.Geometry.SectorsPerTrack*SelectedDrive.Geometry.BytesPerSector;
|
||||
DriveLayoutEx.PartitionEntry[1].PartitionNumber = 2;
|
||||
DriveLayoutEx.PartitionEntry[1].RewritePartition = TRUE;
|
||||
DriveLayoutEx.PartitionEntry[1].Mbr.BootIndicator = FALSE;
|
||||
DriveLayoutEx.PartitionEntry[1].Mbr.HiddenSectors = SelectedDrive.Geometry.SectorsPerTrack*SelectedDrive.Geometry.BytesPerSector;
|
||||
DriveLayoutEx.PartitionEntry[1].Mbr.PartitionType = DriveLayoutEx.PartitionEntry[0].Mbr.PartitionType + 0x10; // Hidden whatever
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue