]> wimlib.net Git - wimlib/blobdiff - src/modify.c
split WIM apply, doc updates
[wimlib] / src / modify.c
index 3dc0de44542827cb5f6f1cf30c75a20515840cd3..5223b81912c5abde8943a9d2c85023ca814029cd 100644 (file)
@@ -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);