1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00
This commit is contained in:
Will Thompson 2017-10-12 16:13:12 +00:00 committed by GitHub
commit 496369cb4f

View file

@ -1541,10 +1541,17 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, HANDLE hSourceImage)
LastRefresh = 0;
if (img_report.compression_type != BLED_COMPRESSION_NONE) {
int64_t bled_ret;
uprintf("Writing Compressed Image...");
bled_init(_uprintf, update_progress, &FormatStatus);
bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, img_report.compression_type);
bled_ret = bled_uncompress_with_handles(hSourceImage, hPhysicalDrive, img_report.compression_type);
bled_exit();
if (bled_ret < 0 && SCODE_CODE(FormatStatus) != ERROR_CANCELLED) {
// Unfortunately, different compression backends return different negative error codes
uprintf("Writing compressed image failed: %" PRIi64, bled_ret);
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_WRITE_FAULT;
goto out;
}
} else {
uprintf(hSourceImage?"Writing Image...":"Zeroing drive...");
// Our buffer size must be a multiple of the sector size and *ALIGNED* to the sector size