diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-27 00:02:20 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-07-27 00:30:53 +0200 |
commit | 72b7147021a18ea6a045514fa7cad7772c4bb811 (patch) | |
tree | 887444e7b44b2c4046d1553524a86d0c0f9556c7 /src/ExpandVolume/ExpandVolume.c | |
parent | c29ee8331afa52f72df5fb21daa02457243650fe (diff) | |
download | VeraCrypt-72b7147021a18ea6a045514fa7cad7772c4bb811.tar.gz VeraCrypt-72b7147021a18ea6a045514fa7cad7772c4bb811.zip |
Windows: use large output buffer for IOCTL_DISK_GET_DRIVE_GEOMETRY_EX calls to avoid failure with disk drivers that don't support returning only sizeof(DISK_GEOMETRY_EX).
Diffstat (limited to 'src/ExpandVolume/ExpandVolume.c')
-rw-r--r-- | src/ExpandVolume/ExpandVolume.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c index 3ed22575..9e9252c3 100644 --- a/src/ExpandVolume/ExpandVolume.c +++ b/src/ExpandVolume/ExpandVolume.c @@ -559,17 +559,17 @@ static int ExpandVolume (HWND hwndDlg, wchar_t *lpszVolume, Password *pVolumePas } else { - DISK_GEOMETRY_EX driveInfo; + BYTE dgBuffer[256]; bResult = DeviceIoControl (dev, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, - &driveInfo, sizeof (driveInfo), &dwResult, NULL); + dgBuffer, sizeof (dgBuffer), &dwResult, NULL); if (!bResult) goto error; - hostSize = driveInfo.DiskSize.QuadPart; + hostSize = ((PDISK_GEOMETRY_EX) dgBuffer)->DiskSize.QuadPart; - HostSectorSize = driveInfo.Geometry.BytesPerSector; + HostSectorSize = ((PDISK_GEOMETRY_EX) dgBuffer)->Geometry.BytesPerSector; } if (hostSize == 0) |