mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-06 00:56:35 -05:00
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:
7 files changed
+578
-124
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user