-
- if ((flags & WIMLIB_EXTRACT_FLAG_NTFS)) {
- #ifdef WITH_NTFS_3G
- unsigned long mnt_flags;
- ret = ntfs_check_if_mounted(output_dir, &mnt_flags);
- if (ret != 0) {
- ERROR_WITH_ERRNO("NTFS-3g: Cannot determine if `%s' "
- "is mounted", output_dir);
- return WIMLIB_ERR_NTFS_3G;
- }
- if (!(mnt_flags & NTFS_MF_MOUNTED)) {
- ERROR("NTFS-3g: Filesystem on `%s' is not mounted ",
- output_dir);
- return WIMLIB_ERR_NTFS_3G;
- }
- if (mnt_flags & NTFS_MF_READONLY) {
- ERROR("NTFS-3g: Filesystem on `%s' is mounted "
- "read-only", output_dir);
- return WIMLIB_ERR_NTFS_3G;
- }
- #else
- ERROR("wimlib was compiled without support for NTFS-3g, so");
- ERROR("we cannot extract a WIM image while preserving NTFS-");
- ERROR("specific information");
- return WIMLIB_ERR_UNSUPPORTED;
- #endif
+
+}
+
+WIMLIBAPI int wimlib_apply_image_to_ntfs_volume(WIMStruct *w, int image,
+ const char *device, int flags)
+{
+#ifdef WITH_NTFS_3G
+ int ret;
+
+ if (!device)
+ return WIMLIB_ERR_INVALID_PARAM;
+ if (image == WIM_ALL_IMAGES) {
+ ERROR("Can only apply a single image when applying "
+ "directly to a NTFS volume");
+ return WIMLIB_ERR_INVALID_PARAM;