VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Driver
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-23 20:57:00 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2018-08-24 00:49:59 +0200
commit7cbe6b71e50b535d40336385600139cf2f8524ba (patch)
tree3b34de9c4744e143be5bc5150eeac630f0280857 /src/Driver
parentf5a765e86088eb90c4392e43ad8a3c27bfa814cc (diff)
downloadVeraCrypt-7cbe6b71e50b535d40336385600139cf2f8524ba.tar.gz
VeraCrypt-7cbe6b71e50b535d40336385600139cf2f8524ba.zip
Windows: implement a driver configuration option to explicitly allow defragmenting non-système disques by Windows built-in defragmenter tool.
Diffstat (limited to 'src/Driver')
-rw-r--r--src/Driver/Ntdriver.c4
-rw-r--r--src/Driver/Ntdriver.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c
index 6e774724..e8fb2824 100644
--- a/src/Driver/Ntdriver.c
+++ b/src/Driver/Ntdriver.c
@@ -129,6 +129,7 @@ BOOL CacheBootPassword = FALSE;
BOOL CacheBootPim = FALSE;
BOOL NonAdminSystemFavoritesAccessDisabled = FALSE;
BOOL BlockSystemTrimCommand = FALSE;
+BOOL AllowWindowsDefrag = FALSE;
static size_t EncryptionThreadPoolFreeCpuCountLimit = 0;
static BOOL SystemFavoriteVolumeDirty = FALSE;
static BOOL PagingFileCreationPrevented = FALSE;
@@ -1265,7 +1266,7 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION
Dump ("ProcessVolumeDeviceControlIrp (IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS)\n");
// Vista's and Windows 10 filesystem defragmenter fails if IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS does not succeed.
if (!(OsMajorVersion == 6 && OsMinorVersion == 0)
- && !(OsMajorVersion == 10 && EnableExtendedIoctlSupport && Extension->bRawDevice)
+ && !(OsMajorVersion == 10 && AllowWindowsDefrag && Extension->bRawDevice)
)
{
Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
@@ -4249,6 +4250,7 @@ NTSTATUS ReadRegistryConfigFlags (BOOL driverEntry)
EnableExtendedIoctlSupport = (flags & TC_DRIVER_CONFIG_ENABLE_EXTENDED_IOCTL)? TRUE : FALSE;
AllowTrimCommand = (flags & VC_DRIVER_CONFIG_ALLOW_NONSYS_TRIM)? TRUE : FALSE;
+ AllowWindowsDefrag = (flags & VC_DRIVER_CONFIG_ALLOW_WINDOWS_DEFRAG)? TRUE : FALSE;
}
else
status = STATUS_INVALID_PARAMETER;
diff --git a/src/Driver/Ntdriver.h b/src/Driver/Ntdriver.h
index b679952a..2479d45b 100644
--- a/src/Driver/Ntdriver.h
+++ b/src/Driver/Ntdriver.h
@@ -124,6 +124,7 @@ extern BOOL VolumeClassFilterRegistered;
extern BOOL CacheBootPassword;
extern BOOL CacheBootPim;
extern BOOL BlockSystemTrimCommand;
+extern BOOL AllowWindowsDefrag;
/* Helper macro returning x seconds in units of 100 nanoseconds */
#define WAIT_SECONDS(x) ((x)*10000000)