From 0c9515dc75c9b2cd01116469787d76cddcc450b5 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Wed, 6 May 2009 08:50:22 +0000 Subject: [PATCH] - Sync spoolss, sxs, urlmon with Wine 1.1.20 svn path=/trunk/; revision=40815 --- reactos/dll/win32/spoolss/router.c | 2 +- reactos/dll/win32/sxs/sxs.c | 8 + reactos/dll/win32/sxs/sxs.spec | 2 +- reactos/dll/win32/urlmon/binding.c | 74 ++++++ reactos/dll/win32/urlmon/bindprot.c | 20 +- reactos/dll/win32/urlmon/file.c | 4 +- reactos/dll/win32/urlmon/format.c | 18 +- reactos/dll/win32/urlmon/ftp.c | 63 +++++- reactos/dll/win32/urlmon/gopher.c | 4 +- reactos/dll/win32/urlmon/http.c | 63 +++++- reactos/dll/win32/urlmon/mimefilter.c | 263 ++++++++++++++++++++++ reactos/dll/win32/urlmon/mk.c | 4 +- reactos/dll/win32/urlmon/regsvr.c | 23 +- reactos/dll/win32/urlmon/session.c | 6 +- reactos/dll/win32/urlmon/umon.c | 4 - reactos/dll/win32/urlmon/urlmon.inf | 21 +- reactos/dll/win32/urlmon/urlmon.rbuild | 4 + reactos/dll/win32/urlmon/urlmon_local.idl | 2 + reactos/dll/win32/urlmon/urlmon_main.c | 5 +- reactos/dll/win32/urlmon/urlmon_main.h | 7 +- 20 files changed, 547 insertions(+), 50 deletions(-) create mode 100644 reactos/dll/win32/urlmon/mimefilter.c create mode 100644 reactos/dll/win32/urlmon/urlmon_local.idl diff --git a/reactos/dll/win32/spoolss/router.c b/reactos/dll/win32/spoolss/router.c index 479d23a6a7f..1fcf628fe07 100644 --- a/reactos/dll/win32/spoolss/router.c +++ b/reactos/dll/win32/spoolss/router.c @@ -270,7 +270,7 @@ BOOL backend_load_all(void) EnterCriticalSection(&backend_cs); - /* if we failed before, dont try again */ + /* if we failed before, don't try again */ if (!failed && (used_backends == 0)) { pb = backend_load(localsplW, NULL, NULL); diff --git a/reactos/dll/win32/sxs/sxs.c b/reactos/dll/win32/sxs/sxs.c index 06e6672dbf7..76c2f85d0d4 100644 --- a/reactos/dll/win32/sxs/sxs.c +++ b/reactos/dll/win32/sxs/sxs.c @@ -22,7 +22,9 @@ #include "windef.h" #include "winbase.h" +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(sxs); /*********************************************************************** * DllMain (SXS.@) @@ -40,3 +42,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } return TRUE; } + +HRESULT WINAPI CreateAssemblyCache(DWORD unimplemented, DWORD dwReserved) +{ + FIXME("%u %u stub\n", unimplemented, dwReserved); + return E_NOTIMPL; +} diff --git a/reactos/dll/win32/sxs/sxs.spec b/reactos/dll/win32/sxs/sxs.spec index 012d06b9c38..cd32a2e9ddb 100644 --- a/reactos/dll/win32/sxs/sxs.spec +++ b/reactos/dll/win32/sxs/sxs.spec @@ -1,2 +1,2 @@ -@ stub CreateAssemblyCache +@ stdcall CreateAssemblyCache(long long) @ stub CreateAssemblyNameObject diff --git a/reactos/dll/win32/urlmon/binding.c b/reactos/dll/win32/urlmon/binding.c index fb30367954a..28d0802174b 100644 --- a/reactos/dll/win32/urlmon/binding.c +++ b/reactos/dll/win32/urlmon/binding.c @@ -80,6 +80,7 @@ struct Binding { const IBindingVtbl *lpBindingVtbl; const IInternetProtocolSinkVtbl *lpInternetProtocolSinkVtbl; const IInternetBindInfoVtbl *lpInternetBindInfoVtbl; + const IWinInetHttpInfoVtbl *lpWinInetHttpInfoVtbl; const IServiceProviderVtbl *lpServiceProviderVtbl; LONG ref; @@ -117,6 +118,7 @@ struct Binding { #define BINDING(x) ((IBinding*) &(x)->lpBindingVtbl) #define PROTSINK(x) ((IInternetProtocolSink*) &(x)->lpInternetProtocolSinkVtbl) #define BINDINF(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl) +#define INETINFO(x) ((IWinInetHttpInfo*) &(x)->lpWinInetHttpInfoVtbl) #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl) #define STREAM(x) ((IStream*) &(x)->lpStreamVtbl) @@ -901,6 +903,31 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv); *ppv = SERVPROV(This); + }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) { + TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv); + + /* NOTE: This violidates COM rules, but tests prove that we should do it */ + if(!get_wininet_info(This->protocol)) + return E_NOINTERFACE; + + *ppv = INETINFO(This); + }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) { + IWinInetHttpInfo *http_info; + IWinInetInfo *info; + HRESULT hres; + + TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv); + + info = get_wininet_info(This->protocol); + if(!info) + return E_NOINTERFACE; + + hres = IWinInetInfo_QueryInterface(info, &IID_IWinInetHttpInfo, (void**)&http_info); + if(FAILED(hres)) + return E_NOINTERFACE; + + IWinInetHttpInfo_Release(http_info); + *ppv = INETINFO(This); } if(*ppv) { @@ -1448,6 +1475,52 @@ static const IInternetBindInfoVtbl InternetBindInfoVtbl = { InternetBindInfo_GetBindString }; +#define INETINFO_THIS(iface) DEFINE_THIS(Binding, WinInetHttpInfo, iface) + +static HRESULT WINAPI WinInetHttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv) +{ + Binding *This = INETINFO_THIS(iface); + return IBinding_QueryInterface(BINDING(This), riid, ppv); +} + +static ULONG WINAPI WinInetHttpInfo_AddRef(IWinInetHttpInfo *iface) +{ + Binding *This = INETINFO_THIS(iface); + return IBinding_AddRef(BINDING(This)); +} + +static ULONG WINAPI WinInetHttpInfo_Release(IWinInetHttpInfo *iface) +{ + Binding *This = INETINFO_THIS(iface); + return IBinding_Release(BINDING(This)); +} + +static HRESULT WINAPI WinInetHttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer) +{ + Binding *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI WinInetHttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved) +{ + Binding *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved); + return E_NOTIMPL; +} + +#undef INETINFO_THIS + +static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = { + WinInetHttpInfo_QueryInterface, + WinInetHttpInfo_AddRef, + WinInetHttpInfo_Release, + WinInetHttpInfo_QueryOption, + WinInetHttpInfo_QueryInfo +}; + #define SERVPROV_THIS(iface) DEFINE_THIS(Binding, ServiceProvider, iface) static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, @@ -1559,6 +1632,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, LPCWSTR url, ret->lpBindingVtbl = &BindingVtbl; ret->lpInternetProtocolSinkVtbl = &InternetProtocolSinkVtbl; ret->lpInternetBindInfoVtbl = &InternetBindInfoVtbl; + ret->lpWinInetHttpInfoVtbl = &WinInetHttpInfoVtbl; ret->lpServiceProviderVtbl = &ServiceProviderVtbl; ret->ref = 1; diff --git a/reactos/dll/win32/urlmon/bindprot.c b/reactos/dll/win32/urlmon/bindprot.c index 07f2722bf7c..1f245943b3b 100644 --- a/reactos/dll/win32/urlmon/bindprot.c +++ b/reactos/dll/win32/urlmon/bindprot.c @@ -34,6 +34,7 @@ typedef struct { IInternetBindInfo *bind_info; IInternetProtocolSink *protocol_sink; IServiceProvider *service_provider; + IWinInetInfo *wininet_info; LONG priority; @@ -104,6 +105,8 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { + if(This->wininet_info) + IWinInetInfo_Release(This->wininet_info); if(This->protocol) IInternetProtocol_Release(This->protocol); if(This->bind_info) @@ -120,17 +123,18 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface) static HRESULT WINAPI BindProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { BindProtocol *This = PROTOCOL_THIS(iface); IInternetProtocol *protocol = NULL; IInternetPriority *priority; IServiceProvider *service_provider; + BOOL urlmon_protocol = FALSE; CLSID clsid = IID_NULL; LPOLESTR clsid_str; HRESULT hres; - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); if(!szUrl || !pOIProtSink || !pOIBindInfo) @@ -149,7 +153,7 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl IClassFactory *cf; IUnknown *unk; - hres = get_protocol_handler(szUrl, &clsid, &cf); + hres = get_protocol_handler(szUrl, &clsid, &urlmon_protocol, &cf); if(FAILED(hres)) return hres; @@ -178,6 +182,9 @@ static HRESULT WINAPI BindProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl This->protocol = protocol; + if(urlmon_protocol) + IInternetProtocol_QueryInterface(protocol, &IID_IWinInetInfo, (void**)&This->wininet_info); + IInternetBindInfo_AddRef(pOIBindInfo); This->bind_info = pOIBindInfo; @@ -304,6 +311,13 @@ void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *s IServiceProvider_Release(service_provider); } +IWinInetInfo *get_wininet_info(IInternetProtocol *bind_protocol) +{ + BindProtocol *This = PROTOCOL_THIS(bind_protocol); + + return This->wininet_info; +} + #undef PROTOCOL_THIS static const IInternetProtocolVtbl BindProtocolVtbl = { diff --git a/reactos/dll/win32/urlmon/file.c b/reactos/dll/win32/urlmon/file.c index 8b5a229b7ca..1e3db1681ee 100644 --- a/reactos/dll/win32/urlmon/file.c +++ b/reactos/dll/win32/urlmon/file.c @@ -92,7 +92,7 @@ static ULONG WINAPI FileProtocol_Release(IInternetProtocol *iface) static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { FileProtocol *This = PROTOCOL_THIS(iface); BINDINFO bindinfo; @@ -106,7 +106,7 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl static const WCHAR wszFile[] = {'f','i','l','e',':'}; - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); if(!szUrl || strlenW(szUrl) < sizeof(wszFile)/sizeof(WCHAR) diff --git a/reactos/dll/win32/urlmon/format.c b/reactos/dll/win32/urlmon/format.c index 0c87ca54789..bf9dda06034 100644 --- a/reactos/dll/win32/urlmon/format.c +++ b/reactos/dll/win32/urlmon/format.c @@ -35,11 +35,13 @@ typedef struct { static IEnumFORMATETC *EnumFORMATETC_Create(UINT cfmtetc, const FORMATETC *rgfmtetc, UINT it); -#define ENUMF_THIS(iface) ICOM_THIS_MULTI(EnumFORMATETC, lpEnumFORMATETCVtbl, iface) +#define ENUMF_THIS(iface) DEFINE_THIS(EnumFORMATETC, EnumFORMATETC, iface) static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID riid, void **ppv) { - TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + EnumFORMATETC *This = ENUMF_THIS(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); *ppv = NULL; @@ -55,7 +57,7 @@ static HRESULT WINAPI EnumFORMATETC_QueryInterface(IEnumFORMATETC *iface, REFIID static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); return ref; @@ -63,7 +65,7 @@ static ULONG WINAPI EnumFORMATETC_AddRef(IEnumFORMATETC *iface) static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -81,7 +83,7 @@ static ULONG WINAPI EnumFORMATETC_Release(IEnumFORMATETC *iface) static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); ULONG cnt; TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched); @@ -108,7 +110,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface, ULONG celt, static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)->(%d)\n", This, celt); @@ -118,7 +120,7 @@ static HRESULT WINAPI EnumFORMATETC_Skip(IEnumFORMATETC *iface, ULONG celt) static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)\n", This); @@ -128,7 +130,7 @@ static HRESULT WINAPI EnumFORMATETC_Reset(IEnumFORMATETC *iface) static HRESULT WINAPI EnumFORMATETC_Clone(IEnumFORMATETC *iface, IEnumFORMATETC **ppenum) { - ENUMF_THIS(iface); + EnumFORMATETC *This = ENUMF_THIS(iface); TRACE("(%p)->(%p)\n", This, ppenum); diff --git a/reactos/dll/win32/urlmon/ftp.c b/reactos/dll/win32/urlmon/ftp.c index dbdd7a7fd37..c6789e583c3 100644 --- a/reactos/dll/win32/urlmon/ftp.c +++ b/reactos/dll/win32/urlmon/ftp.c @@ -26,12 +26,14 @@ typedef struct { const IInternetProtocolVtbl *lpInternetProtocolVtbl; const IInternetPriorityVtbl *lpInternetPriorityVtbl; + const IWinInetHttpInfoVtbl *lpWinInetHttpInfoVtbl; LONG ref; } FtpProtocol; -#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) -#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl) +#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) +#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl) +#define INETHTTPINFO(x) ((IWinInetHttpInfo*) &(x)->lpWinInetHttpInfoVtbl) #define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(FtpProtocol, base, iface) @@ -97,6 +99,12 @@ static HRESULT WINAPI FtpProtocol_QueryInterface(IInternetProtocol *iface, REFII }else if(IsEqualGUID(&IID_IInternetPriority, riid)) { TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv); *ppv = PRIORITY(This); + }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) { + TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv); + *ppv = INETHTTPINFO(This); + }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) { + TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv); + *ppv = INETHTTPINFO(This); } if(*ppv) { @@ -135,13 +143,13 @@ static ULONG WINAPI FtpProtocol_Release(IInternetProtocol *iface) static HRESULT WINAPI FtpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { FtpProtocol *This = PROTOCOL_THIS(iface); static const WCHAR ftpW[] = {'f','t','p',':'}; - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); if(strncmpW(szUrl, ftpW, sizeof(ftpW)/sizeof(WCHAR))) @@ -295,6 +303,52 @@ static const IInternetPriorityVtbl FtpPriorityVtbl = { FtpPriority_GetPriority }; +#define INETINFO_THIS(iface) DEFINE_THIS(FtpProtocol, WinInetHttpInfo, iface) + +static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv) +{ + FtpProtocol *This = INETINFO_THIS(iface); + return IBinding_QueryInterface(PROTOCOL(This), riid, ppv); +} + +static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface) +{ + FtpProtocol *This = INETINFO_THIS(iface); + return IBinding_AddRef(PROTOCOL(This)); +} + +static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface) +{ + FtpProtocol *This = INETINFO_THIS(iface); + return IBinding_Release(PROTOCOL(This)); +} + +static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer) +{ + FtpProtocol *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved) +{ + FtpProtocol *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved); + return E_NOTIMPL; +} + +#undef INETINFO_THIS + +static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = { + HttpInfo_QueryInterface, + HttpInfo_AddRef, + HttpInfo_Release, + HttpInfo_QueryOption, + HttpInfo_QueryInfo +}; + HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) { FtpProtocol *ret; @@ -308,6 +362,7 @@ HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) ret->base.vtbl = &AsyncProtocolVtbl; ret->lpInternetProtocolVtbl = &FtpProtocolVtbl; ret->lpInternetPriorityVtbl = &FtpPriorityVtbl; + ret->lpWinInetHttpInfoVtbl = &WinInetHttpInfoVtbl; ret->ref = 1; *ppobj = PROTOCOL(ret); diff --git a/reactos/dll/win32/urlmon/gopher.c b/reactos/dll/win32/urlmon/gopher.c index c562657152c..f2abcddc8ed 100644 --- a/reactos/dll/win32/urlmon/gopher.c +++ b/reactos/dll/win32/urlmon/gopher.c @@ -123,11 +123,11 @@ static ULONG WINAPI GopherProtocol_Release(IInternetProtocol *iface) static HRESULT WINAPI GopherProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { GopherProtocol *This = PROTOCOL_THIS(iface); - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); return protocol_start(&This->base, PROTOCOL(This), szUrl, pOIProtSink, pOIBindInfo); diff --git a/reactos/dll/win32/urlmon/http.c b/reactos/dll/win32/urlmon/http.c index 80eefbed204..9c11d4104c2 100644 --- a/reactos/dll/win32/urlmon/http.c +++ b/reactos/dll/win32/urlmon/http.c @@ -34,6 +34,7 @@ typedef struct { const IInternetProtocolVtbl *lpInternetProtocolVtbl; const IInternetPriorityVtbl *lpInternetPriorityVtbl; + const IWinInetHttpInfoVtbl *lpWinInetHttpInfoVtbl; BOOL https; IHttpNegotiate *http_negotiate; @@ -42,8 +43,9 @@ typedef struct { LONG ref; } HttpProtocol; -#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) -#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl) +#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) +#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl) +#define INETHTTPINFO(x) ((IWinInetHttpInfo*) &(x)->lpWinInetHttpInfoVtbl) /* Default headers from native */ static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g', @@ -326,6 +328,12 @@ static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFI }else if(IsEqualGUID(&IID_IInternetPriority, riid)) { TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv); *ppv = PRIORITY(This); + }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) { + TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv); + *ppv = INETHTTPINFO(This); + }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) { + TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv); + *ppv = INETHTTPINFO(This); } if(*ppv) { @@ -364,14 +372,14 @@ static ULONG WINAPI HttpProtocol_Release(IInternetProtocol *iface) static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { HttpProtocol *This = PROTOCOL_THIS(iface); static const WCHAR httpW[] = {'h','t','t','p',':'}; static const WCHAR httpsW[] = {'h','t','t','p','s',':'}; - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); if(This->https @@ -527,6 +535,52 @@ static const IInternetPriorityVtbl HttpPriorityVtbl = { HttpPriority_GetPriority }; +#define INETINFO_THIS(iface) DEFINE_THIS(HttpProtocol, WinInetHttpInfo, iface) + +static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv) +{ + HttpProtocol *This = INETINFO_THIS(iface); + return IBinding_QueryInterface(PROTOCOL(This), riid, ppv); +} + +static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface) +{ + HttpProtocol *This = INETINFO_THIS(iface); + return IBinding_AddRef(PROTOCOL(This)); +} + +static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface) +{ + HttpProtocol *This = INETINFO_THIS(iface); + return IBinding_Release(PROTOCOL(This)); +} + +static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer) +{ + HttpProtocol *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, + void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved) +{ + HttpProtocol *This = INETINFO_THIS(iface); + FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved); + return E_NOTIMPL; +} + +#undef INETINFO_THIS + +static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = { + HttpInfo_QueryInterface, + HttpInfo_AddRef, + HttpInfo_Release, + HttpInfo_QueryOption, + HttpInfo_QueryInfo +}; + static HRESULT create_http_protocol(BOOL https, void **ppobj) { HttpProtocol *ret; @@ -538,6 +592,7 @@ static HRESULT create_http_protocol(BOOL https, void **ppobj) ret->base.vtbl = &AsyncProtocolVtbl; ret->lpInternetProtocolVtbl = &HttpProtocolVtbl; ret->lpInternetPriorityVtbl = &HttpPriorityVtbl; + ret->lpWinInetHttpInfoVtbl = &WinInetHttpInfoVtbl; ret->https = https; ret->ref = 1; diff --git a/reactos/dll/win32/urlmon/mimefilter.c b/reactos/dll/win32/urlmon/mimefilter.c new file mode 100644 index 00000000000..ee6f50f238f --- /dev/null +++ b/reactos/dll/win32/urlmon/mimefilter.c @@ -0,0 +1,263 @@ +/* + * Copyright 2009 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "urlmon_main.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(urlmon); + +typedef struct { + const IInternetProtocolVtbl *lpIInternetProtocolVtbl; + const IInternetProtocolSinkVtbl *lpIInternetProtocolSinkVtbl; + + LONG ref; +} MimeFilter; + +#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpIInternetProtocolVtbl) +#define PROTOCOLSINK(x) ((IInternetProtocolSink*) &(x)->lpIInternetProtocolSinkVtbl) + +#define PROTOCOL_THIS(iface) DEFINE_THIS(MimeFilter, IInternetProtocol, iface) + +static HRESULT WINAPI MimeFilterProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + + *ppv = NULL; + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { + TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) { + TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv); + *ppv = PROTOCOL(This); + }else if(IsEqualGUID(&IID_IInternetProtocolSink, riid)) { + TRACE("(%p)->(IID_IInternetProtocolSink %p)\n", This, ppv); + *ppv = PROTOCOLSINK(This); + } + + if(*ppv) { + IInternetProtocol_AddRef(iface); + return S_OK; + } + + WARN("not supported interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI MimeFilterProtocol_AddRef(IInternetProtocol *iface) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + LONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p) ref=%d\n", This, ref); + return ref; +} + +static ULONG WINAPI MimeFilterProtocol_Release(IInternetProtocol *iface) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + heap_free(This); + + URLMON_UnlockModule(); + } + + return ref; +} + +static HRESULT WINAPI MimeFilterProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, + IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, + DWORD grfPI, HANDLE_PTR dwReserved) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, + pOIBindInfo, grfPI, dwReserved); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%p)\n", This, pProtocolData); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, + DWORD dwOptions) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%08x)\n", This, dwOptions); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Suspend(IInternetProtocol *iface) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Resume(IInternetProtocol *iface) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Read(IInternetProtocol *iface, void *pv, + ULONG cb, ULONG *pcbRead) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, + DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)->(%08x)\n", This, dwOptions); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterProtocol_UnlockRequest(IInternetProtocol *iface) +{ + MimeFilter *This = PROTOCOL_THIS(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +#undef PROTOCOL_THIS + +static const IInternetProtocolVtbl MimeFilterProtocolVtbl = { + MimeFilterProtocol_QueryInterface, + MimeFilterProtocol_AddRef, + MimeFilterProtocol_Release, + MimeFilterProtocol_Start, + MimeFilterProtocol_Continue, + MimeFilterProtocol_Abort, + MimeFilterProtocol_Terminate, + MimeFilterProtocol_Suspend, + MimeFilterProtocol_Resume, + MimeFilterProtocol_Read, + MimeFilterProtocol_Seek, + MimeFilterProtocol_LockRequest, + MimeFilterProtocol_UnlockRequest +}; + +#define PROTSINK_THIS(iface) DEFINE_THIS(MimeFilter, IInternetProtocolSink, iface) + +static HRESULT WINAPI MimeFilterSink_QueryInterface(IInternetProtocolSink *iface, + REFIID riid, void **ppv) +{ + MimeFilter *This = PROTSINK_THIS(iface); + return IInternetProtocol_QueryInterface(PROTOCOL(This), riid, ppv); +} + +static ULONG WINAPI MimeFilterSink_AddRef(IInternetProtocolSink *iface) +{ + MimeFilter *This = PROTSINK_THIS(iface); + return IInternetProtocol_AddRef(PROTOCOL(This)); +} + +static ULONG WINAPI MimeFilterSink_Release(IInternetProtocolSink *iface) +{ + MimeFilter *This = PROTSINK_THIS(iface); + return IInternetProtocol_Release(PROTOCOL(This)); +} + +static HRESULT WINAPI MimeFilterSink_Switch(IInternetProtocolSink *iface, + PROTOCOLDATA *pProtocolData) +{ + MimeFilter *This = PROTSINK_THIS(iface); + FIXME("(%p)->(%p)\n", This, pProtocolData); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterSink_ReportProgress(IInternetProtocolSink *iface, + ULONG ulStatusCode, LPCWSTR szStatusText) +{ + MimeFilter *This = PROTSINK_THIS(iface); + FIXME("(%p)->(%u %s)\n", This, ulStatusCode, debugstr_w(szStatusText)); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterSink_ReportData(IInternetProtocolSink *iface, + DWORD grfBSCF, ULONG ulProgress, ULONG ulProgressMax) +{ + MimeFilter *This = PROTSINK_THIS(iface); + FIXME("(%p)->(%d %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax); + return E_NOTIMPL; +} + +static HRESULT WINAPI MimeFilterSink_ReportResult(IInternetProtocolSink *iface, + HRESULT hrResult, DWORD dwError, LPCWSTR szResult) +{ + MimeFilter *This = PROTSINK_THIS(iface); + FIXME("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult)); + return E_NOTIMPL; +} + +#undef PROTSINK_THIS + +static const IInternetProtocolSinkVtbl InternetProtocolSinkVtbl = { + MimeFilterSink_QueryInterface, + MimeFilterSink_AddRef, + MimeFilterSink_Release, + MimeFilterSink_Switch, + MimeFilterSink_ReportProgress, + MimeFilterSink_ReportData, + MimeFilterSink_ReportResult +}; + +HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) +{ + MimeFilter *ret; + + TRACE("(%p %p)\n", pUnkOuter, ppobj); + + URLMON_LockModule(); + + ret = heap_alloc_zero(sizeof(MimeFilter)); + + ret->lpIInternetProtocolVtbl = &MimeFilterProtocolVtbl; + ret->lpIInternetProtocolSinkVtbl = &InternetProtocolSinkVtbl; + ret->ref = 1; + + *ppobj = PROTOCOL(ret); + return S_OK; +} diff --git a/reactos/dll/win32/urlmon/mk.c b/reactos/dll/win32/urlmon/mk.c index 2a58d68345d..934eeda8ef7 100644 --- a/reactos/dll/win32/urlmon/mk.c +++ b/reactos/dll/win32/urlmon/mk.c @@ -93,7 +93,7 @@ static HRESULT report_result(IInternetProtocolSink *sink, HRESULT hres, DWORD dw static HRESULT WINAPI MkProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, - DWORD grfPI, DWORD dwReserved) + DWORD grfPI, HANDLE_PTR dwReserved) { MkProtocol *This = PROTOCOL_THIS(iface); IParseDisplayName *pdn; @@ -108,7 +108,7 @@ static HRESULT WINAPI MkProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, static const WCHAR wszMK[] = {'m','k',':','@'}; - TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, + TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink, pOIBindInfo, grfPI, dwReserved); if(strncmpiW(szUrl, wszMK, sizeof(wszMK)/sizeof(WCHAR))) diff --git a/reactos/dll/win32/urlmon/regsvr.c b/reactos/dll/win32/urlmon/regsvr.c index 2728cedac7a..9561a23feaf 100644 --- a/reactos/dll/win32/urlmon/regsvr.c +++ b/reactos/dll/win32/urlmon/regsvr.c @@ -513,10 +513,10 @@ static struct regsvr_interface const interface_list[] = { #define INF_SET_CLSID(clsid) \ do \ { \ - static CHAR name[] = "CLSID_" #clsid; \ + static CHAR name[] = #clsid; \ \ pse[i].pszName = name; \ - clsids[i++] = &CLSID_ ## clsid; \ + clsids[i++] = &clsid; \ } while (0) static HRESULT register_inf(BOOL doregister) @@ -525,19 +525,20 @@ static HRESULT register_inf(BOOL doregister) HMODULE hAdvpack; HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); STRTABLEA strtable; - STRENTRYA pse[7]; - static CLSID const *clsids[34]; + STRENTRYA pse[8]; + static CLSID const *clsids[8]; unsigned int i = 0; static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; - INF_SET_CLSID(CdlProtocol); - INF_SET_CLSID(FileProtocol); - INF_SET_CLSID(FtpProtocol); - INF_SET_CLSID(GopherProtocol); - INF_SET_CLSID(HttpProtocol); - INF_SET_CLSID(HttpSProtocol); - INF_SET_CLSID(MkProtocol); + INF_SET_CLSID(CLSID_CdlProtocol); + INF_SET_CLSID(CLSID_FileProtocol); + INF_SET_CLSID(CLSID_FtpProtocol); + INF_SET_CLSID(CLSID_GopherProtocol); + INF_SET_CLSID(CLSID_HttpProtocol); + INF_SET_CLSID(CLSID_HttpSProtocol); + INF_SET_CLSID(CLSID_MkProtocol); + INF_SET_CLSID(CLSID_DeCompMimeFilter); for(i = 0; i < sizeof(pse)/sizeof(pse[0]); i++) { pse[i].pszValue = heap_alloc(39); diff --git a/reactos/dll/win32/urlmon/session.c b/reactos/dll/win32/urlmon/session.c index 72308e1eeec..9cacde7ae91 100644 --- a/reactos/dll/win32/urlmon/session.c +++ b/reactos/dll/win32/urlmon/session.c @@ -228,7 +228,7 @@ IInternetProtocolInfo *get_protocol_info(LPCWSTR url) return ret; } -HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret) +HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, BOOL *urlmon_protocol, IClassFactory **ret) { name_space *ns; WCHAR schema[64]; @@ -250,6 +250,8 @@ HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret) IClassFactory_AddRef(*ret); if(clsid) *clsid = ns->clsid; + if(urlmon_protocol) + *urlmon_protocol = ns->urlmon; } LeaveCriticalSection(&session_cs); @@ -257,6 +259,8 @@ HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret) if(*ret) return S_OK; + if(urlmon_protocol) + *urlmon_protocol = FALSE; return get_protocol_cf(schema, schema_len, clsid, ret); } diff --git a/reactos/dll/win32/urlmon/umon.c b/reactos/dll/win32/urlmon/umon.c index fe60c754716..e6e20b9d11c 100644 --- a/reactos/dll/win32/urlmon/umon.c +++ b/reactos/dll/win32/urlmon/umon.c @@ -20,13 +20,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include "urlmon_main.h" #include "winreg.h" -#include "winternl.h" -#include "wininet.h" #include "shlwapi.h" #include "wine/debug.h" diff --git a/reactos/dll/win32/urlmon/urlmon.inf b/reactos/dll/win32/urlmon/urlmon.inf index efdf4ef81a9..63d88c4a613 100644 --- a/reactos/dll/win32/urlmon/urlmon.inf +++ b/reactos/dll/win32/urlmon/urlmon.inf @@ -3,11 +3,19 @@ Signature="$CHICAGO$" [RegisterDll] -AddReg=Protocols.Reg, ZoneMap.Reg, Zones.Reg +AddReg=Classes.Reg, Protocols.Reg, ZoneMap.Reg, Zones.Reg [UnregisterDll] -DelReg=Protocols.Reg, ZoneMap.Reg, Zones.Reg +DelReg=Classes.Reg, Protocols.Reg, ZoneMap.Reg, Zones.Reg + + +[Classes.Reg] + +;; CLSID_DeCompMimeFilter +HKCR,"CLSID\%CLSID_DeCompMimeFilter%",,,"AP lzdhtml encoding/decoding Filter" +HKCR,"CLSID\%CLSID_DeCompMimeFilter%\InProcServer32",,,"%MODULE%" +HKCR,"CLSID\%CLSID_DeCompMimeFilter%\InProcServer32","ThreadingModel",,"Apartment" [Protocols.Reg] @@ -26,7 +34,12 @@ HKCR,"PROTOCOLS\Handler\http","CLSID",,"%CLSID_HttpProtocol%" HKCR,"PROTOCOLS\Handler\https",,,"https: Asynchronous Pluggable Protocol Handler" HKCR,"PROTOCOLS\Handler\https","CLSID",,"%CLSID_HttpsProtocol%" HKCR,"PROTOCOLS\Handler\mk",,,"mk: Asynchronous Pluggable Protocol Handler" -HKCR,"PROTOCOLS\Handler\mk","CLSID",,"%CLSID_MkProtocol%" +HKCR,"PROTOCOLS\Filter\deflate",,,"AP Deflate Encoding/Decoding Filter" +HKCR,"PROTOCOLS\Filter\deflate","CLSID",,"%CLSID_DeCompMimeFilter%" +HKCR,"PROTOCOLS\Filter\gzip",,,"AP Deflate Encoding/Decoding Filter" +HKCR,"PROTOCOLS\Filter\gzip","CLSID",,"%CLSID_DeCompMimeFilter%" +HKCR,"PROTOCOLS\Filter\lzdhtml",,,"AP Deflate Encoding/Decoding Filter" +HKCR,"PROTOCOLS\Filter\lzdhtml","CLSID",,"%CLSID_DeCompMimeFilter%" [ZoneMap.Reg] @@ -448,6 +461,8 @@ HKLM,"%ZONES_UNTRUSTED%","1E05",0x10003,0x10000 [Strings] +MODULE="urlmon.dll" + PATH_ZONEMAP="Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap" PATH_ZONEMAP_PROTOCOLS="Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProtocolDefaults" PATH_ZONEMAP_DOMAINS="Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains" diff --git a/reactos/dll/win32/urlmon/urlmon.rbuild b/reactos/dll/win32/urlmon/urlmon.rbuild index 2a6525eeb73..a9df130d3ab 100644 --- a/reactos/dll/win32/urlmon/urlmon.rbuild +++ b/reactos/dll/win32/urlmon/urlmon.rbuild @@ -18,6 +18,7 @@ gopher.c http.c internet.c + mimefilter.c mk.c protocol.c regsvr.c @@ -37,4 +38,7 @@ kernel32 ntdll + + urlmon_local.idl + diff --git a/reactos/dll/win32/urlmon/urlmon_local.idl b/reactos/dll/win32/urlmon/urlmon_local.idl new file mode 100644 index 00000000000..1a1403ea73e --- /dev/null +++ b/reactos/dll/win32/urlmon/urlmon_local.idl @@ -0,0 +1,2 @@ + +#include "urlmon.idl" diff --git a/reactos/dll/win32/urlmon/urlmon_main.c b/reactos/dll/win32/urlmon/urlmon_main.c index ad1b07bd6f4..8561937643a 100644 --- a/reactos/dll/win32/urlmon/urlmon_main.c +++ b/reactos/dll/win32/urlmon/urlmon_main.c @@ -187,6 +187,8 @@ static const ClassFactory ZoneManagerCF = { &ClassFactoryVtbl, ZoneMgrImpl_Construct}; static const ClassFactory StdURLMonikerCF = { &ClassFactoryVtbl, StdURLMoniker_Construct}; +static const ClassFactory MimeFilterCF = + { &ClassFactoryVtbl, MimeFilter_Construct}; struct object_creation_info { @@ -212,7 +214,8 @@ static const struct object_creation_info object_creation[] = { &CLSID_MkProtocol, CLASSFACTORY(&MkProtocolCF), wszMk }, { &CLSID_InternetSecurityManager, CLASSFACTORY(&SecurityManagerCF), NULL }, { &CLSID_InternetZoneManager, CLASSFACTORY(&ZoneManagerCF), NULL }, - { &CLSID_StdURLMoniker, CLASSFACTORY(&StdURLMonikerCF), NULL } + { &CLSID_StdURLMoniker, CLASSFACTORY(&StdURLMonikerCF), NULL }, + { &CLSID_DeCompMimeFilter, CLASSFACTORY(&MimeFilterCF), NULL } }; static void init_session(BOOL init) diff --git a/reactos/dll/win32/urlmon/urlmon_main.h b/reactos/dll/win32/urlmon/urlmon_main.h index 54c0435de8d..1ee2eec313e 100644 --- a/reactos/dll/win32/urlmon/urlmon_main.h +++ b/reactos/dll/win32/urlmon/urlmon_main.h @@ -45,6 +45,7 @@ extern HRESULT HttpSProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); +extern HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); /********************************************************************** * Dll lifetime tracking declaration for urlmon.dll @@ -53,12 +54,11 @@ extern LONG URLMON_refCount; static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); } static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); } -#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field)) #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc))) #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface) -IInternetProtocolInfo *get_protocol_info(LPCWSTR url); -HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret); +IInternetProtocolInfo *get_protocol_info(LPCWSTR); +HRESULT get_protocol_handler(LPCWSTR,CLSID*,BOOL*,IClassFactory**); BOOL is_registered_protocol(LPCWSTR); void register_urlmon_namespace(IClassFactory*,REFIID,LPCWSTR,BOOL); @@ -67,6 +67,7 @@ HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, v HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol); void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink); +IWinInetInfo *get_wininet_info(IInternetProtocol*); typedef struct ProtocolVtbl ProtocolVtbl;