X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fxml.c;h=a6e745aaf3f09405975077dc880f720b977331ff;hp=6f044d60a300962bc5447768ba274534120170cf;hb=161d3898359e3feb8c96ae220b376ef33c72a1d6;hpb=f9695b9f40035f1a20968293255761a8301eaba0 diff --git a/src/xml.c b/src/xml.c index 6f044d60..a6e745aa 100644 --- a/src/xml.c +++ b/src/xml.c @@ -78,6 +78,7 @@ struct image_info { tchar *display_name; tchar *display_description; tchar *flags; + struct wim_lookup_table *lookup_table; /* temporary field */ }; struct xml_string_spec { @@ -1078,7 +1079,7 @@ calculate_dentry_statistics(struct wim_dentry *dentry, void *arg) * link bytes", and this size is multiplied by the link count (NOT one * less than the link count). */ - lte = inode_unnamed_lte_resolved(inode); + lte = inode_unnamed_lte(inode, info->lookup_table); if (lte) { info->total_bytes += wim_resource_size(lte); if (!dentry_is_first_in_inode(dentry)) @@ -1088,7 +1089,7 @@ calculate_dentry_statistics(struct wim_dentry *dentry, void *arg) if (inode->i_nlink >= 2 && dentry_is_first_in_inode(dentry)) { for (unsigned i = 0; i < inode->i_num_ads; i++) { if (inode->i_ads_entries[i].stream_name_nbytes) { - lte = inode_stream_lte_resolved(inode, i + 1); + lte = inode_stream_lte(inode, i + 1, info->lookup_table); if (lte) { info->hard_link_bytes += inode->i_nlink * wim_resource_size(lte); @@ -1119,6 +1120,7 @@ xml_update_image_info(WIMStruct *w, int image) image_info->dir_count = 0; image_info->total_bytes = 0; image_info->hard_link_bytes = 0; + image_info->lookup_table = w->lookup_table; for_dentry_in_tree(w->image_metadata[image - 1]->root_dentry, calculate_dentry_statistics, @@ -1236,7 +1238,7 @@ libxml_global_cleanup() * Reads the XML data from a WIM file. */ int -read_xml_data(filedes_t in_fd, +read_xml_data(int in_fd, const struct resource_entry *res_entry, struct wim_info **info_ret) { @@ -1428,11 +1430,6 @@ write_xml_data(const struct wim_info *wim_info, int image, int out_fd, DEBUG("Ended XML document"); - /* Call xmlFreeTextWriter() before ftello() because the former will - * flush the file stream. */ - xmlFreeTextWriter(writer); - writer = NULL; - end_offset = filedes_offset(out_fd); if (end_offset == -1) { ret = WIMLIB_ERR_WRITE;