From 16a0ef18b1404aab857696ae479e246dfbcfbaa3 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 3 Sep 2014 23:43:53 -0500 Subject: [PATCH 1/1] Add WIMLIB_ERR_FVE_LOCKED_VOLUME --- include/wimlib.h | 4 ++++ src/util.c | 2 ++ src/win32_capture.c | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/wimlib.h b/include/wimlib.h index 76d63b26..d8d0e755 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -2434,6 +2434,7 @@ enum wimlib_error_code { WIMLIB_ERR_MOUNTED_IMAGE_IS_BUSY = 79, WIMLIB_ERR_NOT_A_MOUNTPOINT = 80, WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT = 81, + WIMLIB_ERR_FVE_LOCKED_VOLUME = 82, }; @@ -4339,6 +4340,9 @@ wimlib_unmount_image_with_progress(const wimlib_tchar *dir, * be rolled back, and no visible changes shall have been made to @p wim. * Possible error codes include: * + * @retval ::WIMLIB_ERR_FVE_LOCKED_VOLUME + * Windows-only: One of the "add" commands attempted to add files from an + * encrypted BitLocker volume that hasn't yet been unlocked. * @retval ::WIMLIB_ERR_INVALID_CAPTURE_CONFIG * The capture configuration structure specified for an add command was * invalid. diff --git a/src/util.c b/src/util.c index 33c611c8..e074b951 100644 --- a/src/util.c +++ b/src/util.c @@ -381,6 +381,8 @@ static const tchar *error_strings[] = { = T("There is not a WIM image mounted on the directory"), [WIMLIB_ERR_NOT_PERMITTED_TO_UNMOUNT] = T("The current user does not have permission to unmount the WIM image"), + [WIMLIB_ERR_FVE_LOCKED_VOLUME] + = T("The volume must be unlocked before it can be used"), }; /* API function documented in wimlib.h */ diff --git a/src/win32_capture.c b/src/win32_capture.c index 71a59369..8cf32efd 100644 --- a/src/win32_capture.c +++ b/src/win32_capture.c @@ -1123,7 +1123,10 @@ winnt_build_dentry_tree_recursive(struct wim_dentry **root_ret, ERROR_WITH_ERRNO("\"%ls\": Can't open file " "(status=0x%08"PRIx32")", printable_path(full_path), (u32)status); - ret = WIMLIB_ERR_OPEN; + if (status == STATUS_FVE_LOCKED_VOLUME) + ret = WIMLIB_ERR_FVE_LOCKED_VOLUME; + else + ret = WIMLIB_ERR_OPEN; } /* XXX: Provide option to exclude files that fail with * STATUS_SHARING_VIOLATION? */ -- 2.43.0