VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Keyfiles.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-27 11:18:58 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-27 13:39:22 +0100
commita8112b8373a9cd9c4c481895179f6b31db33d967 (patch)
treec40c7bafb960e5038e7eb3194f5969f9245a6f32 /src/Common/Keyfiles.c
parent2dbbd6b9d210c32bb672512d74a0761845608dd5 (diff)
downloadVeraCrypt-a8112b8373a9cd9c4c481895179f6b31db33d967.tar.gz
VeraCrypt-a8112b8373a9cd9c4c481895179f6b31db33d967.zip
Windows: use the correct window handle for creating message boxes. This became important after the introduction of the wait dialog in order to avoid having message boxes behind the wait dialog.
Diffstat (limited to 'src/Common/Keyfiles.c')
-rw-r--r--src/Common/Keyfiles.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c
index 88ab5ece..cb36a146 100644
--- a/src/Common/Keyfiles.c
+++ b/src/Common/Keyfiles.c
@@ -218,7 +218,7 @@ close:
}
-BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
+BOOL KeyFilesApply (HWND hwndDlg, Password *password, KeyFile *firstKeyFile)
{
BOOL status = TRUE;
KeyFile kfSubStruct;
@@ -252,8 +252,8 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
if (keyfileData.empty())
{
SetLastError (ERROR_HANDLE_EOF);
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE", hwndDlg);
status = FALSE;
continue;
}
@@ -291,8 +291,8 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
// Determine whether it's a path or a file
if (stat (kf->FileName, &statStruct) != 0)
{
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE", hwndDlg);
status = FALSE;
continue;
}
@@ -305,8 +305,8 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
StringCbPrintfA (searchPath, sizeof (searchPath), "%s\\*.*", kf->FileName);
if ((searchHandle = _findfirst (searchPath, &fBuf)) == -1)
{
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE_PATH");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE_PATH", hwndDlg);
status = FALSE;
continue;
}
@@ -323,8 +323,8 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
// Determine whether it's a path or a file
if (stat (kfSub->FileName, &statStruct) != 0)
{
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE", hwndDlg);
status = FALSE;
continue;
}
@@ -347,8 +347,8 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
// Apply keyfile to the pool
if (!KeyFileProcess (keyPool, kfSub))
{
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE", hwndDlg);
status = FALSE;
}
@@ -359,15 +359,15 @@ BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile)
if (keyfileCount == 0)
{
- ErrorDirect ((wstring (GetString ("ERR_KEYFILE_PATH_EMPTY")) + L"\n\n" + SingleStringToWide (kf->FileName)).c_str());
+ ErrorDirect ((wstring (GetString ("ERR_KEYFILE_PATH_EMPTY")) + L"\n\n" + SingleStringToWide (kf->FileName)).c_str(), hwndDlg);
status = FALSE;
}
}
// Apply keyfile to the pool
else if (!KeyFileProcess (keyPool, kf))
{
- handleWin32Error (MainDlg);
- Error ("ERR_PROCESS_KEYFILE");
+ handleWin32Error (hwndDlg);
+ Error ("ERR_PROCESS_KEYFILE", hwndDlg);
status = FALSE;
}
}