mshtml: Store window URL as BSTR.
This commit is contained in:
parent
a100550383
commit
535e2b23a3
dlls/mshtml
|
@ -308,7 +308,7 @@ struct HTMLWindow {
|
||||||
|
|
||||||
nsChannelBSC *bscallback;
|
nsChannelBSC *bscallback;
|
||||||
IMoniker *mon;
|
IMoniker *mon;
|
||||||
LPOLESTR url;
|
BSTR url;
|
||||||
|
|
||||||
IHTMLEventObj *event;
|
IHTMLEventObj *event;
|
||||||
|
|
||||||
|
|
|
@ -1261,7 +1261,7 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result)
|
||||||
SAFEARRAYBOUND bound;
|
SAFEARRAYBOUND bound;
|
||||||
VARIANT var, varOut;
|
VARIANT var, varOut;
|
||||||
LONG ind;
|
LONG ind;
|
||||||
BSTR url, unk;
|
BSTR unk;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(!This->window)
|
if(!This->window)
|
||||||
|
@ -1296,8 +1296,7 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result)
|
||||||
|
|
||||||
ind = 1;
|
ind = 1;
|
||||||
V_VT(&var) = VT_BSTR;
|
V_VT(&var) = VT_BSTR;
|
||||||
url = SysAllocString(This->window->url);
|
V_BSTR(&var) = This->window->url;
|
||||||
V_BSTR(&var) = url;
|
|
||||||
SafeArrayPutElement(sa, &ind, &var);
|
SafeArrayPutElement(sa, &ind, &var);
|
||||||
|
|
||||||
ind = 3;
|
ind = 3;
|
||||||
|
@ -1338,7 +1337,6 @@ static void handle_navigation_error(nsChannelBSC *This, DWORD result)
|
||||||
V_BOOL(&varOut) = VARIANT_TRUE;
|
V_BOOL(&varOut) = VARIANT_TRUE;
|
||||||
IOleCommandTarget_Exec(olecmd, &CGID_DocHostCmdPriv, 1, 0, &var, FAILED(hres)?NULL:&varOut);
|
IOleCommandTarget_Exec(olecmd, &CGID_DocHostCmdPriv, 1, 0, &var, FAILED(hres)?NULL:&varOut);
|
||||||
|
|
||||||
SysFreeString(url);
|
|
||||||
SysFreeString(unk);
|
SysFreeString(unk);
|
||||||
SafeArrayDestroy(sa);
|
SafeArrayDestroy(sa);
|
||||||
IOleCommandTarget_Release(olecmd);
|
IOleCommandTarget_Release(olecmd);
|
||||||
|
|
|
@ -68,6 +68,7 @@ static BOOL use_gecko_script(HTMLWindow *window)
|
||||||
|
|
||||||
void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
||||||
{
|
{
|
||||||
|
WCHAR *url;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
if(This->mon) {
|
if(This->mon) {
|
||||||
|
@ -76,7 +77,7 @@ void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(This->url) {
|
if(This->url) {
|
||||||
CoTaskMemFree(This->url);
|
SysFreeString(This->url);
|
||||||
This->url = NULL;
|
This->url = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,9 +87,13 @@ void set_current_mon(HTMLWindow *This, IMoniker *mon)
|
||||||
IMoniker_AddRef(mon);
|
IMoniker_AddRef(mon);
|
||||||
This->mon = mon;
|
This->mon = mon;
|
||||||
|
|
||||||
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
|
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &url);
|
||||||
if(FAILED(hres))
|
if(SUCCEEDED(hres)) {
|
||||||
|
This->url = SysAllocString(url);
|
||||||
|
CoTaskMemFree(url);
|
||||||
|
}else {
|
||||||
WARN("GetDisplayName failed: %08x\n", hres);
|
WARN("GetDisplayName failed: %08x\n", hres);
|
||||||
|
}
|
||||||
|
|
||||||
set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
|
set_script_mode(This, use_gecko_script(This) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue