1.0.12 release

This commit is contained in:
longpanda
2020-05-30 20:13:04 +08:00
parent c8e86938fe
commit 8cde5a4898
17 changed files with 208 additions and 14 deletions

View File

@@ -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);