[ui] fix ability to toggle progress report during WIM image extraction

* Also add log progress report for compressed images
This commit is contained in:
Pete Batard 2020-11-14 19:38:56 +00:00
parent 29205b3a0e
commit 630c508525
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
4 changed files with 27 additions and 6 deletions

View file

@ -1423,7 +1423,16 @@ static BOOL SetupWinToGo(DWORD DriveIndex, const char* drive_name, BOOL use_esp)
static void update_progress(const uint64_t processed_bytes)
{
// NB: We don't really care about resetting this value to UINT64_MAX for a new pass.
static uint64_t last_value = UINT64_MAX;
uint64_t cur_value;
UpdateProgressWithInfo(OP_FORMAT, MSG_261, processed_bytes, img_report.image_size);
cur_value = (processed_bytes * min(80, img_report.image_size)) / img_report.image_size;
if (cur_value != last_value) {
last_value = cur_value;
uprintfs("+");
}
}
// Some compressed images use streams that aren't multiple of the sector
@ -1498,7 +1507,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, HANDLE hSourceImage)
UpdateProgressWithInfoInit(NULL, FALSE);
if (img_report.compression_type != BLED_COMPRESSION_NONE) {
uprintf("Writing compressed image...");
uprintf("Writing compressed image:");
sec_buf = (uint8_t*)_mm_malloc(SelectedDrive.SectorSize, SelectedDrive.SectorSize);
if (sec_buf == NULL) {
FormatStatus = ERROR_SEVERITY_ERROR | FAC(FACILITY_STORAGE) | ERROR_NOT_ENOUGH_MEMORY;