summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-11 14:01:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-11 14:01:25 +0000
commit773421e8ba17637d994088c393d406226b516a30 (patch)
tree130c0bf529e30f493ae4f2abbe1230d31fecdeed /src
parent3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff)
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/mir_core.def2
-rw-r--r--src/mir_core/protos.cpp19
2 files changed, 21 insertions, 0 deletions
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def
index add3c18cf3..e78ccb8ffa 100644
--- a/src/mir_core/mir_core.def
+++ b/src/mir_core/mir_core.def
@@ -243,3 +243,5 @@ IsWinVer7Plus @240
IsFullScreen @241
IsWorkstationLocked @242
IsScreenSaverRunning @243
+ProtoLogA @244
+ProtoLogW @245
diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp
index 369f8b7abd..02d5cb2139 100644
--- a/src/mir_core/protos.cpp
+++ b/src/mir_core/protos.cpp
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_protomod.h>
#include <m_protoint.h>
#include <m_skin.h>
+#include <m_netlib.h>
static HANDLE hAckEvent;
@@ -42,6 +43,24 @@ void UninitProtocols()
}
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_CORE_DLL(void) ProtoLogA(struct PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args)
+{
+ char buf[4096];
+ vsprintf_s(buf, sizeof(buf), szFormat, args);
+ CallService(MS_NETLIB_LOG, (WPARAM)pThis->m_hNetlibUser, (LPARAM)buf);
+}
+
+MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args)
+{
+ WCHAR buf[4096];
+ vswprintf_s(buf, SIZEOF(buf), wszFormat, args);
+ CallService(MS_NETLIB_LOGW, (WPARAM)pThis->m_hNetlibUser, (LPARAM)buf);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
MIR_CORE_DLL(INT_PTR) ProtoBroadcastAck(const char *szModule, HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
if (type == ACKTYPE_AVATAR && hProcess) {