- metadata_lte = new_lookup_table_entry();
- if (!metadata_lte)
- return WIMLIB_ERR_NOMEM;
-
- metadata_lte->resource_entry.flags = WIM_RESHDR_FLAG_METADATA;
- metadata_lte->unhashed = 1;
-
- new_imd = new_image_metadata();
- if (!new_imd) {
- free_lookup_table_entry(metadata_lte);
- return WIMLIB_ERR_NOMEM;
- }
-
- new_imd->root_dentry = root_dentry;
- new_imd->metadata_lte = metadata_lte;
- new_imd->security_data = sd;
- new_imd->modified = 1;
-
- ret = append_image_metadata(wim, new_imd);
- if (ret)
- put_image_metadata(new_imd, NULL);
- return ret;
-}
-
-/* Append an empty image to the WIMStruct. */