diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/kernel/qhostinfo_win.cpp | 14 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface_win.cpp | 3 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy_win.cpp | 15 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 36 |
4 files changed, 44 insertions, 24 deletions
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index b30204b..8241c84 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -49,7 +49,7 @@ #include "qhostinfo_p.h" #include "private/qnativesocketengine_p.h" #include <ws2tcpip.h> -#include <qlibrary.h> +#include <private/qsystemlibrary_p.h> #include <qmutex.h> #include <qurl.h> #include <private/qmutexpool_p.h> @@ -90,13 +90,13 @@ static void resolveLibrary() // Attempt to resolve getaddrinfo(); without it we'll have to fall // back to gethostbyname(), which has no IPv6 support. #if !defined(Q_OS_WINCE) - local_getaddrinfo = (getaddrinfoProto) QLibrary::resolve(QLatin1String("ws2_32.dll"), "getaddrinfo"); - local_freeaddrinfo = (freeaddrinfoProto) QLibrary::resolve(QLatin1String("ws2_32.dll"), "freeaddrinfo"); - local_getnameinfo = (getnameinfoProto) QLibrary::resolve(QLatin1String("ws2_32.dll"), "getnameinfo"); + local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo"); + local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo"); + local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo"); #else - local_getaddrinfo = (getaddrinfoProto) QLibrary::resolve(QLatin1String("ws2.dll"), "getaddrinfo"); - local_freeaddrinfo = (freeaddrinfoProto) QLibrary::resolve(QLatin1String("ws2.dll"), "freeaddrinfo"); - local_getnameinfo = (getnameinfoProto) QLibrary::resolve(QLatin1String("ws2.dll"), "getnameinfo"); + local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getaddrinfo"); + local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "freeaddrinfo"); + local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getnameinfo"); #endif } diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp index 056650d..a1d1df6 100644 --- a/src/network/kernel/qnetworkinterface_win.cpp +++ b/src/network/kernel/qnetworkinterface_win.cpp @@ -48,6 +48,7 @@ #include <qhostinfo.h> #include <qhash.h> #include <qurl.h> +#include <private/qsystemlibrary_p.h> QT_BEGIN_NAMESPACE @@ -66,7 +67,7 @@ static void resolveLibs() if (!done) { done = true; - HINSTANCE iphlpapiHnd = LoadLibrary(L"iphlpapi"); + HINSTANCE iphlpapiHnd = QSystemLibrary::load(L"iphlpapi"); if (iphlpapiHnd == NULL) return; diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp index 537107e..a72ef38 100644 --- a/src/network/kernel/qnetworkproxy_win.cpp +++ b/src/network/kernel/qnetworkproxy_win.cpp @@ -51,6 +51,7 @@ #include <string.h> #include <qt_windows.h> #include <wininet.h> +#include <private/qsystemlibrary_p.h> /* * Information on the WinHTTP DLL: @@ -277,15 +278,15 @@ void QWindowsSystemProxy::init() return; #else // load the winhttp.dll library - HINSTANCE winhttpHnd = LoadLibrary(L"winhttp"); - if (!winhttpHnd) + QSystemLibrary lib(L"winhttp"); + if (!lib.load()) return; // failed to load - ptrWinHttpOpen = (PtrWinHttpOpen)GetProcAddress(winhttpHnd, "WinHttpOpen"); - ptrWinHttpCloseHandle = (PtrWinHttpCloseHandle)GetProcAddress(winhttpHnd, "WinHttpCloseHandle"); - ptrWinHttpGetProxyForUrl = (PtrWinHttpGetProxyForUrl)GetProcAddress(winhttpHnd, "WinHttpGetProxyForUrl"); - ptrWinHttpGetDefaultProxyConfiguration = (PtrWinHttpGetDefaultProxyConfiguration)GetProcAddress(winhttpHnd, "WinHttpGetDefaultProxyConfiguration"); - ptrWinHttpGetIEProxyConfigForCurrentUser = (PtrWinHttpGetIEProxyConfigForCurrentUser)GetProcAddress(winhttpHnd, "WinHttpGetIEProxyConfigForCurrentUser"); + ptrWinHttpOpen = (PtrWinHttpOpen)lib.resolve("WinHttpOpen"); + ptrWinHttpCloseHandle = (PtrWinHttpCloseHandle)lib.resolve("WinHttpCloseHandle"); + ptrWinHttpGetProxyForUrl = (PtrWinHttpGetProxyForUrl)lib.resolve("WinHttpGetProxyForUrl"); + ptrWinHttpGetDefaultProxyConfiguration = (PtrWinHttpGetDefaultProxyConfiguration)lib.resolve("WinHttpGetDefaultProxyConfiguration"); + ptrWinHttpGetIEProxyConfigForCurrentUser = (PtrWinHttpGetIEProxyConfigForCurrentUser)lib.resolve("WinHttpGetIEProxyConfigForCurrentUser"); // Try to obtain the Internet Explorer configuration. WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ieProxyConfig; diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index d1225c1..6affa36 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -42,7 +42,11 @@ #include "qsslsocket_openssl_symbols_p.h" -#include <QtCore/qlibrary.h> +#ifdef Q_OS_WIN +# include <private/qsystemlibrary_p.h> +#else +# include <QtCore/qlibrary.h> +#endif #include <QtCore/qmutex.h> #include <private/qmutexpool_p.h> #include <QtCore/qdatetime.h> @@ -345,22 +349,22 @@ static QStringList findAllLibSsl() } # endif -static QPair<QLibrary*, QLibrary*> loadOpenSsl() +#ifdef Q_OS_WIN +static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32() { - QPair<QLibrary*,QLibrary*> pair; + QPair<QSystemLibrary*,QSystemLibrary*> pair; pair.first = 0; pair.second = 0; -# ifdef Q_OS_WIN - QLibrary *ssleay32 = new QLibrary(QLatin1String("ssleay32")); - if (!ssleay32->load()) { + QSystemLibrary *ssleay32 = new QSystemLibrary(QLatin1String("ssleay32")); + if (!ssleay32->load(false)) { // Cannot find ssleay32.dll delete ssleay32; return pair; } - QLibrary *libeay32 = new QLibrary(QLatin1String("libeay32")); - if (!libeay32->load()) { + QSystemLibrary *libeay32 = new QSystemLibrary(QLatin1String("libeay32")); + if (!libeay32->load(false)) { delete ssleay32; delete libeay32; return pair; @@ -369,7 +373,16 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() pair.first = ssleay32; pair.second = libeay32; return pair; -# elif defined(Q_OS_SYMBIAN) +} +#else + +static QPair<QLibrary*, QLibrary*> loadOpenSsl() +{ + QPair<QLibrary*,QLibrary*> pair; + pair.first = 0; + pair.second = 0; + +# if defined(Q_OS_SYMBIAN) QLibrary *libssl = new QLibrary(QLatin1String("libssl")); if (!libssl->load()) { // Cannot find ssleay32.dll @@ -469,6 +482,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() return pair; # endif } +#endif bool q_resolveOpenSslSymbols() { @@ -483,7 +497,11 @@ bool q_resolveOpenSslSymbols() return false; triedToResolveSymbols = true; +#ifdef Q_OS_WIN + QPair<QSystemLibrary *, QSystemLibrary *> libs = loadOpenSslWin32(); +#else QPair<QLibrary *, QLibrary *> libs = loadOpenSsl(); +#endif if (!libs.first || !libs.second) // failed to load them return false; |