Windows Driver: correct value of number of cylinders by adding 1 since our virtual partition starts at Extension->BytesPerSector and not 0.

This commit is contained in:
Mounir IDRASSI 2017-05-23 12:31:46 +02:00
parent f50bf2cf61
commit 0e15c65b3e
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC

View File

@ -704,7 +704,8 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
Extension->TracksPerCylinder = 1; Extension->TracksPerCylinder = 1;
Extension->SectorsPerTrack = 1; Extension->SectorsPerTrack = 1;
Extension->BytesPerSector = Extension->cryptoInfo->SectorSize; 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->PartitionType = 0;
Extension->bRawDevice = bRawDevice; Extension->bRawDevice = bRawDevice;