Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
ee104bfa
Commit
ee104bfa
authored
Oct 20, 2021
by
longpanda
Browse files
Optimization for Ventoy2Disk.exe
parent
9cfd0581
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
INSTALL/Ventoy2Disk.exe
INSTALL/Ventoy2Disk.exe
+0
-0
Ventoy2Disk/Ventoy2Disk/DiskService_vds.c
Ventoy2Disk/Ventoy2Disk/DiskService_vds.c
+8
-3
Ventoy2Disk/Ventoy2Disk/PhyDrive.c
Ventoy2Disk/Ventoy2Disk/PhyDrive.c
+3
-1
No files found.
INSTALL/Ventoy2Disk.exe
View file @
ee104bfa
No preview for this file type
Ventoy2Disk/Ventoy2Disk/DiskService_vds.c
View file @
ee104bfa
...
@@ -383,6 +383,7 @@ STATIC BOOL VDS_CallBack_DeletePartition(void *pInterface, VDS_DISK_PROP *pDiskP
...
@@ -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
...
@@ -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
;
}
}
...
...
Ventoy2Disk/Ventoy2Disk/PhyDrive.c
View file @
ee104bfa
...
@@ -1657,7 +1657,9 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle, int TryId)
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment