mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Fix failure to format some disks (e.g. VHDX) caused by partition offset not 4K aligned
Now we set offset to 1MB which is a typical values used for MBR disks. We also use a more standard way to calculate legacy number of cylinders
This commit is contained in:
@@ -798,8 +798,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject,
|
||||
Extension->TracksPerCylinder = 1;
|
||||
Extension->SectorsPerTrack = 1;
|
||||
Extension->BytesPerSector = Extension->cryptoInfo->SectorSize;
|
||||
// Add extra sector since our virtual partition starts at Extension->BytesPerSector and not 0
|
||||
Extension->NumberOfCylinders = (Extension->DiskLength / Extension->BytesPerSector) + 1;
|
||||
Extension->NumberOfCylinders = Extension->DiskLength / Extension->BytesPerSector;
|
||||
Extension->PartitionType = 0;
|
||||
|
||||
Extension->bRawDevice = bRawDevice;
|
||||
|
||||
Reference in New Issue
Block a user