1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Windows: Don't allow to encrypt the system drive if it is already encrypted by BitLocker

This commit is contained in:
Mounir IDRASSI
2020-07-02 02:10:26 +02:00
parent ac3cccdd21
commit 9a804654f5
4 changed files with 117 additions and 0 deletions

View File

@@ -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())