diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-05-23 12:31:46 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-05-25 01:15:18 +0200 |
commit | 0e15c65b3e6b67643799917f342df04d0473bb05 (patch) | |
tree | 342a35f47cf7d91d1e2e3e4f0cc15cb68f617504 /src/Driver/Ntvol.c | |
parent | f50bf2cf614a4386bc76874a65326077d9827753 (diff) | |
download | VeraCrypt-0e15c65b3e6b67643799917f342df04d0473bb05.tar.gz VeraCrypt-0e15c65b3e6b67643799917f342df04d0473bb05.zip |
Windows Driver: correct value of number of cylinders by adding 1 since our virtual partition starts at Extension->BytesPerSector and not 0.
Diffstat (limited to 'src/Driver/Ntvol.c')
-rw-r--r-- | src/Driver/Ntvol.c | 3 |
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; |