summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-21 20:23:22 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-21 20:23:22 +0000
commit52824c91bac6d6cc0f04e242b07d9031477b6362 (patch)
tree3cafc4ce886f9066b50d4d32bfdda4c5c9f954f4 /protocols/JabberG
parentb4caa062df453412e7cafa5b96afab0b0c3a2940 (diff)
protocols cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/jabber_10.vcxproj8
-rw-r--r--protocols/JabberG/jabber_11.vcxproj8
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp11
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp11
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp21
5 files changed, 13 insertions, 46 deletions
diff --git a/protocols/JabberG/jabber_10.vcxproj b/protocols/JabberG/jabber_10.vcxproj
index e9d51ee5e9..8f99e8ab51 100644
--- a/protocols/JabberG/jabber_10.vcxproj
+++ b/protocols/JabberG/jabber_10.vcxproj
@@ -92,7 +92,7 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -127,7 +127,7 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -160,7 +160,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -190,7 +190,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
diff --git a/protocols/JabberG/jabber_11.vcxproj b/protocols/JabberG/jabber_11.vcxproj
index 74bf78b9a1..e75dcc9bf5 100644
--- a/protocols/JabberG/jabber_11.vcxproj
+++ b/protocols/JabberG/jabber_11.vcxproj
@@ -95,7 +95,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -129,7 +129,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -162,7 +162,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -193,7 +193,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index aa00846287..d0acf58696 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -113,7 +113,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PRODUCT_UNLICENSED 0xABCDABCD
#endif
-typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);
#define StringCchCopy(x,y,z) lstrcpyn((x),(z),(y))
@@ -124,7 +123,6 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
{
OSVERSIONINFOEX osvi;
SYSTEM_INFO si;
- PGNSI pGNSI;
PGPI pGPI;
DWORD dwType;
@@ -142,13 +140,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
return FALSE;
}
- // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
- HMODULE hKernel = GetModuleHandle(TEXT("kernel32.dll"));
- pGNSI = (PGNSI) GetProcAddress(hKernel, "GetNativeSystemInfo");
- if (pGNSI != NULL)
- pGNSI(&si);
- else
- GetSystemInfo(&si);
+ GetNativeSystemInfo(&si);
// Some code from Crash Dumper Plugin :-)
if (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId && osvi.dwMajorVersion > 4)
@@ -182,6 +174,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
break;
}
+ HMODULE hKernel = GetModuleHandle(TEXT("kernel32.dll"));
pGPI = (PGPI) GetProcAddress(hKernel, "GetProductInfo");
if (pGPI != NULL)
pGPI(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &dwType);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 5990dad83b..9cfc9aceb3 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -624,18 +624,9 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
}
-typedef BOOL (WINAPI *LWS)(VOID);
-
int CJabberProto::AdhocLockWSHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSession* pSession)
{
- BOOL bOk = FALSE;
- HMODULE hLibrary = LoadLibrary(_T("user32.dll"));
- if (hLibrary) {
- LWS pLws = (LWS)GetProcAddress(hLibrary, "LockWorkStation");
- if (pLws)
- bOk = pLws();
- FreeLibrary(hLibrary);
- }
+ BOOL bOk = LockWorkStation();
TCHAR szMsg[ 1024 ];
if (bOk)
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<DNS_SRV_DATAA> 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)