Module: wine Branch: master Commit: 66514fd7135cd672b832f78eda54e994bbb1bdc4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=66514fd7135cd672b832f78eda...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Feb 25 19:35:12 2015 +0100
appwiz.cpl: Use custom user agent string for addon downloader.
---
dlls/appwiz.cpl/Makefile.in | 2 +- dlls/appwiz.cpl/addons.c | 61 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/dlls/appwiz.cpl/Makefile.in b/dlls/appwiz.cpl/Makefile.in index 1cf7b0e..a8341fa 100644 --- a/dlls/appwiz.cpl/Makefile.in +++ b/dlls/appwiz.cpl/Makefile.in @@ -1,5 +1,5 @@ MODULE = appwiz.cpl -IMPORTS = uuid urlmon advpack comctl32 advapi32 shell32 user32 comdlg32 +IMPORTS = uuid urlmon advpack comctl32 advapi32 shell32 ole32 user32 comdlg32 DELAYIMPORTS = msi
C_SRCS = \ diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index 7fce9cb..9fbb386 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -415,6 +415,8 @@ static enum install_res install_from_cache(void) return res; }
+static IInternetBindInfo InstallCallbackBindInfo; + static HRESULT WINAPI InstallCallback_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv) { @@ -423,6 +425,12 @@ static HRESULT WINAPI InstallCallback_QueryInterface(IBindStatusCallback *iface, return S_OK; }
+ if(IsEqualGUID(&IID_IInternetBindInfo, riid)) { + TRACE("IID_IInternetBindInfo\n"); + *ppv = &InstallCallbackBindInfo; + return S_OK; + } + return E_INVALIDARG; }
@@ -564,6 +572,59 @@ static const IBindStatusCallbackVtbl InstallCallbackVtbl = {
static IBindStatusCallback InstallCallback = { &InstallCallbackVtbl };
+static HRESULT WINAPI InstallCallbackBindInfo_QueryInterface(IInternetBindInfo *iface, REFIID riid, void **ppv) +{ + return IBindStatusCallback_QueryInterface(&InstallCallback, riid, ppv); +} + +static ULONG WINAPI InstallCallbackBindInfo_AddRef(IInternetBindInfo *iface) +{ + return 2; +} + +static ULONG WINAPI InstallCallbackBindInfo_Release(IInternetBindInfo *iface) +{ + return 1; +} + +static HRESULT WINAPI InstallCallbackBindInfo_GetBindInfo(IInternetBindInfo *iface, DWORD *bindf, BINDINFO *bindinfo) +{ + ERR("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI InstallCallbackBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type, + WCHAR **strs, ULONG cnt, ULONG *fetched) +{ + static const WCHAR wine_addon_downloaderW[] = + {'W','i','n','e',' ','A','d','d','o','n',' ','D','o','w','n','l','o','a','d','e','r',0}; + + switch(string_type) { + case BINDSTRING_USER_AGENT: + TRACE("BINDSTRING_USER_AGENT\n"); + + *strs = CoTaskMemAlloc(sizeof(wine_addon_downloaderW)); + if(!*strs) + return E_OUTOFMEMORY; + + memcpy(*strs, wine_addon_downloaderW, sizeof(wine_addon_downloaderW)); + *fetched = 1; + return S_OK; + } + + return E_NOTIMPL; +} + +static const IInternetBindInfoVtbl InstallCallbackBindInfoVtbl = { + InstallCallbackBindInfo_QueryInterface, + InstallCallbackBindInfo_AddRef, + InstallCallbackBindInfo_Release, + InstallCallbackBindInfo_GetBindInfo, + InstallCallbackBindInfo_GetBindString +}; + +static IInternetBindInfo InstallCallbackBindInfo = { &InstallCallbackBindInfoVtbl }; + static void append_url_params( WCHAR *url ) { static const WCHAR arch_formatW[] = {'?','a','r','c','h','='};