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
30 #include "wine/debug.h"
32 #include "mshtml_private.h"
33 #include "pluginhost.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
38 HTMLPluginContainer plugin_container;
40 IHTMLObjectElement IHTMLObjectElement_iface;
41 IHTMLObjectElement2 IHTMLObjectElement2_iface;
43 nsIDOMHTMLObjectElement *nsobject;
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,
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,
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->IHTMLObjectElement2_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->IHTMLObjectElement2_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);
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);
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));
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);
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));
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);
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));
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);
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));
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);
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));
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);
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);
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));
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);
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);
246 static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VARIANT v)
248 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
253 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
257 static const WCHAR formatW[] = {'%','d',0};
258 sprintfW(buf, formatW, V_I4(&v));
262 FIXME("unimplemented for arg %s\n", debugstr_variant(&v));
266 nsAString_InitDepend(&width_str, buf);
267 nsres = nsIDOMHTMLObjectElement_SetWidth(This->nsobject, &width_str);
268 nsAString_Finish(&width_str);
269 if(NS_FAILED(nsres)) {
270 FIXME("SetWidth failed: %08x\n", nsres);
274 notif_container_change(&This->plugin_container, DISPID_UNKNOWN);
278 static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
280 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
285 TRACE("(%p)->(%p)\n", This, p);
287 nsAString_Init(&width_str, NULL);
288 nsres = nsIDOMHTMLObjectElement_GetWidth(This->nsobject, &width_str);
289 if(NS_SUCCEEDED(nsres)) {
290 const PRUnichar *width;
292 nsAString_GetData(&width_str, &width);
294 V_BSTR(p) = SysAllocString(width);
295 hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
297 ERR("GetWidth failed: %08x\n", nsres);
301 nsAString_Finish(&width_str);
305 static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)
307 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
308 nsAString height_str;
312 TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
316 static const WCHAR formatW[] = {'%','d',0};
317 sprintfW(buf, formatW, V_I4(&v));
321 FIXME("unimplemented for arg %s\n", debugstr_variant(&v));
325 nsAString_InitDepend(&height_str, buf);
326 nsres = nsIDOMHTMLObjectElement_SetHeight(This->nsobject, &height_str);
327 nsAString_Finish(&height_str);
328 if(NS_FAILED(nsres)) {
329 FIXME("SetHeight failed: %08x\n", nsres);
333 notif_container_change(&This->plugin_container, DISPID_UNKNOWN);
337 static HRESULT WINAPI HTMLObjectElement_get_height(IHTMLObjectElement *iface, VARIANT *p)
339 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
340 nsAString height_str;
344 TRACE("(%p)->(%p)\n", This, p);
346 nsAString_Init(&height_str, NULL);
347 nsres = nsIDOMHTMLObjectElement_GetHeight(This->nsobject, &height_str);
348 if(NS_SUCCEEDED(nsres)) {
349 const PRUnichar *height;
351 nsAString_GetData(&height_str, &height);
353 V_BSTR(p) = SysAllocString(height);
354 hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
356 ERR("GetHeight failed: %08x\n", nsres);
360 nsAString_Finish(&height_str);
364 static HRESULT WINAPI HTMLObjectElement_get_readyState(IHTMLObjectElement *iface, LONG *p)
366 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
367 FIXME("(%p)->(%p)\n", This, p);
371 static HRESULT WINAPI HTMLObjectElement_put_onreadystatechange(IHTMLObjectElement *iface, VARIANT v)
373 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
374 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
378 static HRESULT WINAPI HTMLObjectElement_get_onreadystatechange(IHTMLObjectElement *iface, VARIANT *p)
380 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
381 FIXME("(%p)->(%p)\n", This, p);
385 static HRESULT WINAPI HTMLObjectElement_put_onerror(IHTMLObjectElement *iface, VARIANT v)
387 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
388 FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
392 static HRESULT WINAPI HTMLObjectElement_get_onerror(IHTMLObjectElement *iface, VARIANT *p)
394 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
395 FIXME("(%p)->(%p)\n", This, p);
399 static HRESULT WINAPI HTMLObjectElement_put_altHtml(IHTMLObjectElement *iface, BSTR v)
401 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
402 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
406 static HRESULT WINAPI HTMLObjectElement_get_altHtml(IHTMLObjectElement *iface, BSTR *p)
408 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
409 FIXME("(%p)->(%p)\n", This, p);
413 static HRESULT WINAPI HTMLObjectElement_put_vspace(IHTMLObjectElement *iface, LONG v)
415 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
416 FIXME("(%p)->(%d)\n", This, v);
420 static HRESULT WINAPI HTMLObjectElement_get_vspace(IHTMLObjectElement *iface, LONG *p)
422 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
426 TRACE("(%p)->(%p)\n", This, p);
428 nsres = nsIDOMHTMLObjectElement_GetVspace(This->nsobject, &vspace);
429 if(NS_FAILED(nsres)) {
430 ERR("GetVspace failed: %08x\n", nsres);
438 static HRESULT WINAPI HTMLObjectElement_put_hspace(IHTMLObjectElement *iface, LONG v)
440 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
441 FIXME("(%p)->(%d)\n", This, v);
445 static HRESULT WINAPI HTMLObjectElement_get_hspace(IHTMLObjectElement *iface, LONG *p)
447 HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
448 FIXME("(%p)->(%p)\n", This, p);
452 static const IHTMLObjectElementVtbl HTMLObjectElementVtbl = {
453 HTMLObjectElement_QueryInterface,
454 HTMLObjectElement_AddRef,
455 HTMLObjectElement_Release,
456 HTMLObjectElement_GetTypeInfoCount,
457 HTMLObjectElement_GetTypeInfo,
458 HTMLObjectElement_GetIDsOfNames,
459 HTMLObjectElement_Invoke,
460 HTMLObjectElement_get_object,
461 HTMLObjectElement_get_classid,
462 HTMLObjectElement_get_data,
463 HTMLObjectElement_put_recordset,
464 HTMLObjectElement_get_recordset,
465 HTMLObjectElement_put_align,
466 HTMLObjectElement_get_align,
467 HTMLObjectElement_put_name,
468 HTMLObjectElement_get_name,
469 HTMLObjectElement_put_codeBase,
470 HTMLObjectElement_get_codeBase,
471 HTMLObjectElement_put_codeType,
472 HTMLObjectElement_get_codeType,
473 HTMLObjectElement_put_code,
474 HTMLObjectElement_get_code,
475 HTMLObjectElement_get_BaseHref,
476 HTMLObjectElement_put_type,
477 HTMLObjectElement_get_type,
478 HTMLObjectElement_get_form,
479 HTMLObjectElement_put_width,
480 HTMLObjectElement_get_width,
481 HTMLObjectElement_put_height,
482 HTMLObjectElement_get_height,
483 HTMLObjectElement_get_readyState,
484 HTMLObjectElement_put_onreadystatechange,
485 HTMLObjectElement_get_onreadystatechange,
486 HTMLObjectElement_put_onerror,
487 HTMLObjectElement_get_onerror,
488 HTMLObjectElement_put_altHtml,
489 HTMLObjectElement_get_altHtml,
490 HTMLObjectElement_put_vspace,
491 HTMLObjectElement_get_vspace,
492 HTMLObjectElement_put_hspace,
493 HTMLObjectElement_get_hspace
496 static inline HTMLObjectElement *impl_from_IHTMLObjectElement2(IHTMLObjectElement2 *iface)
498 return CONTAINING_RECORD(iface, HTMLObjectElement, IHTMLObjectElement2_iface);
501 static HRESULT WINAPI HTMLObjectElement2_QueryInterface(IHTMLObjectElement2 *iface,
502 REFIID riid, void **ppv)
504 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
506 return IHTMLDOMNode_QueryInterface(&This->plugin_container.element.node.IHTMLDOMNode_iface,
510 static ULONG WINAPI HTMLObjectElement2_AddRef(IHTMLObjectElement2 *iface)
512 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
514 return IHTMLDOMNode_AddRef(&This->plugin_container.element.node.IHTMLDOMNode_iface);
517 static ULONG WINAPI HTMLObjectElement2_Release(IHTMLObjectElement2 *iface)
519 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
521 return IHTMLDOMNode_Release(&This->plugin_container.element.node.IHTMLDOMNode_iface);
524 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfoCount(IHTMLObjectElement2 *iface, UINT *pctinfo)
526 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
527 return IDispatchEx_GetTypeInfoCount(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
531 static HRESULT WINAPI HTMLObjectElement2_GetTypeInfo(IHTMLObjectElement2 *iface, UINT iTInfo,
532 LCID lcid, ITypeInfo **ppTInfo)
534 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
535 return IDispatchEx_GetTypeInfo(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
536 iTInfo, lcid, ppTInfo);
539 static HRESULT WINAPI HTMLObjectElement2_GetIDsOfNames(IHTMLObjectElement2 *iface, REFIID riid,
540 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
542 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
543 return IDispatchEx_GetIDsOfNames(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
544 riid, rgszNames, cNames, lcid, rgDispId);
547 static HRESULT WINAPI HTMLObjectElement2_Invoke(IHTMLObjectElement2 *iface, DISPID dispIdMember,
548 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
549 EXCEPINFO *pExcepInfo, UINT *puArgErr)
551 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
552 return IDispatchEx_Invoke(&This->plugin_container.element.node.dispex.IDispatchEx_iface,
553 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
556 static HRESULT WINAPI HTMLObjectElement2_namedRecordset(IHTMLObjectElement2 *iface, BSTR dataMember,
557 VARIANT *hierarchy, IDispatch **ppRecordset)
559 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
560 FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(dataMember), hierarchy, ppRecordset);
564 static HRESULT WINAPI HTMLObjectElement2_put_classid(IHTMLObjectElement2 *iface, BSTR v)
566 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
567 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
571 static HRESULT WINAPI HTMLObjectElement2_get_classid(IHTMLObjectElement2 *iface, BSTR *p)
573 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
574 FIXME("(%p)->(%p)\n", This, p);
578 static HRESULT WINAPI HTMLObjectElement2_put_data(IHTMLObjectElement2 *iface, BSTR v)
580 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
581 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
585 static HRESULT WINAPI HTMLObjectElement2_get_data(IHTMLObjectElement2 *iface, BSTR *p)
587 HTMLObjectElement *This = impl_from_IHTMLObjectElement2(iface);
588 FIXME("(%p)->(%p)\n", This, p);
592 static const IHTMLObjectElement2Vtbl HTMLObjectElement2Vtbl = {
593 HTMLObjectElement2_QueryInterface,
594 HTMLObjectElement2_AddRef,
595 HTMLObjectElement2_Release,
596 HTMLObjectElement2_GetTypeInfoCount,
597 HTMLObjectElement2_GetTypeInfo,
598 HTMLObjectElement2_GetIDsOfNames,
599 HTMLObjectElement2_Invoke,
600 HTMLObjectElement2_namedRecordset,
601 HTMLObjectElement2_put_classid,
602 HTMLObjectElement2_get_classid,
603 HTMLObjectElement2_put_data,
604 HTMLObjectElement2_get_data
607 static inline HTMLObjectElement *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
609 return CONTAINING_RECORD(iface, HTMLObjectElement, plugin_container.element.node);
612 static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
614 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
616 if(IsEqualGUID(&IID_IUnknown, riid)) {
617 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
618 *ppv = &This->IHTMLObjectElement_iface;
619 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
620 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
621 *ppv = &This->IHTMLObjectElement_iface;
622 }else if(IsEqualGUID(&IID_IHTMLObjectElement, riid)) {
623 TRACE("(%p)->(IID_IHTMLObjectElement %p)\n", This, ppv);
624 *ppv = &This->IHTMLObjectElement_iface;
625 }else if(IsEqualGUID(&IID_IHTMLObjectElement2, riid)) {
626 TRACE("(%p)->(IID_IHTMLObjectElement2 %p)\n", This, ppv);
627 *ppv = &This->IHTMLObjectElement2_iface;
628 }else if(IsEqualGUID(&IID_HTMLPluginContainer, riid)) {
629 TRACE("(%p)->(IID_HTMLPluginContainer %p)\n", This, ppv);
630 *ppv = &This->plugin_container;
635 hres = HTMLElement_QI(&This->plugin_container.element.node, riid, ppv);
636 if(hres == E_NOINTERFACE && This->plugin_container.plugin_host && This->plugin_container.plugin_host->plugin_unk) {
637 IUnknown *plugin_iface, *ret;
639 hres = IUnknown_QueryInterface(This->plugin_container.plugin_host->plugin_unk, riid, (void**)&plugin_iface);
641 hres = wrap_iface(plugin_iface, (IUnknown*)&This->IHTMLObjectElement_iface, &ret);
642 IUnknown_Release(plugin_iface);
646 TRACE("returning plugin iface %p wrapped to %p\n", plugin_iface, ret);
655 IUnknown_AddRef((IUnknown*)*ppv);
659 static void HTMLObjectElement_destructor(HTMLDOMNode *iface)
661 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
663 if(This->plugin_container.plugin_host)
664 detach_plugin_host(This->plugin_container.plugin_host);
666 HTMLElement_destructor(&This->plugin_container.element.node);
669 static HRESULT HTMLObjectElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
671 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
672 FIXME("(%p)->(%p)\n", This, p);
676 static HRESULT HTMLObjectElement_get_dispid(HTMLDOMNode *iface, BSTR name,
677 DWORD grfdex, DISPID *pid)
679 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
681 TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(name), grfdex, pid);
683 return get_plugin_dispid(&This->plugin_container, name, pid);
686 static HRESULT HTMLObjectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid,
687 WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
689 HTMLObjectElement *This = impl_from_HTMLDOMNode(iface);
691 TRACE("(%p)->(%d)\n", This, id);
693 return invoke_plugin_prop(&This->plugin_container, id, lcid, flags, params, res, ei);
696 static const NodeImplVtbl HTMLObjectElementImplVtbl = {
697 HTMLObjectElement_QI,
698 HTMLObjectElement_destructor,
700 HTMLElement_handle_event,
701 HTMLElement_get_attr_col,
707 HTMLObjectElement_get_readystate,
708 HTMLObjectElement_get_dispid,
709 HTMLObjectElement_invoke
712 static const tid_t HTMLObjectElement_iface_tids[] = {
714 IHTMLObjectElement_tid,
715 IHTMLObjectElement2_tid,
718 static dispex_static_data_t HTMLObjectElement_dispex = {
720 DispHTMLObjectElement_tid,
722 HTMLObjectElement_iface_tids
725 HRESULT HTMLObjectElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
727 HTMLObjectElement *ret;
730 ret = heap_alloc_zero(sizeof(*ret));
732 return E_OUTOFMEMORY;
734 ret->IHTMLObjectElement_iface.lpVtbl = &HTMLObjectElementVtbl;
735 ret->IHTMLObjectElement2_iface.lpVtbl = &HTMLObjectElement2Vtbl;
736 ret->plugin_container.element.node.vtbl = &HTMLObjectElementImplVtbl;
738 HTMLElement_Init(&ret->plugin_container.element, doc, nselem, &HTMLObjectElement_dispex);
740 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLObjectElement, (void**)&ret->nsobject);
742 /* Share nsobject reference with nsnode */
743 assert(nsres == NS_OK && (nsIDOMNode*)ret->nsobject == ret->plugin_container.element.node.nsnode);
744 nsIDOMNode_Release(ret->plugin_container.element.node.nsnode);
746 *elem = &ret->plugin_container.element;