summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tlen/src')
-rw-r--r--protocols/Tlen/src/stdafx.h2
-rw-r--r--protocols/Tlen/src/tlen_file.cpp4
-rw-r--r--protocols/Tlen/src/tlen_p2p_old.cpp9
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp7
-rw-r--r--protocols/Tlen/src/tlen_ws.cpp8
5 files changed, 15 insertions, 15 deletions
diff --git a/protocols/Tlen/src/stdafx.h b/protocols/Tlen/src/stdafx.h
index d0b6031d7a..67f085a708 100644
--- a/protocols/Tlen/src/stdafx.h
+++ b/protocols/Tlen/src/stdafx.h
@@ -281,7 +281,7 @@ struct TlenProtocol : public PROTO<TlenProtocol>
int __cdecl MUCHandleEvent(WPARAM wParam, LPARAM lParam);
//====================================================================================
- HANDLE hFileNetlibUser;
+ HNETLIBUSER hFileNetlibUser;
TLEN_MODEMSGS modeMsgs;
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp
index 11a269f377..dcbc77d8c0 100644
--- a/protocols/Tlen/src/tlen_file.cpp
+++ b/protocols/Tlen/src/tlen_file.cpp
@@ -182,7 +182,7 @@ static void __cdecl TlenFileReceiveThread(void *arg)
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
ProtoBroadcastAck(ft->proto->m_szModuleName, ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, ft, 0);
- HANDLE s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)ft->proto->m_hNetlibUser, (LPARAM)&nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->m_hNetlibUser, &nloc);
if (s != NULL) {
ft->s = s;
ft->proto->debugLogA("Entering file receive loop");
@@ -481,7 +481,7 @@ static void __cdecl TlenFileSendingThread(void *arg)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
- HANDLE hConn = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)ft->proto->m_hNetlibUser, (LPARAM)&nloc);
+ HANDLE hConn = Netlib_OpenConnection(ft->proto->m_hNetlibUser, &nloc);
if (hConn != NULL) {
ProtoBroadcastAck(ft->proto->m_szModuleName, ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, ft, 0);
ft->s = hConn;
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp
index a2265f6e8a..71eee92fc8 100644
--- a/protocols/Tlen/src/tlen_p2p_old.cpp
+++ b/protocols/Tlen/src/tlen_p2p_old.cpp
@@ -300,7 +300,7 @@ static HANDLE TlenP2PBindSocks4(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = sb->szHost;
nloc.wPort = sb->wPort;
- HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hFileNetlibUser, (LPARAM) &nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->hFileNetlibUser, &nloc);
if (s == NULL) {
// TlenLog("Connection failed (%d), thread ended", WSAGetLastError());
return NULL;
@@ -352,7 +352,7 @@ static HANDLE TlenP2PBindSocks5(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = sb->szHost;
nloc.wPort = sb->wPort;
- HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hFileNetlibUser, (LPARAM) &nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->hFileNetlibUser, &nloc);
if (s == NULL) {
ft->proto->debugLogA("Connection failed (%d), thread ended", WSAGetLastError());
return NULL;
@@ -443,7 +443,6 @@ static HANDLE TlenP2PBindSocks5(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft)
HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft)
{
- NETLIBBIND nlb = {0};
HANDLE s = NULL;
int useProxy;
DBVARIANT dbv;
@@ -491,13 +490,15 @@ HANDLE TlenP2PListen(TLEN_FILE_TRANSFER *ft)
ft->wLocalPort = sb.wPort;
}
}
+
+ NETLIBBIND nlb = {};
if (useProxy<2) {
nlb.cbSize = sizeof(NETLIBBIND);
nlb.pfnNewConnectionV2 = ft->pfnNewConnectionV2;
nlb.wPort = 0; // Use user-specified incoming port ranges, if available
nlb.pExtra = proto;
ft->proto->debugLogA("Calling MS_NETLIB_BINDPORT");
- s = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) ft->proto->m_hNetlibUser, (LPARAM) &nlb);
+ s = Netlib_BindPort(ft->proto->m_hNetlibUser, &nlb);
ft->proto->debugLogA("listening on %d",s);
}
if (useProxy == 0) {
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index 6dfb47e3f8..eb52fb034b 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -292,11 +292,12 @@ static void __cdecl TlenVoiceReceiveThread(void *arg)
TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)arg;
ft->proto->debugLogA("Thread started: type=file_receive server='%s' port='%d'", ft->hostName, ft->wPort);
+ SetDlgItemText(ft->proto->voiceDlgHWND, IDC_STATUS, TranslateT("...Connecting..."));
+
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
- SetDlgItemText(ft->proto->voiceDlgHWND, IDC_STATUS, TranslateT("...Connecting..."));
- HANDLE s = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)ft->proto->m_hNetlibUser, (LPARAM)&nloc);
+ HANDLE s = Netlib_OpenConnection(ft->proto->m_hNetlibUser, &nloc);
if (s != NULL) {
ft->s = s;
ft->proto->debugLogA("Entering file receive loop");
@@ -548,7 +549,7 @@ static void __cdecl TlenVoiceSendingThread(void *arg)
NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
- HANDLE sock = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)ft->proto->m_hNetlibUser, (LPARAM)&nloc);
+ HANDLE sock = Netlib_OpenConnection(ft->proto->m_hNetlibUser, &nloc);
if (sock != NULL) {
SetDlgItemText(ft->proto->voiceDlgHWND, IDC_STATUS, TranslateT("...Connecting..."));
//ProtoBroadcastAck(ft->proto->m_szModuleName, ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, ft, 0);
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp
index 1bed6c9865..eaa952d33b 100644
--- a/protocols/Tlen/src/tlen_ws.cpp
+++ b/protocols/Tlen/src/tlen_ws.cpp
@@ -42,7 +42,7 @@ BOOL TlenWsInit(TlenProtocol *proto)
NETLIBUSERSETTINGS nlus = {0};
nlus.cbSize = sizeof(nlus);
nlus.useProxy = 0;
- CallService(MS_NETLIB_SETUSERSETTINGS, (WPARAM) proto->hFileNetlibUser, (LPARAM) &nlus);
+ Netlib_SetUserSettings(proto->hFileNetlibUser, &nlus);
return (proto->m_hNetlibUser != NULL)?TRUE:FALSE;
}
@@ -57,17 +57,15 @@ void TlenWsUninit(TlenProtocol *proto)
HANDLE TlenWsConnect(TlenProtocol *proto, char *host, WORD port)
{
- NETLIBOPENCONNECTION nloc = {0};
-
+ NETLIBOPENCONNECTION nloc = {};
nloc.cbSize = sizeof(NETLIBOPENCONNECTION); //NETLIBOPENCONNECTION_V1_SIZE;
nloc.szHost = host;
nloc.wPort = port;
nloc.flags = 0;
nloc.timeout = 6;
- return (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) proto->m_hNetlibUser, (LPARAM) &nloc);
+ return Netlib_OpenConnection(proto->m_hNetlibUser, &nloc);
}
-
int TlenWsSend(TlenProtocol *proto, HANDLE s, char *data, int datalen)
{
int len;