-end_extract_stream_to_tmpfile(struct wim_lookup_table_entry *lte,
- int status, void *_ctx)
+extract_chunk(const void *chunk, size_t size, void *_ctx)
+{
+ struct apply_ctx *ctx = _ctx;
+ int ret;
+
+ if (filedes_valid(&ctx->tmpfile_fd)) {
+ ret = full_write(&ctx->tmpfile_fd, chunk, size);
+ if (ret)
+ ERROR_WITH_ERRNO("Error writing to file descriptor");
+ } else {
+ struct wim_lookup_table_entry lte_override;
+
+ memcpy(<e_override, ctx->cur_stream,
+ sizeof(struct wim_lookup_table_entry));
+
+ lte_override.resource_location = RESOURCE_IN_ATTACHED_BUFFER;
+ lte_override.size = size;
+ lte_override.attached_buffer = (void *)chunk;
+
+ ret = extract_stream_instances(ctx->cur_stream, <e_override, ctx);
+ }
+ return ret;
+}
+
+static int
+end_extract_stream(struct wim_lookup_table_entry *lte,
+ int status, void *_ctx)