VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/ExpandVolume/ExpandVolume.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ExpandVolume/ExpandVolume.c')
-rw-r--r--src/ExpandVolume/ExpandVolume.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c
index 82c4207e..6167b9c8 100644
--- a/src/ExpandVolume/ExpandVolume.c
+++ b/src/ExpandVolume/ExpandVolume.c
@@ -559,18 +559,17 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas
}
else
{
- DISK_GEOMETRY driveInfo;
+ DISK_GEOMETRY_EX driveInfo;
- bResult = DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0,
+ bResult = DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0,
&driveInfo, sizeof (driveInfo), &dwResult, NULL);
if (!bResult)
goto error;
- hostSize = driveInfo.Cylinders.QuadPart * driveInfo.BytesPerSector *
- driveInfo.SectorsPerTrack * driveInfo.TracksPerCylinder;
+ hostSize = driveInfo.DiskSize.QuadPart;
- HostSectorSize = driveInfo.BytesPerSector;
+ HostSectorSize = driveInfo.Geometry.BytesPerSector;
}
if (hostSize == 0)