Commit 9fb647ef authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added [Un]RegisterNamespace implementation.

parent 5f3d7f0d
...@@ -29,9 +29,19 @@ ...@@ -29,9 +29,19 @@
#include "urlmon_main.h" #include "urlmon_main.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
typedef struct name_space {
LPWSTR protocol;
IClassFactory *cf;
struct name_space *next;
} name_space;
static name_space *name_space_list = NULL;
HRESULT get_protocol_iface(LPCWSTR url, IUnknown **ret) HRESULT get_protocol_iface(LPCWSTR url, IUnknown **ret)
{ {
WCHAR schema[64], str_clsid[64]; WCHAR schema[64], str_clsid[64];
...@@ -111,16 +121,63 @@ static HRESULT WINAPI InternetSession_RegisterNameSpace(IInternetSession *iface, ...@@ -111,16 +121,63 @@ static HRESULT WINAPI InternetSession_RegisterNameSpace(IInternetSession *iface,
IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzProtocol, ULONG cPatterns, IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzProtocol, ULONG cPatterns,
const LPCWSTR *ppwzPatterns, DWORD dwReserved) const LPCWSTR *ppwzPatterns, DWORD dwReserved)
{ {
FIXME("(%p %s %s %ld %p %ld)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzProtocol), name_space *new_name_space;
int size;
TRACE("(%p %s %s %ld %p %ld)\n", pCF, debugstr_guid(rclsid), debugstr_w(pwzProtocol),
cPatterns, ppwzPatterns, dwReserved); cPatterns, ppwzPatterns, dwReserved);
return E_NOTIMPL;
if(cPatterns || ppwzPatterns)
FIXME("patterns not supported\n");
if(dwReserved)
WARN("dwReserved = %ld\n", dwReserved);
if(!pCF || !pwzProtocol)
return E_INVALIDARG;
new_name_space = HeapAlloc(GetProcessHeap(), 0, sizeof(name_space));
size = (strlenW(pwzProtocol)+1)*sizeof(WCHAR);
new_name_space->protocol = HeapAlloc(GetProcessHeap(), 0, size);
memcpy(new_name_space->protocol, pwzProtocol, size);
IClassFactory_AddRef(pCF);
new_name_space->cf = pCF;
new_name_space->next = name_space_list;
name_space_list = new_name_space;
return S_OK;
} }
static HRESULT WINAPI InternetSession_UnregisterNameSpace(IInternetSession *iface, static HRESULT WINAPI InternetSession_UnregisterNameSpace(IInternetSession *iface,
IClassFactory *pCF, LPCWSTR pszProtocol) IClassFactory *pCF, LPCWSTR pszProtocol)
{ {
FIXME("(%p %s)\n", pCF, debugstr_w(pszProtocol)); name_space *iter, *last = NULL;
return E_NOTIMPL;
TRACE("(%p %s)\n", pCF, debugstr_w(pszProtocol));
if(!pCF || !pszProtocol)
return E_INVALIDARG;
for(iter = name_space_list; iter; iter = iter->next) {
if(iter->cf == pCF && !strcmpW(iter->protocol, pszProtocol))
break;
last = iter;
}
if(!iter)
return S_OK;
if(last)
last->next = iter->next;
else
name_space_list = iter->next;
IClassFactory_Release(iter->cf);
HeapFree(GetProcessHeap(), 0, iter->protocol);
HeapFree(GetProcessHeap(), 0, iter);
return S_OK;
} }
static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface, static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment