testprogs/win32/rpcecho-win32-pipe ...
[metze/samba/wip.git] / testprogs / win32 / rpcecho-win32-pipe / rpcecho.idl
1 /*
2    RPC echo IDL.
3
4    Copyright (C) Tim Potter 2003
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 [
22 /*uuid(60a15ec5-4de8-11d7-a637-005056a20182),
23 version(1.0)*/
24   uuid("e3514235-4b06-11d1-ab04-00c04fc2dcd2"),
25   version(4.0),
26   pointer_default(unique)
27 ]
28 interface rpcecho
29 {
30 #define unistr [string] wchar_t *
31 #define uint8 char
32 #define uint16 short
33 #define uint32 long
34 #define HYPER_T hyper
35         // Add one to an integer
36         void AddOne(
37                 [in] uint32 in_data,
38                 [in] uint32 in_data2,
39                 [out] int *out_data
40         );
41         // Echo an array of bytes back at the caller
42         void EchoData(
43                 [in] int len,
44                 [in] [size_is(len)] char in_data[],
45                 [out] [size_is(len)] char out_data[]
46         );
47         // Sink data to the server
48         void SinkData(
49                 [in] int len,
50                 [in] [size_is(len)] char in_data[]
51         );
52         // Source data from server
53         void SourceData(
54                 [in] int len,
55                 [out] [size_is(len)] char out_data[]
56         );
57
58         const long myconstant = 42;
59
60         /* test strings */
61         void TestCall (
62                 [in]   unistr *s1,
63                 [out]  unistr *s2
64                 );
65
66
67         /* test some alignment issues */
68         typedef struct {
69                 uint8 v;
70         } echo_info1;
71
72         typedef struct {
73                 uint16 v;
74         } echo_info2;
75
76         typedef struct {
77                 uint32 v;
78         } echo_info3;
79
80         typedef struct {
81                 HYPER_T v;
82         } echo_info4;
83
84         typedef struct {
85                 uint8 v1;
86                 HYPER_T v2;
87         } echo_info5;
88
89         typedef struct {
90                 uint8 v1;
91                 echo_info1 info1;
92         } echo_info6;
93
94         typedef struct {
95                 uint8 v1;
96                 echo_info4 info4;
97         } echo_info7;
98
99         typedef union {
100                 [case(1)]  echo_info1 info1;
101                 [case(2)]  echo_info2 info2;
102                 [case(3)]  echo_info3 info3;
103                 [case(4)]  echo_info4 info4;
104                 [case(5)]  echo_info5 info5;
105                 [case(6)]  echo_info6 info6;
106                 [case(7)]  echo_info7 info7;
107         } echo_Info;
108
109         long TestCall2 (
110                 [in]                     uint16 level,
111                 [out,switch_is(level)]   echo_Info **info
112                 );
113
114         long TestSleep(
115                 [in] long seconds
116                 );
117
118         typedef pipe byte BYTE_PIPE;
119
120         long TestPipe(
121                 [in] long count,
122                 [out] BYTE_PIPE
123                 );
124
125 /*
126         typedef enum {
127                 ECHO_ENUM1 = 1,
128                 ECHO_ENUM2 = 2
129         } echo_Enum1;
130
131         typedef [v1_enum] enum {
132                 ECHO_ENUM1_32 = 1,
133                 ECHO_ENUM2_32 = 2
134         } echo_Enum1_32;
135
136         typedef struct {
137                 echo_Enum1 e1;
138                 echo_Enum1_32 e2;
139         } echo_Enum2;
140
141         typedef union {
142                 [case(ECHO_ENUM1)] echo_Enum1 e1;
143                 [case(ECHO_ENUM2)] echo_Enum2 e2;
144         } echo_Enum3;
145
146         void echo_TestEnum(
147                 [in,out,ref] echo_Enum1 *foo1,
148                 [in,out,ref] echo_Enum2 *foo2,
149                 [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
150                 );
151
152         typedef struct {
153                 uint32 x;
154                 [size_is(x)] uint16 surrounding[*];
155         } echo_Surrounding;
156
157         void echo_TestSurrounding(
158                 [in,out,ref] echo_Surrounding *data
159         );
160
161         uint16 echo_TestDoublePointer([in,ref] uint16 ***data);
162 */
163 }