Commit 814e07d8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Update wine_url in nsIURI::SetPath.

parent 684307f4
......@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = mshtml.dll
IMPORTLIB = libmshtml.$(IMPLIBEXT)
IMPORTS = urlmon ole32 oleaut32 user32 gdi32 advapi32 kernel32
IMPORTS = urlmon shlwapi ole32 oleaut32 user32 gdi32 advapi32 kernel32
EXTRALIBS = -lstrmiids -luuid
EXTRADEFS = -DCOM_NO_WINDOWS_H
......
......@@ -579,6 +579,20 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return ret;
}
static inline WCHAR *heap_strdupAtoW(const char *str)
{
LPWSTR ret = NULL;
if(str) {
DWORD len;
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
ret = heap_alloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, -1);
}
return ret;
}
HINSTANCE get_shdoclc(void);
......
......@@ -1465,14 +1465,31 @@ static nsresult NSAPI nsURI_GetPath(nsIWineURI *iface, nsACString *aPath)
static nsresult NSAPI nsURI_SetPath(nsIWineURI *iface, const nsACString *aPath)
{
nsURI *This = NSURI_THIS(iface);
const char *path;
TRACE("(%p)->(%p)\n", This, aPath);
nsACString_GetData(aPath, &path);
TRACE("(%p)->(%p(%s))\n", This, aPath, debugstr_a(path));
if(This->uri)
return nsIURI_SetPath(This->uri, aPath);
FIXME("default action not implemented\n");
return NS_ERROR_NOT_IMPLEMENTED;
if(This->wine_url) {
WCHAR new_url[INTERNET_MAX_URL_LENGTH];
DWORD size = sizeof(new_url)/sizeof(WCHAR);
LPWSTR pathw;
HRESULT hres;
pathw = heap_strdupAtoW(path);
hres = UrlCombineW(This->wine_url, pathw, new_url, &size, 0);
heap_free(pathw);
if(SUCCEEDED(hres))
nsIWineURI_SetWineURL(NSWINEURI(This), new_url);
else
WARN("UrlCombine failed: %08x\n", hres);
}
if(!This->uri)
return NS_OK;
return nsIURI_SetPath(This->uri, aPath);
}
static nsresult NSAPI nsURI_Equals(nsIWineURI *iface, nsIURI *other, PRBool *_retval)
......
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