2 * This file defines the macros and types necessary to define COM interfaces,
3 * and the three most basic COM interfaces: IUnknown, IMalloc and IClassFactory.
5 * Copyright (C) 1999 Francois Gouget
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_WINE_OBJ_BASE_H
23 #define __WINE_WINE_OBJ_BASE_H
25 /*****************************************************************************
26 * define ICOM_MSVTABLE_COMPAT
27 * to implement the microsoft com vtable compatibility workaround for g++.
29 * NOTE: Turning this option on will produce a winelib that is incompatible
30 * with the binary emulator.
32 * If the compiler supports the com_interface attribute, leave this off, and
33 * define the ICOM_USE_COM_INTERFACE_ATTRIBUTE macro below. This may also
34 * require the addition of the -vtable-thunks option for g++.
36 * If you aren't interested in Winelib C++ compatibility at all, leave both
39 * The preferable method for using ICOM_USE_COM_INTERFACE_ATTRIBUTE macro
40 * would be to define it only for your Winelib application. This allows you
41 * to have both binary and Winelib compatibility for C and C++ at the same
44 /* #define ICOM_MSVTABLE_COMPAT 1 */
45 /* #define ICOM_USE_COM_INTERFACE_ATTRIBUTE 1 */
47 /*****************************************************************************
48 * Defines the basic types
58 #ifndef NONAMELESSSTRUCT
59 #define LISet32(li, v) ((li).HighPart = (v) < 0 ? -1 : 0, (li).LowPart = (v))
60 #define ULISet32(li, v) ((li).HighPart = 0, (li).LowPart = (v))
62 #define LISet32(li, v) ((li).s.HighPart = (v) < 0 ? -1 : 0, (li).s.LowPart = (v))
63 #define ULISet32(li, v) ((li).s.HighPart = 0, (li).s.LowPart = (v))
66 /*****************************************************************************
69 HRESULT WINAPI
StringFromCLSID16(REFCLSID id
, LPOLESTR16
*);
70 HRESULT WINAPI
StringFromCLSID(REFCLSID id
, LPOLESTR
*);
72 HRESULT WINAPI
CLSIDFromString16(LPCOLESTR16
, CLSID
*);
73 HRESULT WINAPI
CLSIDFromString(LPCOLESTR
, CLSID
*);
75 HRESULT WINAPI
CLSIDFromProgID16(LPCOLESTR16 progid
, LPCLSID riid
);
76 HRESULT WINAPI
CLSIDFromProgID(LPCOLESTR progid
, LPCLSID riid
);
78 HRESULT WINAPI
ProgIDFromCLSID(REFCLSID clsid
, LPOLESTR
*lplpszProgID
);
81 INT WINAPI
StringFromGUID2(REFGUID id
, LPOLESTR str
, INT cmax
);
84 /*****************************************************************************
85 * Macros to define a COM interface
88 * The goal of the following set of definitions is to provide a way to use the same
89 * header file definitions to provide both a C interface and a C++ object oriented
90 * interface to COM interfaces. The type of interface is selected automatically
91 * depending on the language but it is always possible to get the C interface in C++
92 * by defining CINTERFACE.
94 * It is based on the following assumptions:
95 * - all COM interfaces derive from IUnknown, this should not be a problem.
96 * - the header file only defines the interface, the actual fields are defined
97 * separately in the C file implementing the interface.
99 * The natural approach to this problem would be to make sure we get a C++ class and
100 * virtual methods in C++ and a structure with a table of pointer to functions in C.
101 * Unfortunately the layout of the virtual table is compiler specific, the layout of
102 * g++ virtual tables is not the same as that of an egcs virtual table which is not the
103 * same as that generated by Visual C+. There are workarounds to make the virtual tables
104 * compatible via padding but unfortunately the one which is imposed to the WINE emulator
105 * by the Windows binaries, i.e. the Visual C++ one, is the most compact of all.
107 * So the solution I finally adopted does not use virtual tables. Instead I use inline
108 * non virtual methods that dereference the method pointer themselves and perform the call.
110 * Let's take Direct3D as an example:
112 * #define ICOM_INTERFACE IDirect3D
113 * #define IDirect3D_METHODS \
114 * ICOM_METHOD1(HRESULT,Initialize, REFIID,) \
115 * ICOM_METHOD2(HRESULT,EnumDevices, LPD3DENUMDEVICESCALLBACK,, LPVOID,) \
116 * ICOM_METHOD2(HRESULT,CreateLight, LPDIRECT3DLIGHT*,, IUnknown*,) \
117 * ICOM_METHOD2(HRESULT,CreateMaterial,LPDIRECT3DMATERIAL*,, IUnknown*,) \
118 * ICOM_METHOD2(HRESULT,CreateViewport,LPDIRECT3DVIEWPORT*,, IUnknown*,) \
119 * ICOM_METHOD2(HRESULT,FindDevice, LPD3DFINDDEVICESEARCH,, LPD3DFINDDEVICERESULT,)
120 * #define IDirect3D_IMETHODS \
121 * IUnknown_IMETHODS \
123 * ICOM_DEFINE(IDirect3D,IUnknown)
124 * #undef ICOM_INTERFACE
126 * #ifdef ICOM_CINTERFACE
127 * // *** IUnknown methods *** //
128 * #define IDirect3D_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
129 * #define IDirect3D_AddRef(p) ICOM_CALL (AddRef,p)
130 * #define IDirect3D_Release(p) ICOM_CALL (Release,p)
131 * // *** IDirect3D methods *** //
132 * #define IDirect3D_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
133 * #define IDirect3D_EnumDevices(p,a,b) ICOM_CALL2(EnumDevice,p,a,b)
134 * #define IDirect3D_CreateLight(p,a,b) ICOM_CALL2(CreateLight,p,a,b)
135 * #define IDirect3D_CreateMaterial(p,a,b) ICOM_CALL2(CreateMaterial,p,a,b)
136 * #define IDirect3D_CreateViewport(p,a,b) ICOM_CALL2(CreateViewport,p,a,b)
137 * #define IDirect3D_FindDevice(p,a,b) ICOM_CALL2(FindDevice,p,a,b)
141 * - The ICOM_INTERFACE macro is used in the ICOM_METHOD macros to define the type of the 'this'
142 * pointer. Defining this macro here saves us the trouble of having to repeat the interface
143 * name everywhere. Note however that because of the way macros work, a macro like ICOM_METHOD1
144 * cannot use 'ICOM_INTERFACE##_VTABLE' because this would give 'ICOM_INTERFACE_VTABLE' and not
145 * 'IDirect3D_VTABLE'.
146 * - ICOM_METHODS defines the methods specific to this interface. It is then aggregated with the
147 * inherited methods to form ICOM_IMETHODS.
148 * - ICOM_IMETHODS defines the list of methods that are inheritable from this interface. It must
149 * be written manually (rather than using a macro to generate the equivalent code) to avoid
150 * macro recursion (which compilers don't like).
151 * - The ICOM_DEFINE finally declares all the structures necessary for the interface. We have to
152 * explicitly use the interface name for macro expansion reasons again.
153 * Inherited methods are inherited in C by using the IDirect3D_METHODS macro and the parent's
154 * Xxx_IMETHODS macro. In C++ we need only use the IDirect3D_METHODS since method inheritance
155 * is taken care of by the language.
156 * - In C++ the ICOM_METHOD macros generate a function prototype and a call to a function pointer
157 * method. This means using once 't1 p1, t2 p2, ...' and once 'p1, p2' without the types. The
158 * only way I found to handle this is to have one ICOM_METHOD macro per number of parameters and
159 * to have it take only the type information (with const if necessary) as parameters.
160 * The 'undef ICOM_INTERFACE' is here to remind you that using ICOM_INTERFACE in the following
161 * macros will not work. This time it's because the ICOM_CALL macro expansion is done only once
162 * the 'IDirect3D_Xxx' macro is expanded. And by that time ICOM_INTERFACE will be long gone
164 * - You may have noticed the double commas after each parameter type. This allows you to put the
165 * name of that parameter which I think is good for documentation. It is not required and since
166 * I did not know what to put there for this example (I could only find doc about IDirect3D2),
168 * - Finally the set of 'IDirect3D_Xxx' macros is a standard set of macros defined to ease access
169 * to the interface methods in C. Unfortunately I don't see any way to avoid having to duplicate
170 * the inherited method definitions there. This time I could have used a trick to use only one
171 * macro whatever the number of parameters but I prefered to have it work the same way as above.
172 * - You probably have noticed that we don't define the fields we need to actually implement this
173 * interface: reference count, pointer to other resources and miscellaneous fields. That's
174 * because these interfaces are just that: interfaces. They may be implemented more than once, in
175 * different contexts and sometimes not even in Wine. Thus it would not make sense to impose
176 * that the interface contains some specific fields.
180 * typedef struct IDirect3DVtbl IDirect3DVtbl;
182 * IDirect3DVtbl* lpVtbl;
184 * struct IDirect3DVtbl {
185 * HRESULT (*QueryInterface)(IDirect3D* me, REFIID riid, LPVOID* ppvObj);
186 * ULONG (*QueryInterface)(IDirect3D* me);
187 * ULONG (*QueryInterface)(IDirect3D* me);
188 * HRESULT (*Initialize)(IDirect3D* me, REFIID a);
189 * HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
190 * HRESULT (*CreateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
191 * HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
192 * HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
193 * HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
196 * #ifdef ICOM_CINTERFACE
197 * // *** IUnknown methods *** //
198 * #define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
199 * #define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
200 * #define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
201 * // *** IDirect3D methods *** //
202 * #define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
203 * #define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevice(p,a,b)
204 * #define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
205 * #define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
206 * #define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
207 * #define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
211 * - IDirect3D only contains a pointer to the IDirect3D virtual/jump table. This is the only thing
212 * the user needs to know to use the interface. Of course the structure we will define to
213 * implement this interface will have more fields but the first one will match this pointer.
214 * - The code generated by ICOM_DEFINE defines both the structure representing the interface and
215 * the structure for the jump table. ICOM_DEFINE uses the parent's Xxx_IMETHODS macro to
216 * automatically repeat the prototypes of all the inherited methods and then uses IDirect3D_METHODS
217 * to define the IDirect3D methods.
218 * - Each method is declared as a pointer to function field in the jump table. The implementation
219 * will fill this jump table with appropriate values, probably using a static variable, and
220 * initialize the lpVtbl field to point to this variable.
221 * - The IDirect3D_Xxx macros then just derefence the lpVtbl pointer and use the function pointer
222 * corresponding to the macro name. This emulates the behavior of a virtual table and should be
224 * - This C code should be quite compatible with the Windows headers both for code that uses COM
225 * interfaces and for code implementing a COM interface.
228 * And in C++ (with gcc's g++):
230 * typedef struct IDirect3D: public IUnknown {
231 * private: HRESULT (*Initialize)(IDirect3D* me, REFIID a);
232 * public: inline HRESULT Initialize(REFIID a) { return ((IDirect3D*)t.lpVtbl)->Initialize(this,a); };
233 * private: HRESULT (*EnumDevices)(IDirect3D* me, LPD3DENUMDEVICESCALLBACK a, LPVOID b);
234 * public: inline HRESULT EnumDevices(LPD3DENUMDEVICESCALLBACK a, LPVOID b)
235 * { return ((IDirect3D*)t.lpVtbl)->EnumDevices(this,a,b); };
236 * private: HRESULT (*freateLight)(IDirect3D* me, LPDIRECT3DLIGHT* a, IUnknown* b);
237 * public: inline HRESULT CreateLight(LPDIRECT3DLIGHT* a, IUnknown* b)
238 * { return ((IDirect3D*)t.lpVtbl)->CreateLight(this,a,b); };
239 * private: HRESULT (*CreateMaterial)(IDirect3D* me, LPDIRECT3DMATERIAL* a, IUnknown* b);
240 * public: inline HRESULT CreateMaterial(LPDIRECT3DMATERIAL* a, IUnknown* b)
241 * { return ((IDirect3D*)t.lpVtbl)->CreateMaterial(this,a,b); };
242 * private: HRESULT (*CreateViewport)(IDirect3D* me, LPDIRECT3DVIEWPORT* a, IUnknown* b);
243 * public: inline HRESULT CreateViewport(LPDIRECT3DVIEWPORT* a, IUnknown* b)
244 * { return ((IDirect3D*)t.lpVtbl)->CreateViewport(this,a,b); };
245 * private: HRESULT (*FindDevice)(IDirect3D* me, LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b);
246 * public: inline HRESULT FindDevice(LPD3DFINDDEVICESEARCH a, LPD3DFINDDEVICERESULT b)
247 * { return ((IDirect3D*)t.lpVtbl)->FindDevice(this,a,b); };
251 * - In C++ IDirect3D does double duty as both the virtual/jump table and as the interface
252 * definition. The reason for this is to avoid having to duplicate the mehod definitions: once
253 * to have the function pointers in the jump table and once to have the methods in the interface
254 * class. Here one macro can generate both. This means though that the first pointer, t.lpVtbl
255 * defined in IUnknown, must be interpreted as the jump table pointer if we interpret the
256 * structure as the the interface class, and as the function pointer to the QueryInterface
257 * method, t.QueryInterface, if we interpret the structure as the jump table. Fortunately this
258 * gymnastic is entirely taken care of in the header of IUnknown.
259 * - Of course in C++ we use inheritance so that we don't have to duplicate the method definitions.
260 * - Since IDirect3D does double duty, each ICOM_METHOD macro defines both a function pointer and
261 * a non-vritual inline method which dereferences it and calls it. This way this method behaves
262 * just like a virtual method but does not create a true C++ virtual table which would break the
263 * structure layout. If you look at the implementation of these methods you'll notice that they
264 * would not work for void functions. We have to return something and fortunately this seems to
265 * be what all the COM methods do (otherwise we would need another set of macros).
266 * - Note how the ICOM_METHOD generates both function prototypes mixing types and formal parameter
267 * names and the method invocation using only the formal parameter name. This is the reason why
268 * we need different macros to handle different numbers of parameters.
269 * - Finally there is no IDirect3D_Xxx macro. These are not needed in C++ unless the CINTERFACE
270 * macro is defined in which case we would not be here.
271 * - This C++ code works well for code that just uses COM interfaces. But it will not work with
272 * C++ code implement a COM interface. That's because such code assumes the interface methods
273 * are declared as virtual C++ methods which is not the case here.
276 * Implementing a COM interface.
278 * This continues the above example. This example assumes that the implementation is in C.
280 * typedef struct _IDirect3D {
286 * static ICOM_VTABLE(IDirect3D) d3dvt;
288 * // implement the IDirect3D methods here
290 * int IDirect3D_QueryInterface(IDirect3D* me)
292 * ICOM_THIS(IDirect3D,me);
298 * static ICOM_VTABLE(IDirect3D) d3dvt = {
299 * ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
300 * IDirect3D_QueryInterface,
303 * IDirect3D_Initialize,
308 * - We first define what the interface really contains. This is th e_IDirect3D structure. The
309 * first field must of course be the virtual table pointer. Everything else is free.
310 * - Then we predeclare our static virtual table variable, we will need its address in some
311 * methods to initialize the virtual table pointer of the returned interface objects.
312 * - Then we implement the interface methods. To match what has been declared in the header file
313 * they must take a pointer to a IDirect3D structure and we must cast it to an _IDirect3D so that
314 * we can manipulate the fields. This is performed by the ICOM_THIS macro.
315 * - Finally we initialize the virtual table.
320 #if !defined(__cplusplus) || defined(CINTERFACE)
321 #define ICOM_CINTERFACE 1
324 #ifndef ICOM_CINTERFACE
327 #define ICOM_METHOD(ret,xfn) \
328 public: virtual ret CALLBACK (xfn)(void) = 0;
329 #define ICOM_METHOD1(ret,xfn,ta,na) \
330 public: virtual ret CALLBACK (xfn)(ta a) = 0;
331 #define ICOM_METHOD2(ret,xfn,ta,na,tb,nb) \
332 public: virtual ret CALLBACK (xfn)(ta a,tb b) = 0;
333 #define ICOM_METHOD3(ret,xfn,ta,na,tb,nb,tc,nc) \
334 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c) = 0;
335 #define ICOM_METHOD4(ret,xfn,ta,na,tb,nb,tc,nc,td,nd) \
336 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d) = 0;
337 #define ICOM_METHOD5(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
338 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e) = 0;
339 #define ICOM_METHOD6(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
340 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f) = 0;
341 #define ICOM_METHOD7(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
342 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g) = 0;
343 #define ICOM_METHOD8(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
344 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h) = 0;
345 #define ICOM_METHOD9(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
346 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i) = 0;
347 #define ICOM_METHOD10(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
348 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j) = 0;
349 #define ICOM_METHOD11(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
350 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k) = 0;
351 #define ICOM_METHOD12(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
352 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l) = 0;
353 #define ICOM_METHOD13(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
354 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m) = 0;
355 #define ICOM_METHOD14(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
356 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n) = 0;
357 #define ICOM_METHOD15(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
358 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o) = 0;
359 #define ICOM_METHOD16(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
360 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p) = 0;
361 #define ICOM_METHOD17(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
362 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q) = 0;
363 #define ICOM_METHOD18(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
364 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r) = 0;
365 #define ICOM_METHOD19(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
366 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s) = 0;
367 #define ICOM_METHOD20(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
368 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t) = 0;
369 #define ICOM_METHOD21(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
370 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u) = 0;
371 #define ICOM_METHOD22(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
372 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v) = 0;
373 #define ICOM_METHOD23(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
374 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w) = 0;
375 #define ICOM_METHOD24(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
376 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x) = 0;
377 #define ICOM_METHOD25(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
378 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y) = 0;
379 #define ICOM_METHOD26(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
380 public: virtual ret CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z) = 0;
383 #define ICOM_VMETHOD(xfn) \
384 public: virtual void CALLBACK (xfn)(void) = 0;
385 #define ICOM_VMETHOD1(xfn,ta,na) \
386 public: virtual void CALLBACK (xfn)(ta a) = 0;
387 #define ICOM_VMETHOD2(xfn,ta,na,tb,nb) \
388 public: virtual void CALLBACK (xfn)(ta a,tb b) = 0;
389 #define ICOM_VMETHOD3(xfn,ta,na,tb,nb,tc,nc) \
390 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c) = 0;
391 #define ICOM_VMETHOD4(xfn,ta,na,tb,nb,tc,nc,td,nd) \
392 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d) = 0;
393 #define ICOM_VMETHOD5(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
394 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e) = 0;
395 #define ICOM_VMETHOD6(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
396 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f) = 0;
397 #define ICOM_VMETHOD7(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
398 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g) = 0;
399 #define ICOM_VMETHOD8(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
400 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h) = 0;
401 #define ICOM_VMETHOD9(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
402 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i) = 0;
403 #define ICOM_VMETHOD10(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
404 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i, tj j) = 0;
405 #define ICOM_VMETHOD11(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
406 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i, tj j, tk k) = 0;
407 #define ICOM_VMETHOD12(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
408 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l) = 0;
409 #define ICOM_VMETHOD13(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
410 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m) = 0;
411 #define ICOM_VMETHOD14(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
412 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n) = 0;
413 #define ICOM_VMETHOD15(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
414 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o) = 0;
415 #define ICOM_VMETHOD16(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
416 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p) = 0;
417 #define ICOM_VMETHOD17(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
418 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q) = 0;
419 #define ICOM_VMETHOD18(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
420 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r) = 0;
421 #define ICOM_VMETHOD19(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
422 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s) = 0;
423 #define ICOM_VMETHOD20(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
424 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t) = 0;
425 #define ICOM_VMETHOD21(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
426 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u) = 0;
427 #define ICOM_VMETHOD22(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
428 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v) = 0;
429 #define ICOM_VMETHOD23(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
430 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w) = 0;
431 #define ICOM_VMETHOD24(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
432 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x) = 0;
433 #define ICOM_VMETHOD25(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
434 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y) = 0;
435 #define ICOM_VMETHOD26(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
436 public: virtual void CALLBACK (xfn)(ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z) = 0;
439 #ifdef ICOM_USE_COM_INTERFACE_ATTRIBUTE
441 #define ICOM_DEFINE(iface,ibase) \
442 struct iface: public ibase { \
444 } __attribute__ ((com_interface));
448 #define ICOM_DEFINE(iface,ibase) \
449 struct iface: public ibase { \
453 #endif /* ICOM_USE_COM_INTERFACE_ATTRIBUTE */
455 #define ICOM_VTBL(iface) (iface)
460 #define ICOM_METHOD(ret,xfn) \
461 ret (CALLBACK *xfn)(ICOM_INTERFACE* me);
462 #define ICOM_METHOD1(ret,xfn,ta,na) \
463 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a);
464 #define ICOM_METHOD2(ret,xfn,ta,na,tb,nb) \
465 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b);
466 #define ICOM_METHOD3(ret,xfn,ta,na,tb,nb,tc,nc) \
467 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c);
468 #define ICOM_METHOD4(ret,xfn,ta,na,tb,nb,tc,nc,td,nd) \
469 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d);
470 #define ICOM_METHOD5(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
471 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e);
472 #define ICOM_METHOD6(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
473 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f);
474 #define ICOM_METHOD7(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
475 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g);
476 #define ICOM_METHOD8(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh) \
477 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h);
478 #define ICOM_METHOD9(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni) \
479 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i);
480 #define ICOM_METHOD10(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj) \
481 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j);
482 #define ICOM_METHOD11(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk) \
483 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k);
484 #define ICOM_METHOD12(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
485 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l);
486 #define ICOM_METHOD13(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
487 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m);
488 #define ICOM_METHOD14(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
489 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n);
490 #define ICOM_METHOD15(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
491 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o);
492 #define ICOM_METHOD16(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
493 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p);
494 #define ICOM_METHOD17(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
495 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q);
496 #define ICOM_METHOD18(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
497 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r);
498 #define ICOM_METHOD19(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
499 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s);
500 #define ICOM_METHOD20(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
501 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t);
502 #define ICOM_METHOD21(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
503 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u);
504 #define ICOM_METHOD22(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
505 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v);
506 #define ICOM_METHOD23(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
507 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w);
508 #define ICOM_METHOD24(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
509 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x);
510 #define ICOM_METHOD25(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
511 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y);
512 #define ICOM_METHOD26(ret,xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
513 ret (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z);
515 #define ICOM_VMETHOD(xfn) \
516 void (CALLBACK *xfn)(ICOM_INTERFACE* me);
517 #define ICOM_VMETHOD1(xfn,ta,na) \
518 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a);
519 #define ICOM_VMETHOD2(xfn,ta,na,tb,nb) \
520 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b);
521 #define ICOM_VMETHOD3(xfn,ta,na,tb,nb,tc,nc) \
522 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c);
523 #define ICOM_VMETHOD4(xfn,ta,na,tb,nb,tc,nc,td,nd) \
524 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d);
525 #define ICOM_VMETHOD5(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne) \
526 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e);
527 #define ICOM_VMETHOD6(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf) \
528 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f);
529 #define ICOM_VMETHOD7(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng) \
530 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g);
531 #define ICOM_VMETHOD8(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,nh) \
532 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h);
533 #define ICOM_VMETHOD9(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ni) \
534 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i);
535 #define ICOM_VMETHOD10(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,nj) \
536 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j);
537 #define ICOM_VMETHOD11(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,nk) \
538 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k);
539 #define ICOM_VMETHOD12(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl) \
540 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l);
541 #define ICOM_VMETHOD13(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm) \
542 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m);
543 #define ICOM_VMETHOD14(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn) \
544 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n);
545 #define ICOM_VMETHOD15(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no) \
546 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o);
547 #define ICOM_VMETHOD16(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np) \
548 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p);
549 #define ICOM_VMETHOD17(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq) \
550 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q);
551 #define ICOM_VMETHOD18(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr) \
552 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r);
553 #define ICOM_VMETHOD19(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns) \
554 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s);
555 #define ICOM_VMETHOD20(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt) \
556 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t);
557 #define ICOM_VMETHOD21(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu) \
558 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u);
559 #define ICOM_VMETHOD22(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv) \
560 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v);
561 #define ICOM_VMETHOD23(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw) \
562 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w);
563 #define ICOM_VMETHOD24(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx) \
564 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x);
565 #define ICOM_VMETHOD25(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny) \
566 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y);
567 #define ICOM_VMETHOD26(xfn,ta,na,tb,nb,tc,nc,td,nd,te,ne,tf,nf,tg,ng,th,nh,ti,ni,tj,nj,tk,nk,tl,nl,tm,nm,tn,nn,to,no,tp,np,tq,nq,tr,nr,ts,ns,tt,nt,tu,nu,tv,nv,tw,nw,tx,nx,ty,ny,tz,nz) \
568 void (CALLBACK *xfn)(ICOM_INTERFACE* me,ta a,tb b,tc c,td d,te e,tf f,tg g,th h,ti i,tj j,tk k,tl l,tm m,tn n,to o,tp p,tq q,tr r,ts s,tt t,tu u,tv v,tw w,tx x,ty y,tz z);
571 #define ICOM_VTABLE(iface) iface##Vtbl
572 #define ICOM_VFIELD(iface) ICOM_VTABLE(iface)* lpVtbl
573 #define ICOM_VTBL(iface) (iface)->lpVtbl
575 #ifdef ICOM_MSVTABLE_COMPAT
576 #define ICOM_DEFINE(iface,ibase) \
577 typedef struct ICOM_VTABLE(iface) ICOM_VTABLE(iface); \
579 const ICOM_VFIELD(iface); \
581 struct ICOM_VTABLE(iface) { \
587 #define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 0,0,
590 #define ICOM_DEFINE(iface,ibase) \
591 typedef struct ICOM_VTABLE(iface) ICOM_VTABLE(iface); \
593 const ICOM_VFIELD(iface); \
595 struct ICOM_VTABLE(iface) { \
599 #define ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
600 #endif /* ICOM_MSVTABLE_COMPAT */
603 #define ICOM_THIS(impl,iface) impl* const This=(impl*)(iface)
604 #define ICOM_CTHIS(impl,iface) const impl* const This=(const impl*)(iface)
606 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
607 #define ICOM_CTHIS_MULTI(impl,field,iface) const impl* const This=(const impl*)((char*)(iface) - offsetof(impl,field))
609 #endif /*ICOM_CINTERFACE */
611 #define ICOM_CALL(xfn, ptr) ICOM_VTBL(ptr)->xfn(ptr)
612 #define ICOM_CALL1(xfn, ptr,a) ICOM_VTBL(ptr)->xfn(ptr,a)
613 #define ICOM_CALL2(xfn, ptr,a,b) ICOM_VTBL(ptr)->xfn(ptr,a,b)
614 #define ICOM_CALL3(xfn, ptr,a,b,c) ICOM_VTBL(ptr)->xfn(ptr,a,b,c)
615 #define ICOM_CALL4(xfn, ptr,a,b,c,d) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d)
616 #define ICOM_CALL5(xfn, ptr,a,b,c,d,e) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e)
617 #define ICOM_CALL6(xfn, ptr,a,b,c,d,e,f) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f)
618 #define ICOM_CALL7(xfn, ptr,a,b,c,d,e,f,g) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g)
619 #define ICOM_CALL8(xfn, ptr,a,b,c,d,e,f,g,h) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h)
620 #define ICOM_CALL9(xfn, ptr,a,b,c,d,e,f,g,h,i) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i)
621 #define ICOM_CALL10(xfn, ptr,a,b,c,d,e,f,g,h,i,j) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j)
622 #define ICOM_CALL11(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k)
623 #define ICOM_CALL12(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l)
624 #define ICOM_CALL13(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m)
625 #define ICOM_CALL14(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n)
626 #define ICOM_CALL15(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
627 #define ICOM_CALL16(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
628 #define ICOM_CALL17(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)
629 #define ICOM_CALL18(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)
630 #define ICOM_CALL19(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s)
631 #define ICOM_CALL20(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)
632 #define ICOM_CALL21(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)
633 #define ICOM_CALL22(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v)
634 #define ICOM_CALL23(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w)
635 #define ICOM_CALL24(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)
636 #define ICOM_CALL25(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)
637 #define ICOM_CALL26(xfn, ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) ICOM_VTBL(ptr)->xfn(ptr,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
640 /*****************************************************************************
641 * Predeclare the interfaces
643 DEFINE_OLEGUID(IID_IClassFactory
, 0x00000001L
, 0, 0);
644 typedef struct IClassFactory IClassFactory
, *LPCLASSFACTORY
;
646 DEFINE_OLEGUID(IID_IMalloc
, 0x00000002L
, 0, 0);
647 typedef struct IMalloc IMalloc
,*LPMALLOC
;
649 DEFINE_OLEGUID(IID_IUnknown
, 0x00000000L
, 0, 0);
650 typedef struct IUnknown IUnknown
, *LPUNKNOWN
;
653 /*****************************************************************************
656 #define ICOM_INTERFACE IUnknown
657 #define IUnknown_IMETHODS \
658 ICOM_METHOD2(HRESULT,QueryInterface,REFIID,riid, LPVOID*,ppvObj) \
659 ICOM_METHOD (ULONG,AddRef) \
660 ICOM_METHOD (ULONG,Release)
661 #ifdef ICOM_CINTERFACE
662 typedef struct ICOM_VTABLE(IUnknown
) ICOM_VTABLE(IUnknown
);
664 ICOM_VFIELD(IUnknown
);
665 #if defined(ICOM_USE_COM_INTERFACE_ATTRIBUTE)
666 } __attribute__ ((com_interface
));
669 #endif /* ICOM_US_COM_INTERFACE_ATTRIBUTE */
671 struct ICOM_VTABLE(IUnknown
) {
672 #ifdef ICOM_MSVTABLE_COMPAT
675 #endif /* ICOM_MSVTABLE_COMPAT */
677 #else /* ICOM_CINTERFACE */
680 #endif /* ICOM_CINTERFACE */
682 ICOM_METHOD2(HRESULT
,QueryInterface
,REFIID
,riid
, LPVOID
*,ppvObj
)
683 ICOM_METHOD (ULONG
,AddRef
)
684 ICOM_METHOD (ULONG
,Release
)
685 #if defined(ICOM_USE_COM_INTERFACE_ATTRIBUTE)
686 } __attribute__ ((com_interface
));
689 #endif /* ICOM_US_COM_INTERFACE_ATTRIBUTE */
691 #undef ICOM_INTERFACE
693 /*** IUnknown methods ***/
694 #define IUnknown_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
695 #define IUnknown_AddRef(p) ICOM_CALL (AddRef,p)
696 #define IUnknown_Release(p) ICOM_CALL (Release,p)
698 HRESULT CALLBACK
IUnknown_QueryInterface_Proxy(IUnknown
*This
,REFIID riid
,LPVOID
*ppvObj
);
699 ULONG CALLBACK
IUnknown_AddRef_Proxy(IUnknown
*This
);
700 ULONG CALLBACK
IUnknown_Release_Proxy(IUnknown
*This
);
702 /*****************************************************************************
703 * IClassFactory interface
705 #define ICOM_INTERFACE IClassFactory
706 #define IClassFactory_METHODS \
707 ICOM_METHOD3(HRESULT,CreateInstance, LPUNKNOWN,pUnkOuter, REFIID,riid, LPVOID*,ppvObject) \
708 ICOM_METHOD1(HRESULT,LockServer, BOOL,fLock)
709 #define IClassFactory_IMETHODS \
711 IClassFactory_METHODS
712 ICOM_DEFINE(IClassFactory
,IUnknown
)
713 #undef ICOM_INTERFACE
715 /*** IUnknown methods ***/
716 #define IClassFactory_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
717 #define IClassFactory_AddRef(p) ICOM_CALL (AddRef,p)
718 #define IClassFactory_Release(p) ICOM_CALL (Release,p)
719 /*** IClassFactory methods ***/
720 #define IClassFactory_CreateInstance(p,a,b,c) ICOM_CALL3(CreateInstance,p,a,b,c)
721 #define IClassFactory_LockServer(p,a) ICOM_CALL1(LockServer,p,a)
724 /*****************************************************************************
727 #define ICOM_INTERFACE IMalloc
728 #define IMalloc_METHODS \
729 ICOM_METHOD1 (LPVOID,Alloc, DWORD,cb) \
730 ICOM_METHOD2 (LPVOID,Realloc, LPVOID,pv, DWORD,cb) \
731 ICOM_VMETHOD1( Free, LPVOID,pv) \
732 ICOM_METHOD1(DWORD, GetSize, LPVOID,pv) \
733 ICOM_METHOD1(INT, DidAlloc, LPVOID,pv) \
734 ICOM_METHOD (VOID, HeapMinimize)
735 #define IMalloc_IMETHODS \
738 ICOM_DEFINE(IMalloc
,IUnknown
)
739 #undef ICOM_INTERFACE
741 /*** IUnknown methods ***/
742 #define IMalloc_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
743 #define IMalloc_AddRef(p) ICOM_CALL (AddRef,p)
744 #define IMalloc_Release(p) ICOM_CALL (Release,p)
745 /*** IMalloc methods ***/
746 #define IMalloc_Alloc(p,a) ICOM_CALL1(Alloc,p,a)
747 #define IMalloc_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b)
748 #define IMalloc_Free(p,a) ICOM_CALL1(Free,p,a)
749 #define IMalloc_GetSize(p,a) ICOM_CALL1(GetSize,p,a)
750 #define IMalloc_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a)
751 #define IMalloc_HeapMinimize(p) ICOM_CALL (HeapMinimize,p)
753 /* values passed to CoGetMalloc */
754 #define MEMCTX_TASK 1 /* private task memory */
755 #define MEMCTX_SHARED 2 /* shared memory */
757 #define MEMCTX_MACSYSTEM 3 /* system heap on mac */
759 /* mainly for internal use... */
760 #define MEMCTX_UNKNOWN -1
761 #define MEMCTX_SAME -2
763 HRESULT WINAPI
CoGetMalloc(DWORD dwMemContext
,LPMALLOC
* lpMalloc
);
765 LPVOID WINAPI
CoTaskMemAlloc(ULONG size
);
767 void WINAPI
CoTaskMemFree(LPVOID ptr
);
769 /* FIXME: unimplemented */
770 LPVOID WINAPI
CoTaskMemRealloc(LPVOID ptr
, ULONG size
);
773 /*****************************************************************************
777 HRESULT WINAPI
CoCreateGuid(GUID
* pguid
);
779 HINSTANCE WINAPI
CoLoadLibrary(LPOLESTR lpszLibName
, BOOL bAutoFree
);
781 void WINAPI
CoFreeAllLibraries(void);
783 void WINAPI
CoFreeLibrary(HINSTANCE hLibrary
);
785 void WINAPI
CoFreeUnusedLibraries(void);
787 HRESULT WINAPI
CoCreateInstance(REFCLSID rclsid
, LPUNKNOWN pUnkOuter
, DWORD dwClsContext
, REFIID iid
, LPVOID
*ppv
);
789 HRESULT WINAPI
CoGetClassObject(REFCLSID rclsid
, DWORD dwClsContext
, COSERVERINFO
*pServerInfo
, REFIID iid
, LPVOID
*ppv
);
791 HRESULT WINAPI
CoInitialize(LPVOID lpReserved
);
792 HRESULT WINAPI
CoInitializeEx(LPVOID lpReserved
, DWORD dwCoInit
);
794 void WINAPI
CoUninitialize(void);
796 typedef enum tagCOINIT
798 COINIT_APARTMENTTHREADED
= 0x2, /* Apartment model */
799 COINIT_MULTITHREADED
= 0x0, /* OLE calls objects on any thread */
800 COINIT_DISABLE_OLE1DDE
= 0x4, /* Don't use DDE for Ole1 support */
801 COINIT_SPEED_OVER_MEMORY
= 0x8 /* Trade memory for speed */
805 /* FIXME: not implemented */
806 BOOL WINAPI
CoIsOle1Class(REFCLSID rclsid
);
808 HRESULT WINAPI
CoLockObjectExternal(LPUNKNOWN pUnk
, BOOL fLock
, BOOL fLastUnlockReleases
);
810 /* class registration flags; passed to CoRegisterClassObject */
811 typedef enum tagREGCLS
813 REGCLS_SINGLEUSE
= 0,
814 REGCLS_MULTIPLEUSE
= 1,
815 REGCLS_MULTI_SEPARATE
= 2,
819 HRESULT WINAPI
CoRegisterClassObject(REFCLSID rclsid
,LPUNKNOWN pUnk
,DWORD dwClsContext
,DWORD flags
,LPDWORD lpdwRegister
);
821 HRESULT WINAPI
CoRevokeClassObject(DWORD dwRegister
);
823 HRESULT WINAPI
CoGetPSClsid(REFIID riid
,CLSID
*pclsid
);
825 /*****************************************************************************
826 * COM Server dll - exports
828 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
* ppv
);
829 HRESULT WINAPI
DllCanUnloadNow(void);
835 #endif /* __WINE_WINE_OBJ_BASE_H */