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