summaryrefslogtreecommitdiff
path: root/src/modules/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protocols.cpp21
1 files changed, 19 insertions, 2 deletions
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);