X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fmodify.c;h=5223b81912c5abde8943a9d2c85023ca814029cd;hb=35dd893208119869db6a90b1d1663f9aea88a3f7;hp=3dc0de44542827cb5f6f1cf30c75a20515840cd3;hpb=3b293f2984ccd95cf58363ae448deda14224d310;p=wimlib diff --git a/src/modify.c b/src/modify.c index 3dc0de44..5223b819 100644 --- a/src/modify.c +++ b/src/modify.c @@ -364,6 +364,15 @@ WIMLIBAPI int wimlib_export_image(WIMStruct *src_wim, struct wim_pair wims; struct wim_security_data *sd; + if (!src_wim || !dest_wim) + return WIMLIB_ERR_INVALID_PARAM; + + if (src_wim->hdr.total_parts != 1 || src_wim->hdr.total_parts != 1) { + ERROR("Exporting an image to or from a split WIM is " + "unsupported"); + return WIMLIB_ERR_SPLIT_UNSUPPORTED; + } + if (src_image == WIM_ALL_IMAGES) { if (src_wim->hdr.image_count > 1) { @@ -466,6 +475,11 @@ WIMLIBAPI int wimlib_delete_image(WIMStruct *w, int image) int i; int ret; + if (w->hdr.total_parts != 1) { + ERROR("Deleting an image from a split WIM is not supported."); + return WIMLIB_ERR_SPLIT_UNSUPPORTED; + } + if (image == WIM_ALL_IMAGES) { num_images = w->hdr.image_count; for (i = 1; i <= num_images; i++) { @@ -791,6 +805,11 @@ int do_add_image(WIMStruct *w, const char *dir, const char *name, return WIMLIB_ERR_INVALID_PARAM; } + if (w->hdr.total_parts != 1) { + ERROR("Cannot add an image to a split WIM"); + return WIMLIB_ERR_SPLIT_UNSUPPORTED; + } + if (wimlib_image_name_in_use(w, name)) { ERROR("There is already an image named \"%s\" in `%s'", name, w->filename);