VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Common/Dlgcode.c7
-rw-r--r--src/Mount/Mount.c38
-rw-r--r--src/Mount/Mount.h2
3 files changed, 29 insertions, 18 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index ef3b5662..a5bad787 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6607,4 +6607,9 @@ void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, v
{
WaitDialogDisplaying = TRUE;
+ if (hwnd)
+ EnableWindow (hwnd, FALSE);
+ else
+ EnableWindow (MainDlg, FALSE);
+ finally_do_arg (HWND, hwnd, { if (finally_arg) EnableWindow(finally_arg, TRUE); else EnableWindow (MainDlg, TRUE);});
DialogBoxParamW (hInst,
@@ -7085,5 +7090,5 @@ retry:
else
{
- ShowWaitDialog (hwndDlg, TRUE, UnmountWaitThreadProc, &param);
+ ShowWaitDialog (hwndDlg, FALSE, UnmountWaitThreadProc, &param);
}
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index af661312..e67c9018 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -4710,5 +4710,5 @@ retry:
{
- ShowWaitDialog (hwndDlg, TRUE, DismountAllThreadProc, &dismountAllThreadParam);
+ ShowWaitDialog (hwndDlg, FALSE, DismountAllThreadProc, &dismountAllThreadParam);
}
else
@@ -5052,5 +5052,5 @@ static BOOL MountAllDevices (HWND hwndDlg, BOOL bPasswordPrompt)
param.bRet = FALSE;
- ShowWaitDialog (hwndDlg, TRUE, mountAllDevicesThreadProc, &param);
+ ShowWaitDialog (hwndDlg, FALSE, mountAllDevicesThreadProc, &param);
return param.bRet;
@@ -7802,5 +7802,5 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
if (lw == IDM_MOUNT_FAVORITE_VOLUMES)
{
- ShowWaitDialog (hwndDlg, TRUE, mountFavoriteVolumeThreadFunction, NULL);
+ _beginthread(mountFavoriteVolumeThreadFunction, 0, NULL);
return 1;
}
@@ -7876,11 +7876,11 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
else
{
- mountFavoriteVolumeThreadParam param;
- param.systemFavorites = FALSE;
- param.logOnMount = FALSE;
- param.hotKeyMount = FALSE;
- param.favoriteVolumeToMount = &FavoriteVolumes[favoriteIndex];
+ mountFavoriteVolumeThreadParam* pParam = (mountFavoriteVolumeThreadParam*) calloc(1, sizeof(mountFavoriteVolumeThreadParam));
+ pParam->systemFavorites = FALSE;
+ pParam->logOnMount = FALSE;
+ pParam->hotKeyMount = FALSE;
+ pParam->favoriteVolumeToMount = &FavoriteVolumes[favoriteIndex];
- ShowWaitDialog (hwndDlg, TRUE, mountFavoriteVolumeThreadFunction, &param);
+ _beginthread(mountFavoriteVolumeThreadFunction, 0, pParam);
}
}
@@ -8969,5 +8969,5 @@ BOOL MountFavoriteVolumes (HWND hwnd, BOOL systemFavorites, BOOL logOnMount, BOO
}
-void CALLBACK mountFavoriteVolumeThreadFunction (void *pArg, HWND hwnd)
+void CALLBACK mountFavoriteVolumeCallbackFunction (void *pArg, HWND hwnd)
{
mountFavoriteVolumeThreadParam* pParam = (mountFavoriteVolumeThreadParam*) pArg;
@@ -8979,4 +8979,6 @@ void CALLBACK mountFavoriteVolumeThreadFunction (void *pArg, HWND hwnd)
else
MountFavoriteVolumes (hwnd, pParam->systemFavorites, pParam->logOnMount, pParam->hotKeyMount);
+
+ free (pParam);
}
else
@@ -8984,4 +8986,8 @@ void CALLBACK mountFavoriteVolumeThreadFunction (void *pArg, HWND hwnd)
}
+void __cdecl mountFavoriteVolumeThreadFunction (void *pArg)
+{
+ ShowWaitDialog (NULL, FALSE, mountFavoriteVolumeCallbackFunction, pArg);
+}
static void SaveDefaultKeyFilesParam (HWND hwnd)
@@ -9117,11 +9123,11 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam)
case HK_MOUNT_FAVORITE_VOLUMES:
{
- mountFavoriteVolumeThreadParam param;
- param.systemFavorites = FALSE;
- param.logOnMount = FALSE;
- param.hotKeyMount = TRUE;
- param.favoriteVolumeToMount = NULL;
+ mountFavoriteVolumeThreadParam* pParam = (mountFavoriteVolumeThreadParam*) calloc(1, sizeof(mountFavoriteVolumeThreadParam));
+ pParam->systemFavorites = FALSE;
+ pParam->logOnMount = FALSE;
+ pParam->hotKeyMount = TRUE;
+ pParam->favoriteVolumeToMount = NULL;
- ShowWaitDialog (hwndDlg, TRUE, mountFavoriteVolumeThreadFunction, &param);
+ _beginthread(mountFavoriteVolumeThreadFunction, 0, pParam);
}
break;
diff --git a/src/Mount/Mount.h b/src/Mount/Mount.h
index dcae9921..097a8a48 100644
--- a/src/Mount/Mount.h
+++ b/src/Mount/Mount.h
@@ -128,5 +128,5 @@ typedef struct
void SetDriverConfigurationFlag (uint32 flag, BOOL state);
BOOL MountFavoriteVolumes (HWND hwnd, BOOL systemFavorites = FALSE, BOOL logOnMount = FALSE, BOOL hotKeyMount = FALSE, const VeraCrypt::FavoriteVolume &favoriteVolumeToMount = VeraCrypt::FavoriteVolume());
-void CALLBACK mountFavoriteVolumeThreadFunction (void *pArg, HWND hwnd);
+void __cdecl mountFavoriteVolumeThreadFunction (void *pArg);
#endif