From 773421e8ba17637d994088c393d406226b516a30 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 11 Oct 2013 14:01:25 +0000 Subject: - 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 --- src/mir_core/mir_core.def | 2 ++ src/mir_core/protos.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src') 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 #include #include +#include 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) { -- cgit v1.2.3