From b660fac5560005706aeab0a0d5ad2b32bdcaf929 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 1 Jun 2015 17:20:04 +0000 Subject: - ProtoCallService() function considered too dangerous and therefore isn't exported anymore, it's closed in the core, CallProtoService() is used instead everywhere; - fixes for some quirks with PS_* calls. git-svn-id: http://svn.miranda-ng.org/main/trunk@13959 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/miranda.h | 2 ++ src/core/stdautoaway/src/autoaway.cpp | 7 +++---- src/core/stdchat/src/window.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/miranda.h b/src/core/miranda.h index c5008e358a..5d31e64aed 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -142,6 +142,8 @@ void KillModuleMenus(int hLangpack); extern LIST accounts; +INT_PTR ProtoCallService(LPCSTR szModule, const char *szService, WPARAM wParam, LPARAM lParam); + PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBaseProto, const TCHAR *tszAccountName); PROTOACCOUNT* __fastcall Proto_GetAccount(const char *accName); diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index f501ec2bda..e3aa0603de 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -45,12 +45,11 @@ static bool Proto_IsAccountLocked(PROTOACCOUNT *pa) return pa && db_get_b(NULL, pa->szModuleName, "LockMainStatus", 0) != 0; } -static void Proto_SetStatus(const char* szProto, unsigned status) +static void Proto_SetStatus(const char *szProto, unsigned status) { if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) { - TCHAR *awayMsg = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto); - CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)awayMsg); - mir_free(awayMsg); + ptrT awayMsg((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, (LPARAM)szProto)); + CallProtoService(szProto, PS_SETAWAYMSG, status, awayMsg); } CallProtoService(szProto, PS_SETSTATUS, status, 0); diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 806fa9a128..e8e9071dd4 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -989,7 +989,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si USERINFO *ui = pci->SM_GetUserFromIndex(si->ptszID, si->pszModule, currentHovered); if (ui) { if (ProtoServiceExists(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT)) { - TCHAR *p = (TCHAR*)ProtoCallService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID); + TCHAR *p = (TCHAR*)CallProtoService(si->pszModule, MS_GC_PROTO_GETTOOLTIPTEXT, (WPARAM)si->ptszID, (LPARAM)ui->pszUID); if (p != NULL) { _tcsncpy_s(tszBuf, p, _TRUNCATE); mir_free(p); -- cgit v1.2.3