mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-27 21:43:29 +01:00
Windows Driver: Better code for EncryptionFragmentSize variable handling
This commit is contained in:
parent
7e20f65e68
commit
fac35ab08a
@ -4833,12 +4833,13 @@ NTSTATUS ReadRegistryConfigFlags (BOOL driverEntry)
|
||||
EncryptionItemCount = EncryptionIoRequestCount - 1;
|
||||
|
||||
/* EncryptionFragmentSize value in registry is expressed in KiB */
|
||||
EncryptionFragmentSize *= 1024;
|
||||
if (EncryptionFragmentSize == 0)
|
||||
EncryptionFragmentSize = TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024;
|
||||
else if (EncryptionFragmentSize > (8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024))
|
||||
EncryptionFragmentSize = 8 * TC_ENC_IO_QUEUE_MAX_FRAGMENT_SIZE / 1024;
|
||||
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;
|
||||
|
||||
|
||||
EncryptionFragmentSize = EncryptionFragmentSize * 1024;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user