&progress);
}
- part_write_flags = write_flags & WIMLIB_WRITE_MASK_PUBLIC;
+ part_write_flags = write_flags;
part_write_flags |= WIMLIB_WRITE_FLAG_USE_EXISTING_TOTALBYTES;
if (part_number != 1)
part_write_flags |= WIMLIB_WRITE_FLAG_NO_METADATA;
struct swm_info *swm_info = _swm_info;
u64 stream_size;
- /* TODO */
- stream_size = lte->rspec->size_in_wim;
+ if (lte_is_partial(lte)) {
+ ERROR("Splitting of WIM containing packed streams is not supported.\n"
+ " Export it in the default format first.");
+ return WIMLIB_ERR_UNSUPPORTED;
+ }
+ if (lte->resource_location == RESOURCE_IN_WIM)
+ stream_size = lte->rspec->size_in_wim;
+ else
+ stream_size = lte->size;
/* - Start first part if no parts have been started so far;
* - Start next part if adding this stream exceeds maximum part size,
if (swm_name == NULL || swm_name[0] == T('\0') || part_size == 0)
return WIMLIB_ERR_INVALID_PARAM;
+ if (write_flags & ~WIMLIB_WRITE_MASK_PUBLIC)
+ return WIMLIB_ERR_INVALID_PARAM;
+
if (!wim_has_metadata(wim))
return WIMLIB_ERR_METADATA_NOT_FOUND;