mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 07:28:47 +00:00
urlmon: Return CLSID from get_protocol_handler.
This commit is contained in:
parent
6c13f391da
commit
87de64227a
|
@ -1079,7 +1079,7 @@ static HRESULT get_protocol(Binding *This, LPCWSTR url)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = get_protocol_handler(url, &cf);
|
hres = get_protocol_handler(url, NULL, &cf);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
|
|
|
@ -36,25 +36,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
|
||||||
typedef struct name_space {
|
typedef struct name_space {
|
||||||
LPWSTR protocol;
|
LPWSTR protocol;
|
||||||
IClassFactory *cf;
|
IClassFactory *cf;
|
||||||
|
CLSID clsid;
|
||||||
|
|
||||||
struct name_space *next;
|
struct name_space *next;
|
||||||
} name_space;
|
} name_space;
|
||||||
|
|
||||||
static name_space *name_space_list = NULL;
|
static name_space *name_space_list = NULL;
|
||||||
|
|
||||||
static IClassFactory *find_name_space(LPCWSTR protocol)
|
static name_space *find_name_space(LPCWSTR protocol)
|
||||||
{
|
{
|
||||||
name_space *iter;
|
name_space *iter;
|
||||||
|
|
||||||
for(iter = name_space_list; iter; iter = iter->next) {
|
for(iter = name_space_list; iter; iter = iter->next) {
|
||||||
if(!strcmpW(iter->protocol, protocol))
|
if(!strcmpW(iter->protocol, protocol))
|
||||||
return iter->cf;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT get_protocol_iface(LPCWSTR schema, DWORD schema_len, IUnknown **ret)
|
static HRESULT get_protocol_iface(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, IUnknown **ret)
|
||||||
{
|
{
|
||||||
WCHAR str_clsid[64];
|
WCHAR str_clsid[64];
|
||||||
HKEY hkey = NULL;
|
HKEY hkey = NULL;
|
||||||
|
@ -92,13 +93,16 @@ static HRESULT get_protocol_iface(LPCWSTR schema, DWORD schema_len, IUnknown **r
|
||||||
return hres;
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pclsid)
|
||||||
|
*pclsid = clsid;
|
||||||
|
|
||||||
return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)ret);
|
return CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
|
IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
|
||||||
{
|
{
|
||||||
IInternetProtocolInfo *ret = NULL;
|
IInternetProtocolInfo *ret = NULL;
|
||||||
IClassFactory *cf;
|
name_space *ns;
|
||||||
IUnknown *unk;
|
IUnknown *unk;
|
||||||
WCHAR schema[64];
|
WCHAR schema[64];
|
||||||
DWORD schema_len;
|
DWORD schema_len;
|
||||||
|
@ -109,18 +113,18 @@ IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
|
||||||
if(FAILED(hres) || !schema_len)
|
if(FAILED(hres) || !schema_len)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cf = find_name_space(schema);
|
ns = find_name_space(schema);
|
||||||
if(cf) {
|
if(ns) {
|
||||||
hres = IClassFactory_QueryInterface(cf, &IID_IInternetProtocolInfo, (void**)&ret);
|
hres = IClassFactory_QueryInterface(ns->cf, &IID_IInternetProtocolInfo, (void**)&ret);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
hres = IClassFactory_CreateInstance(cf, NULL, &IID_IInternetProtocolInfo, (void**)&ret);
|
hres = IClassFactory_CreateInstance(ns->cf, NULL, &IID_IInternetProtocolInfo, (void**)&ret);
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = get_protocol_iface(schema, schema_len, &unk);
|
hres = get_protocol_iface(schema, schema_len, NULL, &unk);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -130,10 +134,10 @@ IInternetProtocolInfo *get_protocol_info(LPCWSTR url)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT get_protocol_handler(LPCWSTR url, IClassFactory **ret)
|
HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret)
|
||||||
{
|
{
|
||||||
IClassFactory *cf;
|
|
||||||
IUnknown *unk;
|
IUnknown *unk;
|
||||||
|
name_space *ns;
|
||||||
WCHAR schema[64];
|
WCHAR schema[64];
|
||||||
DWORD schema_len;
|
DWORD schema_len;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
@ -143,13 +147,15 @@ HRESULT get_protocol_handler(LPCWSTR url, IClassFactory **ret)
|
||||||
if(FAILED(hres) || !schema_len)
|
if(FAILED(hres) || !schema_len)
|
||||||
return schema_len ? hres : E_FAIL;
|
return schema_len ? hres : E_FAIL;
|
||||||
|
|
||||||
cf = find_name_space(schema);
|
ns = find_name_space(schema);
|
||||||
if(cf) {
|
if(ns) {
|
||||||
*ret = cf;
|
*ret = ns->cf;
|
||||||
|
if(clsid)
|
||||||
|
*clsid = ns->clsid;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
hres = get_protocol_iface(schema, schema_len, &unk);
|
hres = get_protocol_iface(schema, schema_len, clsid, &unk);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
|
@ -213,6 +219,7 @@ static HRESULT WINAPI InternetSession_RegisterNameSpace(IInternetSession *iface,
|
||||||
|
|
||||||
IClassFactory_AddRef(pCF);
|
IClassFactory_AddRef(pCF);
|
||||||
new_name_space->cf = pCF;
|
new_name_space->cf = pCF;
|
||||||
|
new_name_space->clsid = *rclsid;
|
||||||
|
|
||||||
new_name_space->next = name_space_list;
|
new_name_space->next = name_space_list;
|
||||||
name_space_list = new_name_space;
|
name_space_list = new_name_space;
|
||||||
|
|
|
@ -56,7 +56,7 @@ HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL, DWORD dwSize, LPWSTR pszFileNa
|
||||||
void UMCloseCacheFileStream(IUMCacheStream *pstr);
|
void UMCloseCacheFileStream(IUMCacheStream *pstr);
|
||||||
|
|
||||||
IInternetProtocolInfo *get_protocol_info(LPCWSTR url);
|
IInternetProtocolInfo *get_protocol_info(LPCWSTR url);
|
||||||
HRESULT get_protocol_handler(LPCWSTR url, IClassFactory **ret);
|
HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret);
|
||||||
|
|
||||||
HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
|
HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue