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 PersistStream_GetSizeMax
}; };
static Uri* create_uri_obj(void) { HRESULT Uri_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
{
Uri *ret = heap_alloc_zero(sizeof(Uri)); Uri *ret = heap_alloc_zero(sizeof(Uri));
if(ret) {
ret->IUri_iface.lpVtbl = &UriVtbl;
ret->IUriBuilderFactory_iface.lpVtbl = &UriBuilderFactoryVtbl;
ret->IPersistStream_iface.lpVtbl = &PersistStreamVtbl;
ret->ref = 1;
}
return 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;
*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) if(dwFlags & ~supported_flags)
FIXME("Ignoring unsupported flag(s) %x\n", dwFlags & ~supported_flags); FIXME("Ignoring unsupported flag(s) %x\n", dwFlags & ~supported_flags);
ret = create_uri_obj(); hr = Uri_Construct(NULL, (void**)&ret);
if(!ret) { if(FAILED(hr)) {
*ppURI = NULL; *ppURI = NULL;
return E_OUTOFMEMORY; return hr;
} }
/* Explicitly set the default flags if it doesn't cause a flag conflict. */ /* 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; return hr;
} }
ret = create_uri_obj(); hr = Uri_Construct(NULL, (void**)&ret);
if(!ret) { if(FAILED(hr)) {
*uri = NULL; *uri = NULL;
return E_OUTOFMEMORY; return hr;
} }
hr = generate_uri(builder, &data, ret, create_flags); 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); parse_uri(&data, 0);
ret = create_uri_obj(); hr = Uri_Construct(NULL, (void**)&ret);
if(!ret) { if(FAILED(hr)) {
*result = NULL; *result = NULL;
return E_OUTOFMEMORY; return hr;
} }
if(extras & COMBINE_URI_FORCE_FLAG_USE) { 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); generate_raw_uri(&data, data.uri, raw_flags);
ret = create_uri_obj(); hr = Uri_Construct(NULL, (void**)&ret);
if(!ret) { if(FAILED(hr)) {
SysFreeString(data.uri); SysFreeString(data.uri);
heap_free(path); heap_free(path);
*result = NULL; *result = NULL;
return E_OUTOFMEMORY; return hr;
} }
if(flags & URL_DONT_SIMPLIFY) if(flags & URL_DONT_SIMPLIFY)

View File

@ -27,6 +27,7 @@
#define NO_SHLWAPI_REG #define NO_SHLWAPI_REG
#include "shlwapi.h" #include "shlwapi.h"
#include "advpub.h" #include "advpub.h"
#include "initguid.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -34,6 +35,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
DEFINE_GUID(CLSID_CUri, 0xDF2FCE13, 0x25EC, 0x45BB, 0x9D,0x4C, 0xCE,0xCD,0x47,0xC2,0x43,0x0C);
LONG URLMON_refCount = 0; LONG URLMON_refCount = 0;
static HMODULE hCabinet = NULL; static HMODULE hCabinet = NULL;
@ -292,6 +295,8 @@ static ClassFactory StdURLMonikerCF =
{ { &ClassFactoryVtbl }, StdURLMoniker_Construct}; { { &ClassFactoryVtbl }, StdURLMoniker_Construct};
static ClassFactory MimeFilterCF = static ClassFactory MimeFilterCF =
{ { &ClassFactoryVtbl }, MimeFilter_Construct}; { { &ClassFactoryVtbl }, MimeFilter_Construct};
static ClassFactory CUriCF =
{ { &ClassFactoryVtbl }, Uri_Construct};
struct object_creation_info struct object_creation_info
{ {
@ -318,7 +323,8 @@ static const struct object_creation_info object_creation[] =
{ &CLSID_InternetSecurityManager, &SecurityManagerCF.IClassFactory_iface, NULL }, { &CLSID_InternetSecurityManager, &SecurityManagerCF.IClassFactory_iface, NULL },
{ &CLSID_InternetZoneManager, &ZoneManagerCF.IClassFactory_iface, NULL }, { &CLSID_InternetZoneManager, &ZoneManagerCF.IClassFactory_iface, NULL },
{ &CLSID_StdURLMoniker, &StdURLMonikerCF.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) 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 GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj) DECLSPEC_HIDDEN;
extern HRESULT MkProtocol_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 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 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; 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 HRESULT WINAPI URLMON_DllUnregisterServer(void) DECLSPEC_HIDDEN;
extern GUID const CLSID_PSFactoryBuffer DECLSPEC_HIDDEN; extern GUID const CLSID_PSFactoryBuffer DECLSPEC_HIDDEN;
extern GUID const CLSID_CUri DECLSPEC_HIDDEN;
/********************************************************************** /**********************************************************************
* Dll lifetime tracking declaration for urlmon.dll * Dll lifetime tracking declaration for urlmon.dll

View File

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