urlmon: Added HlinkParseDisplayNameEx implementation.

This commit is contained in:
Jacek Caban 2008-01-29 00:18:33 +01:00 committed by Alexandre Julliard
parent 254000dc99
commit 60b0539c87
4 changed files with 40 additions and 1 deletions

View File

@ -95,9 +95,26 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
if(pclsid)
*pclsid = clsid;
if(!ret)
return S_OK;
return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)ret);
}
BOOL is_registered_protocol(LPCWSTR url)
{
DWORD schema_len;
WCHAR schema[64];
HRESULT hres;
hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]),
&schema_len, 0);
if(FAILED(hres))
return FALSE;
return get_protocol_cf(schema, schema_len, NULL, NULL) == S_OK;
}
IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
{
IInternetProtocolInfo *ret = NULL;

View File

@ -1185,6 +1185,27 @@ HRESULT WINAPI BindAsyncMoniker(IMoniker *pmk, DWORD grfOpt, IBindStatusCallback
return hr;
}
/***********************************************************************
* MkParseDisplayNameEx (URLMON.@)
*/
HRESULT WINAPI MkParseDisplayNameEx(IBindCtx *pbc, LPCWSTR szDisplayName, ULONG *pchEaten, LPMONIKER *ppmk)
{
TRACE("(%p %s %p %p)\n", pbc, debugstr_w(szDisplayName), pchEaten, ppmk);
if(is_registered_protocol(szDisplayName)) {
HRESULT hres;
hres = CreateURLMoniker(NULL, szDisplayName, ppmk);
if(SUCCEEDED(hres)) {
*pchEaten = strlenW(szDisplayName);
return hres;
}
}
return MkParseDisplayName(pbc, szDisplayName, pchEaten, ppmk);
}
/***********************************************************************
* URLDownloadToFileA (URLMON.@)
*

View File

@ -53,7 +53,7 @@
@ stub IsLoggingEnabledA
@ stub IsLoggingEnabledW
@ stdcall IsValidURL(ptr wstr long)
@ stdcall MkParseDisplayNameEx(ptr ptr ptr ptr) ole32.MkParseDisplayName
@ stdcall MkParseDisplayNameEx(ptr wstr ptr ptr)
@ stdcall ObtainUserAgentString(long str ptr)
@ stub PrivateCoInstall
@ stdcall RegisterBindStatusCallback(ptr ptr ptr long)

View File

@ -67,6 +67,7 @@ void UMCloseCacheFileStream(IUMCacheStream *pstr);
IInternetProtocolInfo *get_protocol_info(LPCWSTR url);
HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret);
BOOL is_registered_protocol(LPCWSTR);
HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);