summaryrefslogtreecommitdiff
path: root/testprogs/win32/rpcecho/rpcecho.idl
blob: 38fa58af411cb87138e25ed3e312bc8a76088f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/* 
   RPC echo IDL.

   Copyright (C) Tim Potter 2003
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program 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 General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

[
uuid(60a15ec5-4de8-11d7-a637-005056a20182),
version(1.0)
]
interface rpcecho
{
	// Add one to an integer
	void AddOne(
		[in] int in_data,
		[out] int *out_data
	);
	// Echo an array of bytes back at the caller
	void EchoData(
		[in] int len,
		[in] [size_is(len)] char in_data[],
		[out] [size_is(len)] char out_data[]
	);
	// Sink data to the server
	void SinkData(
		[in] int len,
		[in] [size_is(len)] char in_data[]
	);
	// Source data from server
	void SourceData(
		[in] int len,
		[out] [size_is(len)] char out_data[]
	);

#define unistr [string] wchar_t *
#define uint8 char
#define uint16 short
#define uint32 long
#define HYPER_T hyper

	const long myconstant = 42;

	/* test strings */
 	void TestCall (
		[in]   unistr *s1,
		[out]  unistr *s2
 		);


	/* test some alignment issues */
	typedef struct {
		uint8 v;
	} echo_info1;

	typedef struct {
		uint16 v;
	} echo_info2;

	typedef struct {
		uint32 v;
	} echo_info3;

	typedef struct {
		HYPER_T v;
	} echo_info4;

	typedef struct {
		uint8 v1;
		HYPER_T v2;
	} echo_info5;

	typedef struct {
		uint8 v1;
		echo_info1 info1;
	} echo_info6;

	typedef struct {
		uint8 v1;
		echo_info4 info4;
	} echo_info7;

	typedef union {
		[case(1)]  echo_info1 info1;
		[case(2)]  echo_info2 info2;
		[case(3)]  echo_info3 info3;
		[case(4)]  echo_info4 info4;
		[case(5)]  echo_info5 info5;
		[case(6)]  echo_info6 info6;
		[case(7)]  echo_info7 info7;
	} echo_Info;

	long TestCall2 (
		[in]                     uint16 level,
		[out,switch_is(level)]   echo_Info **info
		);

	long TestSleep(
		[in] long seconds
		);

	typedef enum {
		ECHO_ENUM1 = 1,
		ECHO_ENUM2 = 2
	} echo_Enum1;

	typedef [v1_enum] enum {
		ECHO_ENUM1_32 = 1,
		ECHO_ENUM2_32 = 2
	} echo_Enum1_32;

	typedef struct {
		echo_Enum1 e1;
		echo_Enum1_32 e2;
	} echo_Enum2;

	typedef union {
		[case(ECHO_ENUM1)] echo_Enum1 e1;
		[case(ECHO_ENUM2)] echo_Enum2 e2;
	} echo_Enum3;

	void echo_TestEnum(
		[in,out,ref] echo_Enum1 *foo1,
		[in,out,ref] echo_Enum2 *foo2,
		[in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
		);

	typedef struct {
		uint32 x;
		[size_is(x)] uint16 surrounding[*];
	} echo_Surrounding;

	void echo_TestSurrounding(
		[in,out,ref] echo_Surrounding *data
	);

	uint16 echo_TestDoublePointer([in] uint16 ***data);
}