static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv) { WebBrowser *ret; HRESULT hres; TRACE("(%p %s %p) version=%d\n", pOuter, debugstr_guid(riid), ppv, version); ret = heap_alloc_zero(sizeof(WebBrowser)); ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl; ret->lpServiceProviderVtbl = &ServiceProviderVtbl; ret->ref = 1; ret->version = version; DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret)); ret->visible = VARIANT_TRUE; ret->menu_bar = VARIANT_TRUE; ret->address_bar = VARIANT_TRUE; ret->status_bar = VARIANT_TRUE; ret->tool_bar = VARIANT_TRUE; WebBrowser_OleObject_Init(ret); WebBrowser_ViewObject_Init(ret); WebBrowser_Persist_Init(ret); WebBrowser_ClassInfo_Init(ret); WebBrowser_HlinkFrame_Init(ret); SHDOCVW_LockModule(); hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv); IWebBrowser2_Release(WEBBROWSER(ret)); return hres; }
HRESULT InternetExplorer_Create(IUnknown *pOuter, REFIID riid, void **ppv) { InternetExplorer *ret; HRESULT hres; TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv); ret = heap_alloc(sizeof(InternetExplorer)); ret->ref = 0; ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret); DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret)); InternetExplorer_WebBrowser_Init(ret); create_frame_hwnd(ret); ret->doc_host.frame_hwnd = ret->frame_hwnd; hres = IWebBrowser2_QueryInterface(WEBBROWSER2(ret), riid, ppv); if(FAILED(hres)) { heap_free(ret); return hres; } return hres; }
static HRESULT create_webbrowser(int version, IUnknown *outer, REFIID riid, void **ppv) { WebBrowser *ret; HRESULT hres; TRACE("(%p %s %p) version=%d\n", outer, debugstr_guid(riid), ppv, version); ret = heap_alloc_zero(sizeof(WebBrowser)); ret->IWebBrowser2_iface.lpVtbl = &WebBrowser2Vtbl; ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl; ret->ref = 1; ret->version = version; DocHost_Init(&ret->doc_host, &ret->IWebBrowser2_iface, &DocHostContainerVtbl); ret->visible = VARIANT_TRUE; ret->menu_bar = VARIANT_TRUE; ret->address_bar = VARIANT_TRUE; ret->status_bar = VARIANT_TRUE; ret->tool_bar = VARIANT_TRUE; WebBrowser_OleObject_Init(ret); WebBrowser_ViewObject_Init(ret); WebBrowser_Persist_Init(ret); WebBrowser_ClassInfo_Init(ret); HlinkFrame_Init(&ret->hlink_frame, (IUnknown*)&ret->IWebBrowser2_iface, &ret->doc_host); lock_module(); hres = IWebBrowser2_QueryInterface(&ret->IWebBrowser2_iface, riid, ppv); IWebBrowser2_Release(&ret->IWebBrowser2_iface); return hres; }