-/*
- * Adds the dentry tree and security data for a new image to the image metadata
- * array of the WIMStruct.
- */
-static int
-add_new_dentry_tree(WIMStruct *wim, struct wim_dentry *root_dentry,
- struct wim_security_data *sd)
-{
- struct wim_image_metadata *new_imd;
- struct wim_lookup_table_entry *metadata_lte;
- int ret;
-
- metadata_lte = new_lookup_table_entry();
- if (metadata_lte == NULL)
- return WIMLIB_ERR_NOMEM;
-
- metadata_lte->flags = WIM_RESHDR_FLAG_METADATA;
- metadata_lte->unhashed = 1;
-
- new_imd = new_image_metadata();
- if (new_imd == NULL) {
- 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;
-}
-