VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Driver/Ntvol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c
index 8be0393a..1c242408 100644
--- a/src/Driver/Ntvol.c
+++ b/src/Driver/Ntvol.c
@@ -704,7 +704,8 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
Extension->TracksPerCylinder = 1;
Extension->SectorsPerTrack = 1;
Extension->BytesPerSector = Extension->cryptoInfo->SectorSize;
- Extension->NumberOfCylinders = Extension->DiskLength / Extension->BytesPerSector;
+ // Add extra sector since our virtual partition starts at Extension->BytesPerSector and not 0
+ Extension->NumberOfCylinders = (Extension->DiskLength / Extension->BytesPerSector) + 1;
Extension->PartitionType = 0;
Extension->bRawDevice = bRawDevice;