summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/proto.cpp7
-rw-r--r--protocols/Discord/src/proto.cpp6
-rw-r--r--protocols/FacebookRM/src/http_request.h4
-rw-r--r--protocols/FacebookRM/src/proto.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp5
-rw-r--r--protocols/IRCG/src/ircproto.cpp9
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp12
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h2
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp8
-rw-r--r--protocols/IcqOscarJ/src/utilities.h2
-rw-r--r--protocols/JabberG/src/jabber_ws.cpp4
-rw-r--r--protocols/MRA/src/MraAvatars.cpp4
-rw-r--r--protocols/MRA/src/MraProto.cpp4
-rw-r--r--protocols/MSN/src/msn_proto.cpp10
-rw-r--r--protocols/MSN/src/msn_proto.h2
-rw-r--r--protocols/MinecraftDynmap/src/proto.cpp4
-rw-r--r--protocols/Omegle/src/proto.cpp4
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp6
-rw-r--r--protocols/SkypeWeb/src/http_request.h4
-rw-r--r--protocols/SkypeWeb/src/skype_network.cpp5
-rw-r--r--protocols/Steam/src/http_request.h4
-rw-r--r--protocols/Steam/src/steam_proto.cpp4
-rw-r--r--protocols/Tlen/src/tlen_ws.cpp15
-rw-r--r--protocols/Tox/src/tox_netlib.cpp5
-rw-r--r--protocols/Twitter/src/proto.cpp6
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp4
-rw-r--r--protocols/WhatsApp/src/WASocketConnection.cpp4
-rw-r--r--protocols/WhatsApp/src/WASocketConnection.h2
-rw-r--r--protocols/WhatsApp/src/proto.cpp4
-rw-r--r--protocols/WhatsApp/src/stdafx.h2
31 files changed, 72 insertions, 86 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index f3dbb61265..a670de6faa 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -48,13 +48,12 @@ CAimProto::CAimProto(const char* aProtoName, const wchar_t* aUserName) :
wchar_t descr[MAX_PATH];
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
char szP2P[128];
mir_snprintf(szP2P, "%sP2P", m_szModuleName);
@@ -62,7 +61,7 @@ CAimProto::CAimProto(const char* aProtoName, const wchar_t* aUserName) :
mir_snwprintf(descr, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.szSettingsModule = szP2P;
nlu.minIncomingPorts = 1;
- m_hNetlibPeer = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibPeer = Netlib_RegisterUser(&nlu);
}
CAimProto::~CAimProto()
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index ea3975a983..427fba67d2 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -68,20 +68,20 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) :
// Network initialization
CMStringW descr;
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.szSettingsModule = m_szModuleName;
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
descr.Format(TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr.GetBuffer();
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
CMStringA module(FORMAT, "%s.Gateway", m_szModuleName);
nlu.szSettingsModule = module.GetBuffer();
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_UNICODE;
descr.Format(TranslateT("%s gateway connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr.GetBuffer();
- m_hGatewayNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hGatewayNetlibUser = Netlib_RegisterUser(&nlu);
}
CDiscordProto::~CDiscordProto()
diff --git a/protocols/FacebookRM/src/http_request.h b/protocols/FacebookRM/src/http_request.h
index ceab52b405..634b24605a 100644
--- a/protocols/FacebookRM/src/http_request.h
+++ b/protocols/FacebookRM/src/http_request.h
@@ -287,9 +287,7 @@ public:
dataLength = (int)mir_strlen(pData);
}
- char message[1024];
- mir_snprintf(message, "Send request to %s", szUrl);
- CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
+ Netlib_Logf(NULL, "Send request to %s", szUrl);
return (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)(NETLIBHTTPREQUEST*)this);
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 98c301eb21..73ff55b9c0 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -84,12 +84,12 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
// Create standard network connection
wchar_t descr[512];
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index b9c0fd0610..cf2ec94613 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -442,7 +442,7 @@ void gg_debughandler(int level, const char *format, va_list ap)
memcpy(szText, prefix, PREFIXLEN);
mir_vsnprintf(szText + mir_strlen(szText), sizeof(szText) - mir_strlen(szText), szFormat, ap);
- CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText);
+ Netlib_Log(NULL, szText);
free(szFormat);
}
#endif
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 1001112208..5606f0a398 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -42,13 +42,12 @@ GGPROTO::GGPROTO(const char *pszProtoName, const wchar_t *tszUserName) :
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
// Register services
CreateProtoService(PS_GETAVATARCAPS, &GGPROTO::getavatarcaps);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index de31e447f3..440359e82a 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -173,17 +173,16 @@ static int sttCheckPerform(const char *szSetting, LPARAM lParam)
int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
{
- NETLIBUSER nlu = { 0 };
wchar_t name[128];
+ mir_snwprintf(name, TranslateT("%s server connection"), m_tszUserName);
db_unset(NULL, m_szModuleName, "JTemp");
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
- mir_snwprintf(name, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = name;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
char szTemp2[256];
@@ -191,7 +190,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
nlu.szSettingsModule = szTemp2;
mir_snwprintf(name, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.ptszDescriptiveName = name;
- hNetlibDCC = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ hNetlibDCC = Netlib_RegisterUser(&nlu);
GCREGISTER gcr = {};
gcr.dwFlags = GC_CHANMGR | GC_BOLD | GC_ITALICS | GC_UNDERLINE | GC_COLOR | GC_BKGCOLOR;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index d9ed1b32dd..e385a13aec 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -156,10 +156,10 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CIcqProto::OnPreBuildStatusMenu);
// Register netlib users
- NETLIBUSER nlu = { 0 };
wchar_t szBuffer[MAX_PATH + 64];
mir_snwprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
- nlu.cbSize = sizeof(nlu);
+
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = m_szModuleName;
@@ -169,7 +169,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
nlu.pfnHttpGatewayBegin = icq_httpGatewayBegin;
nlu.pfnHttpGatewayWrapSend = icq_httpGatewayWrapSend;
nlu.pfnHttpGatewayUnwrapRecv = icq_httpGatewayUnwrapRecv;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
char szP2PModuleName[MAX_PATH];
mir_snprintf(szP2PModuleName, "%sP2P", m_szModuleName);
@@ -178,7 +178,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = szP2PModuleName;
nlu.minIncomingPorts = 1;
- m_hDirectNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hDirectNetlibUser = Netlib_RegisterUser(&nlu);
// Register custom database events
DBEVENTTYPEDESCR eventType = { sizeof(eventType) };
@@ -211,8 +211,8 @@ CIcqProto::~CIcqProto()
delete m_arAvatars[i];
// NetLib clean-up
- NetLib_SafeCloseHandle(&m_hDirectNetlibUser);
- NetLib_SafeCloseHandle(&m_hNetlibUser);
+ Netlib_CloseHandle(m_hDirectNetlibUser);
+ Netlib_CloseHandle(m_hNetlibUser);
// Destroy hookable events
if (m_modeMsgsEvent)
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 3c5da05d35..7fa039a78b 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -140,7 +140,7 @@ struct CIcqProto : public PROTO<CIcqProto>
int __cdecl OnPreBuildStatusMenu(WPARAM, LPARAM);
//====| Data |========================================================================
- HANDLE m_hDirectNetlibUser;
+ HNETLIBUSER m_hDirectNetlibUser;
BYTE m_bGatewayMode;
BYTE m_bSecureLogin;
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 49ef420754..7ad7f12dbf 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -1361,7 +1361,7 @@ DWORD ICQWaitForSingleObject(HANDLE hObject, DWORD dwMilliseconds, int bWaitAlwa
}
-HANDLE NetLib_OpenConnection(HANDLE hUser, const char* szIdent, NETLIBOPENCONNECTION* nloc)
+HANDLE NetLib_OpenConnection(HNETLIBUSER hUser, const char* szIdent, NETLIBOPENCONNECTION* nloc)
{
Netlib_Logf(hUser, "%sConnecting to %s:%u", szIdent ? szIdent : "", nloc->szHost, nloc->wPort);
@@ -1417,7 +1417,7 @@ int CIcqProto::NetLog_Direct(const char *fmt, ...)
va_start(va, fmt);
mir_vsnprintf(szText, sizeof(szText), fmt, va);
va_end(va);
- return CallService(MS_NETLIB_LOG, (WPARAM)m_hDirectNetlibUser, (LPARAM)szText);
+ return Netlib_Log(m_hDirectNetlibUser, szText);
}
int CIcqProto::NetLog_Uni(BOOL bDC, const char *fmt, ...)
@@ -1428,8 +1428,8 @@ int CIcqProto::NetLog_Uni(BOOL bDC, const char *fmt, ...)
mir_vsnprintf(szText, sizeof(szText), fmt, va);
va_end(va);
- HANDLE hNetlib = (bDC) ? m_hDirectNetlibUser : m_hNetlibUser;
- return CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)szText);
+ HNETLIBUSER hNetlib = (bDC) ? m_hDirectNetlibUser : m_hNetlibUser;
+ return Netlib_Log(hNetlib, szText);
}
char* __fastcall ICQTranslateUtf(const char *src)
diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h
index 119ebe79eb..ad5907c1bb 100644
--- a/protocols/IcqOscarJ/src/utilities.h
+++ b/protocols/IcqOscarJ/src/utilities.h
@@ -95,7 +95,7 @@ __inline static void SAFE_FREE(WCHAR** str) { SAFE_FREE((void**)str); }
DWORD ICQWaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds, int bWaitAlways = FALSE);
-HANDLE NetLib_OpenConnection(HANDLE hUser, const char* szIdent, NETLIBOPENCONNECTION* nloc);
+HANDLE NetLib_OpenConnection(HNETLIBUSER hUser, const char* szIdent, NETLIBOPENCONNECTION* nloc);
void NetLib_CloseConnection(HANDLE *hConnection, int bServerConn);
void NetLib_SafeCloseHandle(HANDLE *hConnection);
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp
index 208a55c37f..986d1620c1 100644
--- a/protocols/JabberG/src/jabber_ws.cpp
+++ b/protocols/JabberG/src/jabber_ws.cpp
@@ -31,11 +31,11 @@ BOOL CJabberProto::WsInit(void)
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = m_szModuleName;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
return m_hNetlibUser != NULL;
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp
index 74c8009b29..6fb91f4131 100644
--- a/protocols/MRA/src/MraAvatars.cpp
+++ b/protocols/MRA/src/MraAvatars.cpp
@@ -58,11 +58,11 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
wchar_t szBuffer[MAX_PATH];
mir_snwprintf(szBuffer, L"%s %s", m_tszUserName, TranslateT("Avatars' plugin connections"));
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = MRA_AVT_SECT_NAME;
nlu.ptszDescriptiveName = szBuffer;
- pmraaqAvatarsQueue->hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ pmraaqAvatarsQueue->hNetlibUser = Netlib_RegisterUser(&nlu);
if (pmraaqAvatarsQueue->hNetlibUser) {
pmraaqAvatarsQueue->iThreadsCount = db_get_dw(NULL, MRA_AVT_SECT_NAME, "WorkThreadsCount", MRA_AVT_DEFAULT_WRK_THREAD_COUNTS);
if (pmraaqAvatarsQueue->iThreadsCount == 0)
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index a8daef4625..71b3f23c66 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -38,11 +38,11 @@ CMraProto::CMraProto(const char* _module, const wchar_t* _displayName) :
wchar_t name[MAX_PATH];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
InitMenus();
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 1efe0b33d9..61eab09889 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -137,18 +137,16 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :
wchar_t szBuffer[MAX_PATH];
char szDbsettings[64];
- NETLIBUSER nlu1 = { 0 };
- nlu1.cbSize = sizeof(nlu1);
+ NETLIBUSER nlu1 = {};
nlu1.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu1.szSettingsModule = szDbsettings;
nlu1.ptszDescriptiveName = szBuffer;
mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
mir_snwprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
- hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
+ hNetlibUserHttps = Netlib_RegisterUser(&nlu1);
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = szBuffer;
@@ -159,7 +157,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :
nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
mir_snwprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
m_DisplayNameCache = NULL;
}
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
index 8af3bed21c..5f75cb3ea1 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -183,7 +183,7 @@ struct CMsnProto : public PROTO<CMsnProto>
clock_t mStatusMsgTS;
HANDLE msnSearchId;
- HANDLE hNetlibUserHttps;
+ HNETLIBUSER hNetlibUserHttps;
HANDLE hHttpsConnection;
HANDLE hMSNNudge;
HANDLE hPopupError, hPopupHotmail, hPopupNotify;
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp
index e57fa44308..a29f44c89a 100644
--- a/protocols/MinecraftDynmap/src/proto.cpp
+++ b/protocols/MinecraftDynmap/src/proto.cpp
@@ -43,12 +43,12 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const wchar_t
// Create standard network connection
wchar_t descr[512];
- NETLIBUSER nlu = {sizeof(nlu)};
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index 05932348e3..57434aa3b1 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -43,12 +43,12 @@ PROTO<OmegleProto>(proto_name, username)
// Create standard network connection
wchar_t descr[512];
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 690636b4dd..3890deb053 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -16,12 +16,12 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN
// Register m_hNetlibUser user
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
+
+ NETLIBUSER nlu = {};
nlu.flags = NUF_UNICODE | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
RegisterGLibLogger();
debugLogW(L"CSametimeProto::CSametimeProto() start m_szModuleName=[%s], m_tszUserName=[%s]", _A2T(m_szModuleName), m_tszUserName);
diff --git a/protocols/SkypeWeb/src/http_request.h b/protocols/SkypeWeb/src/http_request.h
index c597065e7e..ab4a556bcd 100644
--- a/protocols/SkypeWeb/src/http_request.h
+++ b/protocols/SkypeWeb/src/http_request.h
@@ -274,9 +274,7 @@ public:
dataLength = (int)mir_strlen(pData);
}
- char message[1024];
- mir_snprintf(message, "Send request to %s", szUrl);
- CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
+ Netlib_Logf(NULL, "Send request to %s", szUrl);
return (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)(NETLIBHTTPREQUEST*)this);
}
diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp
index cad76e2866..de12a06b7b 100644
--- a/protocols/SkypeWeb/src/skype_network.cpp
+++ b/protocols/SkypeWeb/src/skype_network.cpp
@@ -21,12 +21,11 @@ void CSkypeProto::InitNetwork()
{
CMStringW name(FORMAT, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { 0 };
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = name.GetBuffer();
nlu.szSettingsModule = m_szModuleName;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
}
void CSkypeProto::UnInitNetwork()
diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h
index 357e6f5a45..402185048d 100644
--- a/protocols/Steam/src/http_request.h
+++ b/protocols/Steam/src/http_request.h
@@ -144,9 +144,7 @@ public:
{
szUrl = m_url.GetBuffer();
- char message[1024];
- mir_snprintf(message, "Send request to %s", szUrl);
- CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
+ Netlib_Logf(NULL, "Send request to %s", szUrl);
NETLIBHTTPREQUEST* response = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)this);
HttpResponse* result = new HttpResponse(response, this);
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 3acfe40114..fb6d7e31f3 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -68,11 +68,11 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName)
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = m_szModuleName;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
requestQueue = new RequestQueue(m_hNetlibUser);
}
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp
index c9008cd2ee..1bed6c9865 100644
--- a/protocols/Tlen/src/tlen_ws.cpp
+++ b/protocols/Tlen/src/tlen_ws.cpp
@@ -25,22 +25,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
BOOL TlenWsInit(TlenProtocol *proto)
{
- NETLIBUSER nlu = {0};
- NETLIBUSERSETTINGS nlus = {0};
wchar_t name[128];
+ NETLIBUSER nlu = {};
+ nlu.ptszDescriptiveName = name;
+ nlu.szSettingsModule = proto->m_szModuleName;
- nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
mir_snwprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
- nlu.ptszDescriptiveName = name;
- nlu.szSettingsModule = proto->m_szModuleName;
- proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
+ proto->m_hNetlibUser = Netlib_RegisterUser(&nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_UNICODE;
mir_snwprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
- nlu.ptszDescriptiveName = name;
- proto->hFileNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
+ proto->hFileNetlibUser = Netlib_RegisterUser(&nlu);
+
+ NETLIBUSERSETTINGS nlus = {0};
nlus.cbSize = sizeof(nlus);
nlus.useProxy = 0;
CallService(MS_NETLIB_SETUSERSETTINGS, (WPARAM) proto->hFileNetlibUser, (LPARAM) &nlus);
diff --git a/protocols/Tox/src/tox_netlib.cpp b/protocols/Tox/src/tox_netlib.cpp
index 82153c743a..3376697df5 100644
--- a/protocols/Tox/src/tox_netlib.cpp
+++ b/protocols/Tox/src/tox_netlib.cpp
@@ -5,12 +5,11 @@ void CToxProto::InitNetlib()
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = {0};
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = m_szModuleName;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
debugLogA(__FUNCTION__":Setting protocol / module name to '%s'", m_szModuleName);
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index 4d00afc349..8446207d64 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -301,14 +301,14 @@ INT_PTR TwitterProto::OnTweet(WPARAM, LPARAM)
int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
{
wchar_t descr[512];
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
// Create standard network connection
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
@@ -321,7 +321,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
nlu.szSettingsModule = module;
mir_snwprintf(descr, TranslateT("%s avatar connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- hAvatarNetlib_ = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ hAvatarNetlib_ = Netlib_RegisterUser(&nlu);
if (hAvatarNetlib_ == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 94bef34949..a4d1e4f1b8 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -64,11 +64,11 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) :
wchar_t descr[512];
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
- NETLIBUSER nlu = {sizeof(nlu)};
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
Clist_GroupCreate(NULL, m_vkOptions.pwszDefaultGroup);
diff --git a/protocols/WhatsApp/src/WASocketConnection.cpp b/protocols/WhatsApp/src/WASocketConnection.cpp
index 03ebf84ea7..78957b21c6 100644
--- a/protocols/WhatsApp/src/WASocketConnection.cpp
+++ b/protocols/WhatsApp/src/WASocketConnection.cpp
@@ -1,9 +1,9 @@
#include "stdafx.h"
#include "WASocketConnection.h"
-HANDLE g_hNetlibUser = NULL;
+HNETLIBUSER g_hNetlibUser = NULL;
-void WASocketConnection::initNetwork(HANDLE hNetlibUser) throw (WAException)
+void WASocketConnection::initNetwork(HNETLIBUSER hNetlibUser) throw (WAException)
{
g_hNetlibUser = hNetlibUser;
}
diff --git a/protocols/WhatsApp/src/WASocketConnection.h b/protocols/WhatsApp/src/WASocketConnection.h
index 8770582ce7..23beac6ef2 100644
--- a/protocols/WhatsApp/src/WASocketConnection.h
+++ b/protocols/WhatsApp/src/WASocketConnection.h
@@ -28,7 +28,7 @@ public:
virtual void log(const char *prefix, const char *str);
- static void initNetwork(HANDLE hNetlibUser) throw (WAException);
+ static void initNetwork(HNETLIBUSER hNetlibUser) throw (WAException);
static void quitNetwork();
};
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index 05954b7809..69b91de842 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -35,11 +35,11 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username)
wchar_t descr[512];
mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
- NETLIBUSER nlu = { sizeof(nlu) };
+ NETLIBUSER nlu = {};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
if (m_hNetlibUser == NULL) {
wchar_t error[200];
mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
diff --git a/protocols/WhatsApp/src/stdafx.h b/protocols/WhatsApp/src/stdafx.h
index 6fd6adbc8b..0472849de9 100644
--- a/protocols/WhatsApp/src/stdafx.h
+++ b/protocols/WhatsApp/src/stdafx.h
@@ -88,4 +88,4 @@ Copyright © 2013-14 Uli Hecht
extern HINSTANCE g_hInstance;
extern std::string g_strUserAgent;
extern DWORD g_mirandaVersion;
-extern HANDLE g_hNetlibUser;
+extern HNETLIBUSER g_hNetlibUser;