From 4882bc420186a4aef19be699e3f621dec932417d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 2 Dec 2016 23:55:15 +0300 Subject: MS_SYSTEM_* services became functions --- plugins/AutoShutdown/src/cpuusage.cpp | 2 +- plugins/AutoShutdown/src/shutdownsvc.cpp | 6 ++--- plugins/BasicHistory/src/Scheduler.cpp | 2 +- plugins/Clist_blind/src/clistmenus.cpp | 2 +- plugins/Clist_modern/src/modern_clistmenus.cpp | 10 +++++--- plugins/Clist_modern/src/modern_clui.cpp | 2 +- plugins/Clist_nicer/src/clistmenus.cpp | 5 ++-- plugins/Clist_nicer/src/clui.cpp | 2 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 2 +- plugins/CrashDumper/src/crshdmp.cpp | 2 +- plugins/CrashDumper/src/exhndlr.cpp | 4 +-- plugins/Db_autobackups/src/main.cpp | 2 +- plugins/FTPFileYM/src/dialog.cpp | 2 +- plugins/FTPFileYM/src/job_delete.cpp | 2 +- plugins/FTPFileYM/src/job_packer.cpp | 2 +- plugins/FTPFileYM/src/job_upload.cpp | 2 +- plugins/HistoryStats/src/mu_common.cpp | 35 +------------------------- plugins/HistoryStats/src/mu_common.h | 11 -------- plugins/HistoryStats/src/statistic.cpp | 2 +- plugins/HistoryStats/src/statistic.h | 2 +- plugins/LotusNotify/src/LotusNotify.cpp | 8 +++--- plugins/MirFox/src/MirandaUtils.cpp | 8 +++--- plugins/MirFox/src/MirfoxMiranda.cpp | 12 ++++----- plugins/MirLua/src/m_core.cpp | 2 +- plugins/MirLua/src/mlua_utils.cpp | 2 +- plugins/MirOTR/src/otr.cpp | 2 +- plugins/MirOTR/src/svcs_proto.cpp | 2 +- plugins/MirOTR/src/utils.cpp | 2 +- plugins/NewAwaySysMod/src/Client.cpp | 2 +- plugins/New_GPG/src/init.cpp | 2 +- plugins/NewsAggregator/Src/Update.cpp | 6 ++--- plugins/Ping/src/utils.cpp | 2 +- plugins/PluginUpdater/src/Options.cpp | 2 +- plugins/SeenPlugin/src/utils.cpp | 2 +- plugins/ShellExt/src/shlcom.cpp | 4 +-- plugins/SimpleStatusMsg/src/main.cpp | 6 ++--- plugins/SmileyAdd/src/download.cpp | 4 +-- plugins/SplashScreen/src/main.cpp | 2 +- plugins/StatusManager/src/keepstatus.cpp | 2 +- plugins/StatusManager/src/ks_options.cpp | 8 +++--- plugins/TabSRMM/src/generic_msghandlers.cpp | 2 +- plugins/TipperYM/src/message_pump.cpp | 2 +- plugins/Variables/src/parse_miranda.cpp | 4 +-- plugins/Weather/src/weather_update.cpp | 6 ++--- 44 files changed, 74 insertions(+), 119 deletions(-) (limited to 'plugins') diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp index 1bdd09efaa..555f1c8dbb 100644 --- a/plugins/AutoShutdown/src/cpuusage.cpp +++ b/plugins/AutoShutdown/src/cpuusage.cpp @@ -69,7 +69,7 @@ static BOOL CallBackAndWait(struct CpuUsageThreadParams *param, BYTE nCpuUsage) } if (!param->pfnDataAvailProc(nCpuUsage, param->lParam)) return FALSE; SleepEx(param->dwDelayMillis, TRUE); - return !Miranda_Terminated(); + return !Miranda_IsTerminated(); } static void WinNT_PollThread(void *vparam) diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index d21934975e..553ec71f87 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -134,17 +134,17 @@ static DWORD ShutdownNow(BYTE shutdownType) DWORD dwErrCode = ERROR_SUCCESS; switch (shutdownType) { case SDSDT_CLOSEMIRANDA: - if (!Miranda_Terminated()) { + if (!Miranda_IsTerminated()) { /* waiting for short until ready (but not too long...) */ DWORD dwLastTickCount = GetTickCount(); - while (!CallService(MS_SYSTEM_OKTOEXIT, 0, 0)) { + while (!Miranda_OkToExit()) { /* infinite loop protection (max 5 sec) */ if (GetTickCount() - dwLastTickCount >= 5000) { /* wraparound works */ OutputDebugStringA("Timeout (5 sec)\n"); /* tell others, all ascii */ break; } SleepEx(1000, TRUE); - if (Miranda_Terminated()) break; /* someone else did it */ + if (Miranda_IsTerminated()) break; /* someone else did it */ OutputDebugStringA("Not ready to exit. Waiting...\n"); /* tell others, all ascii */ } /* shutdown service must be called from main thread anyway */ diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 62966543f5..2ef6bf3317 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -1295,7 +1295,7 @@ void DoError(const TaskOptions& to, const std::wstring _error) } if (Options::instance->schedulerAlerts) { - if (CallService(MS_SYSTEM_TERMINATED, 0, 0)) + if (Miranda_IsTerminated()) return; if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) diff --git a/plugins/Clist_blind/src/clistmenus.cpp b/plugins/Clist_blind/src/clistmenus.cpp index 1eb84d0911..87c8b1f602 100644 --- a/plugins/Clist_blind/src/clistmenus.cpp +++ b/plugins/Clist_blind/src/clistmenus.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR CloseAction(WPARAM, LPARAM) { - if (CallService(MS_SYSTEM_OKTOEXIT, 0, 0)) + if (Miranda_OkToExit()) DestroyWindow(pcli->hwndContactList); return 0; diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 7d97a9d428..7cee0bee47 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -30,11 +30,13 @@ int LoadFavoriteContactMenu(); INT_PTR CloseAction(WPARAM, LPARAM) { - int k; g_CluiData.bSTATE = STATE_PREPARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT - do - k = CallService(MS_SYSTEM_OKTOEXIT, 0, 0); - while (!k); + + bool k; + do { + k = Miranda_OkToExit(); + } + while (!k); if (k) DestroyWindow(pcli->hwndContactList); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 6c0e1af226..d42f7c6455 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -538,7 +538,7 @@ static BOOL CLUI_WaitThreadsCompletion() static const BYTE bcMAX_AWAITING_RETRY = 10; // repeat awaiting only 10 times TRACE("CLUI_WaitThreadsCompletion Enter"); if (bEntersCount < bcMAX_AWAITING_RETRY && - (g_CluiData.mutexPaintLock || g_hAwayMsgThread || g_hGetTextAsyncThread || g_hSmoothAnimationThread) && !Miranda_Terminated()) + (g_CluiData.mutexPaintLock || g_hAwayMsgThread || g_hGetTextAsyncThread || g_hSmoothAnimationThread) && !Miranda_IsTerminated()) { TRACE("Waiting threads"); TRACEVAR("g_CluiData.mutexPaintLock: %x", g_CluiData.mutexPaintLock); diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 5a71b78328..0a842dff26 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -34,10 +34,9 @@ void InitIconLibMenuIcons(); INT_PTR CloseAction(WPARAM, LPARAM) { - int k; cfg::shutDown = 1; - k = CallService(MS_SYSTEM_OKTOEXIT, 0, 0); - if (k) { + + if (Miranda_OkToExit()) { DestroyWindow(pcli->hwndContactList); PostQuitMessage(0); Sleep(0); diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 16b1e83f60..0862892698 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1482,7 +1482,7 @@ buttons_done: case ID_TRAY_EXIT: case ID_ICQ_EXIT: cfg::shutDown = 1; - if (CallService(MS_SYSTEM_OKTOEXIT, 0, 0)) + if (Miranda_OkToExit()) DestroyWindow(hwnd); break; case ID_TRAY_HIDE: diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 6d4323338e..774aabc674 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1555,7 +1555,7 @@ void HandleVersionCommand(PCommand command, TArgument*, int argc, PReply reply) else { char miranda[512]; DWORD v = pluginInfo.version; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(miranda), (LPARAM)miranda); + Miranda_GetVersionText(miranda, sizeof(miranda)); mir_snprintf(reply->message, "Miranda %s\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF)); } } diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index cd73cb1b30..eebd830f2b 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -241,7 +241,7 @@ static int ToolbarModulesLoaded(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM) { char temp[MAX_PATH]; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(temp), (LPARAM)temp); + Miranda_GetVersionText(temp, _countof(temp)); crs_a2t(vertxt, temp); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index 0a23ed5ba9..92219a5128 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -137,12 +137,12 @@ DWORD MirandaThreadFilter(DWORD code, EXCEPTION_POINTERS* info) void InitExceptionHandler(void) { - threadfltr = Miranda_SetExceptFilter(MirandaThreadFilter); + threadfltr = SetExceptionFilter(MirandaThreadFilter); SetExceptionHandler(); } void DestroyExceptionHandler(void) { - Miranda_SetExceptFilter(threadfltr); + SetExceptionFilter(threadfltr); RemoveExceptionHandler(); } diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index e768e1377e..aad3eef30a 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -114,7 +114,7 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); - CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(g_szMirVer), LPARAM(g_szMirVer)); + Miranda_GetVersionText(g_szMirVer, sizeof(g_szMirVer)); HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown); HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoad); diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index a9ebbd7d4d..0735bedc22 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -391,7 +391,7 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar uDlg->m_tabs[i]->m_job->pause(); int result = IDYES; - if (!Miranda_Terminated() && UploadJob::iRunningJobCount > 0) + if (!Miranda_IsTerminated() && UploadJob::iRunningJobCount > 0) result = Utils::msgBox(TranslateT("Do you really want to cancel all running jobs?"), MB_YESNO | MB_ICONQUESTION); if (result == IDYES) { diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp index 858bb9e58e..3a3238d7cc 100644 --- a/plugins/FTPFileYM/src/job_delete.cpp +++ b/plugins/FTPFileYM/src/job_delete.cpp @@ -42,7 +42,7 @@ void DeleteJob::waitingThread(void *arg) { DeleteJob *job = (DeleteJob *)arg; - while (!Miranda_Terminated()) { + while (!Miranda_IsTerminated()) { mir_cslockfull lock(mutexJobCount); if (iRunningJobCount < MAX_RUNNING_JOBS) { iRunningJobCount++; diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index 29ec91c4b8..47c2df2906 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -78,7 +78,7 @@ void PackerJob::waitingThread(void *arg) { PackerJob *job = (PackerJob *)arg; - while (!Miranda_Terminated()) { + while (!Miranda_IsTerminated()) { mir_cslockfull lock(mutexJobCount); if (iRunningJobCount < MAX_RUNNING_JOBS) { iRunningJobCount++; diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index 8443dafb6b..9fabe869db 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -148,7 +148,7 @@ void UploadJob::waitingThread(void *arg) { UploadJob *job = (UploadJob *)arg; - while (!Miranda_Terminated()) { + while (!Miranda_IsTerminated()) { mir_cslockfull lock(mutexJobCount); if (iRunningJobCount < MAX_RUNNING_JOBS) { iRunningJobCount++; diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 9737381a2f..62c9e21bb0 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -109,28 +109,6 @@ namespace mu } } - /* - * system - */ - - namespace system - { - DWORD getVersion() - { - return static_cast(CallService(MS_SYSTEM_GETVERSION, 0, 0)); - } - - int getVersionText(int cchVersion, char* szVersion) - { - return CallService(MS_SYSTEM_GETVERSIONTEXT, cchVersion, reinterpret_cast(szVersion)); - } - - int terminated() - { - return CallService(MS_SYSTEM_TERMINATED, 0, 0); - } - } - /* * core interface functions */ @@ -138,7 +116,7 @@ namespace mu bool load() { // check for version - if (!isMirandaVersionOk(system::getVersion())) + if (!isMirandaVersionOk(Miranda_GetVersion())) return false; return true; @@ -160,17 +138,6 @@ namespace mu bool isMirandaUnicode() { - if (system::getVersion() < PLUGIN_MAKE_VERSION(0, 4, 3, 33)) - return false; - - char szVersion[256] = { 0 }; - - if (system::getVersionText(256, szVersion) != 0) - return false; - - if (!strstr(szVersion, "Unicode")) - return false; - return true; } diff --git a/plugins/HistoryStats/src/mu_common.h b/plugins/HistoryStats/src/mu_common.h index f2afb7c9df..11905e187d 100644 --- a/plugins/HistoryStats/src/mu_common.h +++ b/plugins/HistoryStats/src/mu_common.h @@ -57,17 +57,6 @@ namespace mu HICON loadIcon(int id); } - /* - * system - */ - - namespace system - { - DWORD getVersion(); - int getVersionText(int cchVersion, char* szVersion); - int terminated(); - } - /* * updater [external] */ diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index b064304cbf..b2882ed476 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1379,7 +1379,7 @@ void __cdecl Statistic::threadProc(void *lpParameter) pStats->createStatistics(); // check for errors - if (!pStats->m_ErrorText.empty() && !mu::system::terminated()) + if (!pStats->m_ErrorText.empty() && !Miranda_IsTerminated()) MessageBox(0, pStats->m_ErrorText.c_str(), TranslateT("HistoryStats - Error"), MB_ICONERROR | MB_OK); // free statistics diff --git a/plugins/HistoryStats/src/statistic.h b/plugins/HistoryStats/src/statistic.h index 93f3d729bf..c08661a373 100644 --- a/plugins/HistoryStats/src/statistic.h +++ b/plugins/HistoryStats/src/statistic.h @@ -133,7 +133,7 @@ private: // misc routines DWORD getTimeStarted() { return m_TimeStarted; } - bool shouldTerminate() { return (WaitForSingleObject(m_hCancelEvent, 0) == WAIT_OBJECT_0) || (bool_(mu::system::terminated())); } + bool shouldTerminate() { return (WaitForSingleObject(m_hCancelEvent, 0) == WAIT_OBJECT_0) || bool_(Miranda_IsTerminated()); } void handleAddMessage(Contact& contact, Message& msg); void handleAddChat(Contact& contact, bool bOutgoing, DWORD localTimestampStarted, DWORD duration); diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 1e572922bd..9c5d016cde 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -524,8 +524,8 @@ int check() { return 1; } - if (Plugin_Terminated || Miranda_Terminated()){ - log_p(L"check: Plugin_Terminated (=%d) OR Miranda_Terminated()", Plugin_Terminated); + if (Plugin_Terminated || Miranda_IsTerminated()){ + log_p(L"check: Plugin_Terminated (=%d) OR Miranda_IsTerminated()", Plugin_Terminated); return 0; } @@ -641,8 +641,8 @@ void checkthread(void*) TIMEDATE sendDate; char strLink[4 * 16]; - if (Plugin_Terminated || Miranda_Terminated()) { - log_p(L"checkthread: Plugin_Terminated (=%d) OR Miranda_Terminated()", Plugin_Terminated); + if (Plugin_Terminated || Miranda_IsTerminated()) { + log_p(L"checkthread: Plugin_Terminated (=%d) OR Miranda_IsTerminated()", Plugin_Terminated); break; } diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index b3d859ba60..dfaf7d73f0 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -68,7 +68,7 @@ std::wstring& MirandaUtils::getDisplayName() displayName.append(L"Miranda NG v."); char mirandaVersion[128]; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(mirandaVersion), (LPARAM)mirandaVersion); + Miranda_GetVersionText(mirandaVersion, _countof(mirandaVersion)); displayName.append(_A2T(mirandaVersion)); displayName.append(L" ("); displayName.append(getProfileName()); @@ -175,11 +175,11 @@ void MirandaUtils::sendMessage(ActionThreadArgStruct* args, MFENUM_SEND_MESSAGE_ EnterCriticalSection(&ackMapCs); myMfAck = ackMap[hProcess]; LeaveCriticalSection(&ackMapCs); - if(Miranda_Terminated() || args->mirfoxDataPtr->Plugin_Terminated){ - logger->log_p(L"SMTC: ACK break by Plugin_Terminated (=%d) or Miranda_Terminated()", args->mirfoxDataPtr->Plugin_Terminated); + if(Miranda_IsTerminated() || args->mirfoxDataPtr->Plugin_Terminated){ + logger->log_p(L"SMTC: ACK break by Plugin_Terminated (=%d) or Miranda_IsTerminated()", args->mirfoxDataPtr->Plugin_Terminated); break; } - } while (myMfAck == NULL && counter <= MAX_ACK_WAIT_COUNTER); //TODO or Plugin_Terminated or Miranda_Terminated() + } while (myMfAck == NULL && counter <= MAX_ACK_WAIT_COUNTER); //TODO or Plugin_Terminated or Miranda_IsTerminated() logger->log_p(L"SMTC: ACK found counter = [%d] myMfAck = [" SCNuPTR L"]", counter, myMfAck); } diff --git a/plugins/MirFox/src/MirfoxMiranda.cpp b/plugins/MirFox/src/MirfoxMiranda.cpp index f5d64b0450..0a59139994 100644 --- a/plugins/MirFox/src/MirfoxMiranda.cpp +++ b/plugins/MirFox/src/MirfoxMiranda.cpp @@ -121,7 +121,7 @@ void CMirfoxMiranda::onContactAdded_async(void* threadArg) bool canAdd = true; // ceck miranda - if (Miranda_Terminated() || mirfoxMiranda->getMirfoxData().Plugin_Terminated) + if (Miranda_IsTerminated() || mirfoxMiranda->getMirfoxData().Plugin_Terminated) canAdd = false; // check if hContact still exist @@ -182,7 +182,7 @@ void CMirfoxMiranda::onContactSettingChanged_async(void* threadArg){ bool canAdd = true; // ceck miranda - if (Miranda_Terminated() || mirfoxMiranda->getMirfoxData().Plugin_Terminated) + if (Miranda_IsTerminated() || mirfoxMiranda->getMirfoxData().Plugin_Terminated) canAdd = false; // check if hContact still exist @@ -393,8 +393,8 @@ void CMirfoxMiranda::csmThread(void* threadArg) SleepEx(CSMTHREAD_TICK_TIME, TRUE); //check exit every 0,1s //if miranda is exiting - exit this thread - if (Miranda_Terminated() || mirfoxDataPtr->Plugin_Terminated){ - logger->log_p(L"MirfoxMiranda::csmThread break by Plugin_Terminated (=%d) or Miranda_Terminated()", mirfoxDataPtr->Plugin_Terminated); + if (Miranda_IsTerminated() || mirfoxDataPtr->Plugin_Terminated){ + logger->log_p(L"MirfoxMiranda::csmThread break by Plugin_Terminated (=%d) or Miranda_IsTerminated()", mirfoxDataPtr->Plugin_Terminated); break; } @@ -540,8 +540,8 @@ void CMirfoxMiranda::msgQueueThread(void* threadArg) SleepEx(MQTHREAD_TICK_TIME, TRUE); //check exit every 0,1s //if miranda is exiting - exit this thread - if (Miranda_Terminated() || mirfoxDataPtr->Plugin_Terminated){ - logger->log_p(L"mqThread break by Plugin_Terminated (=%d) or Miranda_Terminated()", mirfoxDataPtr->Plugin_Terminated); + if (Miranda_IsTerminated() || mirfoxDataPtr->Plugin_Terminated){ + logger->log_p(L"mqThread break by Plugin_Terminated (=%d) or Miranda_IsTerminated()", mirfoxDataPtr->Plugin_Terminated); delete [] userActionSelection; break; } diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index fa4a769a74..46d6c50c8b 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -423,7 +423,7 @@ LUAMOD_API int luaopen_m_core(lua_State *L) lua_setfield(L, -2, "CALLSERVICE_NOTFOUND"); char version[128]; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(version), (LPARAM)version); + Miranda_GetVersionText(version, _countof(version)); lua_pushstring(L, ptrA(mir_utf8encode(version))); lua_setfield(L, -2, "Version"); diff --git a/plugins/MirLua/src/mlua_utils.cpp b/plugins/MirLua/src/mlua_utils.cpp index ec08831a1d..7323755ea5 100644 --- a/plugins/MirLua/src/mlua_utils.cpp +++ b/plugins/MirLua/src/mlua_utils.cpp @@ -18,7 +18,7 @@ void Log(const wchar_t *format, ...) void ShowNotification(const char *caption, const char *message, int flags, MCONTACT hContact) { - if (Miranda_Terminated()) + if (Miranda_IsTerminated()) return; if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index c521025ef2..ccc723812a 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -203,7 +203,7 @@ extern "C" { wchar_t buff[512]; mir_snwprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); //MessageBox(0, buff, Translate("OTR Information"), MB_OK); - if (!Miranda_Terminated()) { + if (!Miranda_IsTerminated()) { ShowMessage(hContact, buff); } diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 74934fbfd1..4dd0ca4f59 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -108,7 +108,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) mir_free(uname); OtrlTLV *tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED); - if (tlv && !Miranda_Terminated()) { + if (tlv && !Miranda_IsTerminated()) { /* Notify the user that the other side disconnected. */ wchar_t buff[256]; mir_snwprintf(buff, TranslateW(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index d0447831d6..12d5d553ab 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -111,7 +111,7 @@ wchar_t* ProtoGetNickname(const char* proto) } void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact) { - if(CallService(MS_SYSTEM_TERMINATED, 0, 0)) return; + if(Miranda_IsTerminated()) return; if ( !options.bHavePopups) { wchar_t title[256]; diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp index 5d0c349801..f83dc3a0be 100644 --- a/plugins/NewAwaySysMod/src/Client.cpp +++ b/plugins/NewAwaySysMod/src/Client.cpp @@ -36,7 +36,7 @@ void __cdecl UpdateMsgsThreadProc(void *) PROTOACCOUNT **accs; Proto_EnumAccounts(&numAccs, &accs); - while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_Terminated()) { + while (WaitForSingleObject(g_hTerminateUpdateMsgsThread, 0) == WAIT_TIMEOUT && !Miranda_IsTerminated()) { DWORD MinUpdateTimeDifference = (DWORD)g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_UPDATEMSGSPERIOD) * 1000; // in milliseconds for (int i = 0; i < numAccs; i++) { PROTOACCOUNT *p = accs[i]; diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 69bcc3bf16..a2bc038bfa 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -83,7 +83,7 @@ void init_vars() bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0) != 0; password = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); debuglog.init(); - bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001; + bIsMiranda09 = false; bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09) != 0; bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0) != 0; bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0) != 0; diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index 196d47df2a..245229e698 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -28,7 +28,7 @@ UPDATELIST *UpdateListTail = NULL; void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD) { // only run if it is not current updating and the auto update option is enabled - if (!ThreadRunning && !Miranda_Terminated()) { + if (!ThreadRunning && !Miranda_IsTerminated()) { bool HaveUpdates = FALSE; for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) { @@ -51,7 +51,7 @@ void CALLBACK timerProc2(HWND, UINT, UINT_PTR, DWORD) KillTimer(NULL, timerId); ThreadRunning = FALSE; - if (db_get_b(NULL, MODULE, "AutoUpdate", 1) && !Miranda_Terminated()) { + if (db_get_b(NULL, MODULE, "AutoUpdate", 1) && !Miranda_IsTerminated()) { if (db_get_b(NULL, MODULE, "StartupRetrieve", 1)) CheckAllFeeds(0, 1); timerId = SetTimer(NULL, 0, 30000, (TIMERPROC)timerProc); @@ -125,7 +125,7 @@ void UpdateThreadProc(void *AvatarCheck) CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); // update news by getting the first station from the queue until the queue is empty - while (UpdateListHead != NULL && !Miranda_Terminated()) { + while (UpdateListHead != NULL && !Miranda_IsTerminated()) { if (AvatarCheck != NULL) CheckCurrentFeedAvatar(UpdateGetFirst()); else diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 8eb2002532..f1882181dc 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -28,7 +28,7 @@ void CALLBACK sttMainThreadCallback(ULONG_PTR dwParam) void __stdcall ShowPopup(wchar_t *line1, wchar_t *line2, int flags) { - if (CallService(MS_SYSTEM_TERMINATED, 0, 0)) return; + if (Miranda_IsTerminated()) return; if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) { ShowClassPopupT("pingpopups", line1, line2); diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 2ba4607482..536e018471 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -44,7 +44,7 @@ static int GetUpdateMode() if (UpdateMode < 0 || UpdateMode > UPDATE_MODE_MAX_VALUE) { // Missing or unknown mode, determine correct from version of running core char coreVersion[512]; - CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)_countof(coreVersion), (LPARAM)coreVersion); + Miranda_GetVersionText(coreVersion, _countof(coreVersion)); UpdateMode = (strstr(coreVersion, "alpha") == NULL) ? UPDATE_MODE_STABLE : UPDATE_MODE_TRUNK; } diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 3cb5dad4f2..d1cf8d8a17 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -680,7 +680,7 @@ int ModeChange(WPARAM, LPARAM lparam) if ((isetting > ID_STATUS_OFFLINE) && ((WORD)ack->hProcess <= ID_STATUS_OFFLINE)) { //we have just loged-in db_set_dw(NULL, "UserOnline", ack->szModule, GetTickCount()); - if (!Miranda_Terminated() && IsWatchedProtocol(ack->szModule)) { + if (!Miranda_IsTerminated() && IsWatchedProtocol(ack->szModule)) { logthread_info *info = (logthread_info *)mir_alloc(sizeof(logthread_info)); mir_strncpy(info->sProtoName, courProtoName, _countof(info->sProtoName)); info->hContact = 0; diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 1cd20ad1ba..6aaa1dde2f 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -74,7 +74,7 @@ BOOL AddToList(TAddArgList& args) DWORD attr = GetFileAttributesA(args.szFile); if (attr != 0xFFFFFFFF && (attr & FILE_ATTRIBUTE_HIDDEN) == 0) { if ((args.count % 10) == 5) - if (CallService(MS_SYSTEM_TERMINATED, 0, 0) != 0) + if (Miranda_IsTerminated() != 0) return true; if (attr & FILE_ATTRIBUTE_DIRECTORY) { @@ -490,7 +490,7 @@ void __cdecl ThreadServer(HANDLE hMainThread) if (retVal == WAIT_OBJECT_0) QueueUserAPC(ipcService, hMainThread, 0); - if (CallService(MS_SYSTEM_TERMINATED, 0, 0) == 1) + if (Miranda_IsTerminated() == 1) break; } CloseHandle(hEvent); diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index a0b4f95870..4b942d6ef9 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -822,7 +822,7 @@ INT_PTR ShowStatusMessageDialogInternal(WPARAM, LPARAM lParam) struct MsgBoxInitData *box_data; BOOL idvstatusmsg = FALSE; - if (Miranda_Terminated()) return 0; + if (Miranda_IsTerminated()) return 0; if (hTTBButton) { CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButton, (LPARAM)0); @@ -898,7 +898,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM, LPARAM lParam) struct MsgBoxInitData *box_data; BOOL idvstatusmsg = FALSE; - if (Miranda_Terminated()) return 0; + if (Miranda_IsTerminated()) return 0; box_data = (struct MsgBoxInitData *)mir_alloc(sizeof(struct MsgBoxInitData)); @@ -945,7 +945,7 @@ INT_PTR ShowStatusMessageDialog(WPARAM, LPARAM lParam) int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) { - if (Miranda_Terminated()) + if (Miranda_IsTerminated()) return 0; int iStatus = (int)wParam; diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 8e7fa9f86f..fe117a0b9e 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -129,7 +129,7 @@ void __cdecl SmileyDownloadThread(void*) bool needext = false; HANDLE hHttpDwnl = NULL; WaitForSingleObject(g_hDlMutex, 3000); - while (!Miranda_Terminated() && dlQueue.getCount()) { + while (!Miranda_IsTerminated() && dlQueue.getCount()) { ReleaseMutex(g_hDlMutex); if (_waccess(dlQueue[0].fname.c_str(), 0) != 0) { InternetDownloadFile(_T2A(dlQueue[0].url.c_str()), _T2A(dlQueue[0].fname.c_str()), hHttpDwnl); @@ -148,7 +148,7 @@ void __cdecl SmileyDownloadThread(void*) threadRunning = false; ReleaseMutex(g_hDlMutex); - if (!Miranda_Terminated()) { + if (!Miranda_IsTerminated()) { if (needext) CallServiceSync(MS_SMILEYADD_RELOAD, 0, 0); else diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 2731a951a9..4b0203cf0e 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -66,7 +66,7 @@ void SplashMain() // Retrive path to exe of current running Miranda is located szMirDir = Utils_ReplaceVarsW(L"%miranda_path%"); mir_snwprintf(szhAdvaimgPath, L"%s\\plugins\\advaimg.dll", szMirDir); - CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion); + Miranda_GetVersionText(szVersion, MAX_PATH); #ifdef _DEBUG mir_snwprintf(szLogFile, L"%s\\%s.log", szMirDir, _A2W(__PLUGIN_NAME)); diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/keepstatus.cpp index 0667585be3..41c244cde4 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/keepstatus.cpp @@ -142,7 +142,7 @@ int KSLoadMainOptions() if (ServiceExists(ME_CS_STATUSCHANGE)) hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange); hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); - if (db_get_b(NULL, KSMODULENAME, SETTING_CHECKAPMRESUME, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) { + if (db_get_b(NULL, KSMODULENAME, SETTING_CHECKAPMRESUME, 0)) { if (!IsWindow(hMessageWindow)) { hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); diff --git a/plugins/StatusManager/src/ks_options.cpp b/plugins/StatusManager/src/ks_options.cpp index e76a4464b6..890981a8c1 100644 --- a/plugins/StatusManager/src/ks_options.cpp +++ b/plugins/StatusManager/src/ks_options.cpp @@ -170,9 +170,9 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetDlgItemInt(hwndDlg, IDC_MAXDELAY, db_get_dw(NULL, KSMODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY), FALSE); SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, db_get_dw(NULL, KSMODULENAME, SETTING_MAXCONNECTINGTIME, 0), FALSE); CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, db_get_b(NULL, KSMODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, (db_get_b(NULL, KSMODULENAME, SETTING_CNCOTHERLOC, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, (db_get_b(NULL, KSMODULENAME, SETTING_CNCOTHERLOC, FALSE)) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_LOGINERR, db_get_b(NULL, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_NOTHING ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, (db_get_b(NULL, KSMODULENAME, SETTING_CHECKAPMRESUME, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, (db_get_b(NULL, KSMODULENAME, SETTING_CHECKAPMRESUME, FALSE)) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, (db_get_b(NULL, KSMODULENAME, SETTING_FIRSTOFFLINE, FALSE)) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_NOLOCKED, (db_get_b(NULL, KSMODULENAME, SETTING_NOLOCKED, FALSE)) ? BST_CHECKED : BST_UNCHECKED); SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, db_get_dw(NULL, KSMODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE); @@ -235,13 +235,13 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case KS_ENABLEITEMS: EnableWindow(GetDlgItem(hwndDlg, IDC_INCREASEEXPONENTIAL), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_MAXCONNECTINGTIME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CNCOTHERLOC), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CNCOTHERLOC), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_SETDELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_CANCEL), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_MAXDELAY), (IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHECKAPMRESUME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHECKAPMRESUME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_FIRSTOFFLINE), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_NOLOCKED), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); EnableWindow(GetDlgItem(hwndDlg, IDC_PINGCOUNT), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_BYPING, 0)); diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 1d636d1fe3..5052e5f644 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -577,7 +577,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TranslateDialogDefault(hwndDlg); { WORD v[4]; - CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); + Miranda_GetFileVersion(&v); wchar_t tStr[80]; mir_snwprintf(tStr, L"%s %d.%d.%d.%d [build %d]", diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index f0e86cabb9..8fa62b1c8f 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -109,7 +109,7 @@ unsigned int CALLBACK MessagePumpThread(void*) CLCINFOTIPEX *clcitex = NULL; MSG hwndMsg = {0}; - while (GetMessage(&hwndMsg, NULL, 0, 0) > 0 && !Miranda_Terminated()) { + while (GetMessage(&hwndMsg, NULL, 0, 0) > 0 && !Miranda_IsTerminated()) { if (hwndMsg.hwnd != NULL && IsDialogMessage(hwndMsg.hwnd, &hwndMsg)) /* Wine fix. */ continue; switch (hwndMsg.message) { diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index f1a1d753c0..da9874adad 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -598,9 +598,7 @@ static wchar_t* parseVersionString(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE; char versionString[128]; - if (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(versionString), (LPARAM)versionString)) - return NULL; - + Miranda_GetVersionText(versionString, sizeof(versionString)); return mir_a2u(versionString); } diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 148f53ba65..578bec0a8d 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -290,7 +290,7 @@ static void UpdateThreadProc(void *) ReleaseMutex(hUpdateMutex); // update weather by getting the first station from the queue until the queue is empty - while (UpdateListHead != NULL && !Miranda_Terminated()) + while (UpdateListHead != NULL && !Miranda_IsTerminated()) UpdateWeather(UpdateGetFirst()); NetlibHttpDisconnect(); @@ -588,7 +588,7 @@ int GetWeatherData(MCONTACT hContact) void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD) { // only run if it is not current updating and the auto update option is enabled - if (!ThreadRunning && opt.CAutoUpdate && !Miranda_Terminated() && (opt.NoProtoCondition || status == ID_STATUS_ONLINE)) + if (!ThreadRunning && opt.CAutoUpdate && !Miranda_IsTerminated() && (opt.NoProtoCondition || status == ID_STATUS_ONLINE)) UpdateAll(TRUE, FALSE); } @@ -600,7 +600,7 @@ void CALLBACK timerProc2(HWND, UINT, UINT_PTR, DWORD) KillTimer(NULL, timerId); ThreadRunning = FALSE; - if (Miranda_Terminated()) + if (Miranda_IsTerminated()) return; if (opt.StartupUpdate && opt.NoProtoCondition) -- cgit v1.2.3