2 * Copyright 2008 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
28 #include "wine/debug.h"
30 #include "mshtml_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
34 static ITypeLib
*typelib
;
35 static ITypeInfo
*typeinfos
[LAST_tid
];
37 static REFIID tid_ids
[] = {
41 HRESULT
get_typeinfo(tid_t tid
, ITypeInfo
**typeinfo
)
48 hres
= LoadRegTypeLib(&LIBID_MSHTML
, 4, 0, LOCALE_SYSTEM_DEFAULT
, &tl
);
50 ERR("LoadRegTypeLib failed: %08x\n", hres
);
54 if(InterlockedCompareExchangePointer((void**)&typelib
, tl
, NULL
))
61 hres
= ITypeLib_GetTypeInfoOfGuid(typelib
, tid_ids
[tid
], &typeinfo
);
63 ERR("GetTypeInfoOfGuid failed: %08x\n", hres
);
67 if(InterlockedCompareExchangePointer((void**)(typeinfos
+tid
), typeinfo
, NULL
))
68 ITypeInfo_Release(typeinfo
);
71 *typeinfo
= typeinfos
[tid
];
75 void release_typelib(void)
82 for(i
=0; i
< sizeof(typeinfos
)/sizeof(*typeinfos
); i
++)
84 ITypeInfo_Release(typeinfos
[i
]);
86 ITypeLib_Release(typelib
);
89 #define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
91 static HRESULT WINAPI
DispatchEx_QueryInterface(IDispatchEx
*iface
, REFIID riid
, void **ppv
)
93 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
95 return IUnknown_QueryInterface(This
->outer
, riid
, ppv
);
98 static ULONG WINAPI
DispatchEx_AddRef(IDispatchEx
*iface
)
100 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
102 return IUnknown_AddRef(This
->outer
);
105 static ULONG WINAPI
DispatchEx_Release(IDispatchEx
*iface
)
107 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
109 return IUnknown_Release(This
->outer
);
112 static HRESULT WINAPI
DispatchEx_GetTypeInfoCount(IDispatchEx
*iface
, UINT
*pctinfo
)
114 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
116 TRACE("(%p)->(%p)\n", This
, pctinfo
);
122 static HRESULT WINAPI
DispatchEx_GetTypeInfo(IDispatchEx
*iface
, UINT iTInfo
,
123 LCID lcid
, ITypeInfo
**ppTInfo
)
125 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
126 FIXME("(%p)->(%u %u %p)\n", This
, iTInfo
, lcid
, ppTInfo
);
130 static HRESULT WINAPI
DispatchEx_GetIDsOfNames(IDispatchEx
*iface
, REFIID riid
,
131 LPOLESTR
*rgszNames
, UINT cNames
,
132 LCID lcid
, DISPID
*rgDispId
)
134 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
135 FIXME("(%p)->(%s %p %u %u %p)\n", This
, debugstr_guid(riid
), rgszNames
, cNames
,
140 static HRESULT WINAPI
DispatchEx_Invoke(IDispatchEx
*iface
, DISPID dispIdMember
,
141 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
142 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
144 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
145 FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This
, dispIdMember
, debugstr_guid(riid
),
146 lcid
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
150 static HRESULT WINAPI
DispatchEx_GetDispID(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
, DISPID
*pid
)
152 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
153 FIXME("(%p)->(%s %x %p)\n", This
, debugstr_w(bstrName
), grfdex
, pid
);
157 static HRESULT WINAPI
DispatchEx_InvokeEx(IDispatchEx
*iface
, DISPID id
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pdp
,
158 VARIANT
*pvarRes
, EXCEPINFO
*pei
, IServiceProvider
*pspCaller
)
160 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
161 FIXME("(%p)->(%x %x %x %p %p %p %p)\n", This
, id
, lcid
, wFlags
, pdp
, pvarRes
, pei
, pspCaller
);
165 static HRESULT WINAPI
DispatchEx_DeleteMemberByName(IDispatchEx
*iface
, BSTR bstrName
, DWORD grfdex
)
167 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
168 FIXME("(%p)->(%s %x)\n", This
, debugstr_w(bstrName
), grfdex
);
172 static HRESULT WINAPI
DispatchEx_DeleteMemberByDispID(IDispatchEx
*iface
, DISPID id
)
174 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
175 FIXME("(%p)->(%x)\n", This
, id
);
179 static HRESULT WINAPI
DispatchEx_GetMemberProperties(IDispatchEx
*iface
, DISPID id
, DWORD grfdexFetch
, DWORD
*pgrfdex
)
181 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
182 FIXME("(%p)->(%x %x %p)\n", This
, id
, grfdexFetch
, pgrfdex
);
186 static HRESULT WINAPI
DispatchEx_GetMemberName(IDispatchEx
*iface
, DISPID id
, BSTR
*pbstrName
)
188 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
189 FIXME("(%p)->(%x %p)\n", This
, id
, pbstrName
);
193 static HRESULT WINAPI
DispatchEx_GetNextDispID(IDispatchEx
*iface
, DWORD grfdex
, DISPID id
, DISPID
*pid
)
195 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
196 FIXME("(%p)->(%x %x %p)\n", This
, grfdex
, id
, pid
);
200 static HRESULT WINAPI
DispatchEx_GetNameSpaceParent(IDispatchEx
*iface
, IUnknown
**ppunk
)
202 DispatchEx
*This
= DISPATCHEX_THIS(iface
);
203 FIXME("(%p)->(%p)\n", This
, ppunk
);
207 #undef DISPATCHEX_THIS
209 static IDispatchExVtbl DispatchExVtbl
= {
210 DispatchEx_QueryInterface
,
213 DispatchEx_GetTypeInfoCount
,
214 DispatchEx_GetTypeInfo
,
215 DispatchEx_GetIDsOfNames
,
217 DispatchEx_GetDispID
,
219 DispatchEx_DeleteMemberByName
,
220 DispatchEx_DeleteMemberByDispID
,
221 DispatchEx_GetMemberProperties
,
222 DispatchEx_GetMemberName
,
223 DispatchEx_GetNextDispID
,
224 DispatchEx_GetNameSpaceParent
227 void init_dispex(DispatchEx
*dispex
, IUnknown
*outer
)
229 dispex
->lpIDispatchExVtbl
= &DispatchExVtbl
;
230 dispex
->outer
= outer
;