mirror of https://github.com/ventoy/Ventoy.git
Don't delete partition when update in GPT partition style.
This commit is contained in:
parent
d063dbb7f2
commit
f9763a44b2
Binary file not shown.
|
@ -1852,24 +1852,26 @@ int UpdateVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive)
|
||||||
|
|
||||||
if (!TryWritePart2(hDrive, StartSector))
|
if (!TryWritePart2(hDrive, StartSector))
|
||||||
{
|
{
|
||||||
ForceMBR = TRUE;
|
if (pPhyDrive->PartStyle == 0)
|
||||||
Log("Try write failed, now delete partition 2...");
|
{
|
||||||
|
ForceMBR = TRUE;
|
||||||
|
Log("Try write failed, now delete partition 2...");
|
||||||
|
|
||||||
CHECK_CLOSE_HANDLE(hDrive);
|
CHECK_CLOSE_HANDLE(hDrive);
|
||||||
|
|
||||||
Log("Now delete partition 2...");
|
Log("Now delete partition 2...");
|
||||||
DeletePartitions(pPhyDrive->PhyDrive, TRUE);
|
DeletePartitions(pPhyDrive->PhyDrive, TRUE);
|
||||||
|
|
||||||
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
hDrive = GetPhysicalHandle(pPhyDrive->PhyDrive, TRUE, TRUE, FALSE);
|
||||||
if (hDrive == INVALID_HANDLE_VALUE)
|
if (hDrive == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
Log("Failed to GetPhysicalHandle for write.");
|
Log("Failed to GetPhysicalHandle for write.");
|
||||||
rc = 1;
|
rc = 1;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PROGRESS_BAR_SET_POS(PT_FORMAT_PART2);
|
PROGRESS_BAR_SET_POS(PT_FORMAT_PART2);
|
||||||
|
|
||||||
Log("Write Ventoy to disk ............................ ");
|
Log("Write Ventoy to disk ............................ ");
|
||||||
|
|
Loading…
Reference in New Issue