mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-29 05:55:30 -04:00
[vhd] improve mounting/unmounting of WIM
* Also fix wininet not having been removed from DelayLoadDLLs except x64.
This commit is contained in:
parent
110f4025b7
commit
d9a7a03834
3 changed files with 33 additions and 19 deletions
18
src/vhd.c
18
src/vhd.c
|
@ -521,11 +521,15 @@ static DWORD WINAPI WimMountImageThread(LPVOID param)
|
|||
|
||||
PF_INIT_OR_OUT(WIMRegisterMessageCallback, Wimgapi);
|
||||
PF_INIT_OR_OUT(WIMMountImage, Wimgapi);
|
||||
PF_INIT_OR_OUT(WIMUnmountImage, Wimgapi);
|
||||
PF_INIT_OR_OUT(WIMUnregisterMessageCallback, Wimgapi);
|
||||
|
||||
if (wmount_path[0] != 0) {
|
||||
uprintf("WimMountImage: An image is already mounted");
|
||||
goto out;
|
||||
uprintf("WimMountImage: An image is already mounted. Trying to unmount it...");
|
||||
if (pfWIMUnmountImage(wmount_path, wimage, _index, FALSE))
|
||||
uprintf("WimMountImage: Successfully unmounted existing image..");
|
||||
else
|
||||
goto out;
|
||||
}
|
||||
if (GetTempFileNameW(wtemp_dir, L"Ruf", 0, wmount_path) == 0) {
|
||||
uprintf("WimMountImage: Can not generate mount directory: %s", WindowsErrorString());
|
||||
|
@ -565,6 +569,16 @@ static DWORD WINAPI WimMountImageThread(LPVOID param)
|
|||
uprintf("mounted '%S [%d]' on '%S'", wimage, _index, wmount_path);
|
||||
|
||||
out:
|
||||
if (!r) {
|
||||
if (wmount_track[0] != 0) {
|
||||
RemoveDirectoryW(wmount_track);
|
||||
wmount_track[0] = 0;
|
||||
}
|
||||
if (wmount_path[0] != 0) {
|
||||
RemoveDirectoryW(wmount_path);
|
||||
wmount_path[0] = 0;
|
||||
}
|
||||
}
|
||||
wfree(temp_dir);
|
||||
safe_free(wimage);
|
||||
ExitThread((DWORD)r);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue