b0633b03f194bd56aa1185af82eb2844b56e5925
[reactos.git] / dll / win32 / shdocvw / webbrowser.c
1 /*
2 * Implementation of IWebBrowser interface for WebBrowser control
3 *
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005 Jacek Caban
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22 #include "wine/debug.h"
23 #include "shdocvw.h"
24 #include "exdispid.h"
25
26 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
27
28 /**********************************************************************
29 * Implement the IWebBrowser interface
30 */
31
32 #define WEBBROWSER_THIS(iface) DEFINE_THIS(WebBrowser, WebBrowser2, iface)
33
34 static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
35 {
36 WebBrowser *This = WEBBROWSER_THIS(iface);
37
38 if (ppv == NULL)
39 return E_POINTER;
40 *ppv = NULL;
41
42 if(IsEqualGUID(&IID_IUnknown, riid)) {
43 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
44 *ppv = WEBBROWSER(This);
45 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
46 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
47 *ppv = WEBBROWSER(This);
48 }else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
49 TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
50 *ppv = WEBBROWSER(This);
51 }else if(IsEqualGUID(&IID_IWebBrowserApp, riid)) {
52 TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This, ppv);
53 *ppv = WEBBROWSER(This);
54 }else if(IsEqualGUID(&IID_IWebBrowser2, riid)) {
55 TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This, ppv);
56 *ppv = WEBBROWSER(This);
57 }else if(IsEqualGUID(&IID_IOleObject, riid)) {
58 TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
59 *ppv = OLEOBJ(This);
60 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
61 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
62 *ppv = INPLACEOBJ(This);
63 }else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
64 TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
65 *ppv = INPLACEOBJ(This);
66 }else if(IsEqualGUID(&IID_IOleControl, riid)) {
67 TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
68 *ppv = CONTROL(This);
69 }else if(IsEqualGUID(&IID_IPersist, riid)) {
70 TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
71 *ppv = PERSTORAGE(This);
72 }else if(IsEqualGUID(&IID_IPersistStorage, riid)) {
73 TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
74 *ppv = PERSTORAGE(This);
75 }else if(IsEqualGUID(&IID_IPersistMemory, riid)) {
76 TRACE("(%p)->(IID_IPersistStorage %p)\n", This, ppv);
77 *ppv = PERMEMORY(This);
78 }else if(IsEqualGUID (&IID_IPersistStreamInit, riid)) {
79 TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv);
80 *ppv = PERSTRINIT(This);
81 }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) {
82 TRACE("(%p)->(IID_IProvideClassInfo %p)\n", This, ppv);
83 *ppv = CLASSINFO(This);
84 }else if(IsEqualGUID(&IID_IProvideClassInfo2, riid)) {
85 TRACE("(%p)->(IID_IProvideClassInfo2 %p)\n", This, ppv);
86 *ppv = CLASSINFO(This);
87 }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
88 TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
89 *ppv = CONPTCONT(&This->doc_host.cps);
90 }else if(IsEqualGUID(&IID_IViewObject, riid)) {
91 TRACE("(%p)->(IID_IViewObject %p)\n", This, ppv);
92 *ppv = VIEWOBJ(This);
93 }else if(IsEqualGUID(&IID_IViewObject2, riid)) {
94 TRACE("(%p)->(IID_IViewObject2 %p)\n", This, ppv);
95 *ppv = VIEWOBJ2(This);
96 }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
97 TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
98 *ppv = ACTIVEOBJ(This);
99 }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
100 TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
101 *ppv = OLECMD(This);
102 }else if(IsEqualGUID(&IID_IHlinkFrame, riid)) {
103 TRACE("(%p)->(IID_IHlinkFrame %p)\n", This, ppv);
104 *ppv = HLINKFRAME(This);
105 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
106 *ppv = SERVPROV(This);
107 TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
108 }else if(IsEqualGUID(&IID_IQuickActivate, riid)) {
109 TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv);
110 return E_NOINTERFACE;
111 }else if(IsEqualGUID(&IID_IRunnableObject, riid)) {
112 TRACE("(%p)->(IID_IRunnableObject %p) returning NULL\n", This, ppv);
113 return E_NOINTERFACE;
114 }else if(IsEqualGUID(&IID_IPerPropertyBrowsing, riid)) {
115 TRACE("(%p)->(IID_IPerPropertyBrowsing %p) returning NULL\n", This, ppv);
116 return E_NOINTERFACE;
117 }else if(IsEqualGUID(&IID_IOleCache, riid)) {
118 TRACE("(%p)->(IID_IOleCache %p) returning NULL\n", This, ppv);
119 return E_NOINTERFACE;
120 }else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
121 TRACE("(%p)->(IID_IOleInPlaceSite %p) returning NULL\n", This, ppv);
122 return E_NOINTERFACE;
123 }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) {
124 TRACE("(%p)->(IID_IObjectWithSite %p) returning NULL\n", This, ppv);
125 return E_NOINTERFACE;
126 }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) {
127 TRACE("(%p)->(IID_IViewObjectEx %p) returning NULL\n", This, ppv);
128 return E_NOINTERFACE;
129 }
130
131 if(*ppv) {
132 IUnknown_AddRef((IUnknown*)*ppv);
133 return S_OK;
134 }
135
136 FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
137 return E_NOINTERFACE;
138 }
139
140 static ULONG WINAPI WebBrowser_AddRef(IWebBrowser2 *iface)
141 {
142 WebBrowser *This = WEBBROWSER_THIS(iface);
143 LONG ref = InterlockedIncrement(&This->ref);
144 TRACE("(%p) ref=%d\n", This, ref);
145 return ref;
146 }
147
148 static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
149 {
150 WebBrowser *This = WEBBROWSER_THIS(iface);
151 LONG ref = InterlockedDecrement(&This->ref);
152
153 TRACE("(%p) ref=%d\n", This, ref);
154
155 if(!ref) {
156 if(This->doc_host.document)
157 IUnknown_Release(This->doc_host.document);
158
159 DocHost_Release(&This->doc_host);
160
161 WebBrowser_OleObject_Destroy(This);
162
163 heap_free(This);
164 SHDOCVW_UnlockModule();
165 }
166
167 return ref;
168 }
169
170 /* IDispatch methods */
171 static HRESULT WINAPI WebBrowser_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
172 {
173 WebBrowser *This = WEBBROWSER_THIS(iface);
174
175 TRACE("(%p)->(%p)\n", This, pctinfo);
176
177 *pctinfo = 1;
178 return S_OK;
179 }
180
181 static HRESULT WINAPI WebBrowser_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
182 LPTYPEINFO *ppTInfo)
183 {
184 WebBrowser *This = WEBBROWSER_THIS(iface);
185 ITypeInfo *typeinfo;
186 HRESULT hres;
187
188 TRACE("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
189
190 hres = get_typeinfo(&typeinfo);
191 if(FAILED(hres))
192 return hres;
193
194 ITypeInfo_AddRef(typeinfo);
195 *ppTInfo = typeinfo;
196 return S_OK;
197 }
198
199 static HRESULT WINAPI WebBrowser_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
200 LPOLESTR *rgszNames, UINT cNames,
201 LCID lcid, DISPID *rgDispId)
202 {
203 WebBrowser *This = WEBBROWSER_THIS(iface);
204 ITypeInfo *typeinfo;
205 HRESULT hres;
206
207 TRACE("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
208 lcid, rgDispId);
209
210 hres = get_typeinfo(&typeinfo);
211 if(FAILED(hres))
212 return hres;
213
214 return ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
215 }
216
217 static HRESULT WINAPI WebBrowser_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
218 REFIID riid, LCID lcid, WORD wFlags,
219 DISPPARAMS *pDispParams, VARIANT *pVarResult,
220 EXCEPINFO *pExepInfo, UINT *puArgErr)
221 {
222 WebBrowser *This = WEBBROWSER_THIS(iface);
223 ITypeInfo *typeinfo;
224 HRESULT hres;
225
226 TRACE("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
227 lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
228
229 hres = get_typeinfo(&typeinfo);
230 if(FAILED(hres))
231 return hres;
232
233 return ITypeInfo_Invoke(typeinfo, WEBBROWSER2(This), dispIdMember, wFlags, pDispParams,
234 pVarResult, pExepInfo, puArgErr);
235 }
236
237 /* IWebBrowser methods */
238 static HRESULT WINAPI WebBrowser_GoBack(IWebBrowser2 *iface)
239 {
240 WebBrowser *This = WEBBROWSER_THIS(iface);
241 FIXME("(%p)\n", This);
242 return E_NOTIMPL;
243 }
244
245 static HRESULT WINAPI WebBrowser_GoForward(IWebBrowser2 *iface)
246 {
247 WebBrowser *This = WEBBROWSER_THIS(iface);
248 FIXME("(%p)\n", This);
249 return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI WebBrowser_GoHome(IWebBrowser2 *iface)
253 {
254 WebBrowser *This = WEBBROWSER_THIS(iface);
255 TRACE("(%p)\n", This);
256 return go_home(&This->doc_host);
257 }
258
259 static HRESULT WINAPI WebBrowser_GoSearch(IWebBrowser2 *iface)
260 {
261 WebBrowser *This = WEBBROWSER_THIS(iface);
262 FIXME("(%p)\n", This);
263 return E_NOTIMPL;
264 }
265
266 static HRESULT WINAPI WebBrowser_Navigate(IWebBrowser2 *iface, BSTR szUrl,
267 VARIANT *Flags, VARIANT *TargetFrameName,
268 VARIANT *PostData, VARIANT *Headers)
269 {
270 WebBrowser *This = WEBBROWSER_THIS(iface);
271
272 TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(szUrl), debugstr_variant(Flags),
273 debugstr_variant(TargetFrameName), debugstr_variant(PostData),
274 debugstr_variant(Headers));
275
276 return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
277 }
278
279 static HRESULT WINAPI WebBrowser_Refresh(IWebBrowser2 *iface)
280 {
281 WebBrowser *This = WEBBROWSER_THIS(iface);
282 FIXME("(%p)\n", This);
283 return E_NOTIMPL;
284 }
285
286 static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
287 {
288 WebBrowser *This = WEBBROWSER_THIS(iface);
289 FIXME("(%p)->(%s)\n", This, debugstr_variant(Level));
290 return E_NOTIMPL;
291 }
292
293 static HRESULT WINAPI WebBrowser_Stop(IWebBrowser2 *iface)
294 {
295 WebBrowser *This = WEBBROWSER_THIS(iface);
296 FIXME("(%p)\n", This);
297 return E_NOTIMPL;
298 }
299
300 static HRESULT WINAPI WebBrowser_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
301 {
302 WebBrowser *This = WEBBROWSER_THIS(iface);
303
304 TRACE("(%p)->(%p)\n", This, ppDisp);
305
306 if(!ppDisp)
307 return E_POINTER;
308
309 *ppDisp = (IDispatch*)WEBBROWSER2(This);
310 IDispatch_AddRef(*ppDisp);
311 return S_OK;
312 }
313
314 static HRESULT WINAPI WebBrowser_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
315 {
316 WebBrowser *This = WEBBROWSER_THIS(iface);
317 FIXME("(%p)->(%p)\n", This, ppDisp);
318 return E_NOTIMPL;
319 }
320
321 static HRESULT WINAPI WebBrowser_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
322 {
323 WebBrowser *This = WEBBROWSER_THIS(iface);
324 FIXME("(%p)->(%p)\n", This, ppDisp);
325 return E_NOTIMPL;
326 }
327
328 static HRESULT WINAPI WebBrowser_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
329 {
330 WebBrowser *This = WEBBROWSER_THIS(iface);
331
332 TRACE("(%p)->(%p)\n", This, ppDisp);
333
334 *ppDisp = NULL;
335 if(This->doc_host.document)
336 IUnknown_QueryInterface(This->doc_host.document, &IID_IDispatch, (void**)ppDisp);
337
338 return S_OK;
339 }
340
341 static HRESULT WINAPI WebBrowser_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
342 {
343 WebBrowser *This = WEBBROWSER_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, pBool);
345 return E_NOTIMPL;
346 }
347
348 static HRESULT WINAPI WebBrowser_get_Type(IWebBrowser2 *iface, BSTR *Type)
349 {
350 WebBrowser *This = WEBBROWSER_THIS(iface);
351 FIXME("(%p)->(%p)\n", This, Type);
352 return E_NOTIMPL;
353 }
354
355 static HRESULT WINAPI WebBrowser_get_Left(IWebBrowser2 *iface, LONG *pl)
356 {
357 WebBrowser *This = WEBBROWSER_THIS(iface);
358
359 TRACE("(%p)->(%p)\n", This, pl);
360
361 *pl = This->pos_rect.left;
362 return S_OK;
363 }
364
365 static HRESULT WINAPI WebBrowser_put_Left(IWebBrowser2 *iface, LONG Left)
366 {
367 WebBrowser *This = WEBBROWSER_THIS(iface);
368 RECT rect;
369
370 TRACE("(%p)->(%d)\n", This, Left);
371
372 if(!This->inplace)
373 return E_UNEXPECTED;
374
375 rect = This->pos_rect;
376 rect.left = Left;
377
378 /* We don't really change the window position here.
379 * We just notify the embedder that he should do so. */
380 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
381 }
382
383 static HRESULT WINAPI WebBrowser_get_Top(IWebBrowser2 *iface, LONG *pl)
384 {
385 WebBrowser *This = WEBBROWSER_THIS(iface);
386
387 TRACE("(%p)->(%p)\n", This, pl);
388
389 *pl = This->pos_rect.top;
390 return S_OK;
391 }
392
393 static HRESULT WINAPI WebBrowser_put_Top(IWebBrowser2 *iface, LONG Top)
394 {
395 WebBrowser *This = WEBBROWSER_THIS(iface);
396 RECT rect;
397
398 TRACE("(%p)->(%d)\n", This, Top);
399
400 if(!This->inplace)
401 return E_UNEXPECTED;
402
403 rect = This->pos_rect;
404 rect.top = Top;
405
406 /* We don't really change the window position here.
407 * We just notify the embedder that he should do so. */
408 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
409 }
410
411 static HRESULT WINAPI WebBrowser_get_Width(IWebBrowser2 *iface, LONG *pl)
412 {
413 WebBrowser *This = WEBBROWSER_THIS(iface);
414
415 TRACE("(%p)->(%p)\n", This, pl);
416
417 *pl = This->pos_rect.right - This->pos_rect.left;
418 return S_OK;
419 }
420
421 static HRESULT WINAPI WebBrowser_put_Width(IWebBrowser2 *iface, LONG Width)
422 {
423 WebBrowser *This = WEBBROWSER_THIS(iface);
424 RECT rect;
425
426 TRACE("(%p)->(%d)\n", This, Width);
427
428 if(!This->inplace)
429 return E_UNEXPECTED;
430
431 rect = This->pos_rect;
432 rect.right = rect.left+Width;
433
434 /* We don't really change the window size here.
435 * We just notify the embedder that he should do so. */
436 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
437 }
438
439 static HRESULT WINAPI WebBrowser_get_Height(IWebBrowser2 *iface, LONG *pl)
440 {
441 WebBrowser *This = WEBBROWSER_THIS(iface);
442
443 TRACE("(%p)->(%p)\n", This, pl);
444
445 *pl = This->pos_rect.bottom - This->pos_rect.top;
446 return S_OK;
447 }
448
449 static HRESULT WINAPI WebBrowser_put_Height(IWebBrowser2 *iface, LONG Height)
450 {
451 WebBrowser *This = WEBBROWSER_THIS(iface);
452 RECT rect;
453
454 TRACE("(%p)->(%d)\n", This, Height);
455
456 if(!This->inplace)
457 return E_UNEXPECTED;
458
459 rect = This->pos_rect;
460 rect.bottom = rect.top+Height;
461
462 /* We don't really change the window size here.
463 * We just notify the embedder that he should do so. */
464 return IOleInPlaceSite_OnPosRectChange(This->inplace, &rect);
465 }
466
467 static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
468 {
469 WebBrowser *This = WEBBROWSER_THIS(iface);
470 FIXME("(%p)->(%p)\n", This, LocationName);
471 return E_NOTIMPL;
472 }
473
474 static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
475 {
476 WebBrowser *This = WEBBROWSER_THIS(iface);
477
478 FIXME("(%p)->(%p)\n", This, LocationURL);
479
480 if(!This->doc_host.url) {
481 static const WCHAR null_char = 0;
482 *LocationURL = SysAllocString(&null_char);
483 return S_FALSE;
484 }
485
486 *LocationURL = SysAllocString(This->doc_host.url);
487 return S_OK;
488 }
489
490 static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
491 {
492 WebBrowser *This = WEBBROWSER_THIS(iface);
493
494 TRACE("(%p)->(%p)\n", This, pBool);
495
496 *pBool = This->doc_host.busy;
497 return S_OK;
498 }
499
500 static HRESULT WINAPI WebBrowser_Quit(IWebBrowser2 *iface)
501 {
502 WebBrowser *This = WEBBROWSER_THIS(iface);
503
504 TRACE("(%p)\n", This);
505
506 /* It's a InternetExplorer specific method, we have nothing to do here. */
507 return E_FAIL;
508 }
509
510 static HRESULT WINAPI WebBrowser_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
511 {
512 WebBrowser *This = WEBBROWSER_THIS(iface);
513 FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
514 return E_NOTIMPL;
515 }
516
517 static HRESULT WINAPI WebBrowser_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
518 {
519 WebBrowser *This = WEBBROWSER_THIS(iface);
520 FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(&vtValue));
521 return E_NOTIMPL;
522 }
523
524 static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
525 {
526 WebBrowser *This = WEBBROWSER_THIS(iface);
527 FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty), debugstr_variant(pvtValue));
528 return E_NOTIMPL;
529 }
530
531 static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
532 {
533 static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b',
534 ' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0};
535 WebBrowser *This = WEBBROWSER_THIS(iface);
536
537 TRACE("(%p)->(%p)\n", This, Name);
538
539 *Name = SysAllocString(sName);
540
541 return S_OK;
542 }
543
544 static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
545 {
546 WebBrowser *This = WEBBROWSER_THIS(iface);
547
548 TRACE("(%p)->(%p)\n", This, pHWND);
549
550 /* WebBrowser control never has a frame window (in opposition to InternetExplorer) */
551 *pHWND = 0;
552 return E_FAIL;
553 }
554
555 static HRESULT WINAPI WebBrowser_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
556 {
557 WebBrowser *This = WEBBROWSER_THIS(iface);
558 FIXME("(%p)->(%p)\n", This, FullName);
559 return E_NOTIMPL;
560 }
561
562 static HRESULT WINAPI WebBrowser_get_Path(IWebBrowser2 *iface, BSTR *Path)
563 {
564 WebBrowser *This = WEBBROWSER_THIS(iface);
565 FIXME("(%p)->(%p)\n", This, Path);
566 return E_NOTIMPL;
567 }
568
569 static HRESULT WINAPI WebBrowser_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
570 {
571 WebBrowser *This = WEBBROWSER_THIS(iface);
572
573 TRACE("(%p)->(%p)\n", This, pBool);
574
575 *pBool = This->visible;
576 return S_OK;
577 }
578
579 static HRESULT WINAPI WebBrowser_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
580 {
581 WebBrowser *This = WEBBROWSER_THIS(iface);
582 VARIANTARG arg;
583 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
584
585 TRACE("(%p)->(%x)\n", This, Value);
586
587 This->visible = Value;
588
589 V_VT(&arg) = VT_BOOL;
590 V_BOOL(&arg) = Value;
591 call_sink(This->doc_host.cps.wbe2, DISPID_ONVISIBLE, &dispparams);
592
593 return S_OK;
594 }
595
596 static HRESULT WINAPI WebBrowser_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
597 {
598 WebBrowser *This = WEBBROWSER_THIS(iface);
599
600 TRACE("(%p)->(%p)\n", This, pBool);
601
602 *pBool = This->status_bar;
603 return S_OK;
604 }
605
606 static HRESULT WINAPI WebBrowser_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
607 {
608 WebBrowser *This = WEBBROWSER_THIS(iface);
609 VARIANTARG arg;
610 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
611
612 TRACE("(%p)->(%x)\n", This, Value);
613
614 This->status_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
615
616 /* In opposition to InternetExplorer, all we should do here is
617 * inform the embedder about the status bar change. */
618
619 V_VT(&arg) = VT_BOOL;
620 V_BOOL(&arg) = Value;
621 call_sink(This->doc_host.cps.wbe2, DISPID_ONSTATUSBAR, &dispparams);
622
623 return S_OK;
624 }
625
626 static HRESULT WINAPI WebBrowser_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
627 {
628 WebBrowser *This = WEBBROWSER_THIS(iface);
629 FIXME("(%p)->(%p)\n", This, StatusText);
630 return E_NOTIMPL;
631 }
632
633 static HRESULT WINAPI WebBrowser_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
634 {
635 WebBrowser *This = WEBBROWSER_THIS(iface);
636 FIXME("(%p)->(%s)\n", This, debugstr_w(StatusText));
637 return E_NOTIMPL;
638 }
639
640 static HRESULT WINAPI WebBrowser_get_ToolBar(IWebBrowser2 *iface, int *Value)
641 {
642 WebBrowser *This = WEBBROWSER_THIS(iface);
643
644 TRACE("(%p)->(%p)\n", This, Value);
645
646 *Value = This->tool_bar;
647 return S_OK;
648 }
649
650 static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value)
651 {
652 WebBrowser *This = WEBBROWSER_THIS(iface);
653 VARIANTARG arg;
654 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
655
656 TRACE("(%p)->(%x)\n", This, Value);
657
658 This->tool_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
659
660 /* In opposition to InternetExplorer, all we should do here is
661 * inform the embedder about the tool bar change. */
662
663 V_VT(&arg) = VT_BOOL;
664 V_BOOL(&arg) = This->tool_bar;
665 call_sink(This->doc_host.cps.wbe2, DISPID_ONTOOLBAR, &dispparams);
666
667 return S_OK;
668 }
669
670 static HRESULT WINAPI WebBrowser_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
671 {
672 WebBrowser *This = WEBBROWSER_THIS(iface);
673
674 TRACE("(%p)->(%p)\n", This, Value);
675
676 *Value = This->menu_bar;
677 return S_OK;
678 }
679
680 static HRESULT WINAPI WebBrowser_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
681 {
682 WebBrowser *This = WEBBROWSER_THIS(iface);
683 VARIANTARG arg;
684 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
685
686 TRACE("(%p)->(%x)\n", This, Value);
687
688 This->menu_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
689
690 /* In opposition to InternetExplorer, all we should do here is
691 * inform the embedder about the menu bar change. */
692
693 V_VT(&arg) = VT_BOOL;
694 V_BOOL(&arg) = Value;
695 call_sink(This->doc_host.cps.wbe2, DISPID_ONMENUBAR, &dispparams);
696
697 return S_OK;
698 }
699
700 static HRESULT WINAPI WebBrowser_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
701 {
702 WebBrowser *This = WEBBROWSER_THIS(iface);
703
704 TRACE("(%p)->(%p)\n", This, pbFullScreen);
705
706 *pbFullScreen = This->full_screen;
707 return S_OK;
708 }
709
710 static HRESULT WINAPI WebBrowser_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
711 {
712 WebBrowser *This = WEBBROWSER_THIS(iface);
713 VARIANTARG arg;
714 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
715
716 /* In opposition to InternetExplorer, all we should do here is
717 * inform the embedder about the fullscreen change. */
718
719 TRACE("(%p)->(%x)\n", This, bFullScreen);
720
721 This->full_screen = bFullScreen ? VARIANT_TRUE : VARIANT_FALSE;
722
723 V_VT(&arg) = VT_BOOL;
724 V_BOOL(&arg) = bFullScreen;
725 call_sink(This->doc_host.cps.wbe2, DISPID_ONFULLSCREEN, &dispparams);
726
727 return S_OK;
728 }
729
730 static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
731 VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
732 {
733 WebBrowser *This = WEBBROWSER_THIS(iface);
734 LPCWSTR url;
735
736 TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_variant(URL), debugstr_variant(Flags),
737 debugstr_variant(TargetFrameName), debugstr_variant(PostData), debugstr_variant(Headers));
738
739 if(!This->client)
740 return E_FAIL;
741
742 if(!URL)
743 return S_OK;
744
745 switch (V_VT(URL))
746 {
747 case VT_BSTR:
748 url = V_BSTR(URL);
749 break;
750 case VT_BSTR|VT_BYREF:
751 url = *V_BSTRREF(URL);
752 break;
753 default:
754 FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
755 return E_INVALIDARG;
756 }
757
758 return navigate_url(&This->doc_host, url, Flags, TargetFrameName, PostData, Headers);
759 }
760
761 static HRESULT WINAPI WebBrowser_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
762 {
763 WebBrowser *This = WEBBROWSER_THIS(iface);
764 FIXME("(%p)->(%d %p)\n", This, cmdID, pcmdf);
765 return E_NOTIMPL;
766 }
767
768 static HRESULT WINAPI WebBrowser_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
769 OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
770 {
771 WebBrowser *This = WEBBROWSER_THIS(iface);
772 FIXME("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt, debugstr_variant(pvaIn), pvaOut);
773 return E_NOTIMPL;
774 }
775
776 static HRESULT WINAPI WebBrowser_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
777 VARIANT *pvarShow, VARIANT *pvarSize)
778 {
779 WebBrowser *This = WEBBROWSER_THIS(iface);
780 FIXME("(%p)->(%s %s %s)\n", This, debugstr_variant(pvaClsid), debugstr_variant(pvarShow),
781 debugstr_variant(pvarSize));
782 return E_NOTIMPL;
783 }
784
785 static HRESULT WINAPI WebBrowser_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
786 {
787 WebBrowser *This = WEBBROWSER_THIS(iface);
788
789 TRACE("(%p)->(%p)\n", This, lpReadyState);
790
791 *lpReadyState = This->doc_host.ready_state;
792 return S_OK;
793 }
794
795 static HRESULT WINAPI WebBrowser_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
796 {
797 WebBrowser *This = WEBBROWSER_THIS(iface);
798
799 TRACE("(%p)->(%p)\n", This, pbOffline);
800
801 *pbOffline = This->doc_host.offline;
802 return S_OK;
803 }
804
805 static HRESULT WINAPI WebBrowser_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
806 {
807 WebBrowser *This = WEBBROWSER_THIS(iface);
808
809 TRACE("(%p)->(%x)\n", This, bOffline);
810
811 This->doc_host.offline = bOffline ? VARIANT_TRUE : VARIANT_FALSE;
812 return S_OK;
813 }
814
815 static HRESULT WINAPI WebBrowser_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
816 {
817 WebBrowser *This = WEBBROWSER_THIS(iface);
818
819 TRACE("(%p)->(%p)\n", This, pbSilent);
820
821 *pbSilent = This->doc_host.silent;
822 return S_OK;
823 }
824
825 static HRESULT WINAPI WebBrowser_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
826 {
827 WebBrowser *This = WEBBROWSER_THIS(iface);
828
829 TRACE("(%p)->(%x)\n", This, bSilent);
830
831 This->doc_host.silent = bSilent ? VARIANT_TRUE : VARIANT_FALSE;
832 return S_OK;
833 }
834
835 static HRESULT WINAPI WebBrowser_get_RegisterAsBrowser(IWebBrowser2 *iface,
836 VARIANT_BOOL *pbRegister)
837 {
838 WebBrowser *This = WEBBROWSER_THIS(iface);
839
840 FIXME("(%p)->(%p)\n", This, pbRegister);
841
842 *pbRegister = This->register_browser;
843 return S_OK;
844 }
845
846 static HRESULT WINAPI WebBrowser_put_RegisterAsBrowser(IWebBrowser2 *iface,
847 VARIANT_BOOL bRegister)
848 {
849 WebBrowser *This = WEBBROWSER_THIS(iface);
850
851 FIXME("(%p)->(%x)\n", This, bRegister);
852
853 This->register_browser = bRegister ? VARIANT_TRUE : VARIANT_FALSE;
854 return S_OK;
855 }
856
857 static HRESULT WINAPI WebBrowser_get_RegisterAsDropTarget(IWebBrowser2 *iface,
858 VARIANT_BOOL *pbRegister)
859 {
860 WebBrowser *This = WEBBROWSER_THIS(iface);
861 FIXME("(%p)->(%p)\n", This, pbRegister);
862 *pbRegister=0;
863 return S_OK;
864 }
865
866 static HRESULT WINAPI WebBrowser_put_RegisterAsDropTarget(IWebBrowser2 *iface,
867 VARIANT_BOOL bRegister)
868 {
869 WebBrowser *This = WEBBROWSER_THIS(iface);
870 FIXME("(%p)->(%x)\n", This, bRegister);
871 return S_OK;
872 }
873
874 static HRESULT WINAPI WebBrowser_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
875 {
876 WebBrowser *This = WEBBROWSER_THIS(iface);
877
878 TRACE("(%p)->(%p)\n", This, pbRegister);
879
880 *pbRegister = This->theater_mode;
881 return S_OK;
882 }
883
884 static HRESULT WINAPI WebBrowser_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
885 {
886 WebBrowser *This = WEBBROWSER_THIS(iface);
887 VARIANTARG arg;
888 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
889
890 TRACE("(%p)->(%x)\n", This, bRegister);
891
892 This->theater_mode = bRegister ? VARIANT_TRUE : VARIANT_FALSE;
893
894 /* In opposition to InternetExplorer, all we should do here is
895 * inform the embedder about the theater mode change. */
896
897 V_VT(&arg) = VT_BOOL;
898 V_BOOL(&arg) = bRegister;
899 call_sink(This->doc_host.cps.wbe2, DISPID_ONTHEATERMODE, &dispparams);
900
901 return S_OK;
902 }
903
904 static HRESULT WINAPI WebBrowser_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
905 {
906 WebBrowser *This = WEBBROWSER_THIS(iface);
907
908 TRACE("(%p)->(%p)\n", This, Value);
909
910 *Value = This->address_bar;
911 return S_OK;
912 }
913
914 static HRESULT WINAPI WebBrowser_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
915 {
916 WebBrowser *This = WEBBROWSER_THIS(iface);
917 VARIANTARG arg;
918 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
919
920 TRACE("(%p)->(%x)\n", This, Value);
921
922 This->address_bar = Value ? VARIANT_TRUE : VARIANT_FALSE;
923
924 /* In opposition to InternetExplorer, all we should do here is
925 * inform the embedder about the address bar change. */
926
927 V_VT(&arg) = VT_BOOL;
928 V_BOOL(&arg) = Value;
929 call_sink(This->doc_host.cps.wbe2, DISPID_ONADDRESSBAR, &dispparams);
930
931 return S_OK;
932 }
933
934 static HRESULT WINAPI WebBrowser_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
935 {
936 WebBrowser *This = WEBBROWSER_THIS(iface);
937
938 TRACE("(%p)->(%p)\n", This, Value);
939
940 /* It's InternetExplorer object's method. We have nothing to do here. */
941 return E_NOTIMPL;
942 }
943
944 static HRESULT WINAPI WebBrowser_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
945 {
946 WebBrowser *This = WEBBROWSER_THIS(iface);
947 VARIANTARG arg;
948 DISPPARAMS dispparams = {&arg, NULL, 1, 0};
949
950 TRACE("(%p)->(%x)\n", This, Value);
951
952 /* In opposition to InternetExplorer, all we should do here is
953 * inform the embedder about the resizable change. */
954
955 V_VT(&arg) = VT_BOOL;
956 V_BOOL(&arg) = Value;
957 call_sink(This->doc_host.cps.wbe2, DISPID_WINDOWSETRESIZABLE, &dispparams);
958
959 return S_OK;
960 }
961
962 #undef WEBBROWSER_THIS
963
964 static const IWebBrowser2Vtbl WebBrowser2Vtbl =
965 {
966 WebBrowser_QueryInterface,
967 WebBrowser_AddRef,
968 WebBrowser_Release,
969 WebBrowser_GetTypeInfoCount,
970 WebBrowser_GetTypeInfo,
971 WebBrowser_GetIDsOfNames,
972 WebBrowser_Invoke,
973 WebBrowser_GoBack,
974 WebBrowser_GoForward,
975 WebBrowser_GoHome,
976 WebBrowser_GoSearch,
977 WebBrowser_Navigate,
978 WebBrowser_Refresh,
979 WebBrowser_Refresh2,
980 WebBrowser_Stop,
981 WebBrowser_get_Application,
982 WebBrowser_get_Parent,
983 WebBrowser_get_Container,
984 WebBrowser_get_Document,
985 WebBrowser_get_TopLevelContainer,
986 WebBrowser_get_Type,
987 WebBrowser_get_Left,
988 WebBrowser_put_Left,
989 WebBrowser_get_Top,
990 WebBrowser_put_Top,
991 WebBrowser_get_Width,
992 WebBrowser_put_Width,
993 WebBrowser_get_Height,
994 WebBrowser_put_Height,
995 WebBrowser_get_LocationName,
996 WebBrowser_get_LocationURL,
997 WebBrowser_get_Busy,
998 WebBrowser_Quit,
999 WebBrowser_ClientToWindow,
1000 WebBrowser_PutProperty,
1001 WebBrowser_GetProperty,
1002 WebBrowser_get_Name,
1003 WebBrowser_get_HWND,
1004 WebBrowser_get_FullName,
1005 WebBrowser_get_Path,
1006 WebBrowser_get_Visible,
1007 WebBrowser_put_Visible,
1008 WebBrowser_get_StatusBar,
1009 WebBrowser_put_StatusBar,
1010 WebBrowser_get_StatusText,
1011 WebBrowser_put_StatusText,
1012 WebBrowser_get_ToolBar,
1013 WebBrowser_put_ToolBar,
1014 WebBrowser_get_MenuBar,
1015 WebBrowser_put_MenuBar,
1016 WebBrowser_get_FullScreen,
1017 WebBrowser_put_FullScreen,
1018 WebBrowser_Navigate2,
1019 WebBrowser_QueryStatusWB,
1020 WebBrowser_ExecWB,
1021 WebBrowser_ShowBrowserBar,
1022 WebBrowser_get_ReadyState,
1023 WebBrowser_get_Offline,
1024 WebBrowser_put_Offline,
1025 WebBrowser_get_Silent,
1026 WebBrowser_put_Silent,
1027 WebBrowser_get_RegisterAsBrowser,
1028 WebBrowser_put_RegisterAsBrowser,
1029 WebBrowser_get_RegisterAsDropTarget,
1030 WebBrowser_put_RegisterAsDropTarget,
1031 WebBrowser_get_TheaterMode,
1032 WebBrowser_put_TheaterMode,
1033 WebBrowser_get_AddressBar,
1034 WebBrowser_put_AddressBar,
1035 WebBrowser_get_Resizable,
1036 WebBrowser_put_Resizable
1037 };
1038
1039 #define SERVPROV_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface)
1040 /*
1041 * IServiceProvider interface.
1042 */
1043 static HRESULT WINAPI WebBrowser_IServiceProvider_QueryInterface(IServiceProvider *iface,
1044 REFIID riid, LPVOID *ppv)
1045 {
1046 WebBrowser *This = SERVPROV_THIS(iface);
1047
1048 if (ppv == NULL)
1049 return E_POINTER;
1050 *ppv = NULL;
1051
1052 if(IsEqualGUID(&IID_IUnknown, riid)) {
1053 *ppv = WEBBROWSER(This);
1054 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
1055 }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
1056 *ppv = WEBBROWSER(This);
1057 TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
1058 }
1059
1060 if(*ppv) {
1061 IUnknown_AddRef((IUnknown*)*ppv);
1062 return S_OK;
1063 }
1064
1065 FIXME("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
1066 return E_NOINTERFACE;
1067 }
1068
1069 static ULONG WINAPI WebBrowser_IServiceProvider_AddRef(IServiceProvider *iface)
1070 {
1071 WebBrowser *This = SERVPROV_THIS(iface);
1072 return IWebBrowser_AddRef(WEBBROWSER(This));
1073 }
1074
1075 static ULONG WINAPI WebBrowser_IServiceProvider_Release(IServiceProvider *iface)
1076 {
1077 WebBrowser *This = SERVPROV_THIS(iface);
1078 return IWebBrowser_Release(WEBBROWSER(This));
1079 }
1080
1081 static HRESULT STDMETHODCALLTYPE WebBrowser_IServiceProvider_QueryService(IServiceProvider *iface,
1082 REFGUID guidService, REFIID riid, void **ppv)
1083 {
1084 WebBrowser *This = SERVPROV_THIS(iface);
1085 static const IID IID_IBrowserService2 =
1086 {0x68BD21CC,0x438B,0x11d2,{0xA5,0x60,0x00,0xA0,0xC,0x2D,0xBF,0xE8}};
1087
1088 if(*ppv)
1089 ppv = NULL;
1090
1091 if(IsEqualGUID(&IID_IBrowserService2, riid)) {
1092 TRACE("(%p)->(IID_IBrowserService2 return E_FAIL)\n", This);
1093 return E_FAIL;
1094 }
1095
1096 FIXME("(%p)->(%s, %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
1097
1098 return E_NOINTERFACE;
1099 }
1100
1101 #undef SERVPROV_THIS
1102
1103 static const IServiceProviderVtbl ServiceProviderVtbl =
1104 {
1105 WebBrowser_IServiceProvider_QueryInterface,
1106 WebBrowser_IServiceProvider_AddRef,
1107 WebBrowser_IServiceProvider_Release,
1108 WebBrowser_IServiceProvider_QueryService
1109 };
1110
1111 static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv)
1112 {
1113 WebBrowser *ret;
1114 HRESULT hres;
1115
1116 TRACE("(%p %s %p) version=%d\n", pOuter, debugstr_guid(riid), ppv, version);
1117
1118 ret = heap_alloc(sizeof(WebBrowser));
1119
1120 ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
1121 ret->lpServiceProviderVtbl = &ServiceProviderVtbl;
1122 ret->ref = 0;
1123 ret->version = version;
1124
1125 DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
1126
1127 ret->register_browser = VARIANT_FALSE;
1128 ret->visible = VARIANT_TRUE;
1129 ret->menu_bar = VARIANT_TRUE;
1130 ret->address_bar = VARIANT_TRUE;
1131 ret->status_bar = VARIANT_TRUE;
1132 ret->tool_bar = VARIANT_TRUE;
1133 ret->full_screen = VARIANT_FALSE;
1134 ret->theater_mode = VARIANT_FALSE;
1135
1136 WebBrowser_OleObject_Init(ret);
1137 WebBrowser_ViewObject_Init(ret);
1138 WebBrowser_Persist_Init(ret);
1139 WebBrowser_ClassInfo_Init(ret);
1140 WebBrowser_HlinkFrame_Init(ret);
1141
1142 hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
1143 if(SUCCEEDED(hres)) {
1144 SHDOCVW_LockModule();
1145 }else {
1146 heap_free(ret);
1147 return hres;
1148 }
1149
1150 return hres;
1151 }
1152
1153 HRESULT WebBrowserV1_Create(IUnknown *pOuter, REFIID riid, void **ppv)
1154 {
1155 return WebBrowser_Create(1, pOuter, riid, ppv);
1156 }
1157
1158 HRESULT WebBrowserV2_Create(IUnknown *pOuter, REFIID riid, void **ppv)
1159 {
1160 return WebBrowser_Create(2, pOuter, riid, ppv);
1161 }