mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 03:18:26 -06:00
Windows driver: avoid race condition by using IoAttachDeviceToDeviceStackSafe instead IoAttachDeviceToDeviceStack. Set BootArgs.CryptoInfoLength to 0 after clearing boot memory.
This commit is contained in:
@@ -42,7 +42,12 @@ NTSTATUS VolumeFilterAddDevice (PDRIVER_OBJECT driverObject, PDEVICE_OBJECT pdo)
|
||||
Extension = (VolumeFilterExtension *) filterDeviceObject->DeviceExtension;
|
||||
memset (Extension, 0, sizeof (VolumeFilterExtension));
|
||||
|
||||
Extension->LowerDeviceObject = IoAttachDeviceToDeviceStack (filterDeviceObject, pdo); // IoAttachDeviceToDeviceStackSafe() is not required in AddDevice routine and is also unavailable on Windows 2000 SP4
|
||||
status = IoAttachDeviceToDeviceStackSafe (filterDeviceObject, pdo, &(Extension->LowerDeviceObject));
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!Extension->LowerDeviceObject)
|
||||
{
|
||||
status = STATUS_DEVICE_REMOVED;
|
||||
|
||||
Reference in New Issue
Block a user