VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/Driver')
-rw-r--r--src/Driver/DriveFilter.c88
-rw-r--r--src/Driver/Driver.rc8
-rw-r--r--src/Driver/Driver.vcxproj5
-rw-r--r--src/Driver/Driver.vcxproj.filters15
-rw-r--r--src/Driver/DumpFilter.c4
-rw-r--r--src/Driver/EncryptedIoQueue.c113
-rw-r--r--src/Driver/EncryptedIoQueue.h16
-rw-r--r--src/Driver/Fuse/Driver.make2
-rw-r--r--src/Driver/Fuse/FuseService.cpp29
-rw-r--r--src/Driver/Fuse/FuseService.h2
-rw-r--r--src/Driver/Ntdriver.c255
-rw-r--r--src/Driver/Ntdriver.h6
-rw-r--r--src/Driver/Ntvol.c34
-rw-r--r--src/Driver/VolumeFilter.c60
-rw-r--r--src/Driver/veracrypt_vs2019.vcxproj598
-rw-r--r--src/Driver/veracrypt_vs2019.vcxproj.filters326
16 files changed, 1372 insertions, 189 deletions
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c
index f89e6e9a..a615797a 100644
--- a/src/Driver/DriveFilter.c
+++ b/src/Driver/DriveFilter.c
@@ -35,7 +35,7 @@ static BOOL DeviceFilterActive = FALSE;
BOOL BootArgsValid = FALSE;
BootArguments BootArgs;
-byte* BootSecRegionData = NULL;
+uint8* BootSecRegionData = NULL;
uint32 BootSecRegionSize = 0;
uint32 BootPkcs5 = 0;
@@ -47,13 +47,13 @@ static KMUTEX MountMutex;
static volatile BOOL BootDriveFound = FALSE;
static DriveFilterExtension *BootDriveFilterExtension = NULL;
static LARGE_INTEGER BootDriveLength;
-static byte BootLoaderFingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE];
+static uint8 BootLoaderFingerprint[WHIRLPOOL_DIGESTSIZE + SHA512_DIGESTSIZE];
static BOOL CrashDumpEnabled = FALSE;
static BOOL HibernationEnabled = FALSE;
static BOOL LegacyHibernationDriverFilterActive = FALSE;
-static byte *HibernationWriteBuffer = NULL;
+static uint8 *HibernationWriteBuffer = NULL;
static MDL *HibernationWriteBufferMdl = NULL;
static uint32 HibernationPreventionCount = 0;
@@ -82,8 +82,8 @@ NTSTATUS LoadBootArguments (BOOL bIsEfi)
{
NTSTATUS status = STATUS_UNSUCCESSFUL;
PHYSICAL_ADDRESS bootArgsAddr;
- byte *mappedBootArgs;
- byte *mappedCryptoInfo = NULL;
+ uint8 *mappedBootArgs;
+ uint8 *mappedCryptoInfo = NULL;
uint16 bootLoaderArgsIndex;
uint64* BootArgsRegionsPtr = bIsEfi? BootArgsRegionsEFI : BootArgsRegionsDefault;
size_t BootArgsRegionsCount = bIsEfi? sizeof(BootArgsRegionsEFI)/ sizeof(BootArgsRegionsEFI[0]) : sizeof(BootArgsRegionsDefault)/ sizeof(BootArgsRegionsDefault[0]);
@@ -109,7 +109,7 @@ NTSTATUS LoadBootArguments (BOOL bIsEfi)
DumpMem (mappedBootArgs, sizeof (BootArguments));
if (bootArguments->BootLoaderVersion == VERSION_NUM
- && bootArguments->BootArgumentsCrc32 != GetCrc32 ((byte *) bootArguments, (int) ((byte *) &bootArguments->BootArgumentsCrc32 - (byte *) bootArguments)))
+ && bootArguments->BootArgumentsCrc32 != GetCrc32 ((uint8 *) bootArguments, (int) ((uint8 *) &bootArguments->BootArgumentsCrc32 - (uint8 *) bootArguments)))
{
Dump ("BootArguments CRC incorrect\n");
burn (mappedBootArgs, sizeof (BootArguments));
@@ -166,13 +166,13 @@ NTSTATUS LoadBootArguments (BOOL bIsEfi)
uint32 crc;
PHYSICAL_ADDRESS SecRegionAddress;
SECREGION_BOOT_PARAMS* SecRegionParams = (SECREGION_BOOT_PARAMS*) (mappedCryptoInfo + sizeof(BOOT_CRYPTO_HEADER) + 2);
- byte *secRegionData = NULL;
+ uint8 *secRegionData = NULL;
SecRegionAddress.QuadPart = SecRegionParams->Ptr;
Dump ("SecRegion memory 0x%x %d\n", SecRegionAddress.LowPart, SecRegionParams->Size);
// SecRegion correct?
if( (SecRegionParams->Ptr != 0) && (SecRegionParams->Size > 0)) {
- crc = GetCrc32((byte*)SecRegionParams, 12);
+ crc = GetCrc32((uint8*)SecRegionParams, 12);
if(crc == SecRegionParams->Crc) {
Dump ("SecRegion crc ok\n");
secRegionData = MmMapIoSpace (SecRegionAddress, SecRegionParams->Size, MmCached);
@@ -220,7 +220,7 @@ NTSTATUS LoadBootArguments (BOOL bIsEfi)
NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
{
- DriveFilterExtension *Extension;
+ DriveFilterExtension *Extension = NULL;
NTSTATUS status;
PDEVICE_OBJECT filterDeviceObject = NULL;
PDEVICE_OBJECT attachedDeviceObject;
@@ -275,7 +275,7 @@ NTSTATUS DriveFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
err:
if (filterDeviceObject)
{
- if (Extension->LowerDeviceObject)
+ if (Extension && Extension->LowerDeviceObject)
IoDetachDevice (Extension->LowerDeviceObject);
IoDeleteDevice (filterDeviceObject);
@@ -329,7 +329,7 @@ static void InvalidateDriveFilterKeys (DriveFilterExtension *Extension)
Dump ("Drive filter encryption keys invalidated!\n");
}
-static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte* ioBuffer /* ioBuffer must be at least 512 bytes long */)
+static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, uint8* ioBuffer /* ioBuffer must be at least 512 bytes long */)
{
NTSTATUS status;
LARGE_INTEGER offset;
@@ -362,8 +362,8 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
NTSTATUS saveStatus = STATUS_INVALID_PARAMETER;
#ifdef _WIN64
XSTATE_SAVE SaveState;
- if (g_isIntel && HasSAVX())
- saveStatus = KeSaveExtendedProcessorState(XSTATE_MASK_GSSE, &SaveState);
+ if (IsCpuIntel() && HasSAVX())
+ saveStatus = KeSaveExtendedProcessorStateVC(XSTATE_MASK_GSSE, &SaveState);
#else
KFLOATING_SAVE floatingPointState;
if (HasISSE() || (HasSSSE3() && HasMMX()))
@@ -405,7 +405,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte*
if (NT_SUCCESS (saveStatus))
#ifdef _WIN64
- KeRestoreExtendedProcessorState(&SaveState);
+ KeRestoreExtendedProcessorStateVC(&SaveState);
#else
KeRestoreFloatingPointState (&floatingPointState);
#endif
@@ -433,7 +433,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
// Check disk MBR id and GPT ID if BootSecRegion is available to detect boot drive
if (BootSecRegionData != NULL && BootSecRegionSize >= 1024) {
- byte mbr[TC_SECTOR_SIZE_BIOS];
+ uint8 mbr[TC_SECTOR_SIZE_BIOS];
DCS_DISK_ENTRY_LIST* DeList = (DCS_DISK_ENTRY_LIST*)(BootSecRegionData + 512);
offset.QuadPart = 0;
status = TCReadDevice (Extension->LowerDeviceObject, mbr, offset, TC_SECTOR_SIZE_BIOS);
@@ -459,7 +459,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
// Check boot drive signature first (header CRC search could fail if a user restored the header to a non-boot drive)
if (BootDriveSignatureValid)
{
- byte mbr[TC_SECTOR_SIZE_BIOS];
+ uint8 mbr[TC_SECTOR_SIZE_BIOS];
offset.QuadPart = 0;
status = TCReadDevice (Extension->LowerDeviceObject, mbr, offset, TC_SECTOR_SIZE_BIOS);
@@ -520,7 +520,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
pim = (int) (BootArgs.Flags >> 16);
- if (ReadVolumeHeader (!hiddenVolume, header, password, pkcs5_prf, pim, FALSE, &Extension->Queue.CryptoInfo, Extension->HeaderCryptoInfo) == 0)
+ if (ReadVolumeHeader (!hiddenVolume, header, password, pkcs5_prf, pim, &Extension->Queue.CryptoInfo, Extension->HeaderCryptoInfo) == 0)
{
// Header decrypted
status = STATUS_SUCCESS;
@@ -585,7 +585,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
uint32 crcSaved;
crcSaved = DeList->CRC32;
DeList->CRC32 = 0;
- crc = GetCrc32((byte*)DeList, 512);
+ crc = GetCrc32((uint8*)DeList, 512);
if(crc == crcSaved){
if(DeList->DE[DE_IDX_PWDCACHE].Type == DE_PwdCache) {
uint64 sector = 0;
@@ -696,7 +696,7 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
{
NTSTATUS status = STATUS_SUCCESS;
LARGE_INTEGER offset;
- byte *header;
+ uint8 *header;
header = TCalloc (TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE);
if (!header)
@@ -727,7 +727,7 @@ static NTSTATUS SaveDriveVolumeHeader (DriveFilterExtension *Extension)
{
uint32 headerCrc32;
uint64 encryptedAreaLength = Extension->Queue.EncryptedAreaEnd + 1 - Extension->Queue.EncryptedAreaStart;
- byte *fieldPos = header + TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH;
+ uint8 *fieldPos = header + TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH;
PCRYPTO_INFO pCryptoInfo = Extension->HeaderCryptoInfo;
#ifdef _WIN64
CRYPTO_INFO tmpCI;
@@ -988,6 +988,7 @@ static NTSTATUS DispatchPower (PDEVICE_OBJECT DeviceObject, PIRP Irp, DriveFilte
// Dismount the system drive on shutdown on Windows 7 and later
if (DriverShuttingDown
+ && EraseKeysOnShutdown
&& IsOSAtLeast (WIN_7)
&& Extension->BootDrive
&& Extension->DriveMounted
@@ -1046,6 +1047,11 @@ static NTSTATUS DispatchControl (PDEVICE_OBJECT DeviceObject, PIRP Irp, DriveFil
}
}
break;
+ case IOCTL_DISK_GROW_PARTITION:
+ Dump ("DriverFilter-DispatchControl: IOCTL_DISK_GROW_PARTITION blocked\n");
+ IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
+ return TCCompleteDiskIrp (Irp, STATUS_UNSUCCESSFUL, 0);
+ break;
}
status = PassIrp (Extension->LowerDeviceObject, Irp);
@@ -1187,7 +1193,7 @@ void ReopenBootVolumeHeader (PIRP irp, PIO_STACK_LOCATION irpSp)
}
#endif
- if (ReadVolumeHeader (!BootDriveFilterExtension->HiddenSystem, header, &request->VolumePassword, request->pkcs5_prf, request->pim, FALSE, NULL, BootDriveFilterExtension->HeaderCryptoInfo) == 0)
+ if (ReadVolumeHeader (!BootDriveFilterExtension->HiddenSystem, header, &request->VolumePassword, request->pkcs5_prf, request->pim, NULL, BootDriveFilterExtension->HeaderCryptoInfo) == 0)
{
Dump ("Header reopened\n");
#ifdef _WIN64
@@ -1228,16 +1234,16 @@ typedef NTSTATUS (*HiberDriverWriteFunctionB) (PLARGE_INTEGER writeOffset, PMDL
typedef struct
{
#ifdef _WIN64
- byte FieldPad1[64];
+ uint8 FieldPad1[64];
HiberDriverWriteFunctionB WriteFunctionB;
- byte FieldPad2[56];
+ uint8 FieldPad2[56];
#else
- byte FieldPad1[48];
+ uint8 FieldPad1[48];
HiberDriverWriteFunctionB WriteFunctionB;
- byte FieldPad2[32];
+ uint8 FieldPad2[32];
#endif
HiberDriverWriteFunctionA WriteFunctionA;
- byte FieldPad3[24];
+ uint8 FieldPad3[24];
LARGE_INTEGER PartitionStartOffset;
} HiberDriverContext;
@@ -1247,16 +1253,16 @@ typedef struct
{
LIST_ENTRY ModuleList;
#ifdef _WIN64
- byte FieldPad1[32];
+ uint8 FieldPad1[32];
#else
- byte FieldPad1[16];
+ uint8 FieldPad1[16];
#endif
PVOID ModuleBaseAddress;
HiberDriverEntry ModuleEntryAddress;
#ifdef _WIN64
- byte FieldPad2[24];
+ uint8 FieldPad2[24];
#else
- byte FieldPad2[12];
+ uint8 FieldPad2[12];
#endif
UNICODE_STRING ModuleName;
} ModuleTableItem;
@@ -1566,10 +1572,10 @@ static VOID SetupThreadProc (PVOID threadArg)
BOOL headerUpdateRequired = FALSE;
int64 bytesWrittenSinceHeaderUpdate = 0;
- byte *buffer = NULL;
- byte *wipeBuffer = NULL;
- byte wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
- byte wipeRandCharsUpdate[TC_WIPE_RAND_CHAR_COUNT];
+ uint8 *buffer = NULL;
+ uint8 *wipeBuffer = NULL;
+ uint8 wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
+ uint8 wipeRandCharsUpdate[TC_WIPE_RAND_CHAR_COUNT];
KIRQL irql;
NTSTATUS status;
@@ -1577,7 +1583,7 @@ static VOID SetupThreadProc (PVOID threadArg)
// generate real random values for wipeRandChars and
// wipeRandCharsUpdate instead of relying on uninitialized stack memory
ChaCha20RngCtx rngCtx;
- byte pbSeed[CHACHA20RNG_KEYSZ + CHACHA20RNG_IVSZ];
+ uint8 pbSeed[CHACHA20RNG_KEYSZ + CHACHA20RNG_IVSZ];
GetDriverRandomSeed (pbSeed, sizeof (pbSeed));
ChaCha20RngInit (&rngCtx, pbSeed, GetDriverRandomSeed, 0);
@@ -1751,7 +1757,7 @@ static VOID SetupThreadProc (PVOID threadArg)
if (SetupRequest.WipeAlgorithm != TC_WIPE_NONE)
{
- byte wipePass;
+ uint8 wipePass;
int wipePassCount = GetWipePassCount (SetupRequest.WipeAlgorithm);
if (wipePassCount <= 0)
{
@@ -2107,8 +2113,8 @@ void GetBootEncryptionAlgorithmName (PIRP irp, PIO_STACK_LOCATION irpSp)
wchar_t BootEncryptionAlgorithmNameW[256];
wchar_t BootPrfAlgorithmNameW[256];
GetBootEncryptionAlgorithmNameRequest *request = (GetBootEncryptionAlgorithmNameRequest *) irp->AssociatedIrp.SystemBuffer;
- EAGetName (BootEncryptionAlgorithmNameW, BootDriveFilterExtension->Queue.CryptoInfo->ea, 0);
- HashGetName2 (BootPrfAlgorithmNameW, BootDriveFilterExtension->Queue.CryptoInfo->pkcs5);
+ EAGetName (BootEncryptionAlgorithmNameW, 256, BootDriveFilterExtension->Queue.CryptoInfo->ea, 0);
+ HashGetName2 (BootPrfAlgorithmNameW, 256, BootDriveFilterExtension->Queue.CryptoInfo->pkcs5);
RtlStringCbPrintfA (request->BootEncryptionAlgorithmName, sizeof (request->BootEncryptionAlgorithmName), "%S", BootEncryptionAlgorithmNameW);
RtlStringCbPrintfA (request->BootPrfAlgorithmName, sizeof (request->BootPrfAlgorithmName), "%S", BootPrfAlgorithmNameW);
@@ -2187,9 +2193,9 @@ static VOID DecoySystemWipeThreadProc (PVOID threadArg)
ULONG wipeBlockSize = TC_ENCRYPTION_SETUP_IO_BLOCK_SIZE;
CRYPTO_INFO *wipeCryptoInfo = NULL;
- byte *wipeBuffer = NULL;
- byte *wipeRandBuffer = NULL;
- byte wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
+ uint8 *wipeBuffer = NULL;
+ uint8 *wipeRandBuffer = NULL;
+ uint8 wipeRandChars[TC_WIPE_RAND_CHAR_COUNT];
int wipePass, wipePassCount;
int ea = Extension->Queue.CryptoInfo->ea;
diff --git a/src/Driver/Driver.rc b/src/Driver/Driver.rc
index 30019349..ed2e4560 100644
--- a/src/Driver/Driver.rc
+++ b/src/Driver/Driver.rc
@@ -27,8 +27,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,24,20,0
- PRODUCTVERSION 1,24,20,0
+ FILEVERSION 1,26,10,0
+ PRODUCTVERSION 1,26,10,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -45,11 +45,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "IDRIX"
VALUE "FileDescription", "VeraCrypt Driver"
- VALUE "FileVersion", "1.24"
+ VALUE "FileVersion", "1.26.10"
VALUE "LegalTrademarks", "VeraCrypt"
VALUE "OriginalFilename", "veracrypt.sys"
VALUE "ProductName", "VeraCrypt"
- VALUE "ProductVersion", "1.24"
+ VALUE "ProductVersion", "1.26.10"
END
END
BLOCK "VarFileInfo"
diff --git a/src/Driver/Driver.vcxproj b/src/Driver/Driver.vcxproj
index 58a21d3d..7c92f05b 100644
--- a/src/Driver/Driver.vcxproj
+++ b/src/Driver/Driver.vcxproj
@@ -192,6 +192,10 @@ BuildDriver.cmd -rebuild -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Cry
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="..\Crypto\blake2s.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSE2.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSE41.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSSE3.c" />
<ClCompile Include="..\Crypto\Camellia.c" />
<ClCompile Include="..\Crypto\chacha-xmm.c" />
<ClCompile Include="..\Crypto\chacha256.c" />
@@ -223,7 +227,6 @@ BuildDriver.cmd -rebuild -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Cry
<ClCompile Include="..\Common\Xts.c" />
<ClCompile Include="..\Crypto\Aeskey.c" />
<ClCompile Include="..\Crypto\Aestab.c" />
- <ClCompile Include="..\Crypto\Rmd160.c" />
<ClCompile Include="..\Crypto\Sha2.c" />
<ClCompile Include="..\Crypto\Twofish.c" />
<ClCompile Include="..\Crypto\Whirlpool.c" />
diff --git a/src/Driver/Driver.vcxproj.filters b/src/Driver/Driver.vcxproj.filters
index f260fb56..41d7a8c4 100644
--- a/src/Driver/Driver.vcxproj.filters
+++ b/src/Driver/Driver.vcxproj.filters
@@ -87,9 +87,6 @@
<ClCompile Include="..\Crypto\Aestab.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
- <ClCompile Include="..\Crypto\Rmd160.c">
- <Filter>Source Files\Crypto</Filter>
- </ClCompile>
<ClCompile Include="..\Crypto\Sha2.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
@@ -135,6 +132,18 @@
<ClCompile Include="..\Crypto\t1ha2_selfcheck.c">
<Filter>Source Files\Crypto</Filter>
</ClCompile>
+ <ClCompile Include="..\Crypto\blake2s.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSE2.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSE41.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSSE3.c">
+ <Filter>Source Files\Crypto</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\Crypto\Aes_hw_cpu.asm">
diff --git a/src/Driver/DumpFilter.c b/src/Driver/DumpFilter.c
index fc1c7d37..aa059d9d 100644
--- a/src/Driver/DumpFilter.c
+++ b/src/Driver/DumpFilter.c
@@ -18,7 +18,7 @@
static DriveFilterExtension *BootDriveFilterExtension = NULL;
static LARGE_INTEGER DumpPartitionOffset;
-static byte *WriteFilterBuffer = NULL;
+static uint8 *WriteFilterBuffer = NULL;
static SIZE_T WriteFilterBufferSize;
@@ -127,7 +127,7 @@ NTSTATUS DumpFilterEntry (PFILTER_EXTENSION filterExtension, PFILTER_INITIALIZAT
goto err;
}
- WriteFilterBufferSize = filterInitData->MaxPagesPerWrite * PAGE_SIZE;
+ WriteFilterBufferSize = ((SIZE_T)filterInitData->MaxPagesPerWrite) * PAGE_SIZE;
#ifdef _WIN64
highestAcceptableWriteBufferAddr.QuadPart = 0x7FFffffFFFFLL;
diff --git a/src/Driver/EncryptedIoQueue.c b/src/Driver/EncryptedIoQueue.c
index 6f1d3777..8c2e8a41 100644
--- a/src/Driver/EncryptedIoQueue.c
+++ b/src/Driver/EncryptedIoQueue.c
@@ -191,7 +191,7 @@ static NTSTATUS CompleteOriginalIrp (EncryptedIoQueueItem *item, NTSTATUS status
}
-static void AcquireFragmentBuffer (EncryptedIoQueue *queue, byte *buffer)
+static void AcquireFragmentBuffer (EncryptedIoQueue *queue, uint8 *buffer)
{
NTSTATUS status = STATUS_INVALID_PARAMETER;
@@ -209,7 +209,7 @@ static void AcquireFragmentBuffer (EncryptedIoQueue *queue, byte *buffer)
}
-static void ReleaseFragmentBuffer (EncryptedIoQueue *queue, byte *buffer)
+static void ReleaseFragmentBuffer (EncryptedIoQueue *queue, uint8 *buffer)
{
if (buffer == queue->FragmentBufferA)
{
@@ -227,8 +227,8 @@ static void ReleaseFragmentBuffer (EncryptedIoQueue *queue, byte *buffer)
BOOL
UpdateBuffer(
- byte* buffer,
- byte* secRegion,
+ uint8* buffer,
+ uint8* secRegion,
uint64 bufferDiskOffset,
uint32 bufferLength,
BOOL doUpadte
@@ -393,12 +393,12 @@ static VOID IoThreadProc (PVOID threadArg)
{
// Up to three subfragments may be required to handle a partially remapped fragment
int subFragment;
- byte *subFragmentData = request->Data;
+ uint8 *subFragmentData = request->Data;
for (subFragment = 0 ; subFragment < 3; ++subFragment)
{
LARGE_INTEGER subFragmentOffset;
- ULONG subFragmentLength;
+ ULONG subFragmentLength = 0;
subFragmentOffset.QuadPart = request->Offset.QuadPart;
switch (subFragment)
@@ -615,7 +615,7 @@ static VOID MainThreadProc (PVOID threadArg)
&& (item->OriginalLength & (ENCRYPTION_DATA_UNIT_SIZE - 1)) == 0
&& (item->OriginalOffset.QuadPart & (ENCRYPTION_DATA_UNIT_SIZE - 1)) != 0)
{
- byte *buffer;
+ uint8 *buffer;
ULONG alignedLength;
LARGE_INTEGER alignedOffset;
hResult = ULongAdd(item->OriginalLength, ENCRYPTION_DATA_UNIT_SIZE, &alignedLength);
@@ -775,9 +775,10 @@ static VOID MainThreadProc (PVOID threadArg)
while (dataRemaining > 0)
{
- BOOL isLastFragment = dataRemaining <= TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ ULONG queueFragmentSize = queue->FragmentSize;
+ BOOL isLastFragment = dataRemaining <= queueFragmentSize;
- ULONG dataFragmentLength = isLastFragment ? dataRemaining : TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ ULONG dataFragmentLength = isLastFragment ? dataRemaining : queueFragmentSize;
activeFragmentBuffer = (activeFragmentBuffer == queue->FragmentBufferA ? queue->FragmentBufferB : queue->FragmentBufferA);
InterlockedIncrement (&queue->IoThreadPendingRequestCount);
@@ -796,7 +797,7 @@ static VOID MainThreadProc (PVOID threadArg)
request->OrigDataBufferFragment = dataBuffer;
request->Length = dataFragmentLength;
- if (queue->IsFilterDevice)
+ if (queue->IsFilterDevice || queue->bSupportPartialEncryption)
{
if (queue->EncryptedAreaStart == -1 || queue->EncryptedAreaEnd == -1)
{
@@ -847,9 +848,9 @@ static VOID MainThreadProc (PVOID threadArg)
if (isLastFragment)
break;
- dataRemaining -= TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
- dataBuffer += TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
- fragmentOffset.QuadPart += TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ dataRemaining -= queueFragmentSize;
+ dataBuffer += queueFragmentSize;
+ fragmentOffset.QuadPart += queueFragmentSize;
}
}
}
@@ -971,7 +972,11 @@ NTSTATUS EncryptedIoQueueStart (EncryptedIoQueue *queue)
{
NTSTATUS status;
EncryptedIoQueueBuffer *buffer;
- int i;
+ int i, preallocatedIoRequestCount, preallocatedItemCount, fragmentSize;
+
+ preallocatedIoRequestCount = EncryptionIoRequestCount;
+ preallocatedItemCount = EncryptionItemCount;
+ fragmentSize = EncryptionFragmentSize;
queue->StartPending = TRUE;
queue->ThreadExitRequested = FALSE;
@@ -986,30 +991,84 @@ NTSTATUS EncryptedIoQueueStart (EncryptedIoQueue *queue)
KeInitializeEvent (&queue->PoolBufferFreeEvent, SynchronizationEvent, FALSE);
KeInitializeEvent (&queue->QueueResumedEvent, SynchronizationEvent, FALSE);
- queue->FragmentBufferA = TCalloc (TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE);
+retry_fragmentAllocate:
+ queue->FragmentBufferA = TCalloc (fragmentSize);
if (!queue->FragmentBufferA)
- goto noMemory;
+ {
+ if (fragmentSize > TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE)
+ {
+ fragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ goto retry_fragmentAllocate;
+ }
+ else
+ goto noMemory;
+ }
- queue->FragmentBufferB = TCalloc (TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE);
+ queue->FragmentBufferB = TCalloc (fragmentSize);
if (!queue->FragmentBufferB)
- goto noMemory;
-
- KeInitializeEvent (&queue->FragmentBufferAFreeEvent, SynchronizationEvent, TRUE);
- KeInitializeEvent (&queue->FragmentBufferBFreeEvent, SynchronizationEvent, TRUE);
+ {
+ if (fragmentSize > TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE)
+ {
+ fragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ TCfree (queue->FragmentBufferA);
+ queue->FragmentBufferA = NULL;
+ goto retry_fragmentAllocate;
+ }
+ else
+ goto noMemory;
+ }
queue->ReadAheadBufferValid = FALSE;
- queue->ReadAheadBuffer = TCalloc (TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE);
+ queue->ReadAheadBuffer = TCalloc (fragmentSize);
if (!queue->ReadAheadBuffer)
- goto noMemory;
+ {
+ if (fragmentSize > TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE)
+ {
+ fragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ TCfree (queue->FragmentBufferA);
+ TCfree (queue->FragmentBufferB);
+ queue->FragmentBufferA = NULL;
+ queue->FragmentBufferB = NULL;
+ goto retry_fragmentAllocate;
+ }
+ else
+ goto noMemory;
+ }
+
+ queue->FragmentSize = fragmentSize;
+
+ KeInitializeEvent (&queue->FragmentBufferAFreeEvent, SynchronizationEvent, TRUE);
+ KeInitializeEvent (&queue->FragmentBufferBFreeEvent, SynchronizationEvent, TRUE);
+retry_preallocated:
// Preallocate buffers
- for (i = 0; i < TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT; ++i)
+ for (i = 0; i < preallocatedIoRequestCount; ++i)
{
- if (i < TC_ENC_IO_QUEUE_PREALLOCATED_ITEM_COUNT && !GetPoolBuffer (queue, sizeof (EncryptedIoQueueItem)))
- goto noMemory;
+ if (i < preallocatedItemCount && !GetPoolBuffer (queue, sizeof (EncryptedIoQueueItem)))
+ {
+ if (preallocatedItemCount > TC_ENC_IO_QUEUE_PREALLOCATED_ITEM_COUNT)
+ {
+ preallocatedItemCount = TC_ENC_IO_QUEUE_PREALLOCATED_ITEM_COUNT;
+ preallocatedIoRequestCount = TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT;
+ FreePoolBuffers (queue);
+ goto retry_preallocated;
+ }
+ else
+ goto noMemory;
+ }
if (!GetPoolBuffer (queue, sizeof (EncryptedIoRequest)))
- goto noMemory;
+ {
+ if (preallocatedIoRequestCount > TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT)
+ {
+ preallocatedItemCount = TC_ENC_IO_QUEUE_PREALLOCATED_ITEM_COUNT;
+ preallocatedIoRequestCount = TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT;
+ FreePoolBuffers (queue);
+ goto retry_preallocated;
+ }
+ else
+ goto noMemory;
+ }
}
for (buffer = queue->FirstPoolBuffer; buffer != NULL; buffer = buffer->NextBuffer)
diff --git a/src/Driver/EncryptedIoQueue.h b/src/Driver/EncryptedIoQueue.h
index 184e1714..d4d580c9 100644
--- a/src/Driver/EncryptedIoQueue.h
+++ b/src/Driver/EncryptedIoQueue.h
@@ -24,6 +24,7 @@
#define TC_ENC_IO_QUEUE_PREALLOCATED_ITEM_COUNT 8
#define TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT 16
+#define TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_MAX_COUNT 8192
typedef struct EncryptedIoQueueBufferStruct
@@ -48,6 +49,7 @@ typedef struct
// File-handle-based IO
HANDLE HostFileHandle;
+ BOOL bSupportPartialEncryption;
int64 VirtualDeviceLength;
SECURITY_CLIENT_CONTEXT *SecurityClientContext;
@@ -81,8 +83,8 @@ typedef struct
KEVENT CompletionThreadQueueNotEmptyEvent;
// Fragment buffers
- byte *FragmentBufferA;
- byte *FragmentBufferB;
+ uint8 *FragmentBufferA;
+ uint8 *FragmentBufferB;
KEVENT FragmentBufferAFreeEvent;
KEVENT FragmentBufferBFreeEvent;
@@ -92,7 +94,7 @@ typedef struct
ULONG LastReadLength;
LARGE_INTEGER ReadAheadOffset;
ULONG ReadAheadLength;
- byte *ReadAheadBuffer;
+ uint8 *ReadAheadBuffer;
LARGE_INTEGER MaxReadAheadOffset;
LONG OutstandingIoCount;
@@ -117,10 +119,12 @@ typedef struct
LARGE_INTEGER LastPerformanceCounter;
#endif
- byte* SecRegionData;
+ uint8* SecRegionData;
SIZE_T SecRegionSize;
volatile BOOL ThreadBlockReadWrite;
+
+ int FragmentSize;
} EncryptedIoQueue;
@@ -149,8 +153,8 @@ typedef struct
ULONG Length;
int64 EncryptedOffset;
ULONG EncryptedLength;
- byte *Data;
- byte *OrigDataBufferFragment;
+ uint8 *Data;
+ uint8 *OrigDataBufferFragment;
LIST_ENTRY ListEntry;
LIST_ENTRY CompletionListEntry;
diff --git a/src/Driver/Fuse/Driver.make b/src/Driver/Fuse/Driver.make
index f58785b9..47f3c2cd 100644
--- a/src/Driver/Fuse/Driver.make
+++ b/src/Driver/Fuse/Driver.make
@@ -15,6 +15,6 @@ NAME := Driver
OBJS :=
OBJS += FuseService.o
-CXXFLAGS += $(shell pkg-config fuse --cflags)
+CXXFLAGS += $(shell $(PKG_CONFIG) $(VC_FUSE_PACKAGE) --cflags)
include $(BUILD_INC)/Makefile.inc
diff --git a/src/Driver/Fuse/FuseService.cpp b/src/Driver/Fuse/FuseService.cpp
index a2c769f8..5b12ba4d 100644
--- a/src/Driver/Fuse/FuseService.cpp
+++ b/src/Driver/Fuse/FuseService.cpp
@@ -10,7 +10,12 @@
code distribution packages.
*/
+#ifdef TC_OPENBSD
+#define FUSE_USE_VERSION 26
+#else
#define FUSE_USE_VERSION 25
+#endif
+
#include <errno.h>
#include <fcntl.h>
#include <fuse.h>
@@ -51,7 +56,11 @@ namespace VeraCrypt
return 0;
}
+#ifdef TC_OPENBSD
+ static void *fuse_service_init (struct fuse_conn_info *)
+#else
static void *fuse_service_init ()
+#endif
{
try
{
@@ -214,14 +223,14 @@ namespace VeraCrypt
SecureBuffer alignedBuffer (alignedSize);
FuseService::ReadVolumeSectors (alignedBuffer, alignedOffset);
- BufferPtr ((byte *) buf, size).CopyFrom (alignedBuffer.GetRange (offset % sectorSize, size));
+ BufferPtr ((uint8 *) buf, size).CopyFrom (alignedBuffer.GetRange (offset % sectorSize, size));
}
else
{
- FuseService::ReadVolumeSectors (BufferPtr ((byte *) buf, size), offset);
+ FuseService::ReadVolumeSectors (BufferPtr ((uint8 *) buf, size), offset);
}
}
- catch (MissingVolumeData)
+ catch (MissingVolumeData&)
{
return 0;
}
@@ -232,7 +241,7 @@ namespace VeraCrypt
if (strcmp (path, FuseService::GetControlPath()) == 0)
{
shared_ptr <Buffer> infoBuf = FuseService::GetVolumeInfo();
- BufferPtr outBuf ((byte *)buf, size);
+ BufferPtr outBuf ((uint8 *)buf, size);
if (offset >= (off_t) infoBuf->Size())
return 0;
@@ -284,7 +293,7 @@ namespace VeraCrypt
if (strcmp (path, FuseService::GetVolumeImagePath()) == 0)
{
- FuseService::WriteVolumeSectors (BufferPtr ((byte *) buf, size), offset);
+ FuseService::WriteVolumeSectors (BufferPtr ((uint8 *) buf, size), offset);
return size;
}
@@ -293,7 +302,7 @@ namespace VeraCrypt
if (FuseService::AuxDeviceInfoReceived())
return -EACCES;
- FuseService::ReceiveAuxDeviceInfo (ConstBufferPtr ((const byte *)buf, size));
+ FuseService::ReceiveAuxDeviceInfo (ConstBufferPtr ((const uint8 *)buf, size));
return size;
}
}
@@ -350,7 +359,7 @@ namespace VeraCrypt
{
throw;
}
- catch (std::bad_alloc)
+ catch (std::bad_alloc&)
{
return -ENOMEM;
}
@@ -575,7 +584,7 @@ namespace VeraCrypt
sigaction (SIGTERM, &action, nullptr);
// Wait for the exit of the main service
- byte buf[1];
+ uint8 buf[1];
if (read (SignalHandlerPipe->GetReadFD(), buf, sizeof (buf))) { } // Errors ignored
_exit (0);
@@ -583,7 +592,11 @@ namespace VeraCrypt
SignalHandlerPipe->GetWriteFD();
+#ifdef TC_OPENBSD
+ _exit (fuse_main (argc, argv, &fuse_service_oper, NULL));
+#else
_exit (fuse_main (argc, argv, &fuse_service_oper));
+#endif
}
VolumeInfo FuseService::OpenVolumeInfo;
diff --git a/src/Driver/Fuse/FuseService.h b/src/Driver/Fuse/FuseService.h
index 872cb368..d09a40db 100644
--- a/src/Driver/Fuse/FuseService.h
+++ b/src/Driver/Fuse/FuseService.h
@@ -38,7 +38,7 @@ namespace VeraCrypt
VolumeSlotNumber SlotNumber;
};
- friend class ExecFunctor;
+ friend struct ExecFunctor;
public:
static bool AuxDeviceInfoReceived () { return !OpenVolumeInfo.VirtualDevice.IsEmpty(); }
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 957853cd..96f60cdd 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -13,6 +13,8 @@
#include "TCdefs.h"
#include <ntddk.h>
+#include <initguid.h>
+#include <Ntddstor.h>
#include "Crypto.h"
#include "Fat.h"
#include "Tests.h"
@@ -133,6 +135,7 @@ BOOL CacheBootPim = FALSE;
BOOL NonAdminSystemFavoritesAccessDisabled = FALSE;
BOOL BlockSystemTrimCommand = FALSE;
BOOL AllowWindowsDefrag = FALSE;
+BOOL EraseKeysOnShutdown = TRUE; // by default, we erase encryption keys on system shutdown
static size_t EncryptionThreadPoolFreeCpuCountLimit = 0;
static BOOL SystemFavoriteVolumeDirty = FALSE;
static BOOL PagingFileCreationPrevented = FALSE;
@@ -142,16 +145,43 @@ static BOOL RamEncryptionActivated = FALSE;
static KeSaveExtendedProcessorStateFn KeSaveExtendedProcessorStatePtr = NULL;
static KeRestoreExtendedProcessorStateFn KeRestoreExtendedProcessorStatePtr = NULL;
static ExGetFirmwareEnvironmentVariableFn ExGetFirmwareEnvironmentVariablePtr = NULL;
+static KeQueryInterruptTimePreciseFn KeQueryInterruptTimePrecisePtr = NULL;
static KeAreAllApcsDisabledFn KeAreAllApcsDisabledPtr = NULL;
static KeSetSystemGroupAffinityThreadFn KeSetSystemGroupAffinityThreadPtr = NULL;
static KeQueryActiveGroupCountFn KeQueryActiveGroupCountPtr = NULL;
static KeQueryActiveProcessorCountExFn KeQueryActiveProcessorCountExPtr = NULL;
+int EncryptionIoRequestCount = 0;
+int EncryptionItemCount = 0;
+int EncryptionFragmentSize = 0;
POOL_TYPE ExDefaultNonPagedPoolType = NonPagedPool;
ULONG ExDefaultMdlProtection = 0;
PDEVICE_OBJECT VirtualVolumeDeviceObjects[MAX_MOUNTED_VOLUME_DRIVE_NUMBER + 1];
+BOOL AlignValue (ULONG ulValue, ULONG ulAlignment, ULONG *pulResult)
+{
+ BOOL bRet = FALSE;
+ HRESULT hr;
+ if (ulAlignment == 0)
+ {
+ *pulResult = ulValue;
+ bRet = TRUE;
+ }
+ else
+ {
+ ulAlignment -= 1;
+ hr = ULongAdd (ulValue, ulAlignment, &ulValue);
+ if (S_OK == hr)
+ {
+ *pulResult = ulValue & (~ulAlignment);
+ bRet = TRUE;
+ }
+ }
+
+ return bRet;
+}
+
BOOL IsUefiBoot ()
{
BOOL bStatus = FALSE;
@@ -186,7 +216,7 @@ BOOL IsUefiBoot ()
void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
{
LARGE_INTEGER iSeed, iSeed2;
- byte digest[WHIRLPOOL_DIGESTSIZE];
+ uint8 digest[WHIRLPOOL_DIGESTSIZE];
WHIRLPOOL_CTX tctx;
size_t count;
@@ -209,8 +239,17 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed)
iSeed = KeQueryPerformanceCounter (&iSeed2);
WHIRLPOOL_add ((unsigned char *) &(iSeed.QuadPart), sizeof(iSeed.QuadPart), &tctx);
WHIRLPOOL_add ((unsigned char *) &(iSeed2.QuadPart), sizeof(iSeed2.QuadPart), &tctx);
- iSeed.QuadPart = KeQueryInterruptTime ();
- WHIRLPOOL_add ((unsigned char *) &(iSeed.QuadPart), sizeof(iSeed.QuadPart), &tctx);
+ if (KeQueryInterruptTimePrecisePtr)
+ {
+ iSeed.QuadPart = KeQueryInterruptTimePrecisePtr (&iSeed2.QuadPart);
+ WHIRLPOOL_add ((unsigned char *) &(iSeed.QuadPart), sizeof(iSeed.QuadPart), &tctx);
+ WHIRLPOOL_add ((unsigned char *) &(iSeed2.QuadPart), sizeof(iSeed2.QuadPart), &tctx);
+ }
+ else
+ {
+ iSeed.QuadPart = KeQueryInterruptTime ();
+ WHIRLPOOL_add ((unsigned char *) &(iSeed.QuadPart), sizeof(iSeed.QuadPart), &tctx);
+ }
/* use JitterEntropy library to get good quality random bytes based on CPU timing jitter */
if (0 == jent_entropy_init ())
@@ -310,6 +349,14 @@ NTSTATUS DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
ExGetFirmwareEnvironmentVariablePtr = (ExGetFirmwareEnvironmentVariableFn) MmGetSystemRoutineAddress(&funcName);
}
+ // KeQueryInterruptTimePrecise is available starting from Windows 8.1
+ if ((OsMajorVersion > 6) || (OsMajorVersion == 6 && OsMinorVersion >= 3))
+ {
+ UNICODE_STRING funcName;
+ RtlInitUnicodeString(&funcName, L"KeQueryInterruptTimePrecise");
+ KeQueryInterruptTimePrecisePtr = (KeQueryInterruptTimePreciseFn) MmGetSystemRoutineAddress(&funcName);
+ }
+
// Load dump filter if the main driver is already loaded
if (NT_SUCCESS (TCDeviceIoControl (NT_ROOT_PREFIX, TC_IOCTL_GET_DRIVER_VERSION, NULL, 0, &version, sizeof (version))))
return DumpFilterEntry ((PFILTER_EXTENSION) DriverObject, (PFILTER_INITIALIZATION_DATA) RegistryPath);
@@ -986,8 +1033,8 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
outputBuffer->Geometry.TracksPerCylinder = Extension->TracksPerCylinder;
outputBuffer->Geometry.SectorsPerTrack = Extension->SectorsPerTrack;
outputBuffer->Geometry.BytesPerSector = Extension->BytesPerSector;
- /* add one sector to DiskLength since our partition size is DiskLength and its offset if BytesPerSector */
- outputBuffer->DiskSize.QuadPart = Extension->DiskLength + Extension->BytesPerSector;
+ // Add 1MB to the disk size to emulate the geometry of a real MBR disk
+ outputBuffer->DiskSize.QuadPart = Extension->DiskLength + BYTES_PER_MB;
if (bFullBuffer)
{
@@ -1258,7 +1305,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
outputBuffer->BootIndicator = FALSE;
outputBuffer->RecognizedPartition = TRUE;
outputBuffer->RewritePartition = FALSE;
- outputBuffer->StartingOffset.QuadPart = Extension->BytesPerSector;
+ outputBuffer->StartingOffset.QuadPart = BYTES_PER_MB; // Set offset to 1MB to emulate the partition offset on a real MBR disk
outputBuffer->PartitionLength.QuadPart= Extension->DiskLength;
outputBuffer->PartitionNumber = 1;
outputBuffer->HiddenSectors = 0;
@@ -1275,7 +1322,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
outputBuffer->PartitionStyle = PARTITION_STYLE_MBR;
outputBuffer->RewritePartition = FALSE;
- outputBuffer->StartingOffset.QuadPart = Extension->BytesPerSector;
+ outputBuffer->StartingOffset.QuadPart = BYTES_PER_MB; // Set offset to 1MB to emulate the partition offset on a real MBR disk
outputBuffer->PartitionLength.QuadPart= Extension->DiskLength;
outputBuffer->PartitionNumber = 1;
outputBuffer->Mbr.PartitionType = Extension->PartitionType;
@@ -1303,7 +1350,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
outputBuffer->PartitionEntry->BootIndicator = FALSE;
outputBuffer->PartitionEntry->RecognizedPartition = TRUE;
outputBuffer->PartitionEntry->RewritePartition = FALSE;
- outputBuffer->PartitionEntry->StartingOffset.QuadPart = Extension->BytesPerSector;
+ outputBuffer->PartitionEntry->StartingOffset.QuadPart = BYTES_PER_MB; // Set offset to 1MB to emulate the partition offset on a real MBR disk
outputBuffer->PartitionEntry->PartitionLength.QuadPart = Extension->DiskLength;
outputBuffer->PartitionEntry->PartitionNumber = 1;
outputBuffer->PartitionEntry->HiddenSectors = 0;
@@ -1339,7 +1386,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
outputBuffer->PartitionEntry->Mbr.BootIndicator = FALSE;
outputBuffer->PartitionEntry->Mbr.RecognizedPartition = TRUE;
outputBuffer->PartitionEntry->RewritePartition = FALSE;
- outputBuffer->PartitionEntry->StartingOffset.QuadPart = Extension->BytesPerSector;
+ outputBuffer->PartitionEntry->StartingOffset.QuadPart = BYTES_PER_MB; // Set offset to 1MB to emulate the partition offset on a real MBR disk
outputBuffer->PartitionEntry->PartitionLength.QuadPart = Extension->DiskLength;
outputBuffer->PartitionEntry->PartitionNumber = 1;
outputBuffer->PartitionEntry->Mbr.HiddenSectors = 0;
@@ -1500,7 +1547,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
// of the underlaying physical disk and we report a single extent
extents->NumberOfDiskExtents = 1;
extents->Extents[0].DiskNumber = Extension->DeviceNumber;
- extents->Extents[0].StartingOffset.QuadPart = Extension->BytesPerSector;
+ extents->Extents[0].StartingOffset.QuadPart = BYTES_PER_MB; // Set offset to 1MB to emulate the partition offset on a real MBR disk
extents->Extents[0].ExtentLength.QuadPart = Extension->DiskLength;
}
else
@@ -1528,8 +1575,8 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
capacity->Version = sizeof (STORAGE_READ_CAPACITY);
capacity->Size = sizeof (STORAGE_READ_CAPACITY);
capacity->BlockLength = Extension->BytesPerSector;
- capacity->NumberOfBlocks.QuadPart = (Extension->DiskLength / Extension->BytesPerSector) + 1;
- capacity->DiskLength.QuadPart = Extension->DiskLength + Extension->BytesPerSector;
+ capacity->DiskLength.QuadPart = Extension->DiskLength + BYTES_PER_MB; // Add 1MB to the disk size to emulate the geometry of a real MBR disk
+ capacity->NumberOfBlocks.QuadPart = capacity->DiskLength.QuadPart / capacity->BlockLength;
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = sizeof (STORAGE_READ_CAPACITY);
@@ -1688,7 +1735,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
ULONG ulNewInputLength = 0;
BOOL bForwardIoctl = FALSE;
- if (inputLength >= minSizeGeneric && inputLength >= minSizedataSet && inputLength >= minSizeParameter)
+ if (((ULONGLONG) inputLength) >= minSizeGeneric && ((ULONGLONG) inputLength) >= minSizedataSet && ((ULONGLONG) inputLength) >= minSizeParameter)
{
if (bEntireSet)
{
@@ -1700,36 +1747,53 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
}
else
{
- DWORD dwDataSetOffset = ALIGN_VALUE (inputLength, sizeof(DEVICE_DATA_SET_RANGE));
+ DWORD dwDataSetOffset;
DWORD dwDataSetLength = sizeof(DEVICE_DATA_SET_RANGE);
- Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE set. Setting data range to all volume.\n");
-
- ulNewInputLength = dwDataSetOffset + dwDataSetLength;
- pNewSetAttrs = (PDEVICE_MANAGE_DATA_SET_ATTRIBUTES) TCalloc (ulNewInputLength);
- if (pNewSetAttrs)
+ if (AlignValue (inputLength, sizeof(DEVICE_DATA_SET_RANGE), &dwDataSetOffset))
{
- PDEVICE_DATA_SET_RANGE pRange = (PDEVICE_DATA_SET_RANGE) (((unsigned char*) pNewSetAttrs) + dwDataSetOffset);
+ Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE set. Setting data range to all volume.\n");
+
+ if (S_OK == ULongAdd(dwDataSetOffset, dwDataSetLength, &ulNewInputLength))
+ {
+ pNewSetAttrs = (PDEVICE_MANAGE_DATA_SET_ATTRIBUTES) TCalloc (ulNewInputLength);
+ if (pNewSetAttrs)
+ {
+ PDEVICE_DATA_SET_RANGE pRange = (PDEVICE_DATA_SET_RANGE) (((unsigned char*) pNewSetAttrs) + dwDataSetOffset);
- memcpy (pNewSetAttrs, pInputAttrs, inputLength);
+ memcpy (pNewSetAttrs, pInputAttrs, inputLength);
- pRange->StartingOffset = (ULONGLONG) Extension->cryptoInfo->hiddenVolume ? Extension->cryptoInfo->hiddenVolumeOffset : Extension->cryptoInfo->volDataAreaOffset;
- pRange->LengthInBytes = Extension->DiskLength;
+ pRange->StartingOffset = (ULONGLONG) Extension->cryptoInfo->hiddenVolume ? Extension->cryptoInfo->hiddenVolumeOffset : Extension->cryptoInfo->volDataAreaOffset;
+ pRange->LengthInBytes = Extension->DiskLength;
- pNewSetAttrs->Size = sizeof(DEVICE_MANAGE_DATA_SET_ATTRIBUTES);
- pNewSetAttrs->Action = action;
- pNewSetAttrs->Flags = pInputAttrs->Flags & (~DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE);
- pNewSetAttrs->ParameterBlockOffset = pInputAttrs->ParameterBlockOffset;
- pNewSetAttrs->ParameterBlockLength = pInputAttrs->ParameterBlockLength;
- pNewSetAttrs->DataSetRangesOffset = dwDataSetOffset;
- pNewSetAttrs->DataSetRangesLength = dwDataSetLength;
+ pNewSetAttrs->Size = sizeof(DEVICE_MANAGE_DATA_SET_ATTRIBUTES);
+ pNewSetAttrs->Action = action;
+ pNewSetAttrs->Flags = pInputAttrs->Flags & (~DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE);
+ pNewSetAttrs->ParameterBlockOffset = pInputAttrs->ParameterBlockOffset;
+ pNewSetAttrs->ParameterBlockLength = pInputAttrs->ParameterBlockLength;
+ pNewSetAttrs->DataSetRangesOffset = dwDataSetOffset;
+ pNewSetAttrs->DataSetRangesLength = dwDataSetLength;
- bForwardIoctl = TRUE;
+ bForwardIoctl = TRUE;
+ }
+ else
+ {
+ Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - Failed to allocate memory.\n");
+ Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
+ Irp->IoStatus.Information = 0;
+ }
+ }
+ else
+ {
+ Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE set but data range length computation overflowed.\n");
+ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
+ Irp->IoStatus.Information = 0;
+ }
}
else
{
- Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - Failed to allocate memory.\n");
- Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
+ Dump ("ProcessVolumeDeviceControlIrp: IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES - DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE set but data set offset computation overflowed.\n");
+ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
}
}
@@ -1895,7 +1959,7 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
switch (irpSp->Parameters.DeviceIoControl.IoControlCode)
{
case TC_IOCTL_GET_DRIVER_VERSION:
- case TC_IOCTL_LEGACY_GET_DRIVER_VERSION:
+
if (ValidateIOBufferSize (Irp, sizeof (LONG), ValidateOutput))
{
LONG tmp = VERSION_NUM;
@@ -2006,7 +2070,7 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
if (opentest->bDetectTCBootLoader || opentest->DetectFilesystem || opentest->bComputeVolumeIDs)
{
- byte *readBuffer = TCalloc (TC_MAX_VOLUME_SECTOR_SIZE);
+ uint8 *readBuffer = TCalloc (TC_MAX_VOLUME_SECTOR_SIZE);
if (!readBuffer)
{
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
@@ -2169,7 +2233,7 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
if (NT_SUCCESS (ntStatus))
{
- byte *readBuffer = TCalloc (TC_MAX_VOLUME_SECTOR_SIZE);
+ uint8 *readBuffer = TCalloc (TC_MAX_VOLUME_SECTOR_SIZE);
if (!readBuffer)
{
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -2329,7 +2393,6 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
list->volumeType[ListExtension->nDosDriveNo] = PROP_VOL_TYPE_OUTER; // Normal/outer volume (hidden volume protected)
else
list->volumeType[ListExtension->nDosDriveNo] = PROP_VOL_TYPE_NORMAL; // Normal volume
- list->truecryptMode[ListExtension->nDosDriveNo] = ListExtension->cryptoInfo->bTrueCryptMode;
}
}
@@ -2338,21 +2401,6 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
}
break;
- case TC_IOCTL_LEGACY_GET_MOUNTED_VOLUMES:
- if (ValidateIOBufferSize (Irp, sizeof (uint32), ValidateOutput))
- {
- // Prevent the user from downgrading to versions lower than 5.0 by faking mounted volumes.
- // The user could render the system unbootable by downgrading when boot encryption
- // is active or being set up.
-
- memset (Irp->AssociatedIrp.SystemBuffer, 0, irpSp->Parameters.DeviceIoControl.OutputBufferLength);
- *(uint32 *) Irp->AssociatedIrp.SystemBuffer = 0xffffFFFF;
-
- Irp->IoStatus.Status = STATUS_SUCCESS;
- Irp->IoStatus.Information = irpSp->Parameters.DeviceIoControl.OutputBufferLength;
- }
- break;
-
case TC_IOCTL_GET_VOLUME_PROPERTIES:
if (ValidateIOBufferSize (Irp, sizeof (VOLUME_PROPERTIES_STRUCT), ValidateInputOutput))
{
@@ -2628,7 +2676,6 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
|| mount->pkcs5_prf < 0 || mount->pkcs5_prf > LAST_PRF_ID
|| mount->VolumePim < -1 || mount->VolumePim == INT_MAX
|| mount->ProtectedHidVolPkcs5Prf < 0 || mount->ProtectedHidVolPkcs5Prf > LAST_PRF_ID
- || (mount->bTrueCryptMode != FALSE && mount->bTrueCryptMode != TRUE)
)
{
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
@@ -2646,7 +2693,6 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
burn (&mount->ProtectedHidVolPassword, sizeof (mount->ProtectedHidVolPassword));
burn (&mount->pkcs5_prf, sizeof (mount->pkcs5_prf));
burn (&mount->VolumePim, sizeof (mount->VolumePim));
- burn (&mount->bTrueCryptMode, sizeof (mount->bTrueCryptMode));
burn (&mount->ProtectedHidVolPkcs5Prf, sizeof (mount->ProtectedHidVolPkcs5Prf));
burn (&mount->ProtectedHidVolPim, sizeof (mount->ProtectedHidVolPim));
}
@@ -2841,6 +2887,18 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
}
break;
+ case VC_IOCTL_ENCRYPTION_QUEUE_PARAMS:
+ if (ValidateIOBufferSize (Irp, sizeof (EncryptionQueueParameters), ValidateOutput))
+ {
+ EncryptionQueueParameters* pParams = (EncryptionQueueParameters*) Irp->AssociatedIrp.SystemBuffer;
+ pParams->EncryptionFragmentSize = EncryptionFragmentSize;
+ pParams->EncryptionIoRequestCount = EncryptionIoRequestCount;
+ pParams->EncryptionItemCount = EncryptionItemCount;
+ Irp->IoStatus.Information = sizeof (EncryptionQueueParameters);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ }
+ break;
+
default:
return TCCompleteIrp (Irp, STATUS_INVALID_DEVICE_REQUEST, 0);
}
@@ -3116,6 +3174,21 @@ VOID VolumeThreadProc (PVOID Context)
Extension->Queue.HostFileHandle = Extension->hDeviceFile;
Extension->Queue.VirtualDeviceLength = Extension->DiskLength;
Extension->Queue.MaxReadAheadOffset.QuadPart = Extension->HostLength;
+ if (bDevice && pThreadBlock->mount->bPartitionInInactiveSysEncScope
+ && (!Extension->cryptoInfo->hiddenVolume)
+ && (Extension->cryptoInfo->EncryptedAreaLength.Value != Extension->cryptoInfo->VolumeSize.Value)
+ )
+ {
+ // Support partial encryption only in the case of system encryption
+ Extension->Queue.EncryptedAreaStart = 0;
+ Extension->Queue.EncryptedAreaEnd = Extension->cryptoInfo->EncryptedAreaLength.Value - 1;
+ if (Extension->Queue.CryptoInfo->EncryptedAreaLength.Value == 0)
+ {
+ Extension->Queue.EncryptedAreaStart = -1;
+ Extension->Queue.EncryptedAreaEnd = -1;
+ }
+ Extension->Queue.bSupportPartialEncryption = TRUE;
+ }
if (Extension->SecurityClientContextValid)
Extension->Queue.SecurityClientContext = &Extension->SecurityClientContext;
@@ -3251,6 +3324,7 @@ LPWSTR TCTranslateCode (ULONG ulCode)
TC_CASE_RET_NAME (VC_IOCTL_GET_DRIVE_GEOMETRY_EX);
TC_CASE_RET_NAME (VC_IOCTL_EMERGENCY_CLEAR_ALL_KEYS);
TC_CASE_RET_NAME (VC_IOCTL_IS_RAM_ENCRYPTION_ENABLED);
+ TC_CASE_RET_NAME (VC_IOCTL_ENCRYPTION_QUEUE_PARAMS);
TC_CASE_RET_NAME (IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS);
@@ -3379,6 +3453,8 @@ LPWSTR TCTranslateCode (ULONG ulCode)
return (LPWSTR) _T ("IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT");
else if (ulCode == IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES)
return (LPWSTR) _T ("IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES");
+ else if (ulCode == IOCTL_DISK_GROW_PARTITION)
+ return (LPWSTR) _T ("IOCTL_DISK_GROW_PARTITION");
else if (ulCode == IRP_MJ_READ)
return (LPWSTR) _T ("IRP_MJ_READ");
else if (ulCode == IRP_MJ_WRITE)
@@ -3641,7 +3717,7 @@ NTSTATUS ProbeRealDriveSize (PDEVICE_OBJECT driveDeviceObject, LARGE_INTEGER *dr
NTSTATUS status;
LARGE_INTEGER sysLength;
LARGE_INTEGER offset;
- byte *sectorBuffer;
+ uint8 *sectorBuffer;
ULONGLONG startTime;
ULONG sectorSize;
@@ -4568,7 +4644,7 @@ void EnsureNullTerminatedString (wchar_t *str, size_t maxSizeInBytes)
void *AllocateMemoryWithTimeout (size_t size, int retryDelay, int timeout)
{
LARGE_INTEGER waitInterval;
- waitInterval.QuadPart = retryDelay * -10000;
+ waitInterval.QuadPart = ((LONGLONG)retryDelay) * -10000;
ASSERT (KeGetCurrentIrql() <= APC_LEVEL);
ASSERT (retryDelay > 0 && retryDelay <= timeout);
@@ -4751,6 +4827,65 @@ NTSTATUS ReadRegistryConfigFlags (BOOL driverEntry)
TCfree (data);
}
+ if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, VC_ENCRYPTION_IO_REQUEST_COUNT, &data)))
+ {
+ if (data->Type == REG_DWORD)
+ EncryptionIoRequestCount = *(uint32 *) data->Data;
+
+ TCfree (data);
+ }
+
+ if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, VC_ENCRYPTION_ITEM_COUNT, &data)))
+ {
+ if (data->Type == REG_DWORD)
+ EncryptionItemCount = *(uint32 *) data->Data;
+
+ TCfree (data);
+ }
+
+ if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, VC_ENCRYPTION_FRAGMENT_SIZE, &data)))
+ {
+ if (data->Type == REG_DWORD)
+ EncryptionFragmentSize = *(uint32 *) data->Data;
+
+ TCfree (data);
+ }
+
+ if (driverEntry)
+ {
+ if (EncryptionIoRequestCount < TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT)
+ EncryptionIoRequestCount = TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_COUNT;
+ else if (EncryptionIoRequestCount > TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_MAX_COUNT)
+ EncryptionIoRequestCount = TC_ENC_IO_QUEUE_PREALLOCATED_IO_REQUEST_MAX_COUNT;
+
+ if ((EncryptionItemCount == 0) || (EncryptionItemCount > (EncryptionIoRequestCount / 2)))
+ EncryptionItemCount = EncryptionIoRequestCount / 2;
+
+ /* EncryptionFragmentSize value in registry is expressed in KiB */
+ /* Maximum allowed value for EncryptionFragmentSize is 2048 KiB */
+ EncryptionFragmentSize *= 1024;
+ if (EncryptionFragmentSize == 0)
+ EncryptionFragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+ else if (EncryptionFragmentSize > (8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE))
+ EncryptionFragmentSize = 8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE;
+
+
+ }
+
+ if (driverEntry && NT_SUCCESS (TCReadRegistryKey (&name, VC_ERASE_KEYS_SHUTDOWN, &data)))
+ {
+ if (data->Type == REG_DWORD)
+ {
+ if (*((uint32 *) data->Data))
+ EraseKeysOnShutdown = TRUE;
+ else
+ EraseKeysOnShutdown = FALSE;
+ }
+
+ TCfree (data);
+ }
+
+
return status;
}
@@ -4784,7 +4919,7 @@ NTSTATUS ZeroUnreadableSectors (PDEVICE_OBJECT deviceObject, LARGE_INTEGER start
NTSTATUS status;
ULONG sectorSize;
ULONG sectorCount;
- byte *sectorBuffer = NULL;
+ uint8 *sectorBuffer = NULL;
*zeroedSectorCount = 0;
@@ -4822,7 +4957,7 @@ err:
}
-NTSTATUS ReadDeviceSkipUnreadableSectors (PDEVICE_OBJECT deviceObject, byte *buffer, LARGE_INTEGER startOffset, ULONG size, uint64 *badSectorCount)
+NTSTATUS ReadDeviceSkipUnreadableSectors (PDEVICE_OBJECT deviceObject, uint8 *buffer, LARGE_INTEGER startOffset, ULONG size, uint64 *badSectorCount)
{
NTSTATUS status;
ULONG sectorSize;
@@ -4940,7 +5075,7 @@ BOOL IsOSAtLeast (OSVersionEnum reqMinOS)
>= (major << 16 | minor << 8));
}
-NTSTATUS NTAPI KeSaveExtendedProcessorState (
+NTSTATUS NTAPI KeSaveExtendedProcessorStateVC (
__in ULONG64 Mask,
PXSTATE_SAVE XStateSave
)
@@ -4955,7 +5090,7 @@ NTSTATUS NTAPI KeSaveExtendedProcessorState (
}
}
-VOID NTAPI KeRestoreExtendedProcessorState (
+VOID NTAPI KeRestoreExtendedProcessorStateVC (
PXSTATE_SAVE XStateSave
)
{
diff --git a/src/Driver/Ntdriver.h b/src/Driver/Ntdriver.h
index 47ae49f7..3995ffdf 100644
--- a/src/Driver/Ntdriver.h
+++ b/src/Driver/Ntdriver.h
@@ -125,6 +125,10 @@ extern BOOL CacheBootPassword;
extern BOOL CacheBootPim;
extern BOOL BlockSystemTrimCommand;
extern BOOL AllowWindowsDefrag;
+extern int EncryptionIoRequestCount;
+extern int EncryptionItemCount;
+extern int EncryptionFragmentSize;
+extern BOOL EraseKeysOnShutdown;
/* Helper macro returning x seconds in units of 100 nanoseconds */
#define WAIT_SECONDS(x) ((x)*10000000)
@@ -187,7 +191,7 @@ NTSTATUS WriteRegistryConfigFlags (uint32 flags);
BOOL ValidateIOBufferSize (PIRP irp, size_t requiredBufferSize, ValidateIOBufferSizeType type);
NTSTATUS GetDeviceSectorSize (PDEVICE_OBJECT deviceObject, ULONG *bytesPerSector);
NTSTATUS ZeroUnreadableSectors (PDEVICE_OBJECT deviceObject, LARGE_INTEGER startOffset, ULONG size, uint64 *zeroedSectorCount);
-NTSTATUS ReadDeviceSkipUnreadableSectors (PDEVICE_OBJECT deviceObject, byte *buffer, LARGE_INTEGER startOffset, ULONG size, uint64 *badSectorCount);
+NTSTATUS ReadDeviceSkipUnreadableSectors (PDEVICE_OBJECT deviceObject, uint8 *buffer, LARGE_INTEGER startOffset, ULONG size, uint64 *badSectorCount);
BOOL IsVolumeAccessibleByCurrentUser (PEXTENSION volumeDeviceExtension);
void GetElapsedTimeInit (LARGE_INTEGER *lastPerfCounter);
int64 GetElapsedTime (LARGE_INTEGER *lastPerfCounter);
diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c
index f9e11d3d..c26fcebf 100644
--- a/src/Driver/Ntvol.c
+++ b/src/Driver/Ntvol.c
@@ -43,14 +43,14 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
PWSTR pwszMountVolume,
BOOL bRawDevice)
{
- FILE_STANDARD_INFORMATION FileStandardInfo;
+ FILE_STANDARD_INFORMATION FileStandardInfo = { 0 };
FILE_BASIC_INFORMATION FileBasicInfo;
OBJECT_ATTRIBUTES oaFileAttributes;
UNICODE_STRING FullFileName;
IO_STATUS_BLOCK IoStatusBlock;
PCRYPTO_INFO cryptoInfoPtr = NULL;
PCRYPTO_INFO tmpCryptoInfo = NULL;
- LARGE_INTEGER lDiskLength;
+ LARGE_INTEGER lDiskLength = { 0 };
__int64 partitionStartingOffset = 0;
int volumeType;
char *readBuffer = 0;
@@ -58,6 +58,8 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
BOOL forceAccessCheck = !bRawDevice;
BOOL disableBuffering = TRUE;
BOOL exclusiveAccess = mount->bExclusiveAccess;
+ /* when mounting with hidden volume protection, we cache the passwords after both outer and hidden volumes are mounted successfully*/
+ BOOL bAutoCachePassword = mount->bProtectHiddenVolume? FALSE : mount->bCache;
Extension->pfoDeviceFile = NULL;
Extension->hDeviceFile = NULL;
@@ -86,6 +88,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
}
mount->VolumeMountedReadOnlyAfterDeviceWriteProtected = FALSE;
+ mount->VolumeMountedReadOnlyAfterPartialSysEnc = FALSE;
// If we are opening a device, query its size first
if (bRawDevice)
@@ -95,7 +98,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
LARGE_INTEGER diskLengthInfo;
DISK_GEOMETRY_EX dg;
STORAGE_PROPERTY_QUERY storagePropertyQuery = {0};
- byte* dgBuffer;
+ uint8* dgBuffer;
STORAGE_DEVICE_NUMBER storageDeviceNumber;
ntStatus = IoGetDeviceObjectPointer (&FullFileName,
@@ -484,7 +487,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
// Header of a volume that is not within the scope of system encryption, or
// header of a system hidden volume (containing a hidden OS)
- LARGE_INTEGER headerOffset;
+ LARGE_INTEGER headerOffset = {0};
if (mount->UseBackupHeader && lDiskLength.QuadPart <= TC_TOTAL_VOLUME_HEADERS_SIZE)
continue;
@@ -602,26 +605,24 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
{
mount->nReturnCode = ReadVolumeHeaderWCache (
FALSE,
- mount->bCache,
+ bAutoCachePassword,
mount->bCachePim,
readBuffer,
&mount->ProtectedHidVolPassword,
mount->ProtectedHidVolPkcs5Prf,
mount->ProtectedHidVolPim,
- mount->bTrueCryptMode,
&tmpCryptoInfo);
}
else
{
mount->nReturnCode = ReadVolumeHeaderWCache (
mount->bPartitionInInactiveSysEncScope && volumeType == TC_VOLUME_TYPE_NORMAL,
- mount->bCache,
+ bAutoCachePassword,
mount->bCachePim,
readBuffer,
&mount->VolumePassword,
mount->pkcs5_prf,
mount->VolumePim,
- mount->bTrueCryptMode,
&Extension->cryptoInfo);
}
@@ -677,10 +678,9 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
if (Extension->cryptoInfo->EncryptedAreaLength.Value != Extension->cryptoInfo->VolumeSize.Value)
{
- // Partial encryption is not supported for volumes mounted as regular
- mount->nReturnCode = ERR_ENCRYPTION_NOT_COMPLETED;
- ntStatus = STATUS_SUCCESS;
- goto error;
+ // mount as readonly in case of partial system encryption
+ Extension->bReadOnly = mount->bMountReadOnly = TRUE;
+ mount->VolumeMountedReadOnlyAfterPartialSysEnc = TRUE;
}
}
else if (Extension->cryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC)
@@ -798,8 +798,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
Extension->TracksPerCylinder = 1;
Extension->SectorsPerTrack = 1;
Extension->BytesPerSector = Extension->cryptoInfo->SectorSize;
- // Add extra sector since our virtual partition starts at Extension->BytesPerSector and not 0
- Extension->NumberOfCylinders = (Extension->DiskLength / Extension->BytesPerSector) + 1;
+ Extension->NumberOfCylinders = Extension->DiskLength / Extension->BytesPerSector;
Extension->PartitionType = 0;
Extension->bRawDevice = bRawDevice;
@@ -826,6 +825,13 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
// decrypt the hidden volume header.
if (!(volumeType == TC_VOLUME_TYPE_NORMAL && mount->bProtectHiddenVolume))
{
+ /* in case of mounting with hidden volume protection, we cache both passwords manually after bother outer and hidden volumes are mounted*/
+ if (mount->bProtectHiddenVolume && mount->bCache)
+ {
+ AddPasswordToCache(&mount->VolumePassword, mount->VolumePim, mount->bCachePim);
+ AddPasswordToCache(&mount->ProtectedHidVolPassword, mount->ProtectedHidVolPim, mount->bCachePim);
+ }
+
TCfree (readBuffer);
if (tmpCryptoInfo != NULL)
diff --git a/src/Driver/VolumeFilter.c b/src/Driver/VolumeFilter.c
index a3d323be..29d02673 100644
--- a/src/Driver/VolumeFilter.c
+++ b/src/Driver/VolumeFilter.c
@@ -25,7 +25,7 @@ uint32 HiddenSysLeakProtectionCount = 0;
NTSTATUS VolumeFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
{
- VolumeFilterExtension *Extension;
+ VolumeFilterExtension *Extension = NULL;
NTSTATUS status;
PDEVICE_OBJECT filterDeviceObject = NULL;
PDEVICE_OBJECT attachedDeviceObject;
@@ -72,7 +72,7 @@ NTSTATUS VolumeFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
err:
if (filterDeviceObject)
{
- if (Extension->LowerDeviceObject)
+ if (Extension && Extension->LowerDeviceObject)
IoDetachDevice (Extension->LowerDeviceObject);
IoDeleteDevice (filterDeviceObject);
@@ -125,6 +125,32 @@ static NTSTATUS OnStartDeviceCompleted (PDEVICE_OBJECT filterDeviceObject, PIRP
return STATUS_CONTINUE_COMPLETION;
}
+static BOOL IsSystemVolumePartition (VolumeFilterExtension *Extension)
+{
+ NTSTATUS status;
+ BOOL bRet = FALSE;
+ DriveFilterExtension *bootDriveExtension = GetBootDriveFilterExtension();
+ STORAGE_DEVICE_NUMBER storageDeviceNumber;
+
+ if (!bootDriveExtension->SystemStorageDeviceNumberValid)
+ TC_BUG_CHECK (STATUS_INVALID_PARAMETER);
+
+ status = SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &storageDeviceNumber, sizeof (storageDeviceNumber));
+
+ if (NT_SUCCESS (status) && bootDriveExtension->SystemStorageDeviceNumber == storageDeviceNumber.DeviceNumber)
+ {
+ PARTITION_INFORMATION_EX partition;
+ status = SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &partition, sizeof (partition));
+
+ if (NT_SUCCESS (status) && partition.StartingOffset.QuadPart == bootDriveExtension->ConfiguredEncryptedAreaStart)
+ {
+ bRet = TRUE;
+ }
+ }
+
+ return bRet;
+}
+
static NTSTATUS DispatchControl (PDEVICE_OBJECT DeviceObject, PIRP Irp, VolumeFilterExtension *Extension, PIO_STACK_LOCATION irpSp)
{
@@ -139,25 +165,10 @@ static NTSTATUS DispatchControl (PDEVICE_OBJECT DeviceObject, PIRP Irp, VolumeFi
case IOCTL_DISK_IS_WRITABLE:
{
// All volumes except the system volume must be read-only
-
- DriveFilterExtension *bootDriveExtension = GetBootDriveFilterExtension();
- STORAGE_DEVICE_NUMBER storageDeviceNumber;
-
- if (!bootDriveExtension->SystemStorageDeviceNumberValid)
- TC_BUG_CHECK (STATUS_INVALID_PARAMETER);
-
- status = SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, &storageDeviceNumber, sizeof (storageDeviceNumber));
-
- if (NT_SUCCESS (status) && bootDriveExtension->SystemStorageDeviceNumber == storageDeviceNumber.DeviceNumber)
+ if (IsSystemVolumePartition(Extension))
{
- PARTITION_INFORMATION_EX partition;
- status = SendDeviceIoControlRequest (Extension->LowerDeviceObject, IOCTL_DISK_GET_PARTITION_INFO_EX, NULL, 0, &partition, sizeof (partition));
-
- if (NT_SUCCESS (status) && partition.StartingOffset.QuadPart == bootDriveExtension->ConfiguredEncryptedAreaStart)
- {
- IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
- return TCCompleteDiskIrp (Irp, STATUS_SUCCESS, 0);
- }
+ IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
+ return TCCompleteDiskIrp (Irp, STATUS_SUCCESS, 0);
}
IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
@@ -194,6 +205,15 @@ static NTSTATUS DispatchControl (PDEVICE_OBJECT DeviceObject, PIRP Irp, VolumeFi
IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
return TCCompleteDiskIrp (Irp, STATUS_SUCCESS, 0);
+
+ case IOCTL_DISK_GROW_PARTITION:
+ if (IsSystemVolumePartition(Extension))
+ {
+ Dump ("VolumeFilter-DispatchControl: IOCTL_DISK_GROW_PARTITION blocked\n");
+ IoReleaseRemoveLock (&Extension->Queue.RemoveLock, Irp);
+ return TCCompleteDiskIrp (Irp, STATUS_UNSUCCESSFUL, 0);
+ }
+ break;
}
}
diff --git a/src/Driver/veracrypt_vs2019.vcxproj b/src/Driver/veracrypt_vs2019.vcxproj
new file mode 100644
index 00000000..e956bcb0
--- /dev/null
+++ b/src/Driver/veracrypt_vs2019.vcxproj
@@ -0,0 +1,598 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Common\Cache.c" />
+ <ClCompile Include="..\Common\Crc.c" />
+ <ClCompile Include="..\Common\Crypto.c" />
+ <ClCompile Include="..\Common\EncryptionThreadPool.c" />
+ <ClCompile Include="..\Common\Endian.c" />
+ <ClCompile Include="..\Common\GfMul.c" />
+ <ClCompile Include="..\Common\Pkcs5.c" />
+ <ClCompile Include="..\Common\Tests.c" />
+ <ClCompile Include="..\Common\Volumes.c" />
+ <ClCompile Include="..\Common\Wipe.c" />
+ <ClCompile Include="..\Common\Xts.c" />
+ <ClCompile Include="..\Crypto\Aescrypt.c" />
+ <ClCompile Include="..\Crypto\Aeskey.c" />
+ <ClCompile Include="..\Crypto\Aestab.c" />
+ <ClCompile Include="..\Crypto\blake2s.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSE2.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSE41.c" />
+ <ClCompile Include="..\Crypto\blake2s_SSSE3.c" />
+ <ClCompile Include="..\Crypto\Camellia.c" />
+ <ClCompile Include="..\Crypto\chacha-xmm.c" />
+ <ClCompile Include="..\Crypto\chacha256.c" />
+ <ClCompile Include="..\Crypto\chachaRng.c" />
+ <ClCompile Include="..\Crypto\cpu.c" />
+ <ClCompile Include="..\Crypto\jitterentropy-base.c" />
+ <ClCompile Include="..\Crypto\kuznyechik.c" />
+ <ClCompile Include="..\Crypto\kuznyechik_simd.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\rdrand.c">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\SerpentFast.c" />
+ <ClCompile Include="..\Crypto\SerpentFast_simd.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Sha2.c" />
+ <ClCompile Include="..\Crypto\Streebog.c" />
+ <ClCompile Include="..\Crypto\t1ha2.c" />
+ <ClCompile Include="..\Crypto\t1ha2_selfcheck.c" />
+ <ClCompile Include="..\Crypto\t1ha_selfcheck.c" />
+ <ClCompile Include="..\Crypto\Twofish.c" />
+ <ClCompile Include="..\Crypto\Whirlpool.c" />
+ <ClCompile Include="Ntdriver.c" />
+ <ClCompile Include="VolumeFilter.c" />
+ <ClCompile Include="DriveFilter.c" />
+ <ClCompile Include="DumpFilter.c" />
+ <ClCompile Include="EncryptedIoQueue.c" />
+ <ClCompile Include="Ntvol.c" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{4B41C7B5-75C6-40A2-AF4D-55BC1E012BCD}</ProjectGuid>
+ <TemplateGuid>{f2f62967-0815-4fd7-9b86-6eedcac766eb}</TemplateGuid>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <Configuration>Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">Win32</Platform>
+ <RootNamespace>veracrypt</RootNamespace>
+ <WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
+ <ProjectName>driver</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <DriverTargetPlatform>Universal</DriverTargetPlatform>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <DriverTargetPlatform>Universal</DriverTargetPlatform>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <DriverTargetPlatform>Universal</DriverTargetPlatform>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ <DriverType>WDM</DriverType>
+ <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION>
+ <SupportsPackaging>false</SupportsPackaging>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>$(SolutionDir)$(Platform)\$(ConfigurationName)\</OutDir>
+ <TargetName>veracrypt</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>veracrypt</TargetName>
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>veracrypt</TargetName>
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ <OutDir>$(ProjectDir)$(Platform)\$(ConfigurationName)\</OutDir>
+ <TargetName>veracrypt</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetName>veracrypt</TargetName>
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetName>veracrypt</TargetName>
+ <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;DEBUG;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Debug\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyArchitecture>true</SpecifyArchitecture>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyArchitecture>true</SpecifyArchitecture>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Link>
+ <AdditionalDependencies>fltmgr.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Link>
+ <ClCompile>
+ <AdditionalIncludeDirectories>$(SolutionDir)Common;$(SolutionDir)Crypto;$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>TC_WINDOWS_DRIVER;_WIN32;_NO_CRT_STDIO_INLINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <DisableSpecificWarnings>4064;4627;4627;4366;4100;4057;4457;4456;4152;4213;4244;4127;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy $(TargetPath) "..\Release\Setup Files\VeraCrypt-arm64.sys"</Command>
+ </PostBuildEvent>
+ <Inf>
+ <SpecifyArchitecture>true</SpecifyArchitecture>
+ <SpecifyDriverVerDirectiveVersion>false</SpecifyDriverVerDirectiveVersion>
+ </Inf>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <FilesToPackage Include="$(TargetPath)" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\Crypto\Aes.h" />
+ <ClInclude Include="..\Crypto\Aesopt.h" />
+ <ClInclude Include="..\Crypto\AesSmall.h" />
+ <ClInclude Include="..\Crypto\Aestab.h" />
+ <ClInclude Include="..\Crypto\Aes_hw_cpu.h" />
+ <ClInclude Include="..\Crypto\Camellia.h" />
+ <ClInclude Include="..\Crypto\chacha256.h" />
+ <ClInclude Include="..\Crypto\chachaRng.h" />
+ <ClInclude Include="..\Crypto\chacha_u1.h" />
+ <ClInclude Include="..\Crypto\chacha_u4.h" />
+ <ClInclude Include="..\Crypto\config.h" />
+ <ClInclude Include="..\Crypto\cpu.h" />
+ <ClInclude Include="..\Crypto\GostCipher.h" />
+ <ClInclude Include="..\Crypto\jitterentropy-base-user.h" />
+ <ClInclude Include="..\Crypto\jitterentropy.h" />
+ <ClInclude Include="..\Crypto\kuznyechik.h" />
+ <ClInclude Include="..\Crypto\misc.h" />
+ <ClInclude Include="..\Crypto\rdrand.h" />
+ <ClInclude Include="..\Crypto\Rmd160.h" />
+ <ClInclude Include="..\Crypto\SerpentFast.h" />
+ <ClInclude Include="..\Crypto\SerpentFast_sbox.h" />
+ <ClInclude Include="..\Crypto\Sha2.h" />
+ <ClInclude Include="..\Crypto\Streebog.h" />
+ <ClInclude Include="..\Crypto\t1ha.h" />
+ <ClInclude Include="..\Crypto\t1ha_bits.h" />
+ <ClInclude Include="..\Crypto\t1ha_selfcheck.h" />
+ <ClInclude Include="..\Crypto\Twofish.h" />
+ <ClInclude Include="..\Crypto\Whirlpool.h" />
+ <ClInclude Include="DriveFilter.h" />
+ <ClInclude Include="DumpFilter.h" />
+ <ClInclude Include="EncryptedIoQueue.h" />
+ <ClInclude Include="Ntdriver.h" />
+ <ClInclude Include="Ntvol.h" />
+ <ClInclude Include="Resource.h" />
+ <ClInclude Include="VolumeFilter.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Aes_hw_cpu.asm">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win64 -Ox -g -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Aes_x64.asm">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Aes_x86.asm">
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; nasm.exe -Xvc -f win32 -Ox -g --prefix _ -o "$(TargetDir)\%(Filename).obj" "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Twofish_x64.S">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Camellia_aesni_x64.S">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Camellia_x64.S">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha256-x86-nayuki.S">
+ <FileType>Document</FileType>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha256_avx1_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha256_avx2_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha256_sse4_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha512-x86-nayuki.S">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha512-x64-nayuki.S">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha512_avx1_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha512_avx2_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\sha512_sse4_x64.asm">
+ <FileType>Document</FileType>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\rdrand_ml.asm">
+ <FileType>Document</FileType>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\rdseed_ml.asm">
+ <FileType>Document</FileType>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">echo %(Filename)%(Extension) &amp; ml64.exe /nologo /D_M_X64 /W3 /Cx /Zi /Fo "$(TargetDir)\%(Filename).obj" /c "%(FullPath)"
+</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(TargetDir)\%(Filename).obj;%(Outputs)</Outputs>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Driver.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/Driver/veracrypt_vs2019.vcxproj.filters b/src/Driver/veracrypt_vs2019.vcxproj.filters
new file mode 100644
index 00000000..f0c7d0e3
--- /dev/null
+++ b/src/Driver/veracrypt_vs2019.vcxproj.filters
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ <Filter Include="Driver Files">
+ <UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
+ <Extensions>inf;inv;inx;mof;mc;</Extensions>
+ </Filter>
+ <Filter Include="Crypto">
+ <UniqueIdentifier>{27c1f176-3bb2-46ab-abe5-d5ea01d8d4c9}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Crypto\Source Files">
+ <UniqueIdentifier>{a5c1dc1f-29ec-4ea8-b535-61dd2c5e4342}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Crypto\Header Files">
+ <UniqueIdentifier>{e69db28f-0030-4532-9d70-5c11b63d1e2b}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Common">
+ <UniqueIdentifier>{c9095cb6-8efa-4261-902e-a9b8afa443d6}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="DriveFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DumpFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EncryptedIoQueue.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Ntvol.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="VolumeFilter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Aeskey.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Aestab.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Camellia.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\chacha-xmm.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\chacha256.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\chachaRng.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\cpu.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\jitterentropy-base.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\kuznyechik.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\kuznyechik_simd.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\rdrand.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\SerpentFast.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\SerpentFast_simd.cpp">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Sha2.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Streebog.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\t1ha2.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\t1ha2_selfcheck.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\t1ha_selfcheck.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Twofish.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Whirlpool.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Cache.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crc.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Crypto.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\EncryptionThreadPool.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Endian.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\GfMul.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Pkcs5.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Tests.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Volumes.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Wipe.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Common\Xts.c">
+ <Filter>Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\Aescrypt.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Ntdriver.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSE2.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSE41.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Crypto\blake2s_SSSE3.c">
+ <Filter>Crypto\Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="DriveFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DumpFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="EncryptedIoQueue.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Ntdriver.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Ntvol.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="VolumeFilter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Aes.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Aes_hw_cpu.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Aesopt.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Aestab.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Camellia.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\chacha256.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\chachaRng.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\chacha_u1.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\chacha_u4.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\config.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\cpu.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\GostCipher.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\jitterentropy-base-user.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\jitterentropy.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\kuznyechik.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\misc.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\rdrand.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Rmd160.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\SerpentFast.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\SerpentFast_sbox.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Sha2.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Streebog.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\t1ha.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\t1ha_bits.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\t1ha_selfcheck.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Twofish.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\Whirlpool.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Crypto\AesSmall.h">
+ <Filter>Crypto\Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\Crypto\Aes_hw_cpu.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\Aes_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\Aes_x86.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\Twofish_x64.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\Camellia_aesni_x64.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\Camellia_x64.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha256-x86-nayuki.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha256_avx1_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha256_avx2_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha256_sse4_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha512-x86-nayuki.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha512-x64-nayuki.S">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha512_avx1_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha512_avx2_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\sha512_sse4_x64.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\rdrand_ml.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ <CustomBuild Include="..\Crypto\rdseed_ml.asm">
+ <Filter>Crypto\Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="Driver.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file