windowscodecs: Implement MetadataReaderInfo_GetSpecVersion.
[wine/multimedia.git] / dlls / mshtml / htmlobject.c
blobfdd66146dd50f2001fe2a4cd7720c3f0576a2e10
1 /*
2 * Copyright 2010 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 <stdarg.h>
20 #include <assert.h>
22 #define COBJMACROS
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "winreg.h"
28 #include "ole2.h"
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "pluginhost.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
37 typedef struct {
38 HTMLPluginContainer plugin_container;
40 IHTMLObjectElement IHTMLObjectElement_iface;
41 IHTMLObjectElement2 IHTMLObjectElement2_iface;
43 nsIDOMHTMLObjectElement *nsobject;
44 } HTMLObjectElement;
46 static inline HTMLObjectElement *impl_from_IHTMLObjectElement(IHTMLObjectElement *iface)
48 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement_iface);
51 static HRESULT WINAPI HTMLObjectElement_QueryInterface(IHTMLObjectElement *iface,
52 REFIID riid, void **ppv)
54 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
56 return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
57 riid, ppv);
60 static ULONG WINAPI HTMLObjectElement_AddRef(IHTMLObjectElement *iface)
62 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
64 return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
67 static ULONG WINAPI HTMLObjectElement_Release(IHTMLObjectElement *iface)
69 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
71 return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
74 static HRESULT WINAPI HTMLObjectElement_GetTypeInfoCount(IHTMLObjectElement *iface, UINT *pctinfo)
76 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
77 return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
78 pctinfo);
81 static HRESULT WINAPI HTMLObjectElement_GetTypeInfo(IHTMLObjectElement *iface, UINT iTInfo,
82 LCID lcid, ITypeInfo **ppTInfo)
84 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
85 return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
86 iTInfo, lcid, ppTInfo);
89 static HRESULT WINAPI HTMLObjectElement_GetIDsOfNames(IHTMLObjectElement *iface, REFIID riid,
90 LPOLESTR *rgszNames, UINT cNames,
91 LCID lcid, DISPID *rgDispId)
93 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
94 return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
95 riid, rgszNames, cNames, lcid, rgDispId);
98 static HRESULT WINAPI HTMLObjectElement_Invoke(IHTMLObjectElement *iface, DISPID dispIdMember,
99 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
100 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
102 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
103 return IDispatchEx_Invoke(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
104 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
107 static HRESULT WINAPI HTMLObjectElement_get_object(IHTMLObjectElement *iface, IDispatch **p)
109 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
111 TRACE("(%p)->(%p)\n", This, p);
113 return get_plugin_disp(&This->plugin_container, p);
116 static HRESULT WINAPI HTMLObjectElement_get_classid(IHTMLObjectElement *iface, BSTR *p)
118 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
120 TRACE("(%p)->(%p)\n", This, p);
122 return IHTMLObjectElement2_get_classid(&This->IHTMLObjectElement_iface, p);
125 static HRESULT WINAPI HTMLObjectElement_get_data(IHTMLObjectElement *iface, BSTR *p)
127 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
129 TRACE("(%p)->(%p)\n", This, p);
131 return IHTMLObjectElement2_get_data(&This->IHTMLObjectElement_iface, p);
134 static HRESULT WINAPI HTMLObjectElement_put_recordset(IHTMLObjectElement *iface, IDispatch *v)
136 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
137 FIXME("(%p)->(%p)\n", This, v);
138 return E_NOTIMPL;
141 static HRESULT WINAPI HTMLObjectElement_get_recordset(IHTMLObjectElement *iface, IDispatch **p)
143 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
144 FIXME("(%p)->(%p)\n", This, p);
145 return E_NOTIMPL;
148 static HRESULT WINAPI HTMLObjectElement_put_align(IHTMLObjectElement *iface, BSTR v)
150 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
151 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
152 return E_NOTIMPL;
155 static HRESULT WINAPI HTMLObjectElement_get_align(IHTMLObjectElement *iface, BSTR *p)
157 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
158 FIXME("(%p)->(%p)\n", This, p);
159 return E_NOTIMPL;
162 static HRESULT WINAPI HTMLObjectElement_put_name(IHTMLObjectElement *iface, BSTR v)
164 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
165 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
166 return E_NOTIMPL;
169 static HRESULT WINAPI HTMLObjectElement_get_name(IHTMLObjectElement *iface, BSTR *p)
171 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
172 FIXME("(%p)->(%p)\n", This, p);
173 return E_NOTIMPL;
176 static HRESULT WINAPI HTMLObjectElement_put_codeBase(IHTMLObjectElement *iface, BSTR v)
178 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
179 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
180 return E_NOTIMPL;
183 static HRESULT WINAPI HTMLObjectElement_get_codeBase(IHTMLObjectElement *iface, BSTR *p)
185 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
186 FIXME("(%p)->(%p)\n", This, p);
187 return E_NOTIMPL;
190 static HRESULT WINAPI HTMLObjectElement_put_codeType(IHTMLObjectElement *iface, BSTR v)
192 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
193 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
194 return E_NOTIMPL;
197 static HRESULT WINAPI HTMLObjectElement_get_codeType(IHTMLObjectElement *iface, BSTR *p)
199 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
200 FIXME("(%p)->(%p)\n", This, p);
201 return E_NOTIMPL;
204 static HRESULT WINAPI HTMLObjectElement_put_code(IHTMLObjectElement *iface, BSTR v)
206 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
207 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
208 return E_NOTIMPL;
211 static HRESULT WINAPI HTMLObjectElement_get_code(IHTMLObjectElement *iface, BSTR *p)
213 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
214 FIXME("(%p)->(%p)\n", This, p);
215 return E_NOTIMPL;
218 static HRESULT WINAPI HTMLObjectElement_get_BaseHref(IHTMLObjectElement *iface, BSTR *p)
220 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
221 FIXME("(%p)->(%p)\n", This, p);
222 return E_NOTIMPL;
225 static HRESULT WINAPI HTMLObjectElement_put_type(IHTMLObjectElement *iface, BSTR v)
227 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
228 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
229 return E_NOTIMPL;
232 static HRESULT WINAPI HTMLObjectElement_get_type(IHTMLObjectElement *iface, BSTR *p)
234 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
235 FIXME("(%p)->(%p)\n", This, p);
236 return E_NOTIMPL;
239 static HRESULT WINAPI HTMLObjectElement_get_form(IHTMLObjectElement *iface, IHTMLFormElement **p)
241 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
242 FIXME("(%p)->(%p)\n", This, p);
243 return E_NOTIMPL;
246 static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VARIANT v)
248 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
249 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
250 return E_NOTIMPL;
253 static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
255 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
256 FIXME("(%p)->(%p)\n", This, p);
257 return E_NOTIMPL;
260 static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)
262 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
263 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
264 return E_NOTIMPL;
267 static HRESULT WINAPI HTMLObjectElement_get_height(IHTMLObjectElement *iface, VARIANT *p)
269 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
270 FIXME("(%p)->(%p)\n", This, p);
271 return E_NOTIMPL;
274 static HRESULT WINAPI HTMLObjectElement_get_readyState(IHTMLObjectElement *iface, LONG *p)
276 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
277 FIXME("(%p)->(%p)\n", This, p);
278 return E_NOTIMPL;
281 static HRESULT WINAPI HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement *iface, VARIANT v)
283 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
284 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
285 return E_NOTIMPL;
288 static HRESULT WINAPI HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement *iface, VARIANT *p)
290 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
291 FIXME("(%p)->(%p)\n", This, p);
292 return E_NOTIMPL;
295 static HRESULT WINAPI HTMLObjectElement_put_onerror(IHTMLObjectElement *iface, VARIANT v)
297 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
298 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
299 return E_NOTIMPL;
302 static HRESULT WINAPI HTMLObjectElement_get_onerror(IHTMLObjectElement *iface, VARIANT *p)
304 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
305 FIXME("(%p)->(%p)\n", This, p);
306 return E_NOTIMPL;
309 static HRESULT WINAPI HTMLObjectElement_put_altHtml(IHTMLObjectElement *iface, BSTR v)
311 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
312 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
313 return E_NOTIMPL;
316 static HRESULT WINAPI HTMLObjectElement_get_altHtml(IHTMLObjectElement *iface, BSTR *p)
318 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
319 FIXME("(%p)->(%p)\n", This, p);
320 return E_NOTIMPL;
323 static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LONG v)
325 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
326 FIXME("(%p)->(%d)\n", This, v);
327 return E_NOTIMPL;
330 static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
332 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
333 PRInt32 vspace;
334 nsresult nsres;
336 TRACE("(%p)->(%p)\n", This, p);
338 nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, &vspace);
339 if(NS_FAILED(nsres)) {
340 ERR("GetVspace failed: %08x\n", nsres);
341 return E_FAIL;
344 *p = vspace;
345 return S_OK;
348 static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
350 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
351 FIXME("(%p)->(%d)\n", This, v);
352 return E_NOTIMPL;
355 static HRESULT WINAPI HTMLObjectElement_get_hspace(IHTMLObjectElement *iface, LONG *p)
357 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
358 FIXME("(%p)->(%p)\n", This, p);
359 return E_NOTIMPL;
362 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
363 HTMLObjectElement_QueryInterface,
364 HTMLObjectElement_AddRef,
365 HTMLObjectElement_Release,
366 HTMLObjectElement_GetTypeInfoCount,
367 HTMLObjectElement_GetTypeInfo,
368 HTMLObjectElement_GetIDsOfNames,
369 HTMLObjectElement_Invoke,
370 HTMLObjectElement_get_object,
371 HTMLObjectElement_get_classid,
372 HTMLObjectElement_get_data,
373 HTMLObjectElement_put_recordset,
374 HTMLObjectElement_get_recordset,
375 HTMLObjectElement_put_align,
376 HTMLObjectElement_get_align,
377 HTMLObjectElement_put_name,
378 HTMLObjectElement_get_name,
379 HTMLObjectElement_put_codeBase,
380 HTMLObjectElement_get_codeBase,
381 HTMLObjectElement_put_codeType,
382 HTMLObjectElement_get_codeType,
383 HTMLObjectElement_put_code,
384 HTMLObjectElement_get_code,
385 HTMLObjectElement_get_BaseHref,
386 HTMLObjectElement_put_type,
387 HTMLObjectElement_get_type,
388 HTMLObjectElement_get_form,
389 HTMLObjectElement_put_width,
390 HTMLObjectElement_get_width,
391 HTMLObjectElement_put_height,
392 HTMLObjectElement_get_height,
393 HTMLObjectElement_get_readyState,
394 HTMLObjectElement_put_onreadystatechange,
395 HTMLObjectElement_get_onreadystatechange,
396 HTMLObjectElement_put_onerror,
397 HTMLObjectElement_get_onerror,
398 HTMLObjectElement_put_altHtml,
399 HTMLObjectElement_get_altHtml,
400 HTMLObjectElement_put_vspace,
401 HTMLObjectElement_get_vspace,
402 HTMLObjectElement_put_hspace,
403 HTMLObjectElement_get_hspace
406 static inline HTMLObjectElement *impl_from_IHTMLObjectElement2(IHTMLObjectElement2 *iface)
408 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement2_iface);
411 static HRESULT WINAPI HTMLObjectElement2_QueryInterface(IHTMLObjectElement2 *iface,
412 REFIID riid, void **ppv)
414 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
416 return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
417 riid, ppv);
420 static ULONG WINAPI HTMLObjectElement2_AddRef(IHTMLObjectElement2 *iface)
422 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
424 return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
427 static ULONG WINAPI HTMLObjectElement2_Release(IHTMLObjectElement2 *iface)
429 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
431 return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
434 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2 *iface, UINT *pctinfo)
436 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
437 return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
438 pctinfo);
441 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2 *iface, UINT iTInfo,
442 LCID lcid, ITypeInfo **ppTInfo)
444 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
445 return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
446 iTInfo, lcid, ppTInfo);
449 static HRESULT WINAPI HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2 *iface, REFIID riid,
450 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
452 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
453 return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
454 riid, rgszNames, cNames, lcid, rgDispId);
457 static HRESULT WINAPI HTMLObjectElement2_Invoke(IHTMLObjectElement2 *iface, DISPID dispIdMember,
458 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
459 EXCEPINFO *pExcepInfo, UINT *puArgErr)
461 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
462 return IDispatchEx_Invoke(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
463 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
466 static HRESULT WINAPI HTMLObjectElement2_namedRecordset(IHTMLObjectElement2 *iface, BSTR dataMember,
467 VARIANT *hierarchy, IDispatch **ppRecordset)
469 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
470 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
471 return E_NOTIMPL;
474 static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface, BSTR v)
476 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
477 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
478 return E_NOTIMPL;
481 static HRESULT WINAPI HTMLObjectElement2_get_classid(IHTMLObjectElement2 *iface, BSTR *p)
483 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
484 FIXME("(%p)->(%p)\n", This, p);
485 return E_NOTIMPL;
488 static HRESULT WINAPI HTMLObjectElement2_put_data(IHTMLObjectElement2 *iface, BSTR v)
490 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
491 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
492 return E_NOTIMPL;
495 static HRESULT WINAPI HTMLObjectElement2_get_data(IHTMLObjectElement2 *iface, BSTR *p)
497 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
498 FIXME("(%p)->(%p)\n", This, p);
499 return E_NOTIMPL;
502 static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl = {
503 HTMLObjectElement2_QueryInterface,
504 HTMLObjectElement2_AddRef,
505 HTMLObjectElement2_Release,
506 HTMLObjectElement2_GetTypeInfoCount,
507 HTMLObjectElement2_GetTypeInfo,
508 HTMLObjectElement2_GetIDsOfNames,
509 HTMLObjectElement2_Invoke,
510 HTMLObjectElement2_namedRecordset,
511 HTMLObjectElement2_put_classid,
512 HTMLObjectElement2_get_classid,
513 HTMLObjectElement2_put_data,
514 HTMLObjectElement2_get_data
517 static inline HTMLObjectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
519 return CONTAINING_RECORD(iface, HTMLObjectElement, plugin_container.element.node);
522 static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
524 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
526 if(IsEqualGUID(&IID_IUnknown, riid)) {
527 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
528 *ppv = &This->IHTMLObjectElement_iface;
529 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
530 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
531 *ppv = &This->IHTMLObjectElement_iface;
532 }else if(IsEqualGUID(&IID_IHTMLObjectElement, riid)) {
533 TRACE("(%p)->(IID_IHTMLObjectElement %p)\n", This, ppv);
534 *ppv = &This->IHTMLObjectElement_iface;
535 }else if(IsEqualGUID(&IID_IHTMLObjectElement2, riid)) {
536 TRACE("(%p)->(IID_IHTMLObjectElement2 %p)\n", This, ppv);
537 *ppv = &This->IHTMLObjectElement2_iface;
538 }else if(IsEqualGUID(&IID_HTMLPluginContainer, riid)) {
539 TRACE("(%p)->(IID_HTMLPluginContainer %p)\n", This, ppv);
540 *ppv = &This->plugin_container;
541 return S_OK;
542 }else {
543 HRESULT hres;
545 hres = HTMLElement_QI(&This->plugin_container.element.node, riid, ppv);
546 if(hres == E_NOINTERFACE && This->plugin_container.plugin_host && This->plugin_container.plugin_host->plugin_unk) {
547 IUnknown *plugin_iface, *ret;
549 hres = IUnknown_QueryInterface(This->plugin_container.plugin_host->plugin_unk, riid, (void**)&plugin_iface);
550 if(hres == S_OK) {
551 hres = wrap_iface(plugin_iface, (IUnknown*)&This->IHTMLObjectElement_iface, &ret);
552 IUnknown_Release(plugin_iface);
553 if(FAILED(hres))
554 return hres;
556 TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface, ret);
557 *ppv = ret;
558 return S_OK;
562 return hres;
565 IUnknown_AddRef((IUnknown*)*ppv);
566 return S_OK;
569 static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
571 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
573 if(This->plugin_container.plugin_host)
574 detach_plugin_host(This->plugin_container.plugin_host);
576 HTMLElement_destructor(&This->plugin_container.element.node);
579 static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
581 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
582 FIXME("(%p)->(%p)\n", This, p);
583 return E_NOTIMPL;
586 static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
587 DWORD grfdex, DISPID *pid)
589 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
591 TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid);
593 return get_plugin_dispid(&This->plugin_container, name, pid);
596 static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
597 WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
599 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
601 TRACE("(%p)->(%d)\n", This, id);
603 return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei);
606 static const NodeImplVtbl HTMLObjectElementImplVtbl = {
607 HTMLObjectElement_QI,
608 HTMLObjectElement_destructor,
609 HTMLElement_clone,
610 HTMLElement_get_attr_col,
611 NULL,
612 NULL,
613 NULL,
614 NULL,
615 NULL,
616 NULL,
617 HTMLObjectElement_get_readystate,
618 HTMLObjectElement_get_dispid,
619 HTMLObjectElement_invoke
622 static const tid_t HTMLObjectElement_iface_tids[] = {
623 HTMLELEMENT_TIDS,
624 IHTMLObjectElement_tid,
625 IHTMLObjectElement2_tid,
628 static dispex_static_data_t HTMLObjectElement_dispex = {
629 NULL,
630 DispHTMLObjectElement_tid,
631 NULL,
632 HTMLObjectElement_iface_tids
635 HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
637 HTMLObjectElement *ret;
638 nsresult nsres;
640 ret = heap_alloc_zero(sizeof(*ret));
641 if(!ret)
642 return E_OUTOFMEMORY;
644 ret->IHTMLObjectElement_iface.lpVtbl = &HTMLObjectElementVtbl;
645 ret->IHTMLObjectElement2_iface.lpVtbl = &HTMLObjectElement2Vtbl;
646 ret->plugin_container.element.node.vtbl = &HTMLObjectElementImplVtbl;
648 HTMLElement_Init(&ret->plugin_container.element, doc, nselem, &HTMLObjectElement_dispex);
650 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
652 /* Share nsobject reference with nsnode */
653 assert(nsres == NS_OK && (nsIDOMNode*)ret->nsobject == ret->plugin_container.element.node.nsnode);
654 nsIDOMNode_Release(ret->plugin_container.element.node.nsnode);
656 *elem = &ret->plugin_container.element;
657 return S_OK;