VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/BootEncryption.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-02 02:10:26 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2020-07-02 02:20:58 +0200
commit9a804654f5e8588f039407aeaaaf24fd9f0062e5 (patch)
tree22773e2465c688f4e17e198c08b6f1b62aedabaa /src/Common/BootEncryption.cpp
parentac3cccdd2156403d66b32ef5ab35017caff43209 (diff)
downloadVeraCrypt-9a804654f5e8588f039407aeaaaf24fd9f0062e5.tar.gz
VeraCrypt-9a804654f5e8588f039407aeaaaf24fd9f0062e5.zip
Windows: Don't allow to encrypt the system drive if it is already encrypted by BitLocker
Diffstat (limited to 'src/Common/BootEncryption.cpp')
-rw-r--r--src/Common/BootEncryption.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp
index 0a2afb12..502b4e06 100644
--- a/src/Common/BootEncryption.cpp
+++ b/src/Common/BootEncryption.cpp
@@ -5176,6 +5176,12 @@ namespace VeraCrypt
if (IsNonInstallMode())
throw ErrorException ("FEATURE_REQUIRES_INSTALLATION", SRC_POS);
+ /* check if the system drive is already encrypted by BitLocker */
+ wchar_t windowsDrive = (wchar_t) towupper (GetWindowsDirectory()[0]);
+ BitLockerEncryptionStatus bitLockerStatus = GetBitLockerEncryptionStatus (windowsDrive);
+ if (bitLockerStatus == BL_Status_Protected)
+ throw ErrorException ("SYSENC_BITLOCKER_CONFLICT", SRC_POS);
+
SystemDriveConfiguration config = GetSystemDriveConfiguration ();
if (SystemDriveIsDynamic())