struct wim_resource_descriptor rdesc;
struct blob_descriptor blob;
- wim_reshdr_to_desc(reshdr, wim, &rdesc);
- blob_set_is_located_in_nonsolid_wim_resource(&blob, &rdesc);
+ wim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob);
return read_blob_into_alloc_buf(&blob, buf_ret);
}
struct blob_descriptor blob;
int ret;
- wim_reshdr_to_desc(reshdr, wim, &rdesc);
- blob_set_is_located_in_nonsolid_wim_resource(&blob, &rdesc);
+ wim_reshdr_to_desc_and_blob(reshdr, wim, &rdesc, &blob);
blob.unhashed = 1;
ret = sha1_blob(&blob);
}
}
+/*
+ * Convert the short WIM resource header @reshdr to a stand-alone WIM resource
+ * descriptor @rdesc, then set @blob to consist of that entire resource. This
+ * should only be used for non-solid resources!
+ */
+void
+wim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim,
+ struct wim_resource_descriptor *rdesc,
+ struct blob_descriptor *blob)
+{
+ wim_reshdr_to_desc(reshdr, wim, rdesc);
+ blob->size = rdesc->uncompressed_size;
+ blob_set_is_located_in_wim_resource(blob, rdesc, 0);
+}
+
/* Import a WIM resource header from the on-disk format. */
void
get_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr,