diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -94,6 +94,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -187,6 +188,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -255,6 +257,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -326,6 +329,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread->timed_join(boost::posix_time::seconds(10))) { delete gpg_thread; + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -353,6 +357,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread->timed_join(boost::posix_time::seconds(10))) { delete gpg_thread; + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -417,6 +422,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread.timed_join(boost::posix_time::minutes(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted"; break; } @@ -447,6 +453,7 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<"GPG execution timed out, aborted\n"; break; } @@ -581,7 +588,11 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP gpg_configured = true; boost::thread gpg_thread(boost::bind(&pxEexcute_thread, ¶ms)); if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) + { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); + debuglog<<time_str()<<": GPG execution timed out, aborted\n"; + } gpg_configured = false; DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); @@ -696,7 +707,11 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP gpg_configured = true; boost::thread gpg_thread(boost::bind(&pxEexcute_thread, ¶ms)); if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) + { + TerminateProcess(params.hProcess, 1); gpg_thread.~thread(); + debuglog<<time_str()<<": GPG execution timed out, aborted\n"; + } gpg_configured = false; DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); @@ -780,7 +795,11 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP gpg_configured = true; boost::thread gpg_thread(boost::bind(&pxEexcute_thread, ¶ms)); if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) + { + TerminateProcess(params.hProcess, 1); gpg_thread.~thread(); + debuglog<<time_str()<<": GPG execution timed out, aborted\n"; + } gpg_configured = false; DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); @@ -869,6 +888,7 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if(!gpg_thread.timed_join(boost::posix_time::minutes(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted"; gpg_configured = false; break; @@ -901,6 +921,7 @@ static BOOL CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<"GPG execution timed out, aborted\n"; gpg_configured = false; break; @@ -1216,7 +1237,9 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, if(!gpg_thread.timed_join(boost::posix_time::minutes(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); MessageBox(0, _T("GPG execution timed out, aborted"), _T(""), MB_OK); + debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } if(result == pxNotFound) @@ -1247,6 +1270,7 @@ static BOOL CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wParam, if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -1407,6 +1431,7 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam, if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -1514,6 +1539,7 @@ static BOOL CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wParam, if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; break; } @@ -1623,6 +1649,7 @@ static BOOL CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; } MessageBoxA(0, out.c_str(), "GPG output", MB_OK); @@ -1743,6 +1770,7 @@ void InitCheck() if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; return; } @@ -1854,6 +1882,7 @@ void ImportKey() if(!gpg_thread.timed_join(boost::posix_time::seconds(10))) { gpg_thread.~thread(); + TerminateProcess(params.hProcess, 1); debuglog<<time_str()<<": GPG execution timed out, aborted\n"; return; } |