Windows: Fix issue when RAM encryption used, AES selected and AES-NI not supported by CPU that caused the free space of newly created volumes not filled with random data even if "quick format" is not selected by user.
This commit is contained in:
parent
d031addc2c
commit
0121dc0b81
|
@ -442,6 +442,11 @@ FormatFat (void* hwndDlgPtr, unsigned __int64 startSector, fatparams * ft, void
|
|||
return ERR_MODE_INIT_FAILED;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
|
||||
#endif
|
||||
|
||||
x = ft->num_sectors - ft->reserved - ft->size_root_dir / ft->sector_size - ft->fat_length * 2;
|
||||
while (x--)
|
||||
{
|
||||
|
|
|
@ -898,6 +898,11 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
|
||||
#endif
|
||||
|
||||
while (num_sectors--)
|
||||
{
|
||||
if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
|
||||
|
|
|
@ -2234,6 +2234,11 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
|
|||
goto err;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
VcProtectKeys (wipeCryptoInfo, VcGetEncryptionID (wipeCryptoInfo));
|
||||
#endif
|
||||
|
||||
EncryptDataUnits (wipeRandBuffer, &dataUnit, wipeBlockSize / ENCRYPTION_DATA_UNIT_SIZE, wipeCryptoInfo);
|
||||
memcpy (wipeRandChars, wipeRandBuffer, sizeof (wipeRandChars));
|
||||
|
||||
|
|
|
@ -116,6 +116,11 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
|
||||
#endif
|
||||
|
||||
while (num_sectors--)
|
||||
{
|
||||
if (WriteSector (dev, sector, write_buf, &write_buf_cnt, &nSecNo,
|
||||
|
|
Loading…
Reference in New Issue