VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-20 14:20:43 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-20 21:23:20 (GMT)
commitac7714294930d987e44663dfdf3875a2271ff456 (patch)
tree1121cd507ded35304d5a0e5cd7424258bfa872d8
parent5a9409a3afc3a2883e8a6878f77ef3194f5d023f (diff)
downloadVeraCrypt-ac7714294930d987e44663dfdf3875a2271ff456.zip
VeraCrypt-ac7714294930d987e44663dfdf3875a2271ff456.tar.gz
Windows driver: fix IOCTL_DISK_GET_DRIVE_LAYOUT and IOCTL_DISK_GET_DRIVE_LAYOUT_EX output by using setting PartitionCount to 4 instead of 1 since this field must always be a multiple of 4 for MBR disks.
-rw-r--r--src/Driver/Ntdriver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 83cf7de..5a2038f 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -959,7 +959,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
PDRIVE_LAYOUT_INFORMATION outputBuffer = (PDRIVE_LAYOUT_INFORMATION)
Irp->AssociatedIrp.SystemBuffer;
- outputBuffer->PartitionCount = 1;
+ outputBuffer->PartitionCount = 4;
outputBuffer->Signature = GetCrc32((unsigned char*) &(Extension->UniqueVolumeId), 4);
outputBuffer->PartitionEntry->PartitionType = Extension->PartitionType;
@@ -983,7 +983,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
PDRIVE_LAYOUT_INFORMATION_EX outputBuffer = (PDRIVE_LAYOUT_INFORMATION_EX)
Irp->AssociatedIrp.SystemBuffer;
- outputBuffer->PartitionCount = 1;
+ outputBuffer->PartitionCount = 4;
outputBuffer->PartitionStyle = PARTITION_STYLE_MBR;
outputBuffer->Mbr.Signature = GetCrc32((unsigned char*) &(Extension->UniqueVolumeId), 4);