urlmon: Added [Un]RegisterMimeFilter implementation.
This commit is contained in:
parent
96be709c2e
commit
8a669c9a19
|
@ -31,7 +31,16 @@ typedef struct name_space {
|
||||||
struct name_space *next;
|
struct name_space *next;
|
||||||
} name_space;
|
} name_space;
|
||||||
|
|
||||||
|
typedef struct mime_filter {
|
||||||
|
IClassFactory *cf;
|
||||||
|
CLSID clsid;
|
||||||
|
LPWSTR mime;
|
||||||
|
|
||||||
|
struct mime_filter *next;
|
||||||
|
} mime_filter;
|
||||||
|
|
||||||
static name_space *name_space_list = NULL;
|
static name_space *name_space_list = NULL;
|
||||||
|
static mime_filter *mime_filter_list = NULL;
|
||||||
|
|
||||||
static name_space *find_name_space(LPCWSTR protocol)
|
static name_space *find_name_space(LPCWSTR protocol)
|
||||||
{
|
{
|
||||||
|
@ -200,8 +209,8 @@ 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->protocol = heap_strdupW(pwzProtocol);
|
|
||||||
new_name_space->clsid = *rclsid;
|
new_name_space->clsid = *rclsid;
|
||||||
|
new_name_space->protocol = heap_strdupW(pwzProtocol);
|
||||||
|
|
||||||
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;
|
||||||
|
@ -242,15 +251,49 @@ static HRESULT WINAPI InternetSession_UnregisterNameSpace(IInternetSession *ifac
|
||||||
static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface,
|
static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface,
|
||||||
IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzType)
|
IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzType)
|
||||||
{
|
{
|
||||||
FIXME("(%p %s %s)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzType));
|
mime_filter *filter;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p %s %s)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzType));
|
||||||
|
|
||||||
|
filter = heap_alloc(sizeof(mime_filter));
|
||||||
|
|
||||||
|
IClassFactory_AddRef(pCF);
|
||||||
|
filter->cf = pCF;
|
||||||
|
filter->clsid = *rclsid;
|
||||||
|
filter->mime = heap_strdupW(pwzType);
|
||||||
|
|
||||||
|
filter->next = mime_filter_list;
|
||||||
|
mime_filter_list = filter;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI InternetSession_UnregisterMimeFilter(IInternetSession *iface,
|
static HRESULT WINAPI InternetSession_UnregisterMimeFilter(IInternetSession *iface,
|
||||||
IClassFactory *pCF, LPCWSTR pwzType)
|
IClassFactory *pCF, LPCWSTR pwzType)
|
||||||
{
|
{
|
||||||
FIXME("(%p %s)\n", pCF, debugstr_w(pwzType));
|
mime_filter *iter, *prev = NULL;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p %s)\n", pCF, debugstr_w(pwzType));
|
||||||
|
|
||||||
|
for(iter = mime_filter_list; iter; iter = iter->next) {
|
||||||
|
if(iter->cf == pCF && !strcmpW(iter->mime, pwzType))
|
||||||
|
break;
|
||||||
|
prev = iter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!iter)
|
||||||
|
return S_OK;
|
||||||
|
|
||||||
|
if(prev)
|
||||||
|
prev->next = iter->next;
|
||||||
|
else
|
||||||
|
mime_filter_list = iter->next;
|
||||||
|
|
||||||
|
IClassFactory_Release(iter->cf);
|
||||||
|
heap_free(iter->mime);
|
||||||
|
heap_free(iter);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
|
static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
|
||||||
|
|
Loading…
Reference in New Issue