Sweden-Number/dlls/oleaut32/tests/test_tlb.idl

224 lines
6.8 KiB
Plaintext
Raw Normal View History

/*
* ITypeLib test IDL - we dump it and compare results in typelib.c
*
* Copyright 2007 Google (Mikolaj Zalewski)
* Copyright 2006,2015 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma makedep ident
#pragma makedep typelib
import "oaidl.idl"; /* needed by widl */
midl_pragma warning ( disable : 2368 )
#define CUSTDATA_STRLIT c8768723-e6d2-4442-b039-92e9c82429c4
#define CUSTDATA_NUM b481b478-a181-4eb6-b6e0-df63069e8c80
#define CUSTDATA_HEXNUM a09d7c06-cf38-4db3-9450-10641651c35b
[
uuid(8b05fe77-4a6c-4133-b9cd-8f81747af784),
custom(CUSTDATA_STRLIT,"ITypeLib2::GetCustData"),
custom(CUSTDATA_NUM,42),
custom(CUSTDATA_HEXNUM,0x1337C0D3),
id(2)
]
library Test
{
importlib("stdole2.tlb");
typedef [uuid(b14b6bb5-904e-4ff9-b247-bd361f7a0001)]
struct g { int g1; } g;
[uuid(b14b6bb5-904e-4ff9-b247-bd361f7a0002)]
interface test_iface : IUnknown
{
HRESULT test([in] g *ptr);
}
interface child_iface;
interface parent_iface;
[uuid(b14b6bb5-904e-4ff9-b247-bd361f7aa001)]
interface parent_iface : IUnknown
{
HRESULT test1([out,retval] child_iface **iface);
}
[uuid(b14b6bb5-904e-4ff9-b247-bd361f7aa002)]
interface child_iface: parent_iface
{
HRESULT test2(void);
}
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753901),restricted]
struct _n { int n1; };
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753902),hidden]
typedef struct _n n;
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753903),version(1.2),helpcontext(3)]
typedef struct _n nn;
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753904),restricted]
struct _m { int m1; };
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753905),hidden,version(1.2)]
typedef struct _m m;
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753906),helpcontext(3)]
typedef struct _m mm;
[dual,uuid(b14b6bb5-904e-4ff9-b247-bd361f7aaedd)]
interface IDualIface : IDispatch
{
HRESULT test();
}
[uuid(ec5dfcd6-eeb0-4cd6-b51e-8030e1dac009)]
interface ISimpleIface : IDispatch
{
HRESULT test();
}
[uuid(4029f190-ca4a-4611-aeb9-673983cb96dd)]
struct test_struct
{
HRESULT hr;
VARIANT_BOOL b;
IDispatch *disp;
BSTR bstr;
};
/* identical to 'test_struct', only guid is different */
[uuid(4029f190-ca4a-4611-aeb9-673983cb96de)]
struct test_struct2
{
HRESULT hr;
VARIANT_BOOL b;
IDispatch *disp;
BSTR bstr;
};
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396a),restricted]
int t_INT;
typedef [public] enum _a { a1, a2 } a;
typedef [public] enum aa { aa1, aa2 } aa;
typedef enum _b { b1, b2 } b;
typedef enum bb { bb1, bb2 } bb;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b)] enum _c { c1, c2 } c;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396c)] enum cc { cc1, cc2 } cc;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396d),restricted,hidden]
enum _d { d1, d2 } d;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396e),restricted,hidden]
enum dd { dd1, dd2 } dd;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753970),restricted,hidden]
struct _e { int e1; } e;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753971),restricted,hidden]
struct ee { int ee1; } ee;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753972),restricted,hidden]
union _f { int f1; BSTR *f2; } f;
typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753973),restricted,hidden]
union ff { int ff1; BSTR *ff2; } ff;
[uuid(ec5dfcd6-eeb0-4cd6-b51e-8030e1dac00a)]
interface ITestIface : IDispatch
{
HRESULT test1(a value);
HRESULT test2(b value);
HRESULT test3(c value);
HRESULT test4(d value);
HRESULT test5(e value);
HRESULT test6(f value);
}
[uuid(2d4430d5-99ea-4645-85f0-c5814b72804b)]
dispinterface ITestDispatch
{
properties:
[id(10)] int property_int;
[id(11)] HRESULT property_HRESULT;
methods:
[id(1)] void test_void();
[id(2)] void test_void_retval([out,retval] double* ret);
[id(3)] HRESULT test_HRESULT();
[id(4)] HRESULT test_HRESULT_retval([out,retval] double* ret);
[id(5)] int test_int();
[id(6)] int test_int_retval([out,retval] double* ret);
[id(7)] double parse_lcid([in] BSTR x, [lcid] long lcid);
}
[uuid(79ca07f9-ac22-44ac-9aaf-811f45412293), dual]
interface ITestDispDual : IDispatch
{
[id(1)] void test_void();
[id(2)] void test_void_retval([out,retval] double* ret);
[id(3)] HRESULT test_HRESULT();
[id(4)] HRESULT test_HRESULT_retval([out,retval] double* ret);
[id(5)] int test_int();
[id(6)] int test_int_retval([out,retval] double* ret);
[id(7)] HRESULT parse_lcid([in] BSTR x, [lcid] long lcid, [out,retval] double *ret);
}
[uuid(cdb105e3-24fb-4ae6-b826-801b7b2a0a07)]
dispinterface ITestDispInherit
{
interface ITestDispDual;
}
[uuid(786ee4ff-c5dd-4bf4-9578-0d22fb5369cc),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData interface")]
interface custdata_interface : IDispatch
{
[custom(CUSTDATA_STRLIT,"ITypeInfo2::GetFuncCustData custdata_interface::test_method")]
HRESULT test_method([in,custom(CUSTDATA_STRLIT,"ITypeInfo2::GetParamCustData custdata_interface::test_method(x)")] int x);
}
[uuid(6ca99f5e-c86a-42ad-a5ee-5bd4c8e5553c),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData enum")]
enum custdata_enum {
[custom(CUSTDATA_STRLIT,"ITypeInfo2::GetVarCustData enum")]
One,
Two
};
[uuid(62fabe17-f733-4b09-b859-3f455dcda450),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData struct")]
struct custdata_struct {
[custom(CUSTDATA_STRLIT,"ITypeInfo2::GetVarCustData struct")]
int test_field;
};
[/* uuid(...) not allowed on union */ custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData union")]
union custdata_union {
[custom(CUSTDATA_STRLIT,"ITypeInfo2::GetVarCustData union")]
int test_field;
};
[public,uuid(d58744d6-63f9-467c-87e5-c95158098b18),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData typedef")]
typedef custdata_interface * custdata_typedef;
[uuid(bffc216e-2159-465a-80df-b85fd4f4f122),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetCustData dispinterface")]
dispinterface custdata_dispatch
{
properties:
[id(0),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetVarCustData dispinterface property")]
int test_property;
methods:
[id(1),custom(CUSTDATA_STRLIT,"ITypeInfo2::GetFuncCustData dispinterface method")]
void test_method([in,custom(CUSTDATA_STRLIT,"ITypeInfo2::GetParamCustData test_dispatch::test_method(x)")] int x);
}
}