Windows: stop auto-mount scan on mount cancellation

Add a cancel callback and batch abort flag so auto-mount-all stops after dialog cancellation.

Mark MountVolume ERR_USER_ABORT with ERROR_CANCELLED so external /cancelmount also stops the scan.
This commit is contained in:
Mounir IDRASSI committed 2026-06-08 20:19:47 +09:00
1 parent 1871765a76
commit 304088f908
7 files changed
+578 -124

No files matched your search

+4 -3
View File
@@ -8883,8 +8883,6 @@ static UINT g_wmWaitDlg = ::RegisterWindowMessage(L"VeraCryptWaitDlgMessage");
#define WAIT_DLG_CANCEL_RETRY_TIMER_ID 1
#define WAIT_DLG_CANCEL_RETRY_INTERVAL 250
typedef BOOL (CALLBACK* WaitCancelProc)(void* pArg, HWND hWaitDlg);
typedef struct
{
HWND hwnd;
@@ -9064,7 +9062,7 @@ static LRESULT CALLBACK ShowWaitDialogParentWndProc (HWND hWnd, UINT message, WP
}
static void ShowWaitDialogEx(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, WaitCancelProc cancelCallback, void* pArg)
void ShowWaitDialogEx(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, WaitCancelProc cancelCallback, void* pArg)
{
BOOL bEffectiveHideWaitingDialog = bCmdHideWaitingDialogValid? bCmdHideWaitingDialog : bHideWaitingDialog;
WaitThreadParam threadParam;
@@ -9512,7 +9510,10 @@ retry:
if (mount.nReturnCode != 0)
{
if (mount.nReturnCode == ERR_USER_ABORT)
{
SetLastError (ERROR_CANCELLED);
return -1;
}
if (mount.nReturnCode == ERR_PASSWORD_WRONG)
{