- tmpfile_lte.inline_stream_owners[0] = owners[i];
- ret = read_full_stream_with_cbs(&tmpfile_lte, ctx->saved_cbs);
+
+ /* Note: it usually doesn't matter whether we pass the original
+ * stream entry to callbacks provided by the extraction backend
+ * as opposed to the tmpfile stream entry, since they shouldn't
+ * actually read data from the stream other than through the
+ * read_stream_prefix() call below. But for
+ * WIMLIB_EXTRACT_FLAG_WIMBOOT mode on Windows it does matter
+ * because it needs the original stream location in order to
+ * create the external backing reference. */
+
+ orig_lte->out_refcnt = 1;
+ orig_lte->inline_stream_owners[0] = owners[i];
+
+ ret = (*cbs->begin_stream)(orig_lte, cbs->begin_stream_ctx);