From 52824c91bac6d6cc0f04e242b07d9031477b6362 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 21 Sep 2013 20:23:22 +0000 Subject: protocols cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@6170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_thread.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'protocols/JabberG/src/jabber_thread.cpp') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 1f68a2eee7..420544d65c 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -146,9 +146,6 @@ void CJabberProto::OnPingReply(HXML, CJabberIqInfo* pInfo) ///////////////////////////////////////////////////////////////////////////////////////// -typedef DNS_STATUS (WINAPI *DNSQUERYA)(IN PCSTR pszName, IN WORD wType, IN DWORD Options, IN PIP4_ARRAY aipServers OPTIONAL, IN OUT PDNS_RECORDA *ppQueryResults OPTIONAL, IN OUT PVOID *pReserved OPTIONAL); -typedef void (WINAPI *DNSFREELIST)(IN OUT PDNS_RECORDA pRecordList, IN DNS_FREE_TYPE FreeType); - static int CompareDNS(const DNS_SRV_DATAA* dns1, const DNS_SRV_DATAA* dns2) { return (int)dns1->wPriority - (int)dns2->wPriority; @@ -159,23 +156,11 @@ void ThreadData::xmpp_client_query(void) if (inet_addr(server) != INADDR_NONE) return; - HMODULE hDnsapi = LoadLibraryA("dnsapi.dll"); - if (hDnsapi == NULL) - return; - - DNSQUERYA pDnsQuery = (DNSQUERYA)GetProcAddress(hDnsapi, "DnsQuery_A"); - DNSFREELIST pDnsRecordListFree = (DNSFREELIST)GetProcAddress(hDnsapi, "DnsRecordListFree"); - if (pDnsQuery == NULL) { - //dnsapi.dll is not the needed dnsapi ;) - FreeLibrary(hDnsapi); - return; - } - char temp[256]; mir_snprintf(temp, SIZEOF(temp), "_xmpp-client._tcp.%s", server); DNS_RECORDA *results = NULL; - DNS_STATUS status = pDnsQuery(temp, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &results, NULL); + DNS_STATUS status = DnsQuery_A(temp, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, (PDNS_RECORD *)&results, NULL); if (SUCCEEDED(status) && results) { LIST dnsList(5, CompareDNS); @@ -196,12 +181,10 @@ void ThreadData::xmpp_client_query(void) break; } } dnsList.destroy(); - pDnsRecordListFree(results, DnsFreeRecordList); + DnsRecordListFree(results, DnsFreeRecordList); } else proto->Log("%s not resolved", temp); - - FreeLibrary(hDnsapi); } void CJabberProto::xmlStreamInitialize(char *szWhich) -- cgit v1.2.3