VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 23:34:03 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-03 23:48:49 +0100
commit5c934d81227c74ef8806589997518c6823db17d3 (patch)
treef6ce46fe8b894cf2d232dd872925a67327481f44
parent6d2cef1fd8e0e80acdc383779c6cce61eb8e38dc (diff)
downloadVeraCrypt-5c934d81227c74ef8806589997518c6823db17d3.tar.gz
VeraCrypt-5c934d81227c74ef8806589997518c6823db17d3.zip
Windows Driver: Add IOCTL code to query RAM encryption status in VeraCrypt driver
-rw-r--r--src/Common/Apidrvr.h2
-rw-r--r--src/Driver/Ntdriver.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/src/Common/Apidrvr.h b/src/Common/Apidrvr.h
index 2a6941a1..c56d9ff7 100644
--- a/src/Common/Apidrvr.h
+++ b/src/Common/Apidrvr.h
@@ -125,6 +125,8 @@
#define VC_IOCTL_EMERGENCY_CLEAR_ALL_KEYS TC_IOCTL (41)
+#define VC_IOCTL_IS_RAM_ENCRYPTION_ENABLED TC_IOCTL (42)
+
// Legacy IOCTLs used before version 5.0
#define TC_IOCTL_LEGACY_GET_DRIVER_VERSION 466968
#define TC_IOCTL_LEGACY_GET_MOUNTED_VOLUMES 466948
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 70b34f43..7293de2d 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -2796,6 +2796,15 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex
}
break;
+ case VC_IOCTL_IS_RAM_ENCRYPTION_ENABLED:
+ if (ValidateIOBufferSize (Irp, sizeof (int), ValidateOutput))
+ {
+ *(int *) Irp->AssociatedIrp.SystemBuffer = IsRamEncryptionEnabled() ? 1 : 0;
+ Irp->IoStatus.Information = sizeof (int);
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ }
+ break;
+
default:
return TCCompleteIrp (Irp, STATUS_INVALID_DEVICE_REQUEST, 0);
}
@@ -3204,6 +3213,8 @@ LPWSTR TCTranslateCode (ULONG ulCode)
TC_CASE_RET_NAME (TC_IOCTL_WIPE_PASSWORD_CACHE);
TC_CASE_RET_NAME (TC_IOCTL_WRITE_BOOT_DRIVE_SECTOR);
TC_CASE_RET_NAME (VC_IOCTL_GET_DRIVE_GEOMETRY_EX);
+ TC_CASE_RET_NAME (VC_IOCTL_EMERGENCY_CLEAR_ALL_KEYS);
+ TC_CASE_RET_NAME (VC_IOCTL_IS_RAM_ENCRYPTION_ENABLED);
TC_CASE_RET_NAME (IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS);