mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-01-10 15:39:22 -06:00
Windows: remove 32-bit logic from the code since we support only 64-bit. remove 32-bit EFI bootloader files.
We also fix intermediary files folder for Portable and Setup projects
This commit is contained in:
@@ -56,9 +56,7 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
||||
|
||||
LARGE_INTEGER startOffset;
|
||||
LARGE_INTEGER newOffset;
|
||||
#ifdef _WIN64
|
||||
CRYPTO_INFO tmpCI;
|
||||
#endif
|
||||
|
||||
// Seek to start sector
|
||||
startOffset.QuadPart = startSector * FormatSectorSize;
|
||||
@@ -77,7 +75,6 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
||||
|
||||
memset (sector, 0, sizeof (sector));
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
{
|
||||
VirtualLock (&tmpCI, sizeof (tmpCI));
|
||||
@@ -85,7 +82,6 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
||||
VcUnprotectKeys (&tmpCI, VcGetEncryptionID (cryptoInfo));
|
||||
cryptoInfo = &tmpCI;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Remember the original secondary key (XTS mode) before generating a temporary one
|
||||
memcpy (originalK2, cryptoInfo->k2, sizeof (cryptoInfo->k2));
|
||||
@@ -116,10 +112,8 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
VcProtectKeys (cryptoInfo, VcGetEncryptionID (cryptoInfo));
|
||||
#endif
|
||||
|
||||
while (num_sectors--)
|
||||
{
|
||||
@@ -154,13 +148,11 @@ int FormatNoFs (HWND hwndDlg, unsigned __int64 startSector, __int64 num_sectors,
|
||||
VirtualUnlock (temporaryKey, sizeof (temporaryKey));
|
||||
VirtualUnlock (originalK2, sizeof (originalK2));
|
||||
TCfree (write_buf);
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
{
|
||||
burn (&tmpCI, sizeof (CRYPTO_INFO));
|
||||
VirtualUnlock (&tmpCI, sizeof (tmpCI));
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -172,13 +164,11 @@ fail:
|
||||
VirtualUnlock (temporaryKey, sizeof (temporaryKey));
|
||||
VirtualUnlock (originalK2, sizeof (originalK2));
|
||||
TCfree (write_buf);
|
||||
#ifdef _WIN64
|
||||
if (IsRamEncryptionEnabled ())
|
||||
{
|
||||
burn (&tmpCI, sizeof (CRYPTO_INFO));
|
||||
VirtualUnlock (&tmpCI, sizeof (tmpCI));
|
||||
}
|
||||
#endif
|
||||
|
||||
SetLastError (err);
|
||||
return (retVal ? retVal : ERR_OS_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user