mshtml: Update wine_url in nsIURI::SetPath.

This commit is contained in:
Jacek Caban 2008-02-01 15:31:19 +01:00 committed by Alexandre Julliard
parent 684307f43f
commit 814e07d8e8
3 changed files with 37 additions and 6 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)