1
0
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:
Mounir IDRASSI
2015-05-14 23:10:38 +02:00
parent 4a5154e750
commit e95c075f0c
2 changed files with 16 additions and 7 deletions

View File

@@ -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;