oleaut32/tests: Add some more tests for marshalling VARIANTs.
[wine.git] / dlls / oleaut32 / tests / tmarshal.idl
blob16d2f9d2d9e44e979e7ae2066212717c71d76ed1
1 /*
2 * Copyright (C) 2005 Robert Shearman
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
20 #pragma makedep ident
21 #pragma makedep typelib
23 import "ocidl.idl";
25 enum IWidget_dispids
27 DISPID_TM_NAME = 1,
28 DISPID_TM_DOSOMETHING,
29 DISPID_TM_STATE,
30 DISPID_TM_MAP,
31 DISPID_TM_SETOLECOLOR,
32 DISPID_TM_GETOLECOLOR,
33 DISPID_TM_CLONE,
34 DISPID_TM_CLONEDISPATCH,
35 DISPID_TM_CLONECOCLASS,
36 DISPID_TM_VALUE,
37 DISPID_TM_ARRAY,
38 DISPID_TM_VARARRAYPTR,
39 DISPID_TM_VARCARRAY,
40 DISPID_TM_VARARG,
41 DISPID_TM_STRUCTARGS,
42 DISPID_TM_ERROR,
43 DISPID_TM_CLONEINTERFACE,
44 DISPID_TM_TESTDUAL,
45 DISPID_TM_PROP_WITH_LCID,
46 DISPID_TM_PROP_INT,
47 DISPID_TM_PROP_UINT,
48 DISPID_TM_BYREF_UINT,
49 DISPID_TM_PROP_OPT_ARG,
50 DISPID_TM_PROP_REQ_ARG,
51 DISPID_TM_RESTRICTED,
52 DISPID_TM_TESTSECONDIFACE,
53 DISPID_TM_VARARG_RUN,
54 DISPID_TM_VARARG_REF_RUN,
55 DISPID_TM_COCLASS,
57 DISPID_TM_BASETYPES_IN,
58 DISPID_TM_BASETYPES_OUT,
59 DISPID_TM_INT_PTR,
60 DISPID_TM_INT_PTR_PTR,
61 DISPID_TM_IFACE_IN,
62 DISPID_TM_IFACE_OUT,
63 DISPID_TM_IFACE_PTR,
64 DISPID_TM_BSTR,
65 DISPID_TM_VARIANT,
68 static const int DISPID_TM_NEG_RESTRICTED = -26;
70 enum INonOleAutomation_dispids
72 DISPID_NOA_BSTRRET = 1,
73 DISPID_NOA_ERROR
77 uuid(d96d8a3e-78b6-4c8d-8f27-059db959be8a),
78 version(2.5),
79 helpstring("Test Typelib")
81 library TestTypelib
83 importlib("stdole2.tlb");
85 typedef enum tagSTATE
87 STATE_UNWIDGETIFIED = 1,
88 STATE_WIDGETIFIED
89 } STATE;
91 typedef struct tagMYSTRUCT
93 INT field1;
94 ULONGLONG field2;
95 UINT uarr[8];
96 } MYSTRUCT;
98 coclass ApplicationObject2;
101 odl,
102 oleautomation,
103 uuid(12345678-1234-4321-1234-121212121212)
105 interface ISomethingFromDispatch : IDispatch
107 HRESULT anotherfn(void);
111 odl,
112 oleautomation,
113 dual,
114 uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7967)
116 interface ItestDual : IDispatch
118 HRESULT test();
122 odl,
123 uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7968)
125 interface ITestSecondIface : IUnknown
127 HRESULT test();
131 odl,
132 oleautomation,
133 dual,
134 uuid(3f7e06fe-0bce-46f0-8b7d-3a68393c7969)
136 interface ITestSecondDisp : IDispatch
138 HRESULT test();
142 odl,
143 uuid(a1f8cae3-c947-4c5f-b57d-c87b9b5f3586),
144 oleautomation,
145 dual
147 interface IWidget : IDispatch
149 [propput, id(DISPID_TM_NAME)]
150 HRESULT Name([in] BSTR name);
151 [propget, id(DISPID_TM_NAME)]
152 HRESULT Name([out, retval] BSTR *name);
154 [id(DISPID_TM_DOSOMETHING)]
155 HRESULT DoSomething([in] double number, [out] BSTR *str1, [in, defaultvalue("")] BSTR str2, [in, optional] VARIANT *opt);
157 [propget, id(DISPID_TM_STATE)]
158 HRESULT State([out, retval] STATE *state);
159 [propput, id(DISPID_TM_STATE)]
160 HRESULT State([in] STATE state);
162 [id(DISPID_TM_MAP)]
163 HRESULT Map([in] BSTR bstrId, [out, retval] BSTR *sValue);
165 [id(DISPID_TM_SETOLECOLOR)]
166 HRESULT SetOleColor([in] OLE_COLOR val);
168 [id(DISPID_TM_GETOLECOLOR)]
169 HRESULT GetOleColor([out, retval] OLE_COLOR *pVal);
171 [propget, id(DISPID_TM_CLONE)]
172 HRESULT Clone([out, retval] IWidget **ppVal);
174 [propget, id(DISPID_TM_CLONEDISPATCH)]
175 HRESULT CloneDispatch([out, retval] IDispatch **ppVal);
177 [propget, id(DISPID_TM_CLONECOCLASS)]
178 HRESULT CloneCoclass([out, retval] ApplicationObject2 **ppVal);
180 [propget, id(DISPID_VALUE)]
181 HRESULT Value([in] VARIANT *value, [out, retval] VARIANT *retval);
183 [id(DISPID_TM_ARRAY)]
184 HRESULT Array([in] SAFEARRAY(BSTR) values);
186 [id(DISPID_TM_VARARRAYPTR)]
187 HRESULT VariantArrayPtr([in] SAFEARRAY(VARIANT) *values);
189 [id(DISPID_TM_VARCARRAY)]
190 HRESULT VariantCArray([in] ULONG count, [in, out] VARIANT values[2]);
192 [vararg, id(DISPID_TM_VARARG)]
193 HRESULT VarArg([in] int numexpect, [in] SAFEARRAY(VARIANT) values);
195 [id(DISPID_TM_STRUCTARGS)]
196 HRESULT StructArgs([in] MYSTRUCT byval, [in] MYSTRUCT *byptr, [in] MYSTRUCT arr[5]);
198 [id(DISPID_TM_ERROR)]
199 HRESULT Error();
201 [propget, id(DISPID_TM_CLONEINTERFACE)]
202 HRESULT CloneInterface([out, retval] ISomethingFromDispatch **ppVal);
204 [id(DISPID_TM_PROP_WITH_LCID), propput]
205 HRESULT prop_with_lcid([in,lcid] long lcid, [in] INT i);
207 [id(DISPID_TM_PROP_WITH_LCID), propget]
208 HRESULT prop_with_lcid([in,lcid] long lcid, [out,retval] INT *i);
210 [id(DISPID_TM_PROP_INT), propget]
211 HRESULT prop_int([out,retval] INT *i);
213 [id(DISPID_TM_PROP_UINT), propget]
214 HRESULT prop_uint([out,retval] UINT *i);
216 [id(DISPID_TM_BYREF_UINT)]
217 HRESULT ByRefUInt([in, out] UINT *i);
219 [id(DISPID_TM_PROP_OPT_ARG), propput]
220 HRESULT prop_opt_arg([in,optional] INT opt, [in] INT i);
222 [id(DISPID_TM_PROP_REQ_ARG), propput]
223 HRESULT prop_req_arg([in] INT req, [in] INT i);
225 [id(DISPID_TM_RESTRICTED), restricted]
226 HRESULT pos_restrict([out, retval] INT *i);
228 [id(DISPID_TM_NEG_RESTRICTED), restricted]
229 HRESULT neg_restrict([out, retval] INT *i);
231 [id(DISPID_TM_VARARG_RUN), vararg]
232 HRESULT VarArg_Run([in] BSTR name, [in] SAFEARRAY(VARIANT) params, [out, retval] VARIANT *result);
234 [id(DISPID_TM_VARARG_REF_RUN), vararg]
235 HRESULT VarArg_Ref_Run([in] BSTR name, [in] SAFEARRAY(VARIANT) *params, [out, retval] VARIANT *result);
237 [id(DISPID_TM_COCLASS)]
238 HRESULT Coclass([in] ApplicationObject2 *param);
240 [id(DISPID_TM_BASETYPES_IN)]
241 HRESULT basetypes_in([in] signed char c, [in] short s, [in] int i, [in] hyper h,
242 [in] unsigned char uc, [in] unsigned short us, [in] unsigned int ui,
243 [in] unsigned hyper uh, [in] float f, [in] double d, [in] STATE st);
245 [id(DISPID_TM_BASETYPES_OUT)]
246 HRESULT basetypes_out([out] signed char *c, [out] short *s, [out] int *i, [out] hyper *h,
247 [out] unsigned char *uc, [out] unsigned short *us, [out] unsigned int *ui,
248 [out] unsigned hyper *uh, [out] float *f, [out] double *d, [out] STATE *st);
250 [id(DISPID_TM_INT_PTR)]
251 HRESULT int_ptr([in] int *in, [out] int *out, [in, out] int *in_out);
253 [id(DISPID_TM_INT_PTR_PTR)]
254 HRESULT int_ptr_ptr([in] int **in, [out] int **out, [in, out] int **in_out);
256 [id(DISPID_TM_IFACE_IN)]
257 HRESULT iface_in([in] IUnknown *unk, [in] IDispatch *disp, [in] ISomethingFromDispatch *sfd);
259 [id(DISPID_TM_IFACE_OUT)]
260 HRESULT iface_out([out] IUnknown **unk, [out] IDispatch **disp, [out] ISomethingFromDispatch **sfd);
262 [id(DISPID_TM_IFACE_PTR)]
263 HRESULT iface_ptr([in] ISomethingFromDispatch **in, [out] ISomethingFromDispatch **out, [in, out] ISomethingFromDispatch **in_out);
265 [id(DISPID_TM_BSTR)]
266 HRESULT bstr([in] BSTR in, [out] BSTR *out, [in] BSTR *in_ptr, [in, out] BSTR *in_out);
268 [id(DISPID_TM_VARIANT)]
269 HRESULT variant([in] VARIANT in, [out] VARIANT *out, [in] VARIANT *in_ptr, [in, out] VARIANT *in_out);
273 odl,
274 uuid(a1f8cae3-c947-3c5f-a57c-c88b9b6f3586),
275 oleautomation,
276 dual
278 interface IStaticWidget : IDispatch
280 [id(DISPID_TM_TESTDUAL)]
281 HRESULT TestDual([in] ItestDual *p);
283 [id(DISPID_TM_TESTSECONDIFACE)]
284 HRESULT TestSecondIface([in] ITestSecondIface *p);
288 odl,
289 uuid(a028db05-30f0-4b93-b17a-41c72f831d84),
290 dual,
291 oleautomation
293 interface IKindaEnumWidget : IUnknown
295 HRESULT Next(
296 [out] IWidget **widget);
298 HRESULT Count(
299 [out] unsigned long *count);
301 HRESULT Reset();
303 HRESULT Clone(
304 [out] IKindaEnumWidget **ppenum);
308 odl,
309 uuid(a028db06-30f0-4b93-b17a-41c72f831d84),
311 interface INonOleAutomation : IUnknown
313 [id(DISPID_NOA_BSTRRET)]
314 BSTR BstrRet();
316 [id(DISPID_NOA_ERROR)]
317 HRESULT Error();
322 dllname("comm.drv"),
323 uuid(d377f60b-8639-4261-8ee7-75c8340d2cc9),
325 module BadModule
328 entry("Foo"),
330 HRESULT BadModuleFoo();
334 dllname("oleaut32.dll"),
335 uuid(d377f60c-8639-4261-8ee7-75c8340d2cc9),
337 module BadEntry
340 entry("Foo"),
342 HRESULT BadEntryFoo();
346 uuid(bb171948-10ec-407a-9a57-2f85f797ff1a),
347 appobject,
349 coclass ApplicationObject2
351 interface IWidget;
352 [source] interface IWidget;
356 odl,
357 uuid(375f8a9d-33d0-44f3-b972-61f8407899e0)
359 interface ItestIF1 : IUnknown
361 HRESULT fn1([in] int x);
362 HRESULT fn2([out,retval] int *x);
366 odl,
367 uuid(094056a3-666f-4956-be12-1859668310b8)
369 interface ItestIF2 : ItestIF1
371 HRESULT fn3([in] int y);
375 odl,
376 uuid(33baba09-2e68-43ab-81fe-d84b403df2e5)
378 dispinterface ItestIF3
380 interface ItestIF2;
384 odl,
385 uuid(a01005c7-7491-42eb-94f3-668e37ce60a6)
387 dispinterface ItestIF4
389 properties:
390 methods:
391 [id(0x1c)] HRESULT fn([in] int z);
395 odl,
396 uuid(4ab61e25-c09f-4239-8f7f-7a018ea0199f),
397 dual
399 interface ItestIF5 : ItestIF2
401 [id(0x1234)] HRESULT fn4([in] int a);
402 [id(0x1235)] HRESULT fn5([in] int a);
406 odl,
407 uuid(ec236d8e-2cc7-44f2-b394-36c86ff3da74)
409 interface ItestIF6 : IDispatch
411 [id(0x1234)] HRESULT fn4([in] int a);
412 [id(0x1235)] HRESULT fn5([in] int a);
416 odl,
417 uuid(f711b105-554d-4751-818c-46fcc5d7c0d5),
418 dual
420 interface ItestIF7 : ItestIF6
422 [id(0x1236)] HRESULT fn6([in] GUID a);
426 odl,
427 uuid(bdfa260b-ef40-43d3-b071-cddec919f132)
429 interface ItestIF8
431 HRESULT fn1([in] int x);
432 HRESULT fn2([out,retval] int *x);
436 odl,
437 uuid(51033a23-dc37-4f19-aa34-4d8a670458a0)
440 interface ItestIF9 : ItestIF8
442 HRESULT fn3([in] int y);
446 odl,
447 uuid(2e8f14fe-0bce-42f0-8b7d-3af8393c7967)
449 dispinterface ItestIF10
451 interface ItestIF9;
455 odl,
456 uuid(7d9e9371-482e-4944-9b19-511fc705236f)
458 dispinterface ItestIF11
460 interface ItestIF7;