From 0121dc0b81722ac07abac27d8215c524260bb3f2 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 20 Jun 2020 15:10:28 +0200 Subject: 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. --- src/ExpandVolume/InitDataArea.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ExpandVolume') diff --git a/src/ExpandVolume/InitDataArea.c b/src/ExpandVolume/InitDataArea.c index 618358d1..709f44b9 100644 --- a/src/ExpandVolume/InitDataArea.c +++ b/src/ExpandVolume/InitDataArea.c @@ -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, -- cgit v1.2.3