1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-06-10 06:46:59 -05:00

Windows: allow cancelling long mount operations

Add a root-driver abort IOCTL that bypasses the mount control mutex and sets cooperative KDF abort flags for the active mount.

Restrict abort requests to privileged callers or to the user that initiated the pending mount, and retry early wait-dialog cancel requests until the driver has registered the cancellable mount context.

Wire the wait dialog Cancel button to send the abort request through a fresh driver handle, and propagate ERR_USER_ABORT through header/cache processing.

Add a /cancelmount command-line switch that sends the same abort request without displaying UI, so users can cancel hidden-wait-dialog mount operations from another process.
This commit is contained in:
Mounir IDRASSI
2026-06-07 17:14:37 +09:00
parent 105425ebb0
commit 1871765a76
13 changed files with 437 additions and 23 deletions
+8
View File
@@ -129,6 +129,8 @@
#define VC_IOCTL_ENCRYPTION_QUEUE_PARAMS TC_IOCTL (43)
#define TC_IOCTL_ABORT_MOUNT_VOLUME TC_IOCTL (44)
// Undocumented IOCTL sent by Windows 10 when handling EFS data on volumes
#define IOCTL_UNKNOWN_WINDOWS10_EFS_ACCESS 0x455610D8
@@ -180,6 +182,12 @@ typedef struct
BOOL VolumeMasterKeyVulnerable;
} MOUNT_STRUCT;
typedef struct
{
int nDosDriveNo; /* Drive number whose pending mount should be aborted; -1 aborts any pending mount */
int nReturnCode; /* Return code back from driver */
} MOUNT_ABORT_STRUCT;
typedef struct
{
int nDosDriveNo; /* Drive letter to unmount */