From e521cf5548352e7a443241e10614f97bc9630a2c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 11 Jun 2015 19:06:07 +0000 Subject: - more transparent ProtoServiceExists implementation; - ProtoServiceExists moved from mir_core into miranda32.exe; - miranda32.def is used again to define the order of functions precisely; - libraries updated git-svn-id: http://svn.miranda-ng.org/main/trunk@14118 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/protocols/protocols.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/modules/protocols') diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index c1eff7848e..273fb85dd9 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -100,9 +100,9 @@ INT_PTR srvProto_IsLoaded(WPARAM, LPARAM lParam) return (INT_PTR)Proto_IsProtocolLoaded((char*)lParam); } -static PROTO_INTERFACE* defInitProto(const char* szModuleName, const TCHAR*) +static PROTO_INTERFACE* defInitProto(const char* szModule, const TCHAR*) { - return AddDefaultAccount(szModuleName); + return AddDefaultAccount(szModule); } static INT_PTR srvProto_RegisterModule(WPARAM, LPARAM lParam) @@ -366,6 +366,23 @@ static INT_PTR Proto_BroadcastAck(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// +int ProtoServiceExists(const char *szModule, const char *szService) +{ + if (szModule == NULL || szService == NULL) + return false; + + TServiceListItem *item = (TServiceListItem*)bsearch(&szService, serviceItems, _countof(serviceItems), sizeof(serviceItems[0]), CompareServiceItems); + if (item != NULL) + return true; + + char str[MAXMODULELABELLENGTH * 2]; + strncpy_s(str, szModule, _TRUNCATE); + strncat_s(str, szService, _TRUNCATE); + return ServiceExists(str); +} + +///////////////////////////////////////////////////////////////////////////////////////// + INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wParam, LPARAM lParam) { return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam); -- cgit v1.2.3