[core] alter the drive letter we use when Windows has already remounted it

* Our code should be flexible enough to do just that and this will also
  alleviate requiring end users to retry an operation.
This commit is contained in:
Pete Batard 2019-04-08 16:23:54 +01:00
parent 7a04f52f6c
commit 06b33f94e4
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
3 changed files with 27 additions and 28 deletions

View file

@ -1969,7 +1969,7 @@ DWORD WINAPI FormatThread(void* param)
if (GetDrivePartitionData(SelectedDrive.DeviceNumber, fs_type, sizeof(fs_type), TRUE)) {
guid_volume = GetLogicalName(DriveIndex, TRUE, TRUE);
if ((guid_volume != NULL) && (MountVolume(drive_name, guid_volume)))
uprintf("Remounted %s on %s\n", guid_volume, drive_name);
uprintf("Remounted %s as %C:\n", guid_volume, drive_name[0]);
}
goto out;
}
@ -2034,7 +2034,7 @@ DWORD WINAPI FormatThread(void* param)
uprintf("Found volume GUID %s\n", guid_volume);
if (!MountVolume(drive_name, guid_volume)) {
uprintf("Could not remount %s on %s: %s\n", guid_volume, drive_name, WindowsErrorString());
uprintf("Could not remount %s as %C: %s\n", guid_volume, drive_name[0], WindowsErrorString());
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_MOUNT_VOLUME);
goto out;
}
@ -2199,7 +2199,7 @@ out:
guid_volume = GetLogicalName(DriveIndex, TRUE, FALSE);
if (guid_volume != NULL) {
if (MountVolume(drive_name, guid_volume))
uprintf("Re-mounted volume as '%c:' after error\n", drive_name[0]);
uprintf("Re-mounted volume as %C: after error\n", drive_name[0]);
free(guid_volume);
}
}