VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Mount
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-27 00:02:20 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-07-27 00:30:53 +0200
commit72b7147021a18ea6a045514fa7cad7772c4bb811 (patch)
tree887444e7b44b2c4046d1553524a86d0c0f9556c7 /src/Mount
parentc29ee8331afa52f72df5fb21daa02457243650fe (diff)
downloadVeraCrypt-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/Mount')
-rw-r--r--src/Mount/Mount.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index b3773b1a..ec612a16 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -10448,15 +10448,15 @@ int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume)
}
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;
}
if (hostSize == 0)