- if (!wim || !dir) {
- ret = WIMLIB_ERR_INVALID_PARAM;
- goto out;
- }
-
- ret = verify_swm_set(wim, additional_swms, num_additional_swms);
- if (ret)
- goto out;
-
- if ((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE) && (wim->hdr.total_parts != 1)) {
- ERROR("Cannot mount a split WIM read-write");
- ret = WIMLIB_ERR_SPLIT_UNSUPPORTED;
- goto out;
- }
-
- if (num_additional_swms) {
- ret = new_joined_lookup_table(wim, additional_swms,
- num_additional_swms,
- &joined_tab);
- if (ret)
- goto out;
- wim_tab_save = wim->lookup_table;
- wim->lookup_table = joined_tab;
- }