X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwimboot.c;h=b1db0f8c5feac1f842d77c99c1d36610e2ca2885;hb=c78979435a730f9d9abb5e6371db2618b235de89;hp=8d3421c44705a5a3157c48eb8a6d8a22d99a62e7;hpb=29ac4319aa9c75811cd5629cd3471a681fbeb552;p=wimlib diff --git a/src/wimboot.c b/src/wimboot.c index 8d3421c4..b1db0f8c 100644 --- a/src/wimboot.c +++ b/src/wimboot.c @@ -121,7 +121,7 @@ query_partition_and_disk_info(const wchar_t *path, extents, extents_size)) break; if (GetLastError() != ERROR_MORE_DATA) { - ERROR("\"%ls\": Can't get volume extent info (err="PRIu32")", + ERROR("\"%ls\": Can't get volume extent info (err=%"PRIu32")", vol_name, (u32)GetLastError()); ret = WIMLIB_ERR_READ; goto out; @@ -1084,12 +1084,15 @@ wimboot_set_pointer(HANDLE h, if (wof_running) { /* The WOF driver is running. We can create the reparse point * using FSCTL_SET_EXTERNAL_BACKING. */ - + unsigned int max_retries = 4; struct { struct wof_external_info wof_info; struct wim_provider_external_info wim_info; } in; + retry: + memset(&in, 0, sizeof(in)); + in.wof_info.version = WOF_CURRENT_VERSION; in.wof_info.provider = WOF_PROVIDER_WIM; @@ -1103,7 +1106,22 @@ wimboot_set_pointer(HANDLE h, if (!DeviceIoControl(h, FSCTL_SET_EXTERNAL_BACKING, &in, sizeof(in), NULL, 0, &bytes_returned, NULL)) + { + /* Try to track down sporadic errors */ + if (wimlib_print_errors) { + WARNING("FSCTL_SET_EXTERNAL_BACKING failed (err=%u); data was %zu bytes:", + (u32)GetLastError(), sizeof(in)); + print_byte_field((const u8 *)&in, sizeof(in), wimlib_error_file); + putc('\n', wimlib_error_file); + } + if (--max_retries) { + WARNING("Retrying after 100ms..."); + Sleep(100); + goto retry; + } + WARNING("Too many retries; returning failure"); return false; + } } else { /* The WOF driver is running. We need to create the reparse