2 * wim.c - Stuff that doesn't fit into any other file
6 * Copyright (C) 2012, 2013 Eric Biggers
8 * This file is part of wimlib, a library for working with WIM files.
10 * wimlib is free software; you can redistribute it and/or modify it under the
11 * terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 3 of the License, or (at your option)
15 * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 * A PARTICULAR PURPOSE. See the GNU General Public License for more
20 * You should have received a copy of the GNU General Public License
21 * along with wimlib; if not, see http://www.gnu.org/licenses/.
28 #include "wimlib/error.h"
29 #include "wimlib/dentry.h"
30 #include "wimlib/encoding.h"
31 #include "wimlib/file_io.h"
32 #include "wimlib/integrity.h"
33 #include "wimlib/lookup_table.h"
34 #include "wimlib/metadata.h"
36 # include "wimlib/ntfs_3g.h" /* for do_ntfs_umount() */
38 #include "wimlib/security.h"
39 #include "wimlib/wim.h"
40 #include "wimlib/xml.h"
43 # include "wimlib/win32.h" /* for realpath() replacement */
49 # include <langinfo.h>
57 image_print_metadata(WIMStruct *w)
59 DEBUG("Printing metadata for image %d", w->current_image);
60 print_wim_security_data(wim_security_data(w));
61 return for_dentry_in_tree(wim_root_dentry(w), print_dentry,
67 image_print_files(WIMStruct *w)
69 return for_dentry_in_tree(wim_root_dentry(w), print_dentry_full_path,
76 WIMStruct *w = CALLOC(1, sizeof(WIMStruct));
85 * Calls a function on images in the WIM. If @image is WIMLIB_ALL_IMAGES, @visitor
86 * is called on the WIM once for each image, with each image selected as the
87 * current image in turn. If @image is a certain image, @visitor is called on
88 * the WIM only once, with that image selected.
91 for_image(WIMStruct *w, int image, int (*visitor)(WIMStruct *))
98 if (image == WIMLIB_ALL_IMAGES) {
100 end = w->hdr.image_count;
101 } else if (image >= 1 && image <= w->hdr.image_count) {
105 return WIMLIB_ERR_INVALID_IMAGE;
107 for (i = start; i <= end; i++) {
108 ret = select_wim_image(w, i);
119 * Creates a WIMStruct for a new WIM file.
122 wimlib_create_new_wim(int ctype, WIMStruct **w_ret)
125 struct wim_lookup_table *table;
128 DEBUG("Creating new WIM with %"TS" compression.",
129 wimlib_get_compression_type_string(ctype));
131 /* Allocate the WIMStruct. */
132 w = new_wim_struct();
134 return WIMLIB_ERR_NOMEM;
136 ret = init_header(&w->hdr, ctype);
140 table = new_lookup_table(9001);
142 ret = WIMLIB_ERR_NOMEM;
145 w->lookup_table = table;
147 w->compression_type = ctype;
156 select_wim_image(WIMStruct *w, int image)
158 struct wim_image_metadata *imd;
161 DEBUG("Selecting image %d", image);
163 if (image == WIMLIB_NO_IMAGE) {
164 ERROR("Invalid image: %d", WIMLIB_NO_IMAGE);
165 return WIMLIB_ERR_INVALID_IMAGE;
168 if (image == w->current_image)
171 if (image < 1 || image > w->hdr.image_count) {
172 ERROR("Cannot select image %d: There are only %u images",
173 image, w->hdr.image_count);
174 return WIMLIB_ERR_INVALID_IMAGE;
177 /* If a valid image is currently selected, it can be freed if it is not
179 if (w->current_image != WIMLIB_NO_IMAGE) {
180 imd = wim_get_current_image_metadata(w);
181 if (!imd->modified) {
182 wimlib_assert(list_empty(&imd->unhashed_streams));
183 DEBUG("Freeing image %u", w->current_image);
184 destroy_image_metadata(imd, NULL, false);
187 w->current_image = image;
188 imd = wim_get_current_image_metadata(w);
189 if (imd->root_dentry || imd->modified) {
193 DEBUG("Reading metadata resource specified by the following "
194 "lookup table entry:");
195 print_lookup_table_entry(imd->metadata_lte, stderr);
197 ret = read_metadata_resource(w, imd);
199 w->current_image = WIMLIB_NO_IMAGE;
205 WIMLIBAPI const tchar *
206 wimlib_get_compression_type_string(int ctype)
209 case WIMLIB_COMPRESSION_TYPE_NONE:
211 case WIMLIB_COMPRESSION_TYPE_LZX:
213 case WIMLIB_COMPRESSION_TYPE_XPRESS:
221 * Returns the number of an image in the WIM file, given a string that is either
222 * the number of the image, or the name of the image. The images are numbered
226 wimlib_resolve_image(WIMStruct *w, const tchar *image_name_or_num)
232 if (!image_name_or_num || !*image_name_or_num)
233 return WIMLIB_NO_IMAGE;
235 if (!tstrcasecmp(image_name_or_num, T("all"))
236 || !tstrcasecmp(image_name_or_num, T("*")))
237 return WIMLIB_ALL_IMAGES;
238 image = tstrtol(image_name_or_num, &p, 10);
239 if (p != image_name_or_num && *p == T('\0') && image > 0) {
240 if (image > w->hdr.image_count)
241 return WIMLIB_NO_IMAGE;
244 for (i = 1; i <= w->hdr.image_count; i++) {
245 if (!tstrcmp(image_name_or_num,
246 wimlib_get_image_name(w, i)))
249 return WIMLIB_NO_IMAGE;
253 /* Prints some basic information about a WIM file. */
255 wimlib_print_wim_information(const WIMStruct *w)
257 const struct wim_header *hdr;
260 tputs(T("WIM Information:"));
261 tputs(T("----------------"));
262 tprintf(T("Path: %"TS"\n"), w->filename);
263 tfputs(T("GUID: 0x"), stdout);
264 print_byte_field(hdr->guid, WIM_GID_LEN, stdout);
266 tprintf(T("Image Count: %d\n"), hdr->image_count);
267 tprintf(T("Compression: %"TS"\n"),
268 wimlib_get_compression_type_string(w->compression_type));
269 tprintf(T("Part Number: %d/%d\n"), hdr->part_number, hdr->total_parts);
270 tprintf(T("Boot Index: %d\n"), hdr->boot_idx);
271 tprintf(T("Size: %"PRIu64" bytes\n"),
272 wim_info_get_total_bytes(w->wim_info));
273 tprintf(T("Integrity Info: %"TS"\n"),
274 (w->hdr.integrity.offset != 0) ? T("yes") : T("no"));
275 tprintf(T("Relative path junction: %"TS"\n"),
276 (hdr->flags & WIM_HDR_FLAG_RP_FIX) ? T("yes") : T("no"));
281 wimlib_has_integrity_table(const WIMStruct *w)
283 return w->hdr.integrity.size != 0;
287 wimlib_print_available_images(const WIMStruct *w, int image)
293 if (image == WIMLIB_ALL_IMAGES) {
294 n = tprintf(T("Available Images:\n"));
296 last = w->hdr.image_count;
297 } else if (image >= 1 && image <= w->hdr.image_count) {
298 n = tprintf(T("Information for Image %d\n"), image);
302 tprintf(T("wimlib_print_available_images(): Invalid image %d"),
306 for (i = 0; i < n - 1; i++)
309 for (i = first; i <= last; i++)
310 print_image_info(w->wim_info, i);
314 /* Prints the metadata for the specified image, which may be WIMLIB_ALL_IMAGES, but
315 * not WIMLIB_NO_IMAGE. */
317 wimlib_print_metadata(WIMStruct *w, int image)
319 if (w->hdr.part_number != 1) {
320 ERROR("Cannot show the metadata from part %hu of a %hu-part split WIM!",
321 w->hdr.part_number, w->hdr.total_parts);
322 ERROR("Select the first part of the split WIM to see the metadata.");
323 return WIMLIB_ERR_SPLIT_UNSUPPORTED;
325 return for_image(w, image, image_print_metadata);
329 wimlib_print_files(WIMStruct *w, int image)
331 if (w->hdr.part_number != 1) {
332 ERROR("Cannot list the files from part %hu of a %hu-part split WIM!",
333 w->hdr.part_number, w->hdr.total_parts);
334 ERROR("Select the first part of the split WIM if you'd like to list the files.");
335 return WIMLIB_ERR_SPLIT_UNSUPPORTED;
337 return for_image(w, image, image_print_files);
341 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info)
343 memset(info, 0, sizeof(struct wimlib_wim_info));
344 memcpy(info->guid, wim->hdr.guid, WIMLIB_GUID_LEN);
345 info->image_count = wim->hdr.image_count;
346 info->boot_index = wim->hdr.boot_idx;
347 info->wim_version = WIM_VERSION;
348 info->chunk_size = WIM_CHUNK_SIZE;
349 info->part_number = wim->hdr.part_number;
350 info->total_parts = wim->hdr.total_parts;
351 info->compression_type = wim->compression_type;
353 info->total_bytes = wim->wim_info->total_bytes;
355 info->total_bytes = 0;
356 info->has_integrity_table = wim->hdr.integrity.offset != 0;
357 info->opened_from_file = (wim->filename != NULL);
358 info->is_readonly == (wim->hdr.flags & WIM_HDR_FLAG_READONLY) ||
359 (wim->hdr.total_parts != 1) ||
360 (wim->filename && taccess(wim->filename, W_OK));
361 info->has_rpfix = (wim->hdr.flags & WIM_HDR_FLAG_RP_FIX) != 0;
362 info->is_marked_readonly = (wim->hdr.flags & WIM_HDR_FLAG_READONLY) != 0;
363 info->write_in_progress = (wim->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) != 0;
364 info->metadata_only = (wim->hdr.flags & WIM_HDR_FLAG_METADATA_ONLY) != 0;
365 info->resource_only = (wim->hdr.flags & WIM_HDR_FLAG_RESOURCE_ONLY) != 0;
366 info->spanned = (wim->hdr.flags & WIM_HDR_FLAG_SPANNED) != 0;
373 wimlib_get_boot_idx(const WIMStruct *wim)
375 struct wimlib_wim_info info;
377 wimlib_get_wim_info((WIMStruct*)wim, &info);
378 return info.boot_index;
383 wimlib_get_compression_type(const WIMStruct *wim)
385 struct wimlib_wim_info info;
387 wimlib_get_wim_info((WIMStruct*)wim, &info);
388 return info.compression_type;
393 wimlib_get_num_images(const WIMStruct *wim)
395 struct wimlib_wim_info info;
397 wimlib_get_wim_info((WIMStruct*)wim, &info);
398 return info.image_count;
403 wimlib_get_part_number(const WIMStruct *wim, int *total_parts_ret)
405 struct wimlib_wim_info info;
407 wimlib_get_wim_info((WIMStruct*)wim, &info);
409 *total_parts_ret = info.total_parts;
410 return info.part_number;
414 wimlib_set_wim_info(WIMStruct *wim, const struct wimlib_wim_info *info, int which)
418 if (which & WIMLIB_CHANGE_READONLY_FLAG) {
419 if (info->is_marked_readonly)
420 wim->hdr.flags |= WIM_HDR_FLAG_READONLY;
422 wim->hdr.flags &= ~WIM_HDR_FLAG_READONLY;
425 if ((which & ~WIMLIB_CHANGE_READONLY_FLAG) == 0)
428 ret = can_modify_wim(wim);
432 if (which & WIMLIB_CHANGE_GUID)
433 memcpy(wim->hdr.guid, info->guid, WIM_GID_LEN);
435 if (which & WIMLIB_CHANGE_BOOT_INDEX) {
436 if (info->boot_index < 0 || info->boot_index > wim->hdr.image_count)
438 ERROR("%u is not 0 or a valid image in the WIM to mark as bootable",
440 return WIMLIB_ERR_INVALID_IMAGE;
442 wim->hdr.boot_idx = info->boot_index;
445 if (which & WIMLIB_CHANGE_RPFIX_FLAG) {
447 wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;
449 wim->hdr.flags &= ~WIM_HDR_FLAG_RP_FIX;
456 wimlib_set_boot_idx(WIMStruct *wim, int boot_idx)
458 struct wimlib_wim_info info;
460 info.boot_index = boot_idx;
461 return wimlib_set_wim_info(wim, &info, WIMLIB_CHANGE_BOOT_INDEX);
465 do_open_wim(const tchar *filename, int *fd_ret)
469 fd = topen(filename, O_RDONLY | O_BINARY);
471 ERROR_WITH_ERRNO("Can't open \"%"TS"\" read-only", filename);
472 return WIMLIB_ERR_OPEN;
479 reopen_wim(WIMStruct *w)
481 wimlib_assert(w->in_fd == -1);
482 return do_open_wim(w->filename, &w->in_fd);
486 close_wim(WIMStruct *w)
488 if (w->in_fd != -1) {
496 * Begins the reading of a WIM file; opens the file and reads its header and
497 * lookup table, and optionally checks the integrity.
500 begin_read(WIMStruct *w, const tchar *in_wim_path, int open_flags,
501 wimlib_progress_func_t progress_func)
506 DEBUG("Reading the WIM file `%"TS"'", in_wim_path);
508 ret = do_open_wim(in_wim_path, &w->in_fd);
512 /* The absolute path to the WIM is requested so that wimlib_overwrite()
513 * still works even if the process changes its working directory. This
514 * actually happens if a WIM is mounted read-write, since the FUSE
515 * thread changes directory to "/", and it needs to be able to find the
518 * This will break if the full path to the WIM changes in the
519 * intervening time...
521 * Warning: in Windows native builds, realpath() calls the replacement
522 * function in win32.c.
524 w->filename = realpath(in_wim_path, NULL);
526 ERROR_WITH_ERRNO("Failed to resolve WIM filename");
528 return WIMLIB_ERR_NOMEM;
530 return WIMLIB_ERR_OPEN;
533 ret = read_header(w->filename, w->in_fd, &w->hdr);
537 if (w->hdr.flags & WIM_HDR_FLAG_WRITE_IN_PROGRESS) {
538 WARNING("The WIM_HDR_FLAG_WRITE_IN_PROGRESS is set in the header of \"%"TS"\".\n"
539 " It may be being changed by another process, or a process\n"
540 " may have crashed while writing the WIM.", in_wim_path);
543 if (open_flags & WIMLIB_OPEN_FLAG_WRITE_ACCESS) {
544 ret = can_modify_wim(w);
549 if (w->hdr.total_parts != 1 && !(open_flags & WIMLIB_OPEN_FLAG_SPLIT_OK)) {
550 ERROR("\"%"TS"\": This WIM is part %u of a %u-part WIM",
551 in_wim_path, w->hdr.part_number, w->hdr.total_parts);
552 return WIMLIB_ERR_SPLIT_UNSUPPORTED;
555 DEBUG("According to header, WIM contains %u images", w->hdr.image_count);
557 /* If the boot index is invalid, print a warning and set it to 0 */
558 if (w->hdr.boot_idx > w->hdr.image_count) {
559 WARNING("In `%"TS"', image %u is marked as bootable, "
560 "but there are only %u images in the WIM",
561 in_wim_path, w->hdr.boot_idx, w->hdr.image_count);
565 /* Check and cache the compression type */
566 if (w->hdr.flags & WIM_HDR_FLAG_COMPRESSION) {
567 if (w->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZX) {
568 if (w->hdr.flags & WIM_HDR_FLAG_COMPRESS_XPRESS) {
569 ERROR("Multiple compression flags are set in \"%"TS"\"",
571 return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
573 w->compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
574 } else if (w->hdr.flags & WIM_HDR_FLAG_COMPRESS_XPRESS) {
575 w->compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS;
577 ERROR("The compression flag is set on \"%"TS"\", but "
578 "neither the XPRESS nor LZX flag is set",
580 return WIMLIB_ERR_INVALID_COMPRESSION_TYPE;
583 BUILD_BUG_ON(WIMLIB_COMPRESSION_TYPE_NONE != 0);
586 if (open_flags & WIMLIB_OPEN_FLAG_CHECK_INTEGRITY) {
587 ret = check_wim_integrity(w, progress_func);
588 if (ret == WIM_INTEGRITY_NONEXISTENT) {
589 WARNING("No integrity information for `%"TS"'; skipping "
590 "integrity check.", in_wim_path);
591 } else if (ret == WIM_INTEGRITY_NOT_OK) {
592 ERROR("WIM is not intact! (Failed integrity check)");
593 return WIMLIB_ERR_INTEGRITY;
594 } else if (ret != WIM_INTEGRITY_OK) {
599 if (w->hdr.image_count != 0 && w->hdr.part_number == 1) {
600 w->image_metadata = new_image_metadata_array(w->hdr.image_count);
601 if (!w->image_metadata)
602 return WIMLIB_ERR_NOMEM;
605 ret = read_lookup_table(w);
609 ret = read_xml_data(w->in_fd, &w->hdr.xml_res_entry, &w->wim_info);
613 xml_num_images = wim_info_get_num_images(w->wim_info);
614 if (xml_num_images != w->hdr.image_count) {
615 ERROR("In the file `%"TS"', there are %u <IMAGE> elements "
616 "in the XML data,", in_wim_path, xml_num_images);
617 ERROR("but %u images in the WIM! There must be exactly one "
618 "<IMAGE> element per image.", w->hdr.image_count);
619 return WIMLIB_ERR_IMAGE_COUNT;
622 DEBUG("Done beginning read of WIM file `%"TS"'.", in_wim_path);
627 * Opens a WIM file and creates a WIMStruct for it.
630 wimlib_open_wim(const tchar *wim_file, int open_flags,
632 wimlib_progress_func_t progress_func)
637 ret = WIMLIB_ERR_INVALID_PARAM;
638 if (!wim_file || !wim_ret)
641 ret = WIMLIB_ERR_NOMEM;
642 wim = new_wim_struct();
646 ret = begin_read(wim, wim_file, open_flags, progress_func);
648 goto out_wimlib_free;
660 destroy_image_metadata(struct wim_image_metadata *imd,
661 struct wim_lookup_table *table,
662 bool free_metadata_lte)
664 free_dentry_tree(imd->root_dentry, table);
665 imd->root_dentry = NULL;
666 free_wim_security_data(imd->security_data);
667 imd->security_data = NULL;
669 if (free_metadata_lte) {
670 free_lookup_table_entry(imd->metadata_lte);
671 imd->metadata_lte = NULL;
674 struct wim_lookup_table_entry *lte, *tmp;
675 list_for_each_entry_safe(lte, tmp, &imd->unhashed_streams, unhashed_list)
676 free_lookup_table_entry(lte);
678 INIT_LIST_HEAD(&imd->unhashed_streams);
679 INIT_LIST_HEAD(&imd->inode_list);
682 do_ntfs_umount(imd->ntfs_vol);
683 imd->ntfs_vol = NULL;
689 put_image_metadata(struct wim_image_metadata *imd,
690 struct wim_lookup_table *table)
692 if (imd && --imd->refcnt == 0) {
693 destroy_image_metadata(imd, table, true);
698 /* Appends the specified image metadata structure to the array of image metadata
699 * for a WIM, and increments the image count. */
701 append_image_metadata(WIMStruct *w, struct wim_image_metadata *imd)
703 struct wim_image_metadata **imd_array;
705 DEBUG("Reallocating image metadata array for image_count = %u",
706 w->hdr.image_count + 1);
707 imd_array = REALLOC(w->image_metadata,
708 sizeof(w->image_metadata[0]) * (w->hdr.image_count + 1));
711 return WIMLIB_ERR_NOMEM;
712 w->image_metadata = imd_array;
713 imd_array[w->hdr.image_count++] = imd;
718 struct wim_image_metadata *
719 new_image_metadata(void)
721 struct wim_image_metadata *imd;
723 imd = CALLOC(1, sizeof(*imd));
726 INIT_LIST_HEAD(&imd->inode_list);
727 INIT_LIST_HEAD(&imd->unhashed_streams);
728 DEBUG("Created new image metadata (refcnt=1)");
730 ERROR_WITH_ERRNO("Failed to allocate new image metadata structure");
735 struct wim_image_metadata **
736 new_image_metadata_array(unsigned num_images)
738 struct wim_image_metadata **imd_array;
740 DEBUG("Creating new image metadata array for %u images",
743 imd_array = CALLOC(num_images, sizeof(imd_array[0]));
746 ERROR("Failed to allocate memory for %u image metadata structures",
750 for (unsigned i = 0; i < num_images; i++) {
751 imd_array[i] = new_image_metadata();
753 for (unsigned j = 0; j < i; j++)
754 put_image_metadata(imd_array[j], NULL);
762 /* Checksum all streams that are unhashed (other than the metadata streams),
763 * merging them into the lookup table as needed. This is a no-op unless the
764 * library has previously used to add or mount an image using the same
767 wim_checksum_unhashed_streams(WIMStruct *w)
770 for (int i = 0; i < w->hdr.image_count; i++) {
771 struct wim_lookup_table_entry *lte, *tmp;
772 struct wim_image_metadata *imd = w->image_metadata[i];
773 image_for_each_unhashed_stream_safe(lte, tmp, imd) {
774 ret = hash_unhashed_stream(lte, w->lookup_table, NULL);
783 * can_modify_wim - Check if a given WIM is writeable. This is only the case if
784 * it meets the following three conditions:
786 * 1. Write access is allowed to the underlying file (if any) at the filesystem level.
787 * 2. The WIM is not part of a spanned set.
788 * 3. The WIM_HDR_FLAG_READONLY flag is not set in the WIM header.
790 * Return value is 0 if writable; WIMLIB_ERR_WIM_IS_READONLY otherwise.
793 can_modify_wim(WIMStruct *wim)
796 if (taccess(wim->filename, W_OK)) {
797 ERROR_WITH_ERRNO("Can't modify \"%"TS"\"", wim->filename);
798 return WIMLIB_ERR_WIM_IS_READONLY;
801 if (wim->hdr.total_parts != 1) {
802 ERROR("Cannot modify \"%"TS"\": is part of a spanned set",
804 return WIMLIB_ERR_WIM_IS_READONLY;
806 if (wim->hdr.flags & WIM_HDR_FLAG_READONLY) {
807 ERROR("Cannot modify \"%"TS"\": is marked read-only",
809 return WIMLIB_ERR_WIM_IS_READONLY;
815 * can_delete_from_wim - Check if files or images can be deleted from a given
818 * This theoretically should be exactly the same as can_modify_wim(), but
819 * unfortunately, due to bugs in Microsoft's software that generate incorrect
820 * reference counts for some WIM resources, we need to run expensive
821 * verifications to make sure the reference counts are correct on all WIM
822 * resources. Otherwise we might delete a WIM resource whose reference count
823 * has fallen to 0, but is actually still referenced somewhere.
826 can_delete_from_wim(WIMStruct *wim)
830 ret = can_modify_wim(wim);
833 if (!wim->refcnts_ok)
834 wim_recalculate_refcnts(wim);
838 /* Frees the memory for the WIMStruct, including all internal memory; also
839 * closes all files associated with the WIMStruct. */
841 wimlib_free(WIMStruct *w)
843 DEBUG("Freeing WIMStruct");
852 free_lookup_table(w->lookup_table);
855 free_wim_info(w->wim_info);
856 if (w->image_metadata) {
857 for (unsigned i = 0; i < w->hdr.image_count; i++)
858 put_image_metadata(w->image_metadata[i], NULL);
859 FREE(w->image_metadata);
862 DEBUG("Freed WIMStruct");
866 test_locale_ctype_utf8(void)
871 char *ctype = nl_langinfo(CODESET);
873 return (!strstr(ctype, "UTF-8") ||
874 !strstr(ctype, "UTF8") ||
875 !strstr(ctype, "utf8") ||
876 !strstr(ctype, "utf-8"));
881 wimlib_global_init(int init_flags)
883 libxml_global_init();
884 if (!(init_flags & WIMLIB_INIT_FLAG_ASSUME_UTF8)) {
885 wimlib_mbs_is_utf8 = test_locale_ctype_utf8();
887 if (!wimlib_mbs_is_utf8)
888 libntfs3g_global_init();
897 /* Free global memory allocations. Not strictly necessary if the process using
898 * wimlib is just about to exit (as is the case for 'imagex'). */
900 wimlib_global_cleanup(void)
902 libxml_global_cleanup();
903 iconv_global_cleanup();
905 win32_global_cleanup();