From 5dbe3cb375f54da70a80cf1a2cbc94836f82eeaa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 21 Jun 2013 13:54:41 +0000 Subject: new helper ProtoCallService - simply glues module & service name, and then simplyu calls CallService() git-svn-id: http://svn.miranda-ng.org/main/trunk@5077 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/lib/mir_core.lib | Bin 36730 -> 36960 bytes bin10/lib/mir_core64.lib | Bin 33526 -> 33732 bytes bin11/lib/mir_core.lib | Bin 36730 -> 36960 bytes bin11/lib/mir_core64.lib | Bin 33526 -> 33732 bytes include/delphi/m_core.inc | 3 +++ include/m_core.h | 1 + src/mir_core/mir_core.def | 1 + src/mir_core/protos.cpp | 13 +++++++++++++ 8 files changed, 18 insertions(+) diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib index c91ae88aa6..8997fe9dd9 100644 Binary files a/bin10/lib/mir_core.lib and b/bin10/lib/mir_core.lib differ diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib index d0d80964d2..8a267f612e 100644 Binary files a/bin10/lib/mir_core64.lib and b/bin10/lib/mir_core64.lib differ diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib index b1a0f8e48c..14d30e8010 100644 Binary files a/bin11/lib/mir_core.lib and b/bin11/lib/mir_core.lib differ diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib index 583d63393c..8a267f612e 100644 Binary files a/bin11/lib/mir_core64.lib and b/bin11/lib/mir_core64.lib differ diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 2ab7632acc..c7f7dc6428 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -524,6 +524,9 @@ function mir_vsntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list): function ProtoBroadcastAck(const szModule: PAnsiChar; hContact: THandle; type_: int; result_: int; hProcess: THandle; lParam: LPARAM): int_ptr; stdcall; external CoreDLL name 'ProtoBroadcastAck'; +function ProtoCallService(const szModule, szName:PAnsiChar; wParam:WPARAM; lParam:LPARAM):int_ptr; stdcall; + external CoreDLL name 'ProtoServiceExists'; + function ProtoServiceExists(const szModule, szName:PAnsiChar):int; stdcall; external CoreDLL name 'ProtoServiceExists'; diff --git a/include/m_core.h b/include/m_core.h index 7e3c4ea99f..1cb48af582 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -433,6 +433,7 @@ MIR_CORE_DLL(int) mir_vsntprintf(TCHAR *buffer, size_t count, const TCHAR* fm /////////////////////////////////////////////////////////////////////////////// // protocol functions +MIR_CORE_DLL(INT_PTR) ProtoCallService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam); MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService); MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam); diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def index 5631c9c335..4a57e3a945 100644 --- a/src/mir_core/mir_core.def +++ b/src/mir_core/mir_core.def @@ -163,3 +163,4 @@ mir_base64_encode @160 mir_base64_decode @161 ProtoServiceExists @162 ProtoBroadcastAck @163 +ProtoCallService @164 diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp index dfa83a1800..6f2309e412 100644 --- a/src/mir_core/protos.cpp +++ b/src/mir_core/protos.cpp @@ -58,6 +58,19 @@ MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, HANDLE hContact, i ///////////////////////////////////////////////////////////////////////////////////////// +MIR_CORE_DLL(INT_PTR) ProtoCallService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam) +{ + if (szModule == NULL || szService == NULL) + return false; + + char str[MAXMODULELABELLENGTH * 2]; + strncpy_s(str,szModule,strlen(szModule)); + strncat_s(str,szService,strlen(szService)); + return CallService(str, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// + MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService) { if (szModule == NULL || szService == NULL) -- cgit v1.2.3