iphlpapi: Make GetAdaptersAddresses hotpatchable.
[wine] / dlls / ieframe / ie.c
1 /*
2  * Copyright 2006 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #include "ieframe.h"
20
21 #include "wine/debug.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
24
25 static inline InternetExplorer *impl_from_IWebBrowser2(IWebBrowser2 *iface)
26 {
27     return CONTAINING_RECORD(iface, InternetExplorer, IWebBrowser2_iface);
28 }
29
30 static HRESULT WINAPI InternetExplorer_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
31 {
32     InternetExplorer *This = impl_from_IWebBrowser2(iface);
33
34     *ppv = NULL;
35
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->doc_host.cps.IConnectionPointContainer_iface;
54     }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
55         TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
56         *ppv = &This->IServiceProvider_iface;
57     }else if(HlinkFrame_QI(&This->hlink_frame, riid, ppv)) {
58         return S_OK;
59     }
60
61     if(*ppv) {
62         IUnknown_AddRef((IUnknown*)*ppv);
63         return S_OK;
64     }
65
66     WARN("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
67     return E_NOINTERFACE;
68 }
69
70 static ULONG WINAPI InternetExplorer_AddRef(IWebBrowser2 *iface)
71 {
72     InternetExplorer *This = impl_from_IWebBrowser2(iface);
73     LONG ref = InterlockedIncrement(&This->ref);
74     TRACE("(%p) ref=%d\n", This, ref);
75     return ref;
76 }
77
78 static ULONG WINAPI InternetExplorer_Release(IWebBrowser2 *iface)
79 {
80     InternetExplorer *This = impl_from_IWebBrowser2(iface);
81     LONG ref = InterlockedDecrement(&This->ref);
82
83     TRACE("(%p) ref=%d\n", This, ref);
84
85     if(!ref) {
86         if(This->doc_host) {
87             deactivate_document(&This->doc_host->doc_host);
88             DocHost_Release(&This->doc_host->doc_host);
89             if(This->doc_host) {
90                 This->doc_host->ie = NULL;
91                 This->doc_host->doc_host.container_vtbl->release(&This->doc_host->doc_host);
92             }
93         }
94
95         if(This->frame_hwnd)
96             DestroyWindow(This->frame_hwnd);
97         list_remove(&This->entry);
98         heap_free(This);
99
100         released_obj();
101     }
102
103     return ref;
104 }
105
106 static HRESULT WINAPI InternetExplorer_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
107 {
108     InternetExplorer *This = impl_from_IWebBrowser2(iface);
109     FIXME("(%p)->(%p)\n", This, pctinfo);
110     return E_NOTIMPL;
111 }
112
113 static HRESULT WINAPI InternetExplorer_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
114                                      LPTYPEINFO *ppTInfo)
115 {
116     InternetExplorer *This = impl_from_IWebBrowser2(iface);
117     FIXME("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
118     return E_NOTIMPL;
119 }
120
121 static HRESULT WINAPI InternetExplorer_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
122                                        LPOLESTR *rgszNames, UINT cNames,
123                                        LCID lcid, DISPID *rgDispId)
124 {
125     InternetExplorer *This = impl_from_IWebBrowser2(iface);
126     FIXME("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
127             lcid, rgDispId);
128     return E_NOTIMPL;
129 }
130
131 static HRESULT WINAPI InternetExplorer_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
132                                 REFIID riid, LCID lcid, WORD wFlags,
133                                 DISPPARAMS *pDispParams, VARIANT *pVarResult,
134                                 EXCEPINFO *pExepInfo, UINT *puArgErr)
135 {
136     InternetExplorer *This = impl_from_IWebBrowser2(iface);
137     FIXME("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
138             lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
139     return E_NOTIMPL;
140 }
141
142 static HRESULT WINAPI InternetExplorer_GoBack(IWebBrowser2 *iface)
143 {
144     InternetExplorer *This = impl_from_IWebBrowser2(iface);
145     TRACE("(%p)\n", This);
146     return go_back(&This->doc_host->doc_host);
147 }
148
149 static HRESULT WINAPI InternetExplorer_GoForward(IWebBrowser2 *iface)
150 {
151     InternetExplorer *This = impl_from_IWebBrowser2(iface);
152     FIXME("(%p)\n", This);
153     return E_NOTIMPL;
154 }
155
156 static HRESULT WINAPI InternetExplorer_GoHome(IWebBrowser2 *iface)
157 {
158     InternetExplorer *This = impl_from_IWebBrowser2(iface);
159     TRACE("(%p)\n", This);
160     return go_home(&This->doc_host->doc_host);
161 }
162
163 static HRESULT WINAPI InternetExplorer_GoSearch(IWebBrowser2 *iface)
164 {
165     InternetExplorer *This = impl_from_IWebBrowser2(iface);
166     FIXME("(%p)\n", This);
167     return E_NOTIMPL;
168 }
169
170 static HRESULT WINAPI InternetExplorer_Navigate(IWebBrowser2 *iface, BSTR szUrl,
171                                   VARIANT *Flags, VARIANT *TargetFrameName,
172                                   VARIANT *PostData, VARIANT *Headers)
173 {
174     InternetExplorer *This = impl_from_IWebBrowser2(iface);
175
176     TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags, TargetFrameName,
177           PostData, Headers);
178
179     return navigate_url(&This->doc_host->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
180 }
181
182 static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
183 {
184     InternetExplorer *This = impl_from_IWebBrowser2(iface);
185     FIXME("(%p)\n", This);
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
190 {
191     InternetExplorer *This = impl_from_IWebBrowser2(iface);
192     FIXME("(%p)->(%p)\n", This, Level);
193     return E_NOTIMPL;
194 }
195
196 static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)
197 {
198     InternetExplorer *This = impl_from_IWebBrowser2(iface);
199     FIXME("(%p)\n", This);
200     return E_NOTIMPL;
201 }
202
203 static HRESULT WINAPI InternetExplorer_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
204 {
205     InternetExplorer *This = impl_from_IWebBrowser2(iface);
206     FIXME("(%p)->(%p)\n", This, ppDisp);
207     return E_NOTIMPL;
208 }
209
210 static HRESULT WINAPI InternetExplorer_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
211 {
212     InternetExplorer *This = impl_from_IWebBrowser2(iface);
213     FIXME("(%p)->(%p)\n", This, ppDisp);
214     return E_NOTIMPL;
215 }
216
217 static HRESULT WINAPI InternetExplorer_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
218 {
219     InternetExplorer *This = impl_from_IWebBrowser2(iface);
220     FIXME("(%p)->(%p)\n", This, ppDisp);
221     return E_NOTIMPL;
222 }
223
224 static HRESULT WINAPI InternetExplorer_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
225 {
226     InternetExplorer *This = impl_from_IWebBrowser2(iface);
227     FIXME("(%p)->(%p)\n", This, ppDisp);
228     return E_NOTIMPL;
229 }
230
231 static HRESULT WINAPI InternetExplorer_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
232 {
233     InternetExplorer *This = impl_from_IWebBrowser2(iface);
234     FIXME("(%p)->(%p)\n", This, pBool);
235     return E_NOTIMPL;
236 }
237
238 static HRESULT WINAPI InternetExplorer_get_Type(IWebBrowser2 *iface, BSTR *Type)
239 {
240     InternetExplorer *This = impl_from_IWebBrowser2(iface);
241     FIXME("(%p)->(%p)\n", This, Type);
242     return E_NOTIMPL;
243 }
244
245 static HRESULT WINAPI InternetExplorer_get_Left(IWebBrowser2 *iface, LONG *pl)
246 {
247     InternetExplorer *This = impl_from_IWebBrowser2(iface);
248     FIXME("(%p)->(%p)\n", This, pl);
249     return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI InternetExplorer_put_Left(IWebBrowser2 *iface, LONG Left)
253 {
254     InternetExplorer *This = impl_from_IWebBrowser2(iface);
255     FIXME("(%p)->(%d)\n", This, Left);
256     return E_NOTIMPL;
257 }
258
259 static HRESULT WINAPI InternetExplorer_get_Top(IWebBrowser2 *iface, LONG *pl)
260 {
261     InternetExplorer *This = impl_from_IWebBrowser2(iface);
262     FIXME("(%p)->(%p)\n", This, pl);
263     return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI InternetExplorer_put_Top(IWebBrowser2 *iface, LONG Top)
267 {
268     InternetExplorer *This = impl_from_IWebBrowser2(iface);
269     FIXME("(%p)->(%d)\n", This, Top);
270     return E_NOTIMPL;
271 }
272
273 static HRESULT WINAPI InternetExplorer_get_Width(IWebBrowser2 *iface, LONG *pl)
274 {
275     InternetExplorer *This = impl_from_IWebBrowser2(iface);
276     FIXME("(%p)->(%p)\n", This, pl);
277     return E_NOTIMPL;
278 }
279
280 static HRESULT WINAPI InternetExplorer_put_Width(IWebBrowser2 *iface, LONG Width)
281 {
282     InternetExplorer *This = impl_from_IWebBrowser2(iface);
283     FIXME("(%p)->(%d)\n", This, Width);
284     return E_NOTIMPL;
285 }
286
287 static HRESULT WINAPI InternetExplorer_get_Height(IWebBrowser2 *iface, LONG *pl)
288 {
289     InternetExplorer *This = impl_from_IWebBrowser2(iface);
290     FIXME("(%p)->(%p)\n", This, pl);
291     return E_NOTIMPL;
292 }
293
294 static HRESULT WINAPI InternetExplorer_put_Height(IWebBrowser2 *iface, LONG Height)
295 {
296     InternetExplorer *This = impl_from_IWebBrowser2(iface);
297     FIXME("(%p)->(%d)\n", This, Height);
298     return E_NOTIMPL;
299 }
300
301 static HRESULT WINAPI InternetExplorer_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
302 {
303     InternetExplorer *This = impl_from_IWebBrowser2(iface);
304     FIXME("(%p)->(%p)\n", This, LocationName);
305     return E_NOTIMPL;
306 }
307
308 static HRESULT WINAPI InternetExplorer_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
309 {
310     InternetExplorer *This = impl_from_IWebBrowser2(iface);
311
312     TRACE("(%p)->(%p)\n", This, LocationURL);
313
314     return get_location_url(&This->doc_host->doc_host, LocationURL);
315 }
316
317 static HRESULT WINAPI InternetExplorer_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
318 {
319     InternetExplorer *This = impl_from_IWebBrowser2(iface);
320     FIXME("(%p)->(%p)\n", This, pBool);
321     return E_NOTIMPL;
322 }
323
324 static HRESULT WINAPI InternetExplorer_Quit(IWebBrowser2 *iface)
325 {
326     InternetExplorer *This = impl_from_IWebBrowser2(iface);
327     FIXME("(%p)\n", This);
328     return E_NOTIMPL;
329 }
330
331 static HRESULT WINAPI InternetExplorer_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
332 {
333     InternetExplorer *This = impl_from_IWebBrowser2(iface);
334     FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
335     return E_NOTIMPL;
336 }
337
338 static HRESULT WINAPI InternetExplorer_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
339 {
340     InternetExplorer *This = impl_from_IWebBrowser2(iface);
341     FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty));
342     return E_NOTIMPL;
343 }
344
345 static HRESULT WINAPI InternetExplorer_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
346 {
347     InternetExplorer *This = impl_from_IWebBrowser2(iface);
348     FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue);
349     return E_NOTIMPL;
350 }
351
352 static HRESULT WINAPI InternetExplorer_get_Name(IWebBrowser2 *iface, BSTR *Name)
353 {
354     InternetExplorer *This = impl_from_IWebBrowser2(iface);
355     FIXME("(%p)->(%p)\n", This, Name);
356     return E_NOTIMPL;
357 }
358
359 static HRESULT WINAPI InternetExplorer_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
360 {
361     InternetExplorer *This = impl_from_IWebBrowser2(iface);
362     FIXME("(%p)->(%p)\n", This, pHWND);
363     return E_NOTIMPL;
364 }
365
366 static HRESULT WINAPI InternetExplorer_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
367 {
368     InternetExplorer *This = impl_from_IWebBrowser2(iface);
369     FIXME("(%p)->(%p)\n", This, FullName);
370     return E_NOTIMPL;
371 }
372
373 static HRESULT WINAPI InternetExplorer_get_Path(IWebBrowser2 *iface, BSTR *Path)
374 {
375     InternetExplorer *This = impl_from_IWebBrowser2(iface);
376     FIXME("(%p)->(%p)\n", This, Path);
377     return E_NOTIMPL;
378 }
379
380 static HRESULT WINAPI InternetExplorer_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
381 {
382     InternetExplorer *This = impl_from_IWebBrowser2(iface);
383
384     TRACE("(%p)->(%p)\n", This, pBool);
385
386     *pBool = IsWindowVisible(This->frame_hwnd) ? VARIANT_TRUE : VARIANT_FALSE;
387     return S_OK;
388 }
389
390 static HRESULT WINAPI InternetExplorer_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
391 {
392     InternetExplorer *This = impl_from_IWebBrowser2(iface);
393     TRACE("(%p)->(%x)\n", This, Value);
394
395     ShowWindow(This->frame_hwnd, Value ? SW_SHOW : SW_HIDE);
396
397     return S_OK;
398 }
399
400 static HRESULT WINAPI InternetExplorer_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
401 {
402     InternetExplorer *This = impl_from_IWebBrowser2(iface);
403     FIXME("(%p)->(%p)\n", This, pBool);
404     return E_NOTIMPL;
405 }
406
407 static HRESULT WINAPI InternetExplorer_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
408 {
409     InternetExplorer *This = impl_from_IWebBrowser2(iface);
410     FIXME("(%p)->(%x)\n", This, Value);
411     return E_NOTIMPL;
412 }
413
414 static HRESULT WINAPI InternetExplorer_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
415 {
416     InternetExplorer *This = impl_from_IWebBrowser2(iface);
417     FIXME("(%p)->(%p)\n", This, StatusText);
418     return E_NOTIMPL;
419 }
420
421 static HRESULT WINAPI InternetExplorer_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
422 {
423     InternetExplorer *This = impl_from_IWebBrowser2(iface);
424
425     TRACE("(%p)->(%s)\n", This, debugstr_w(StatusText));
426
427     return update_ie_statustext(This, StatusText);
428 }
429
430 static HRESULT WINAPI InternetExplorer_get_ToolBar(IWebBrowser2 *iface, int *Value)
431 {
432     InternetExplorer *This = impl_from_IWebBrowser2(iface);
433     FIXME("(%p)->(%p)\n", This, Value);
434     return E_NOTIMPL;
435 }
436
437 static HRESULT WINAPI InternetExplorer_put_ToolBar(IWebBrowser2 *iface, int Value)
438 {
439     InternetExplorer *This = impl_from_IWebBrowser2(iface);
440     FIXME("(%p)->(%d)\n", This, Value);
441     return E_NOTIMPL;
442 }
443
444 static HRESULT WINAPI InternetExplorer_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
445 {
446     InternetExplorer *This = impl_from_IWebBrowser2(iface);
447     FIXME("(%p)->(%p)\n", This, Value);
448     return E_NOTIMPL;
449 }
450
451 static HRESULT WINAPI InternetExplorer_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
452 {
453     InternetExplorer *This = impl_from_IWebBrowser2(iface);
454     HMENU menu = NULL;
455
456     TRACE("(%p)->(%x)\n", This, Value);
457
458     if(Value)
459         menu = This->menu;
460
461     if(!SetMenu(This->frame_hwnd, menu))
462         return HRESULT_FROM_WIN32(GetLastError());
463
464     return S_OK;
465 }
466
467 static HRESULT WINAPI InternetExplorer_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
468 {
469     InternetExplorer *This = impl_from_IWebBrowser2(iface);
470     FIXME("(%p)->(%p)\n", This, pbFullScreen);
471     return E_NOTIMPL;
472 }
473
474 static HRESULT WINAPI InternetExplorer_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
475 {
476     InternetExplorer *This = impl_from_IWebBrowser2(iface);
477     FIXME("(%p)->(%x)\n", This, bFullScreen);
478     return E_NOTIMPL;
479 }
480
481 static HRESULT WINAPI InternetExplorer_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
482         VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
483 {
484     InternetExplorer *This = impl_from_IWebBrowser2(iface);
485
486     TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName, PostData, Headers);
487
488     if(!URL)
489         return S_OK;
490
491     if(V_VT(URL) != VT_BSTR) {
492         FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
493         return E_INVALIDARG;
494     }
495
496     return navigate_url(&This->doc_host->doc_host, V_BSTR(URL), Flags, TargetFrameName, PostData, Headers);
497 }
498
499 static HRESULT WINAPI InternetExplorer_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
500 {
501     InternetExplorer *This = impl_from_IWebBrowser2(iface);
502     FIXME("(%p)->(%d %p)\n", This, cmdID, pcmdf);
503     return E_NOTIMPL;
504 }
505
506 static HRESULT WINAPI InternetExplorer_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
507         OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
508 {
509     InternetExplorer *This = impl_from_IWebBrowser2(iface);
510     FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut);
511     return E_NOTIMPL;
512 }
513
514 static HRESULT WINAPI InternetExplorer_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
515         VARIANT *pvarShow, VARIANT *pvarSize)
516 {
517     InternetExplorer *This = impl_from_IWebBrowser2(iface);
518     FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize);
519     return E_NOTIMPL;
520 }
521
522 static HRESULT WINAPI InternetExplorer_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
523 {
524     InternetExplorer *This = impl_from_IWebBrowser2(iface);
525     FIXME("(%p)->(%p)\n", This, lpReadyState);
526     return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI InternetExplorer_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
530 {
531     InternetExplorer *This = impl_from_IWebBrowser2(iface);
532     FIXME("(%p)->(%p)\n", This, pbOffline);
533     return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI InternetExplorer_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
537 {
538     InternetExplorer *This = impl_from_IWebBrowser2(iface);
539     FIXME("(%p)->(%x)\n", This, bOffline);
540     return E_NOTIMPL;
541 }
542
543 static HRESULT WINAPI InternetExplorer_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
544 {
545     InternetExplorer *This = impl_from_IWebBrowser2(iface);
546     FIXME("(%p)->(%p)\n", This, pbSilent);
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI InternetExplorer_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
551 {
552     InternetExplorer *This = impl_from_IWebBrowser2(iface);
553     FIXME("(%p)->(%x)\n", This, bSilent);
554     return E_NOTIMPL;
555 }
556
557 static HRESULT WINAPI InternetExplorer_get_RegisterAsBrowser(IWebBrowser2 *iface,
558         VARIANT_BOOL *pbRegister)
559 {
560     InternetExplorer *This = impl_from_IWebBrowser2(iface);
561     FIXME("(%p)->(%p)\n", This, pbRegister);
562     return E_NOTIMPL;
563 }
564
565 static HRESULT WINAPI InternetExplorer_put_RegisterAsBrowser(IWebBrowser2 *iface,
566         VARIANT_BOOL bRegister)
567 {
568     InternetExplorer *This = impl_from_IWebBrowser2(iface);
569     FIXME("(%p)->(%x)\n", This, bRegister);
570     return E_NOTIMPL;
571 }
572
573 static HRESULT WINAPI InternetExplorer_get_RegisterAsDropTarget(IWebBrowser2 *iface,
574         VARIANT_BOOL *pbRegister)
575 {
576     InternetExplorer *This = impl_from_IWebBrowser2(iface);
577     FIXME("(%p)->(%p)\n", This, pbRegister);
578     return E_NOTIMPL;
579 }
580
581 static HRESULT WINAPI InternetExplorer_put_RegisterAsDropTarget(IWebBrowser2 *iface,
582         VARIANT_BOOL bRegister)
583 {
584     InternetExplorer *This = impl_from_IWebBrowser2(iface);
585     FIXME("(%p)->(%x)\n", This, bRegister);
586     return E_NOTIMPL;
587 }
588
589 static HRESULT WINAPI InternetExplorer_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
590 {
591     InternetExplorer *This = impl_from_IWebBrowser2(iface);
592     FIXME("(%p)->(%p)\n", This, pbRegister);
593     return E_NOTIMPL;
594 }
595
596 static HRESULT WINAPI InternetExplorer_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
597 {
598     InternetExplorer *This = impl_from_IWebBrowser2(iface);
599     FIXME("(%p)->(%x)\n", This, bRegister);
600     return E_NOTIMPL;
601 }
602
603 static HRESULT WINAPI InternetExplorer_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
604 {
605     InternetExplorer *This = impl_from_IWebBrowser2(iface);
606     FIXME("(%p)->(%p)\n", This, Value);
607     return E_NOTIMPL;
608 }
609
610 static HRESULT WINAPI InternetExplorer_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
611 {
612     InternetExplorer *This = impl_from_IWebBrowser2(iface);
613     FIXME("(%p)->(%x)\n", This, Value);
614     return E_NOTIMPL;
615 }
616
617 static HRESULT WINAPI InternetExplorer_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
618 {
619     InternetExplorer *This = impl_from_IWebBrowser2(iface);
620     FIXME("(%p)->(%p)\n", This, Value);
621     return E_NOTIMPL;
622 }
623
624 static HRESULT WINAPI InternetExplorer_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
625 {
626     InternetExplorer *This = impl_from_IWebBrowser2(iface);
627     FIXME("(%p)->(%x)\n", This, Value);
628     return E_NOTIMPL;
629 }
630
631 static const IWebBrowser2Vtbl InternetExplorerVtbl =
632 {
633     InternetExplorer_QueryInterface,
634     InternetExplorer_AddRef,
635     InternetExplorer_Release,
636     InternetExplorer_GetTypeInfoCount,
637     InternetExplorer_GetTypeInfo,
638     InternetExplorer_GetIDsOfNames,
639     InternetExplorer_Invoke,
640     InternetExplorer_GoBack,
641     InternetExplorer_GoForward,
642     InternetExplorer_GoHome,
643     InternetExplorer_GoSearch,
644     InternetExplorer_Navigate,
645     InternetExplorer_Refresh,
646     InternetExplorer_Refresh2,
647     InternetExplorer_Stop,
648     InternetExplorer_get_Application,
649     InternetExplorer_get_Parent,
650     InternetExplorer_get_Container,
651     InternetExplorer_get_Document,
652     InternetExplorer_get_TopLevelContainer,
653     InternetExplorer_get_Type,
654     InternetExplorer_get_Left,
655     InternetExplorer_put_Left,
656     InternetExplorer_get_Top,
657     InternetExplorer_put_Top,
658     InternetExplorer_get_Width,
659     InternetExplorer_put_Width,
660     InternetExplorer_get_Height,
661     InternetExplorer_put_Height,
662     InternetExplorer_get_LocationName,
663     InternetExplorer_get_LocationURL,
664     InternetExplorer_get_Busy,
665     InternetExplorer_Quit,
666     InternetExplorer_ClientToWindow,
667     InternetExplorer_PutProperty,
668     InternetExplorer_GetProperty,
669     InternetExplorer_get_Name,
670     InternetExplorer_get_HWND,
671     InternetExplorer_get_FullName,
672     InternetExplorer_get_Path,
673     InternetExplorer_get_Visible,
674     InternetExplorer_put_Visible,
675     InternetExplorer_get_StatusBar,
676     InternetExplorer_put_StatusBar,
677     InternetExplorer_get_StatusText,
678     InternetExplorer_put_StatusText,
679     InternetExplorer_get_ToolBar,
680     InternetExplorer_put_ToolBar,
681     InternetExplorer_get_MenuBar,
682     InternetExplorer_put_MenuBar,
683     InternetExplorer_get_FullScreen,
684     InternetExplorer_put_FullScreen,
685     InternetExplorer_Navigate2,
686     InternetExplorer_QueryStatusWB,
687     InternetExplorer_ExecWB,
688     InternetExplorer_ShowBrowserBar,
689     InternetExplorer_get_ReadyState,
690     InternetExplorer_get_Offline,
691     InternetExplorer_put_Offline,
692     InternetExplorer_get_Silent,
693     InternetExplorer_put_Silent,
694     InternetExplorer_get_RegisterAsBrowser,
695     InternetExplorer_put_RegisterAsBrowser,
696     InternetExplorer_get_RegisterAsDropTarget,
697     InternetExplorer_put_RegisterAsDropTarget,
698     InternetExplorer_get_TheaterMode,
699     InternetExplorer_put_TheaterMode,
700     InternetExplorer_get_AddressBar,
701     InternetExplorer_put_AddressBar,
702     InternetExplorer_get_Resizable,
703     InternetExplorer_put_Resizable
704 };
705
706 static inline InternetExplorer *impl_from_IServiceProvider(IServiceProvider *iface)
707 {
708     return CONTAINING_RECORD(iface, InternetExplorer, IServiceProvider_iface);
709 }
710
711 static HRESULT WINAPI IEServiceProvider_QueryInterface(IServiceProvider *iface,
712             REFIID riid, LPVOID *ppv)
713 {
714     InternetExplorer *This = impl_from_IServiceProvider(iface);
715     return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
716 }
717
718 static ULONG WINAPI IEServiceProvider_AddRef(IServiceProvider *iface)
719 {
720     InternetExplorer *This = impl_from_IServiceProvider(iface);
721     return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
722 }
723
724 static ULONG WINAPI IEServiceProvider_Release(IServiceProvider *iface)
725 {
726     InternetExplorer *This = impl_from_IServiceProvider(iface);
727     return IWebBrowser_Release(&This->IWebBrowser2_iface);
728 }
729
730 static HRESULT WINAPI IEServiceProvider_QueryService(IServiceProvider *iface,
731         REFGUID guidService, REFIID riid, void **ppv)
732 {
733     InternetExplorer *This = impl_from_IServiceProvider(iface);
734
735     if(IsEqualGUID(&SID_SHTMLWindow, riid)) {
736         TRACE("(%p)->(SID_SHTMLWindow)\n", This);
737         return IHTMLWindow2_QueryInterface(&This->doc_host->doc_host.html_window.IHTMLWindow2_iface, riid, ppv);
738     }
739
740     FIXME("(%p)->(%s, %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
741     *ppv = NULL;
742     return E_NOINTERFACE;
743 }
744
745 static const IServiceProviderVtbl ServiceProviderVtbl =
746 {
747     IEServiceProvider_QueryInterface,
748     IEServiceProvider_AddRef,
749     IEServiceProvider_Release,
750     IEServiceProvider_QueryService
751 };
752
753 void InternetExplorer_WebBrowser_Init(InternetExplorer *This)
754 {
755     This->IWebBrowser2_iface.lpVtbl = &InternetExplorerVtbl;
756     This->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
757 }