#include "wimlib/endianness.h"
#include "wimlib/error.h"
#include "wimlib/metadata.h"
-#ifdef WITH_NTFS_3G
-# include "wimlib/ntfs_3g.h" /* for do_ntfs_umount() */
-#endif
#include "wimlib/paths.h"
#include "wimlib/progress.h"
#include "wimlib/xml.h"
struct capture_params params;
struct capture_config config;
capture_tree_t capture_tree = platform_default_capture_tree;
-#ifdef WITH_NTFS_3G
- struct _ntfs_volume *ntfs_vol = NULL;
-#endif
- void *extra_arg = NULL;
struct wim_dentry *branch;
add_flags = add_cmd->add.add_flags;
memset(¶ms, 0, sizeof(params));
#ifdef WITH_NTFS_3G
- if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
+ if (add_flags & WIMLIB_ADD_FLAG_NTFS)
capture_tree = build_dentry_tree_ntfs;
- extra_arg = &ntfs_vol;
- if (wim_get_current_image_metadata(wim)->ntfs_vol != NULL) {
- ERROR("NTFS volume already set");
- ret = WIMLIB_ERR_INVALID_PARAM;
- goto out;
- }
- }
#endif
ret = get_capture_config(config_file, &config,
params.sd_set = sd_set;
params.config = &config;
params.add_flags = add_flags;
- params.extra_arg = extra_arg;
params.progfunc = wim->progfunc;
params.progctx = wim->progctx;
¶ms.progress, params.progctx);
if (ret) {
free_dentry_tree(branch, wim->blob_table);
- goto out_cleanup_after_capture;
+ goto out_destroy_config;
}
if (WIMLIB_IS_WIM_ROOT_PATH(wim_target_path) &&
ERROR("\"%"TS"\" is not a directory!", fs_source_path);
ret = WIMLIB_ERR_NOTDIR;
free_dentry_tree(branch, wim->blob_table);
- goto out_cleanup_after_capture;
+ goto out_destroy_config;
}
ret = attach_branch(branch, wim_target_path, j,
add_flags, params.progfunc, params.progctx);
if (ret)
- goto out_cleanup_after_capture;
+ goto out_destroy_config;
if (config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT) &&
WIMLIB_IS_WIM_ROOT_PATH(wim_target_path))
* /Windows/System32/WimBootCompress.ini in the WIM image. */
ret = platform_default_capture_tree(&branch, config_file, ¶ms);
if (ret)
- goto out_cleanup_after_capture;
+ goto out_destroy_config;
ret = attach_branch(branch, wimboot_cfgfile, j, 0, NULL, NULL);
if (ret)
- goto out_cleanup_after_capture;
+ goto out_destroy_config;
}
-#ifdef WITH_NTFS_3G
- wim_get_current_image_metadata(wim)->ntfs_vol = ntfs_vol;
-#endif
ret = 0;
- goto out_destroy_config;
-out_cleanup_after_capture:
-#ifdef WITH_NTFS_3G
- if (ntfs_vol)
- do_ntfs_umount(ntfs_vol);
-#endif
out_destroy_config:
destroy_capture_config(&config);
out:
#ifndef WITH_NTFS_3G
if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
- ERROR("wimlib was compiled without support for NTFS-3g, so\n"
- " we cannot capture a WIM image directly "
- "from an NTFS volume");
+ ERROR("NTFS-3g capture mode is unsupported because wimlib "
+ "was compiled --without-ntfs-3g");
return WIMLIB_ERR_UNSUPPORTED;
}
#endif
}
if (!is_entire_image) {
- if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
- ERROR("Cannot add directly from an NTFS volume "
- "when not capturing a full image!");
- return WIMLIB_ERR_INVALID_PARAM;
- }
-
if (add_flags & WIMLIB_ADD_FLAG_RPFIX) {
ERROR("Cannot do reparse point fixups when "
"not capturing a full image!");