diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 77c08b039e0..39f454d0721 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -771,13 +771,35 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener nsACString_Finish(&spec_str); nsres = nsIURI_QueryInterface(aURI, &IID_nsIWineURI, (void**)&wine_uri); - if(NS_SUCCEEDED(nsres)) { - nsIWineURI_SetNSContainer(wine_uri, This); - nsIWineURI_Release(wine_uri); - }else { + if(NS_FAILED(nsres)) { WARN("Could not get nsIWineURI interface: %08lx\n", nsres); + return NS_ERROR_NOT_IMPLEMENTED; } + nsIWineURI_SetNSContainer(wine_uri, This); + + if(This->bscallback && This->bscallback->mon) { + LPWSTR url; + HRESULT hres; + + hres = IMoniker_GetDisplayName(This->bscallback->mon, NULL, 0, &url); + if(SUCCEEDED(hres)) { + IMoniker *mon = NULL; + + hres = CreateURLMoniker(NULL, url, &mon); + if(SUCCEEDED(hres)) { + nsIWineURI_SetMoniker(wine_uri, mon); + IMoniker_Release(mon); + }else { + WARN("CreateURLMoniker failed: %08lx\n", hres); + } + }else { + WARN("GetDisplayName failed: %08lx\n", hres); + } + } + + nsIWineURI_Release(wine_uri); + return NS_ERROR_NOT_IMPLEMENTED; }