mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-02-24 11:59:19 -05:00
Optimization for Ventoy2Disk.exe
This commit is contained in:
parent
9cfd05811b
commit
ee104bfa97
Binary file not shown.
@ -383,6 +383,7 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
|
|||||||
hr = IVdsAdvancedDisk_QueryPartitions(pAdvancedDisk, &prop_array, &prop_array_size);
|
hr = IVdsAdvancedDisk_QueryPartitions(pAdvancedDisk, &prop_array, &prop_array_size);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
|
r = TRUE;
|
||||||
for (i = 0; i < prop_array_size; i++)
|
for (i = 0; i < prop_array_size; i++)
|
||||||
{
|
{
|
||||||
if (PartNumber == 0 || PartNumber == prop_array[i].ulPartitionNumber)
|
if (PartNumber == 0 || PartNumber == prop_array[i].ulPartitionNumber)
|
||||||
@ -402,21 +403,25 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
|
|||||||
{
|
{
|
||||||
r = FALSE;
|
r = FALSE;
|
||||||
VDS_SET_ERROR(hr);
|
VDS_SET_ERROR(hr);
|
||||||
Log("Could not delete partitions: %u", LASTERR);
|
Log("Could not delete partitions: 0x%x", LASTERR);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log("Delete this partitions success");
|
Log("Delete this partitions success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r = TRUE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log("No partition to delete on disk '%S'", pDiskProp->pwszName);
|
Log("No partition to delete on disk '%S'", pDiskProp->pwszName);
|
||||||
r = TRUE;
|
r = TRUE;
|
||||||
}
|
}
|
||||||
CoTaskMemFree(prop_array);
|
|
||||||
|
if (prop_array)
|
||||||
|
{
|
||||||
|
CoTaskMemFree(prop_array);
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1657,7 +1657,9 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId)
|
|||||||
|
|
||||||
if (!VDS_DeleteAllPartitions(pPhyDrive->PhyDrive))
|
if (!VDS_DeleteAllPartitions(pPhyDrive->PhyDrive))
|
||||||
{
|
{
|
||||||
Log("Notice: Could not delete partitions: %u", GetLastError());
|
Log("Notice: Could not delete partitions: 0x%x", GetLastError());
|
||||||
|
rc = 1;
|
||||||
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log("Deleting all partitions ......................... OK");
|
Log("Deleting all partitions ......................... OK");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user