Commit 2e24de63 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: COM cleanup for the IHTMLWindow2 iface.

parent 1bffb577
...@@ -105,7 +105,7 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch * ...@@ -105,7 +105,7 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = (IDispatch*)HTMLWINDOW2(This->window); *p = (IDispatch*)&This->window->IHTMLWindow2_iface;
IDispatch_AddRef(*p); IDispatch_AddRef(*p);
return S_OK; return S_OK;
} }
...@@ -579,7 +579,7 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca ...@@ -579,7 +579,7 @@ static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLoca
return E_UNEXPECTED; return E_UNEXPECTED;
} }
return IHTMLWindow2_get_location(HTMLWINDOW2(This->window), p); return IHTMLWindow2_get_location(&This->window->IHTMLWindow2_iface, p);
} }
static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p) static HRESULT WINAPI HTMLDocument_get_lastModified(IHTMLDocument2 *iface, BSTR *p)
...@@ -872,8 +872,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT ...@@ -872,8 +872,8 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
return E_FAIL; return E_FAIL;
} }
*pomWindowResult = (IDispatch*)HTMLWINDOW2(This->window); *pomWindowResult = (IDispatch*)&This->window->IHTMLWindow2_iface;
IHTMLWindow2_AddRef(HTMLWINDOW2(This->window)); IHTMLWindow2_AddRef(&This->window->IHTMLWindow2_iface);
return S_OK; return S_OK;
} }
...@@ -1302,7 +1302,7 @@ static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTML ...@@ -1302,7 +1302,7 @@ static HRESULT WINAPI HTMLDocument_get_parentWindow(IHTMLDocument2 *iface, IHTML
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
*p = HTMLWINDOW2(This->window); *p = &This->window->IHTMLWindow2_iface;
IHTMLWindow2_AddRef(*p); IHTMLWindow2_AddRef(*p);
return S_OK; return S_OK;
} }
...@@ -2097,7 +2097,7 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) ...@@ -2097,7 +2097,7 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
} }
if(This->basedoc.window) { if(This->basedoc.window) {
This->basedoc.window->doc_obj = NULL; This->basedoc.window->doc_obj = NULL;
IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window)); IHTMLWindow2_Release(&This->basedoc.window->IHTMLWindow2_iface);
} }
if(This->basedoc.advise_holder) if(This->basedoc.advise_holder)
IOleAdviseHolder_Release(This->basedoc.advise_holder); IOleAdviseHolder_Release(This->basedoc.advise_holder);
......
...@@ -105,7 +105,7 @@ static HRESULT WINAPI HTMLFrameElement3_get_contentDocument(IHTMLFrameElement3 * ...@@ -105,7 +105,7 @@ static HRESULT WINAPI HTMLFrameElement3_get_contentDocument(IHTMLFrameElement3 *
return E_FAIL; return E_FAIL;
} }
hres = IHTMLWindow2_get_document(HTMLWINDOW2(This->framebase.content_window), &doc); hres = IHTMLWindow2_get_document(&This->framebase.content_window->IHTMLWindow2_iface, &doc);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -430,8 +430,8 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I ...@@ -430,8 +430,8 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
if(This->content_window) { if(This->content_window) {
IHTMLWindow2_AddRef(HTMLWINDOW2(This->content_window)); IHTMLWindow2_AddRef(&This->content_window->IHTMLWindow2_iface);
*p = HTMLWINDOW2(This->content_window); *p = &This->content_window->IHTMLWindow2_iface;
}else { }else {
WARN("NULL content window\n"); WARN("NULL content window\n");
*p = NULL; *p = NULL;
......
...@@ -260,7 +260,7 @@ typedef struct nsChannelBSC nsChannelBSC; ...@@ -260,7 +260,7 @@ typedef struct nsChannelBSC nsChannelBSC;
struct HTMLWindow { struct HTMLWindow {
DispatchEx dispex; DispatchEx dispex;
const IHTMLWindow2Vtbl *lpHTMLWindow2Vtbl; IHTMLWindow2 IHTMLWindow2_iface;
const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl; const IHTMLWindow3Vtbl *lpHTMLWindow3Vtbl;
const IHTMLWindow4Vtbl *lpHTMLWindow4Vtbl; const IHTMLWindow4Vtbl *lpHTMLWindow4Vtbl;
const IHTMLPrivateWindowVtbl *lpIHTMLPrivateWindowVtbl; const IHTMLPrivateWindowVtbl *lpIHTMLPrivateWindowVtbl;
...@@ -622,7 +622,6 @@ struct HTMLDocumentNode { ...@@ -622,7 +622,6 @@ struct HTMLDocumentNode {
struct list plugin_hosts; struct list plugin_hosts;
}; };
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl) #define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl) #define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl) #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
......
...@@ -808,7 +808,7 @@ static HTMLWindow *get_window_from_load_group(nsChannel *This) ...@@ -808,7 +808,7 @@ static HTMLWindow *get_window_from_load_group(nsChannel *This)
window = wine_uri->window_ref ? wine_uri->window_ref->window : NULL; window = wine_uri->window_ref ? wine_uri->window_ref->window : NULL;
if(window) if(window)
IHTMLWindow2_AddRef(HTMLWINDOW2(window)); IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
nsIURI_Release(NSURI(wine_uri)); nsIURI_Release(NSURI(wine_uri));
return window; return window;
...@@ -858,7 +858,7 @@ static HTMLWindow *get_channel_window(nsChannel *This) ...@@ -858,7 +858,7 @@ static HTMLWindow *get_channel_window(nsChannel *This)
nsIDOMWindow_Release(nswindow); nsIDOMWindow_Release(nswindow);
if(window) if(window)
IHTMLWindow2_AddRef(HTMLWINDOW2(window)); IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
else else
FIXME("NULL window for %p\n", nswindow); FIXME("NULL window for %p\n", nswindow);
return window; return window;
...@@ -948,7 +948,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen ...@@ -948,7 +948,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
if(!window) { if(!window) {
if(This->uri->window_ref && This->uri->window_ref->window) { if(This->uri->window_ref && This->uri->window_ref->window) {
window = This->uri->window_ref->window; window = This->uri->window_ref->window;
IHTMLWindow2_AddRef(HTMLWINDOW2(window)); IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
}else { }else {
/* FIXME: Analyze removing get_window_from_load_group call */ /* FIXME: Analyze removing get_window_from_load_group call */
if(This->load_group) if(This->load_group)
...@@ -993,7 +993,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen ...@@ -993,7 +993,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
ERR("AddRequest failed: %08x\n", nsres); ERR("AddRequest failed: %08x\n", nsres);
} }
IHTMLWindow2_Release(HTMLWINDOW2(window)); IHTMLWindow2_Release(&window->IHTMLWindow2_iface);
return nsres; return nsres;
} }
...@@ -2722,7 +2722,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * ...@@ -2722,7 +2722,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
base_wine_url = base_wine_uri->wine_url; base_wine_url = base_wine_uri->wine_url;
if(base_wine_uri->window_ref && base_wine_uri->window_ref->window) { if(base_wine_uri->window_ref && base_wine_uri->window_ref->window) {
window = base_wine_uri->window_ref->window; window = base_wine_uri->window_ref->window;
IHTMLWindow2_AddRef(HTMLWINDOW2(window)); IHTMLWindow2_AddRef(&window->IHTMLWindow2_iface);
} }
TRACE("base url: %s window: %p\n", debugstr_w(base_wine_url), window); TRACE("base url: %s window: %p\n", debugstr_w(base_wine_url), window);
}else if(FAILED(ParseURLA(spec, &parsed_url))) { }else if(FAILED(ParseURLA(spec, &parsed_url))) {
...@@ -2743,7 +2743,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * ...@@ -2743,7 +2743,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
*_retval = (nsIURI*)wine_uri; *_retval = (nsIURI*)wine_uri;
if(window) if(window)
IHTMLWindow2_Release(HTMLWINDOW2(window)); IHTMLWindow2_Release(&window->IHTMLWindow2_iface);
if(base_wine_url) { if(base_wine_url) {
WCHAR url[INTERNET_MAX_URL_LENGTH], rel_url[INTERNET_MAX_URL_LENGTH]; WCHAR url[INTERNET_MAX_URL_LENGTH], rel_url[INTERNET_MAX_URL_LENGTH];
......
...@@ -158,7 +158,7 @@ static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindo ...@@ -158,7 +158,7 @@ static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindo
} }
text = SysAllocString(aText); text = SysAllocString(aText);
IHTMLWindow2_alert(HTMLWINDOW2(window), text); IHTMLWindow2_alert(&window->IHTMLWindow2_iface, text);
SysFreeString(text); SysFreeString(text);
return NS_OK; return NS_OK;
......
...@@ -199,7 +199,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite ...@@ -199,7 +199,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
if(!hostui_setup) { if(!hostui_setup) {
V_VT(&var) = VT_UNKNOWN; V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)HTMLWINDOW2(This->window); V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL); IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
} }
......
...@@ -233,7 +233,7 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel ...@@ -233,7 +233,7 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL); IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}else { }else {
V_VT(&var) = VT_UNKNOWN; V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)HTMLWINDOW2(This->window); V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
V_VT(&out) = VT_EMPTY; V_VT(&out) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out); hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
......
...@@ -321,7 +321,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC ...@@ -321,7 +321,7 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC
return E_FAIL; return E_FAIL;
/* FIXME: Return proxy object */ /* FIXME: Return proxy object */
*ppiunkItem = (IUnknown*)HTMLWINDOW2(This->window); *ppiunkItem = (IUnknown*)&This->window->IHTMLWindow2_iface;
IUnknown_AddRef(*ppiunkItem); IUnknown_AddRef(*ppiunkItem);
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment