-write_wim_resource_from_buffer(const void *buf, size_t buf_size,
- int out_fd, int out_ctype,
- struct resource_entry *out_res_entry,
- u8 hash[SHA1_HASH_SIZE])
-{
- /* Set up a temporary lookup table entry to provide to
- * write_wim_resource(). */
- struct wim_lookup_table_entry lte;
- int ret;
- lte.resource_location = RESOURCE_IN_ATTACHED_BUFFER;
- lte.attached_buffer = (void*)buf;
- lte.resource_entry.original_size = buf_size;
- lte.resource_entry.flags = 0;
- lte.unhashed = 1;
- ret = write_wim_resource(<e, out_fd, out_ctype, out_res_entry, 0);
- if (ret == 0)
- copy_hash(hash, lte.hash);
- return ret;
-}
-
-/* Write the metadata resource for the current WIM image. */
-int
-write_metadata_resource(WIMStruct *w)
+prepare_metadata_resource(WIMStruct *wim, int image,
+ u8 **buf_ret, size_t *len_ret)