From 464170cca9da37da2a18cc3e51749e07bedfa950 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 10 Sep 2011 04:59:38 +0200 Subject: [PATCH] * Try fix win compiling some more. --- thirdparty/liblastfm2/src/ws/win/ComSetup.h | 11 +++++----- .../liblastfm2/src/ws/win/NdisEvents.cpp | 18 +++++++-------- thirdparty/liblastfm2/src/ws/win/NdisEvents.h | 4 ++-- thirdparty/liblastfm2/src/ws/win/Pac.cpp | 22 +++++++++---------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/thirdparty/liblastfm2/src/ws/win/ComSetup.h b/thirdparty/liblastfm2/src/ws/win/ComSetup.h index 1c7bc92d8..55f7fd012 100644 --- a/thirdparty/liblastfm2/src/ws/win/ComSetup.h +++ b/thirdparty/liblastfm2/src/ws/win/ComSetup.h @@ -23,7 +23,6 @@ #endif #include "winable.h" - //#include //#include //#include @@ -39,7 +38,7 @@ public: { HRESULT hr = CoInitialize(0); m_bComInitialised = SUCCEEDED(hr); - _ASSERT(m_bComInitialised); + //_ASSERT(m_bComInitialised); if (m_bComInitialised) { setupSecurity(); } @@ -47,10 +46,10 @@ public: void setupSecurity() { - CSecurityDescriptor sd; - sd.InitializeFromThreadToken(); - HRESULT hr = CoInitializeSecurity(sd, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL); - _ASSERT(SUCCEEDED(hr)); + //CSecurityDescriptor sd; + //sd.InitializeFromThreadToken(); + //HRESULT hr = CoInitializeSecurity(sd, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL); + //_ASSERT(SUCCEEDED(hr)); } ~ComSetup() diff --git a/thirdparty/liblastfm2/src/ws/win/NdisEvents.cpp b/thirdparty/liblastfm2/src/ws/win/NdisEvents.cpp index 7263af24b..08afd7439 100644 --- a/thirdparty/liblastfm2/src/ws/win/NdisEvents.cpp +++ b/thirdparty/liblastfm2/src/ws/win/NdisEvents.cpp @@ -32,10 +32,10 @@ NdisEvents::NdisEvents() NdisEvents::~NdisEvents() { - if (m_pSink) - m_pSink->disconnect(); - if (m_pServices && m_pSink) - m_pServices->CancelAsyncCall(m_pSink); +// if (m_pSink) +// m_pSink->disconnect(); +// if (m_pServices && m_pSink) +// m_pServices->CancelAsyncCall(m_pSink); // and reference counting will take care of the WmiSink object } @@ -47,7 +47,7 @@ NdisEvents::registerForNdisEvents() return hr; // Connect to the root\wmi namespace with the current user. - hr = m_pLocator->ConnectServer(CComBSTR("ROOT\\WMI"), // strNetworkResource + hr = 0; /*m_pLocator->ConnectServer(CComBSTR("ROOT\\WMI"), // strNetworkResource NULL, // strUser NULL, // strPassword NULL, // strLocale @@ -55,11 +55,11 @@ NdisEvents::registerForNdisEvents() CComBSTR(""), // strAuthority NULL, // pCtx &m_pServices - ); + );*/ if (FAILED(hr)) return hr; - m_pSink = new WmiSink(this); +// m_pSink = new WmiSink(this); ////////////////////////// @@ -75,12 +75,12 @@ NdisEvents::registerForNdisEvents() // MSNdis_StatusProtocolUnbind // MSNdis_StatusMediaSpecificIndication - CComBSTR wql("WQL"); +/* CComBSTR wql("WQL"); CComBSTR query("SELECT * FROM MSNdis_StatusMediaDisconnect"); hr = m_pServices->ExecNotificationQueryAsync(wql, query, 0, 0, m_pSink); query = "SELECT * FROM MSNdis_StatusMediaConnect"; - hr = m_pServices->ExecNotificationQueryAsync(wql, query, 0, 0, m_pSink); + hr = m_pServices->ExecNotificationQueryAsync(wql, query, 0, 0, m_pSink);*/ return S_OK; } diff --git a/thirdparty/liblastfm2/src/ws/win/NdisEvents.h b/thirdparty/liblastfm2/src/ws/win/NdisEvents.h index 390d684cf..9d3fa0735 100644 --- a/thirdparty/liblastfm2/src/ws/win/NdisEvents.h +++ b/thirdparty/liblastfm2/src/ws/win/NdisEvents.h @@ -35,8 +35,8 @@ public: virtual void onConnectionDown(BSTR name) = 0; private: - CComPtr m_pLocator; - CComPtr m_pServices; +// CComPtr m_pLocator; +// CComPtr m_pServices; class WmiSink *m_pSink; }; diff --git a/thirdparty/liblastfm2/src/ws/win/Pac.cpp b/thirdparty/liblastfm2/src/ws/win/Pac.cpp index 1bfb9fcef..b6a59bde3 100644 --- a/thirdparty/liblastfm2/src/ws/win/Pac.cpp +++ b/thirdparty/liblastfm2/src/ws/win/Pac.cpp @@ -74,8 +74,8 @@ lastfm::Pac::Pac() lastfm::Pac::~Pac() { - if (m_hSession) - WinHttpCloseHandle(m_hSession); +/* if (m_hSession) + WinHttpCloseHandle(m_hSession);*/ } QNetworkProxy @@ -87,7 +87,7 @@ lastfm::Pac::resolve(const QNetworkRequest &request, const wchar_t* pacUrl) if (!m_hSession) { QByteArray user_agent = request.rawHeader("user-agent"); - m_hSession = WinHttpOpen(CA2W(user_agent), WINHTTP_ACCESS_TYPE_NO_PROXY, 0, 0, WINHTTP_FLAG_ASYNC); + //m_hSession = WinHttpOpen(CA2W(user_agent), WINHTTP_ACCESS_TYPE_NO_PROXY, 0, 0, WINHTTP_FLAG_ASYNC); } if (m_hSession) { @@ -96,29 +96,29 @@ lastfm::Pac::resolve(const QNetworkRequest &request, const wchar_t* pacUrl) memset(&opts, 0, sizeof(opts)); if (pacUrl) { - opts.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; - opts.lpszAutoConfigUrl = pacUrl; + // opts.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; + // opts.lpszAutoConfigUrl = pacUrl; } else { - opts.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; - opts.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A; + // opts.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT; + // opts.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP | WINHTTP_AUTO_DETECT_TYPE_DNS_A; } opts.fAutoLogonIfChallenged = TRUE; - if (WinHttpGetProxyForUrl(m_hSession, request.url().toString().utf16(), &opts, &info)) { + if (WinHttpGetProxyForUrl(m_hSession, (const WCHAR*)request.url().toString().utf16(), &opts, &info)) { if (info.lpszProxy) { - QList proxies = parsePacResult(QString::fromUtf16(info.lpszProxy)); + QList proxies = parsePacResult(QString::fromUtf16((const ushort*)info.lpszProxy)); if (!proxies.empty()) { out = proxies.at(0); } - GlobalFree(info.lpszProxy); + GlobalFree((void*)info.lpszProxy); } if (info.lpszProxyBypass) { - GlobalFree(info.lpszProxyBypass); + GlobalFree((void*)info.lpszProxyBypass); } } else { m_bFailed = true;