+ if (swm->chunk_size != chunk_size &&
+ ctype != WIMLIB_COMPRESSION_TYPE_NONE) {
+ ERROR("The split WIMs do not all have the same "
+ "chunk size");
+ return WIMLIB_ERR_SPLIT_INVALID;
+ }
+ if (memcmp(guid, swm->hdr.guid, WIM_GUID_LEN) != 0) {
+ ERROR("The split WIMs do not all have the same "
+ "GUID");
+ return WIMLIB_ERR_SPLIT_INVALID;
+ }
+ if (swm->hdr.part_number == 1) {
+ ERROR("WIMs `%"TS"' and `%"TS"' both are marked "
+ "as the first WIM in the spanned set",
+ wim->filename, swm->filename);
+ return WIMLIB_ERR_SPLIT_INVALID;
+ }
+ if (swm->hdr.part_number == 0 ||
+ swm->hdr.part_number > total_parts)
+ {
+ ERROR("WIM `%"TS"' says it is part %u in the "
+ "spanned set, but the part number must "
+ "be in the range [1, %u]",
+ swm->filename, swm->hdr.part_number, total_parts);
+ return WIMLIB_ERR_SPLIT_INVALID;
+ }
+ if (parts_to_swms[swm->hdr.part_number - 2])
+ {
+ ERROR("`%"TS"' and `%"TS"' are both marked as "
+ "part %u of %u in the spanned set",
+ parts_to_swms[swm->hdr.part_number - 2]->filename,
+ swm->filename,
+ swm->hdr.part_number,
+ total_parts);
+ return WIMLIB_ERR_SPLIT_INVALID;
+ } else {
+ parts_to_swms[swm->hdr.part_number - 2] = swm;