urlmon: Added CUri ClassFactory implementation.

This commit is contained in:
Piotr Caban 2012-01-13 14:29:47 +01:00 committed by Alexandre Julliard
parent 1c92d20225
commit 11abd08bb5
4 changed files with 43 additions and 21 deletions

View File

@ -5320,16 +5320,23 @@ static const IPersistStreamVtbl PersistStreamVtbl = {
PersistStream_GetSizeMax
};
static Uri* create_uri_obj(void) {
HRESULT Uri_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
{
Uri *ret = heap_alloc_zero(sizeof(Uri));
if(ret) {
TRACE("(%p %p)\n", pUnkOuter, ppobj);
*ppobj = ret;
if(!ret)
return E_OUTOFMEMORY;
ret->IUri_iface.lpVtbl = &UriVtbl;
ret->IUriBuilderFactory_iface.lpVtbl = &UriBuilderFactoryVtbl;
ret->IPersistStream_iface.lpVtbl = &PersistStreamVtbl;
ret->ref = 1;
}
return ret;
*ppobj = &ret->IUri_iface;
return S_OK;
}
/***********************************************************************
@ -5387,10 +5394,10 @@ HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IU
if(dwFlags & ~supported_flags)
FIXME("Ignoring unsupported flag(s) %x\n", dwFlags & ~supported_flags);
ret = create_uri_obj();
if(!ret) {
hr = Uri_Construct(NULL, (void**)&ret);
if(FAILED(hr)) {
*ppURI = NULL;
return E_OUTOFMEMORY;
return hr;
}
/* Explicitly set the default flags if it doesn't cause a flag conflict. */
@ -5547,10 +5554,10 @@ static HRESULT build_uri(const UriBuilder *builder, IUri **uri, DWORD create_fla
return hr;
}
ret = create_uri_obj();
if(!ret) {
hr = Uri_Construct(NULL, (void**)&ret);
if(FAILED(hr)) {
*uri = NULL;
return E_OUTOFMEMORY;
return hr;
}
hr = generate_uri(builder, &data, ret, create_flags);
@ -6115,10 +6122,10 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
parse_uri(&data, 0);
ret = create_uri_obj();
if(!ret) {
hr = Uri_Construct(NULL, (void**)&ret);
if(FAILED(hr)) {
*result = NULL;
return E_OUTOFMEMORY;
return hr;
}
if(extras & COMBINE_URI_FORCE_FLAG_USE) {
@ -6319,12 +6326,12 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
generate_raw_uri(&data, data.uri, raw_flags);
ret = create_uri_obj();
if(!ret) {
hr = Uri_Construct(NULL, (void**)&ret);
if(FAILED(hr)) {
SysFreeString(data.uri);
heap_free(path);
*result = NULL;
return E_OUTOFMEMORY;
return hr;
}
if(flags & URL_DONT_SIMPLIFY)

View File

@ -27,6 +27,7 @@
#define NO_SHLWAPI_REG
#include "shlwapi.h"
#include "advpub.h"
#include "initguid.h"
#include "wine/debug.h"
@ -34,6 +35,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
LONG URLMON_refCount = 0;
static HMODULE hCabinet = NULL;
@ -292,6 +295,8 @@ static ClassFactory StdURLMonikerCF =
{ { &ClassFactoryVtbl }, StdURLMoniker_Construct};
static ClassFactory MimeFilterCF =
{ { &ClassFactoryVtbl }, MimeFilter_Construct};
static ClassFactory CUriCF =
{ { &ClassFactoryVtbl }, Uri_Construct};
struct object_creation_info
{
@ -318,7 +323,8 @@ static const struct object_creation_info object_creation[] =
{ &CLSID_InternetSecurityManager, &SecurityManagerCF.IClassFactory_iface, NULL },
{ &CLSID_InternetZoneManager, &ZoneManagerCF.IClassFactory_iface, NULL },
{ &CLSID_StdURLMoniker, &StdURLMonikerCF.IClassFactory_iface, NULL },
{ &CLSID_DeCompMimeFilter, &MimeFilterCF.IClassFactory_iface, NULL }
{ &CLSID_DeCompMimeFilter, &MimeFilterCF.IClassFactory_iface, NULL },
{ &CLSID_CUri, &CUriCF.IClassFactory_iface, NULL }
};
static void init_session(BOOL init)

View File

@ -47,6 +47,7 @@ extern HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPE
extern HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT Uri_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern BOOL WINAPI URLMON_DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DECLSPEC_HIDDEN;
extern HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN;
@ -54,6 +55,7 @@ extern HRESULT WINAPI URLMON_DllRegisterServer(void) DECLSPEC_HIDDEN;
extern HRESULT WINAPI URLMON_DllUnregisterServer(void) DECLSPEC_HIDDEN;
extern GUID const CLSID_PSFactoryBuffer DECLSPEC_HIDDEN;
extern GUID const CLSID_CUri DECLSPEC_HIDDEN;
/**********************************************************************
* Dll lifetime tracking declaration for urlmon.dll

View File

@ -101,3 +101,10 @@ coclass PSFactoryBuffer { interface IPSFactoryBuffer; }
uuid(8f6b0360-b80d-11d0-a9b3-006097942311)
]
coclass DeCompMimeFilter { interface IInternetProtocol; interface IInternetProtocolSink; }
[
helpstring("CUri"),
threading(apartment),
uuid(df2fce13-25ec-45bb-9d4c-cecd47c2430c)
]
coclass CUri { interface IUri; }