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

Windows: Add various checks to address Coverity reported issues.

This commit is contained in:
Mounir IDRASSI
2022-03-26 20:03:19 +01:00
parent a0809fe85c
commit 762065917f
11 changed files with 105 additions and 28 deletions

View File

@@ -6583,6 +6583,14 @@ static void ShowSystemEncryptionStatus (HWND hwndDlg)
if (GetAsyncKeyState (VK_SHIFT) < 0 && GetAsyncKeyState (VK_CONTROL) < 0)
{
// Ctrl+Shift held (for debugging purposes)
int64 encryptedRatio = 0;
if (BootEncStatus.DriveEncrypted
&& (BootEncStatus.ConfiguredEncryptedAreaStart >= 0)
&& (BootEncStatus.ConfiguredEncryptedAreaEnd >= BootEncStatus.ConfiguredEncryptedAreaStart)
)
{
encryptedRatio = (BootEncStatus.EncryptedAreaEnd + 1 - BootEncStatus.EncryptedAreaStart) * 100I64 / (BootEncStatus.ConfiguredEncryptedAreaEnd + 1 - BootEncStatus.ConfiguredEncryptedAreaStart);
}
DebugMsgBox ("Debugging information for system encryption:\n\nDeviceFilterActive: %d\nBootLoaderVersion: %x\nSetupInProgress: %d\nSetupMode: %d\nVolumeHeaderPresent: %d\nDriveMounted: %d\nDriveEncrypted: %d\n"
"HiddenSystem: %d\nHiddenSystemPartitionStart: %I64d\n"
@@ -6600,7 +6608,7 @@ static void ShowSystemEncryptionStatus (HWND hwndDlg)
BootEncStatus.ConfiguredEncryptedAreaEnd,
BootEncStatus.EncryptedAreaStart,
BootEncStatus.EncryptedAreaEnd,
!BootEncStatus.DriveEncrypted ? 0 : (BootEncStatus.EncryptedAreaEnd + 1 - BootEncStatus.EncryptedAreaStart) * 100I64 / (BootEncStatus.ConfiguredEncryptedAreaEnd + 1 - BootEncStatus.ConfiguredEncryptedAreaStart));
encryptedRatio);
}
if (!BootEncStatus.DriveEncrypted && !BootEncStatus.DriveMounted)