mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-09-18 01:41:15 +00:00
1.0.12 release
This commit is contained in:
@@ -1591,6 +1591,18 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive)
|
||||
Log("Write Boot Image ret:%u dwSize:%u Error:%u", bRet, dwSize, LASTERR);
|
||||
}
|
||||
|
||||
if (0x00 == MBR.PartTbl[0].Active && 0x80 == MBR.PartTbl[1].Active)
|
||||
{
|
||||
Log("Need to chage 1st partition active and 2nd partition inactive.");
|
||||
|
||||
MBR.PartTbl[0].Active = 0x80;
|
||||
MBR.PartTbl[1].Active = 0x00;
|
||||
|
||||
SetFilePointer(hDrive, 0, NULL, FILE_BEGIN);
|
||||
bRet = WriteFile(hDrive, &MBR, 512, &dwSize, NULL);
|
||||
Log("Write NEW MBR ret:%u dwSize:%u Error:%u", bRet, dwSize, LASTERR);
|
||||
}
|
||||
|
||||
//Refresh Drive Layout
|
||||
DeviceIoControl(hDrive, IOCTL_DISK_UPDATE_PROPERTIES, NULL, 0, NULL, 0, &dwSize, NULL);
|
||||
|
||||
|
Reference in New Issue
Block a user