diff options
Diffstat (limited to 'plugins/Watrack_MPD')
-rwxr-xr-x | plugins/Watrack_MPD/src/main.cpp | 6 | ||||
-rwxr-xr-x | plugins/Watrack_MPD/src/utilities.cpp | 18 | ||||
-rwxr-xr-x | plugins/Watrack_MPD/src/utilities.h | 1 |
3 files changed, 3 insertions, 22 deletions
diff --git a/plugins/Watrack_MPD/src/main.cpp b/plugins/Watrack_MPD/src/main.cpp index 55888e4caa..dd9a9feea0 100755 --- a/plugins/Watrack_MPD/src/main.cpp +++ b/plugins/Watrack_MPD/src/main.cpp @@ -24,14 +24,14 @@ SONGINFO SongInfo = {0}; void Start(void* param) { - NETLIBOPENCONNECTION nloc = {0}; + NETLIBOPENCONNECTION nloc = { sizeof(nloc) }; char *tmp = (char*)mir_u2a(gbHost); - nloc.cbSize = sizeof(nloc); nloc.szHost = tmp; nloc.timeout = 5; + nloc.flags = NLOCF_V2; nloc.wPort = gbPort; Connected = FALSE; - ghConnection = NetLib_CreateConnection(ghNetlibUser, &nloc); + ghConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)ghNetlibUser, (LPARAM)&nloc); if(ghConnection) ghPacketReciever = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER,(WPARAM)ghConnection,2048); } diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index 05c5d2f1b4..55e100cea1 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -30,21 +30,3 @@ TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,c db_free(&dbv); return szRes; } - -HANDLE NetLib_CreateConnection(HANDLE hUser, NETLIBOPENCONNECTION* nloc) //from icq ) -{ - HANDLE hConnection; - - nloc->cbSize = sizeof(NETLIBOPENCONNECTION); - nloc->flags |= NLOCF_V2; - - hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hUser, (LPARAM)nloc); - if (!hConnection && (GetLastError() == 87)) - { // this ensures, an old Miranda will be able to connect also - nloc->cbSize = NETLIBOPENCONNECTION_V1_SIZE; - hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hConnection, (LPARAM)nloc); - } - return hConnection; -} - - diff --git a/plugins/Watrack_MPD/src/utilities.h b/plugins/Watrack_MPD/src/utilities.h index 7bd9dd0830..018f32a03c 100755 --- a/plugins/Watrack_MPD/src/utilities.h +++ b/plugins/Watrack_MPD/src/utilities.h @@ -1,7 +1,6 @@ #ifndef UTILITIES_H #define UTILITIES_H -HANDLE NetLib_CreateConnection(HANDLE hUser, NETLIBOPENCONNECTION* nloc); HANDLE CreateThreadEx(pThreadFuncEx AFunc, void* arg, DWORD* pThreadID); TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,const char* szSetting, TCHAR* szDef); |