Module: wine Branch: refs/heads/master Commit: f1757623407963e86eb48b0544efbae399d67a5a URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=f1757623407963e86eb48b05...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Aug 9 16:42:37 2006 +0200
mshtml: Set nsURI's moniker in NewURI.
---
dlls/mshtml/nsio.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index abd2e48..cf689b7 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1608,6 +1608,7 @@ static nsresult NSAPI nsIOService_NewURI NSContainer *nscontainer = NULL; nsIURI *uri = NULL; PRBool is_javascript = FALSE; + IMoniker *base_mon = NULL; nsresult nsres;
nsACString_GetData(aSpec, &spec, NULL); @@ -1651,6 +1652,7 @@ static nsresult NSAPI nsIOService_NewURI nsres = nsIURI_QueryInterface(aBaseURI, &IID_nsIWineURI, (void**)&wine_uri); if(NS_SUCCEEDED(nsres)) { nsIWineURI_GetNSContainer(wine_uri, &nscontainer); + nsIWineURI_GetMoniker(wine_uri, &base_mon); nsIWineURI_Release(wine_uri); }else { ERR("Could not get nsIWineURI: %08lx\n", nsres); @@ -1662,6 +1664,26 @@ static nsresult NSAPI nsIOService_NewURI if(nscontainer) nsIWebBrowserChrome_Release(NSWBCHROME(nscontainer));
+ if(base_mon) { + LPWSTR url; + IMoniker *mon; + DWORD len; + HRESULT hres; + + len = MultiByteToWideChar(CP_ACP, 0, spec, -1, NULL, 0); + url = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, spec, -1, url, -1); + + hres = CreateURLMoniker(base_mon, url, &mon); + HeapFree(GetProcessHeap(), 0, url); + if(SUCCEEDED(hres)) { + nsIWineURI_SetMoniker((nsIWineURI*)*_retval, mon); + IMoniker_Release(mon); + }else { + WARN("CreateURLMoniker failed: %08lx\n", hres); + } + } + return nsres; }