d3d9/tests: Move a Present out of the loops in fog_with_shader_test().
[wine/multimedia.git] / dlls / ieframe / ie.c
blob12be68eeef01012ecd6bfe881361295061200d72
1 /*
2 * Copyright 2006 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "ieframe.h"
21 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
25 static inline InternetExplorer *impl_from_IWebBrowser2(IWebBrowser2 *iface)
27 return CONTAINING_RECORD(iface, InternetExplorer, IWebBrowser2_iface);
30 static HRESULT WINAPI InternetExplorer_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
32 InternetExplorer *This = impl_from_IWebBrowser2(iface);
34 *ppv = NULL;
36 if(IsEqualGUID(&IID_IUnknown, riid)) {
37 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
38 *ppv = &This->IWebBrowser2_iface;
39 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
40 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
41 *ppv = &This->IWebBrowser2_iface;
42 }else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
43 TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
44 *ppv = &This->IWebBrowser2_iface;
45 }else if(IsEqualGUID(&IID_IWebBrowserApp, riid)) {
46 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This, ppv);
47 *ppv = &This->IWebBrowser2_iface;
48 }else if(IsEqualGUID(&IID_IWebBrowser2, riid)) {
49 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This, ppv);
50 *ppv = &This->IWebBrowser2_iface;
51 }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
52 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
53 *ppv = &This->doc_host.cps.IConnectionPointContainer_iface;
54 }else if(IsEqualGUID(&IID_IExternalConnection, riid)) {
55 TRACE("(%p)->(IID_IExternalConnection %p)\n", This, ppv);
56 *ppv = &This->IExternalConnection_iface;
57 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
58 TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
59 *ppv = &This->IServiceProvider_iface;
60 }else if(HlinkFrame_QI(&This->hlink_frame, riid, ppv)) {
61 return S_OK;
64 if(*ppv) {
65 IUnknown_AddRef((IUnknown*)*ppv);
66 return S_OK;
69 WARN("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
70 return E_NOINTERFACE;
73 static ULONG WINAPI InternetExplorer_AddRef(IWebBrowser2 *iface)
75 InternetExplorer *This = impl_from_IWebBrowser2(iface);
76 LONG ref = InterlockedIncrement(&This->ref);
77 TRACE("(%p) ref=%d\n", This, ref);
78 return ref;
81 static ULONG WINAPI InternetExplorer_Release(IWebBrowser2 *iface)
83 InternetExplorer *This = impl_from_IWebBrowser2(iface);
84 LONG ref = InterlockedDecrement(&This->ref);
86 TRACE("(%p) ref=%d\n", This, ref);
88 if(!ref) {
89 deactivate_document(&This->doc_host);
90 DocHost_Release(&This->doc_host);
92 if(This->frame_hwnd)
93 DestroyWindow(This->frame_hwnd);
94 list_remove(&This->entry);
95 heap_free(This);
97 released_obj();
100 return ref;
103 static HRESULT WINAPI InternetExplorer_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
105 InternetExplorer *This = impl_from_IWebBrowser2(iface);
106 FIXME("(%p)->(%p)\n", This, pctinfo);
107 return E_NOTIMPL;
110 static HRESULT WINAPI InternetExplorer_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
111 LPTYPEINFO *ppTInfo)
113 InternetExplorer *This = impl_from_IWebBrowser2(iface);
114 FIXME("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
115 return E_NOTIMPL;
118 static HRESULT WINAPI InternetExplorer_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
119 LPOLESTR *rgszNames, UINT cNames,
120 LCID lcid, DISPID *rgDispId)
122 InternetExplorer *This = impl_from_IWebBrowser2(iface);
123 FIXME("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
124 lcid, rgDispId);
125 return E_NOTIMPL;
128 static HRESULT WINAPI InternetExplorer_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
129 REFIID riid, LCID lcid, WORD wFlags,
130 DISPPARAMS *pDispParams, VARIANT *pVarResult,
131 EXCEPINFO *pExepInfo, UINT *puArgErr)
133 InternetExplorer *This = impl_from_IWebBrowser2(iface);
134 FIXME("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
135 lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
136 return E_NOTIMPL;
139 static HRESULT WINAPI InternetExplorer_GoBack(IWebBrowser2 *iface)
141 InternetExplorer *This = impl_from_IWebBrowser2(iface);
142 TRACE("(%p)\n", This);
143 return go_back(&This->doc_host);
146 static HRESULT WINAPI InternetExplorer_GoForward(IWebBrowser2 *iface)
148 InternetExplorer *This = impl_from_IWebBrowser2(iface);
149 TRACE("(%p)\n", This);
150 return go_forward(&This->doc_host);
153 static HRESULT WINAPI InternetExplorer_GoHome(IWebBrowser2 *iface)
155 InternetExplorer *This = impl_from_IWebBrowser2(iface);
156 TRACE("(%p)\n", This);
157 return go_home(&This->doc_host);
160 static HRESULT WINAPI InternetExplorer_GoSearch(IWebBrowser2 *iface)
162 InternetExplorer *This = impl_from_IWebBrowser2(iface);
163 FIXME("(%p)\n", This);
164 return E_NOTIMPL;
167 static HRESULT WINAPI InternetExplorer_Navigate(IWebBrowser2 *iface, BSTR szUrl,
168 VARIANT *Flags, VARIANT *TargetFrameName,
169 VARIANT *PostData, VARIANT *Headers)
171 InternetExplorer *This = impl_from_IWebBrowser2(iface);
173 TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags, TargetFrameName,
174 PostData, Headers);
176 return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
179 static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
181 InternetExplorer *This = impl_from_IWebBrowser2(iface);
183 TRACE("(%p)\n", This);
185 return refresh_document(&This->doc_host, NULL);
188 static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
190 InternetExplorer *This = impl_from_IWebBrowser2(iface);
192 TRACE("(%p)->(%p)\n", This, Level);
194 return refresh_document(&This->doc_host, Level);
197 static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)
199 InternetExplorer *This = impl_from_IWebBrowser2(iface);
200 FIXME("(%p)\n", This);
201 return E_NOTIMPL;
204 static HRESULT WINAPI InternetExplorer_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
206 InternetExplorer *This = impl_from_IWebBrowser2(iface);
207 FIXME("(%p)->(%p)\n", This, ppDisp);
208 return E_NOTIMPL;
211 static HRESULT WINAPI InternetExplorer_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
213 InternetExplorer *This = impl_from_IWebBrowser2(iface);
214 FIXME("(%p)->(%p)\n", This, ppDisp);
215 return E_NOTIMPL;
218 static HRESULT WINAPI InternetExplorer_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
220 InternetExplorer *This = impl_from_IWebBrowser2(iface);
221 FIXME("(%p)->(%p)\n", This, ppDisp);
222 return E_NOTIMPL;
225 static HRESULT WINAPI InternetExplorer_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
227 InternetExplorer *This = impl_from_IWebBrowser2(iface);
228 FIXME("(%p)->(%p)\n", This, ppDisp);
229 return E_NOTIMPL;
232 static HRESULT WINAPI InternetExplorer_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
234 InternetExplorer *This = impl_from_IWebBrowser2(iface);
235 FIXME("(%p)->(%p)\n", This, pBool);
236 return E_NOTIMPL;
239 static HRESULT WINAPI InternetExplorer_get_Type(IWebBrowser2 *iface, BSTR *Type)
241 InternetExplorer *This = impl_from_IWebBrowser2(iface);
242 FIXME("(%p)->(%p)\n", This, Type);
243 return E_NOTIMPL;
246 static HRESULT WINAPI InternetExplorer_get_Left(IWebBrowser2 *iface, LONG *pl)
248 InternetExplorer *This = impl_from_IWebBrowser2(iface);
249 FIXME("(%p)->(%p)\n", This, pl);
250 return E_NOTIMPL;
253 static HRESULT WINAPI InternetExplorer_put_Left(IWebBrowser2 *iface, LONG Left)
255 InternetExplorer *This = impl_from_IWebBrowser2(iface);
256 FIXME("(%p)->(%d)\n", This, Left);
257 return E_NOTIMPL;
260 static HRESULT WINAPI InternetExplorer_get_Top(IWebBrowser2 *iface, LONG *pl)
262 InternetExplorer *This = impl_from_IWebBrowser2(iface);
263 FIXME("(%p)->(%p)\n", This, pl);
264 return E_NOTIMPL;
267 static HRESULT WINAPI InternetExplorer_put_Top(IWebBrowser2 *iface, LONG Top)
269 InternetExplorer *This = impl_from_IWebBrowser2(iface);
270 FIXME("(%p)->(%d)\n", This, Top);
271 return E_NOTIMPL;
274 static HRESULT WINAPI InternetExplorer_get_Width(IWebBrowser2 *iface, LONG *pl)
276 InternetExplorer *This = impl_from_IWebBrowser2(iface);
277 FIXME("(%p)->(%p)\n", This, pl);
278 return E_NOTIMPL;
281 static HRESULT WINAPI InternetExplorer_put_Width(IWebBrowser2 *iface, LONG Width)
283 InternetExplorer *This = impl_from_IWebBrowser2(iface);
284 FIXME("(%p)->(%d)\n", This, Width);
285 return E_NOTIMPL;
288 static HRESULT WINAPI InternetExplorer_get_Height(IWebBrowser2 *iface, LONG *pl)
290 InternetExplorer *This = impl_from_IWebBrowser2(iface);
291 FIXME("(%p)->(%p)\n", This, pl);
292 return E_NOTIMPL;
295 static HRESULT WINAPI InternetExplorer_put_Height(IWebBrowser2 *iface, LONG Height)
297 InternetExplorer *This = impl_from_IWebBrowser2(iface);
298 FIXME("(%p)->(%d)\n", This, Height);
299 return E_NOTIMPL;
302 static HRESULT WINAPI InternetExplorer_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
304 InternetExplorer *This = impl_from_IWebBrowser2(iface);
305 FIXME("(%p)->(%p)\n", This, LocationName);
306 return E_NOTIMPL;
309 static HRESULT WINAPI InternetExplorer_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
311 InternetExplorer *This = impl_from_IWebBrowser2(iface);
313 TRACE("(%p)->(%p)\n", This, LocationURL);
315 return get_location_url(&This->doc_host, LocationURL);
318 static HRESULT WINAPI InternetExplorer_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
320 InternetExplorer *This = impl_from_IWebBrowser2(iface);
321 FIXME("(%p)->(%p)\n", This, pBool);
322 return E_NOTIMPL;
325 static HRESULT WINAPI InternetExplorer_Quit(IWebBrowser2 *iface)
327 InternetExplorer *This = impl_from_IWebBrowser2(iface);
328 FIXME("(%p)\n", This);
329 return E_NOTIMPL;
332 static HRESULT WINAPI InternetExplorer_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
334 InternetExplorer *This = impl_from_IWebBrowser2(iface);
335 FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
336 return E_NOTIMPL;
339 static HRESULT WINAPI InternetExplorer_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
341 InternetExplorer *This = impl_from_IWebBrowser2(iface);
342 FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty));
343 return E_NOTIMPL;
346 static HRESULT WINAPI InternetExplorer_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
348 InternetExplorer *This = impl_from_IWebBrowser2(iface);
349 FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue);
350 return E_NOTIMPL;
353 static HRESULT WINAPI InternetExplorer_get_Name(IWebBrowser2 *iface, BSTR *Name)
355 InternetExplorer *This = impl_from_IWebBrowser2(iface);
356 FIXME("(%p)->(%p)\n", This, Name);
357 return E_NOTIMPL;
360 static HRESULT WINAPI InternetExplorer_get_HWND(IWebBrowser2 *iface, SHANDLE_PTR *pHWND)
362 InternetExplorer *This = impl_from_IWebBrowser2(iface);
364 TRACE("(%p)->(%p)\n", This, pHWND);
366 *pHWND = (SHANDLE_PTR)This->frame_hwnd;
367 return S_OK;
370 static HRESULT WINAPI InternetExplorer_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
372 InternetExplorer *This = impl_from_IWebBrowser2(iface);
373 FIXME("(%p)->(%p)\n", This, FullName);
374 return E_NOTIMPL;
377 static HRESULT WINAPI InternetExplorer_get_Path(IWebBrowser2 *iface, BSTR *Path)
379 InternetExplorer *This = impl_from_IWebBrowser2(iface);
380 FIXME("(%p)->(%p)\n", This, Path);
381 return E_NOTIMPL;
384 static HRESULT WINAPI InternetExplorer_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
386 InternetExplorer *This = impl_from_IWebBrowser2(iface);
388 TRACE("(%p)->(%p)\n", This, pBool);
390 *pBool = IsWindowVisible(This->frame_hwnd) ? VARIANT_TRUE : VARIANT_FALSE;
391 return S_OK;
394 static HRESULT WINAPI InternetExplorer_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
396 InternetExplorer *This = impl_from_IWebBrowser2(iface);
397 TRACE("(%p)->(%x)\n", This, Value);
399 ShowWindow(This->frame_hwnd, Value ? SW_SHOW : SW_HIDE);
401 return S_OK;
404 static HRESULT WINAPI InternetExplorer_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
406 InternetExplorer *This = impl_from_IWebBrowser2(iface);
407 FIXME("(%p)->(%p)\n", This, pBool);
408 return E_NOTIMPL;
411 static HRESULT WINAPI InternetExplorer_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
413 InternetExplorer *This = impl_from_IWebBrowser2(iface);
414 FIXME("(%p)->(%x)\n", This, Value);
415 return E_NOTIMPL;
418 static HRESULT WINAPI InternetExplorer_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
420 InternetExplorer *This = impl_from_IWebBrowser2(iface);
421 FIXME("(%p)->(%p)\n", This, StatusText);
422 return E_NOTIMPL;
425 static HRESULT WINAPI InternetExplorer_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
427 InternetExplorer *This = impl_from_IWebBrowser2(iface);
429 TRACE("(%p)->(%s)\n", This, debugstr_w(StatusText));
431 return update_ie_statustext(This, StatusText);
434 static HRESULT WINAPI InternetExplorer_get_ToolBar(IWebBrowser2 *iface, int *Value)
436 InternetExplorer *This = impl_from_IWebBrowser2(iface);
437 FIXME("(%p)->(%p)\n", This, Value);
438 return E_NOTIMPL;
441 static HRESULT WINAPI InternetExplorer_put_ToolBar(IWebBrowser2 *iface, int Value)
443 InternetExplorer *This = impl_from_IWebBrowser2(iface);
444 FIXME("(%p)->(%d)\n", This, Value);
445 return E_NOTIMPL;
448 static HRESULT WINAPI InternetExplorer_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
450 InternetExplorer *This = impl_from_IWebBrowser2(iface);
451 FIXME("(%p)->(%p)\n", This, Value);
452 return E_NOTIMPL;
455 static HRESULT WINAPI InternetExplorer_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
457 InternetExplorer *This = impl_from_IWebBrowser2(iface);
458 HMENU menu = NULL;
460 TRACE("(%p)->(%x)\n", This, Value);
462 if(Value)
463 menu = This->menu;
465 if(!SetMenu(This->frame_hwnd, menu))
466 return HRESULT_FROM_WIN32(GetLastError());
468 return S_OK;
471 static HRESULT WINAPI InternetExplorer_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
473 InternetExplorer *This = impl_from_IWebBrowser2(iface);
474 FIXME("(%p)->(%p)\n", This, pbFullScreen);
475 return E_NOTIMPL;
478 static HRESULT WINAPI InternetExplorer_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
480 InternetExplorer *This = impl_from_IWebBrowser2(iface);
481 FIXME("(%p)->(%x)\n", This, bFullScreen);
482 return E_NOTIMPL;
485 static HRESULT WINAPI InternetExplorer_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
486 VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
488 InternetExplorer *This = impl_from_IWebBrowser2(iface);
490 TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName, PostData, Headers);
492 if(!URL)
493 return S_OK;
495 if(V_VT(URL) != VT_BSTR) {
496 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
497 return E_INVALIDARG;
500 return navigate_url(&This->doc_host, V_BSTR(URL), Flags, TargetFrameName, PostData, Headers);
503 static HRESULT WINAPI InternetExplorer_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
505 InternetExplorer *This = impl_from_IWebBrowser2(iface);
506 FIXME("(%p)->(%d %p)\n", This, cmdID, pcmdf);
507 return E_NOTIMPL;
510 static HRESULT WINAPI InternetExplorer_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
511 OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
513 InternetExplorer *This = impl_from_IWebBrowser2(iface);
514 FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut);
515 return E_NOTIMPL;
518 static HRESULT WINAPI InternetExplorer_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
519 VARIANT *pvarShow, VARIANT *pvarSize)
521 InternetExplorer *This = impl_from_IWebBrowser2(iface);
522 FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize);
523 return E_NOTIMPL;
526 static HRESULT WINAPI InternetExplorer_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
528 InternetExplorer *This = impl_from_IWebBrowser2(iface);
529 FIXME("(%p)->(%p)\n", This, lpReadyState);
530 return E_NOTIMPL;
533 static HRESULT WINAPI InternetExplorer_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
535 InternetExplorer *This = impl_from_IWebBrowser2(iface);
536 FIXME("(%p)->(%p)\n", This, pbOffline);
537 return E_NOTIMPL;
540 static HRESULT WINAPI InternetExplorer_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
542 InternetExplorer *This = impl_from_IWebBrowser2(iface);
543 FIXME("(%p)->(%x)\n", This, bOffline);
544 return E_NOTIMPL;
547 static HRESULT WINAPI InternetExplorer_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
549 InternetExplorer *This = impl_from_IWebBrowser2(iface);
550 FIXME("(%p)->(%p)\n", This, pbSilent);
551 return E_NOTIMPL;
554 static HRESULT WINAPI InternetExplorer_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
556 InternetExplorer *This = impl_from_IWebBrowser2(iface);
557 FIXME("(%p)->(%x)\n", This, bSilent);
558 return E_NOTIMPL;
561 static HRESULT WINAPI InternetExplorer_get_RegisterAsBrowser(IWebBrowser2 *iface,
562 VARIANT_BOOL *pbRegister)
564 InternetExplorer *This = impl_from_IWebBrowser2(iface);
565 FIXME("(%p)->(%p)\n", This, pbRegister);
566 return E_NOTIMPL;
569 static HRESULT WINAPI InternetExplorer_put_RegisterAsBrowser(IWebBrowser2 *iface,
570 VARIANT_BOOL bRegister)
572 InternetExplorer *This = impl_from_IWebBrowser2(iface);
573 FIXME("(%p)->(%x)\n", This, bRegister);
574 return E_NOTIMPL;
577 static HRESULT WINAPI InternetExplorer_get_RegisterAsDropTarget(IWebBrowser2 *iface,
578 VARIANT_BOOL *pbRegister)
580 InternetExplorer *This = impl_from_IWebBrowser2(iface);
581 FIXME("(%p)->(%p)\n", This, pbRegister);
582 return E_NOTIMPL;
585 static HRESULT WINAPI InternetExplorer_put_RegisterAsDropTarget(IWebBrowser2 *iface,
586 VARIANT_BOOL bRegister)
588 InternetExplorer *This = impl_from_IWebBrowser2(iface);
589 FIXME("(%p)->(%x)\n", This, bRegister);
590 return E_NOTIMPL;
593 static HRESULT WINAPI InternetExplorer_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
595 InternetExplorer *This = impl_from_IWebBrowser2(iface);
596 FIXME("(%p)->(%p)\n", This, pbRegister);
597 return E_NOTIMPL;
600 static HRESULT WINAPI InternetExplorer_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
602 InternetExplorer *This = impl_from_IWebBrowser2(iface);
603 FIXME("(%p)->(%x)\n", This, bRegister);
604 return E_NOTIMPL;
607 static HRESULT WINAPI InternetExplorer_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
609 InternetExplorer *This = impl_from_IWebBrowser2(iface);
610 FIXME("(%p)->(%p)\n", This, Value);
611 return E_NOTIMPL;
614 static HRESULT WINAPI InternetExplorer_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
616 InternetExplorer *This = impl_from_IWebBrowser2(iface);
617 FIXME("(%p)->(%x)\n", This, Value);
618 return E_NOTIMPL;
621 static HRESULT WINAPI InternetExplorer_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
623 InternetExplorer *This = impl_from_IWebBrowser2(iface);
624 FIXME("(%p)->(%p)\n", This, Value);
625 return E_NOTIMPL;
628 static HRESULT WINAPI InternetExplorer_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
630 InternetExplorer *This = impl_from_IWebBrowser2(iface);
631 FIXME("(%p)->(%x)\n", This, Value);
632 return E_NOTIMPL;
635 static const IWebBrowser2Vtbl InternetExplorerVtbl =
637 InternetExplorer_QueryInterface,
638 InternetExplorer_AddRef,
639 InternetExplorer_Release,
640 InternetExplorer_GetTypeInfoCount,
641 InternetExplorer_GetTypeInfo,
642 InternetExplorer_GetIDsOfNames,
643 InternetExplorer_Invoke,
644 InternetExplorer_GoBack,
645 InternetExplorer_GoForward,
646 InternetExplorer_GoHome,
647 InternetExplorer_GoSearch,
648 InternetExplorer_Navigate,
649 InternetExplorer_Refresh,
650 InternetExplorer_Refresh2,
651 InternetExplorer_Stop,
652 InternetExplorer_get_Application,
653 InternetExplorer_get_Parent,
654 InternetExplorer_get_Container,
655 InternetExplorer_get_Document,
656 InternetExplorer_get_TopLevelContainer,
657 InternetExplorer_get_Type,
658 InternetExplorer_get_Left,
659 InternetExplorer_put_Left,
660 InternetExplorer_get_Top,
661 InternetExplorer_put_Top,
662 InternetExplorer_get_Width,
663 InternetExplorer_put_Width,
664 InternetExplorer_get_Height,
665 InternetExplorer_put_Height,
666 InternetExplorer_get_LocationName,
667 InternetExplorer_get_LocationURL,
668 InternetExplorer_get_Busy,
669 InternetExplorer_Quit,
670 InternetExplorer_ClientToWindow,
671 InternetExplorer_PutProperty,
672 InternetExplorer_GetProperty,
673 InternetExplorer_get_Name,
674 InternetExplorer_get_HWND,
675 InternetExplorer_get_FullName,
676 InternetExplorer_get_Path,
677 InternetExplorer_get_Visible,
678 InternetExplorer_put_Visible,
679 InternetExplorer_get_StatusBar,
680 InternetExplorer_put_StatusBar,
681 InternetExplorer_get_StatusText,
682 InternetExplorer_put_StatusText,
683 InternetExplorer_get_ToolBar,
684 InternetExplorer_put_ToolBar,
685 InternetExplorer_get_MenuBar,
686 InternetExplorer_put_MenuBar,
687 InternetExplorer_get_FullScreen,
688 InternetExplorer_put_FullScreen,
689 InternetExplorer_Navigate2,
690 InternetExplorer_QueryStatusWB,
691 InternetExplorer_ExecWB,
692 InternetExplorer_ShowBrowserBar,
693 InternetExplorer_get_ReadyState,
694 InternetExplorer_get_Offline,
695 InternetExplorer_put_Offline,
696 InternetExplorer_get_Silent,
697 InternetExplorer_put_Silent,
698 InternetExplorer_get_RegisterAsBrowser,
699 InternetExplorer_put_RegisterAsBrowser,
700 InternetExplorer_get_RegisterAsDropTarget,
701 InternetExplorer_put_RegisterAsDropTarget,
702 InternetExplorer_get_TheaterMode,
703 InternetExplorer_put_TheaterMode,
704 InternetExplorer_get_AddressBar,
705 InternetExplorer_put_AddressBar,
706 InternetExplorer_get_Resizable,
707 InternetExplorer_put_Resizable
710 static inline InternetExplorer *impl_from_IExternalConnection(IExternalConnection *iface)
712 return CONTAINING_RECORD(iface, InternetExplorer, IExternalConnection_iface);
716 * Document may keep references to InternetExplorer object causing circular references.
717 * We keep track of external references and release the document object when all
718 * external references are released. A visible main window is also considered as
719 * an external reference.
721 DWORD release_extern_ref(InternetExplorer *This, BOOL last_closes)
723 LONG ref = InterlockedDecrement(&This->extern_ref);
725 TRACE("ref = %d\n", ref);
727 if(ref)
728 return ref;
730 if(!last_closes) {
731 WARN("Last external connection released with FALSE last_closes.\n");
732 return ref;
735 deactivate_document(&This->doc_host);
736 return ref;
739 static HRESULT WINAPI ExternalConnection_QueryInterface(IExternalConnection *iface, REFIID riid, void **ppv)
741 InternetExplorer *This = impl_from_IExternalConnection(iface);
742 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
745 static ULONG WINAPI ExternalConnection_AddRef(IExternalConnection *iface)
747 InternetExplorer *This = impl_from_IExternalConnection(iface);
748 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
751 static ULONG WINAPI ExternalConnection_Release(IExternalConnection *iface)
753 InternetExplorer *This = impl_from_IExternalConnection(iface);
754 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
757 static DWORD WINAPI ExternalConnection_AddConnection(IExternalConnection *iface, DWORD extconn, DWORD reserved)
759 InternetExplorer *This = impl_from_IExternalConnection(iface);
761 TRACE("(%p)->(%x %x)\n", This, extconn, reserved);
763 if(extconn != EXTCONN_STRONG)
764 return 0;
766 return InterlockedIncrement(&This->extern_ref);
769 static DWORD WINAPI ExternalConnection_ReleaseConnection(IExternalConnection *iface, DWORD extconn,
770 DWORD reserved, BOOL fLastReleaseCloses)
772 InternetExplorer *This = impl_from_IExternalConnection(iface);
774 TRACE("(%p)->(%x %x %x)\n", This, extconn, reserved, fLastReleaseCloses);
776 if(extconn != EXTCONN_STRONG)
777 return 0;
779 return release_extern_ref(This, fLastReleaseCloses);
782 static const IExternalConnectionVtbl ExternalConnectionVtbl = {
783 ExternalConnection_QueryInterface,
784 ExternalConnection_AddRef,
785 ExternalConnection_Release,
786 ExternalConnection_AddConnection,
787 ExternalConnection_ReleaseConnection
790 static inline InternetExplorer *impl_from_IServiceProvider(IServiceProvider *iface)
792 return CONTAINING_RECORD(iface, InternetExplorer, IServiceProvider_iface);
795 static HRESULT WINAPI IEServiceProvider_QueryInterface(IServiceProvider *iface,
796 REFIID riid, LPVOID *ppv)
798 InternetExplorer *This = impl_from_IServiceProvider(iface);
799 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
802 static ULONG WINAPI IEServiceProvider_AddRef(IServiceProvider *iface)
804 InternetExplorer *This = impl_from_IServiceProvider(iface);
805 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
808 static ULONG WINAPI IEServiceProvider_Release(IServiceProvider *iface)
810 InternetExplorer *This = impl_from_IServiceProvider(iface);
811 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
814 static HRESULT WINAPI IEServiceProvider_QueryService(IServiceProvider *iface,
815 REFGUID guidService, REFIID riid, void **ppv)
817 InternetExplorer *This = impl_from_IServiceProvider(iface);
819 if(IsEqualGUID(&SID_SHTMLWindow, riid)) {
820 TRACE("(%p)->(SID_SHTMLWindow)\n", This);
821 return IHTMLWindow2_QueryInterface(&This->doc_host.html_window.IHTMLWindow2_iface, riid, ppv);
824 FIXME("(%p)->(%s, %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
825 *ppv = NULL;
826 return E_NOINTERFACE;
829 static const IServiceProviderVtbl ServiceProviderVtbl =
831 IEServiceProvider_QueryInterface,
832 IEServiceProvider_AddRef,
833 IEServiceProvider_Release,
834 IEServiceProvider_QueryService
837 void InternetExplorer_WebBrowser_Init(InternetExplorer *This)
839 This->IWebBrowser2_iface.lpVtbl = &InternetExplorerVtbl;
840 This->IExternalConnection_iface.lpVtbl = &ExternalConnectionVtbl;
841 This->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;