VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Apidrvr.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-05-15 16:22:48 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-05-17 00:46:41 +0200
commit74b82118d5f77116ec5f4a1e2438cdc77cead40f (patch)
treee482a6872cfd4605c1379c469870ea2303273031 /src/Common/Apidrvr.h
parentce4e7fd64d3d462a523253dd53fb36f3aebd179a (diff)
downloadVeraCrypt-74b82118d5f77116ec5f4a1e2438cdc77cead40f.tar.gz
VeraCrypt-74b82118d5f77116ec5f4a1e2438cdc77cead40f.zip
Windows: use IOCTL_DISK_GET_DRIVE_GEOMETRY_EX instead of the deprecated IOCTL_DISK_GET_DRIVE_GEOMETRY in order to get accurate disk size value.
Diffstat (limited to 'src/Common/Apidrvr.h')
-rw-r--r--src/Common/Apidrvr.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Common/Apidrvr.h b/src/Common/Apidrvr.h
index 07a8448c..28202e61 100644
--- a/src/Common/Apidrvr.h
+++ b/src/Common/Apidrvr.h
@@ -119,6 +119,9 @@
#define TC_IOCTL_REREAD_DRIVER_CONFIG TC_IOCTL (37)
#define TC_IOCTL_GET_SYSTEM_DRIVE_DUMP_CONFIG TC_IOCTL (38)
#define VC_IOCTL_GET_BOOT_LOADER_FINGERPRINT TC_IOCTL (39)
+// result IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
+// IN OUT - DISK_GEOMETRY_EX_STRUCT
+#define VC_IOCTL_GET_DRIVE_GEOMETRY_EX TC_IOCTL (40)
// Legacy IOCTLs used before version 5.0
#define TC_IOCTL_LEGACY_GET_DRIVER_VERSION 466968
@@ -240,6 +243,14 @@ DISK_GEOMETRY_STRUCT;
typedef struct
{
+ WCHAR deviceName[TC_MAX_PATH];
+ DISK_GEOMETRY diskGeometry;
+ LARGE_INTEGER DiskSize;
+}
+DISK_GEOMETRY_EX_STRUCT;
+
+typedef struct
+{
WCHAR DeviceName[TC_MAX_PATH];
LARGE_INTEGER RealDriveSize;
BOOL TimeOut;