3802d3c67840b9e25f1bc73701cb4984a6caccff
[kai/samba.git] / testprogs / win32 / rpcecho / 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 #ifndef __PIDL__
22 #define unistr [string] wchar_t *
23 #endif
24
25 [
26 uuid(60a15ec5-4de8-11d7-a637-005056a20182),
27 version(1.0)
28 ]
29 interface rpcecho
30 {
31         // Add one to an integer
32         void AddOne(
33                 [in] int in_data,
34                 [out] int *out_data
35         );
36         // Echo an array of bytes back at the caller
37         void EchoData(
38                 [in] int len,
39                 [in] [size_is(len)] char in_data[],
40                 [out] [size_is(len)] char out_data[]
41         );
42         // Sink data to the server
43         void SinkData(
44                 [in] int len,
45                 [in] [size_is(len)] char in_data[]
46         );
47         // Source data from server
48         void SourceData(
49                 [in] int len,
50                 [out] [size_is(len)] char out_data[]
51         );
52         const long myconstant = 42;
53
54         /* test strings */
55         void TestCall (
56                 [in]   unistr *s1,
57                 [out]  unistr *s2
58                 );
59
60         /* test some alignment issues */
61         typedef struct {
62                 char v;
63         } echo_info1;
64
65         typedef struct {
66                 short v;
67         } echo_info2;
68
69         typedef struct {
70                 long v;
71         } echo_info3;
72
73         typedef struct {
74                 hyper v;
75         } echo_info4;
76
77         typedef struct {
78                 char v1;
79                 hyper v2;
80         } echo_info5;
81
82         typedef struct {
83                 char v1;
84                 echo_info1 info1;
85         } echo_info6;
86
87         typedef struct {
88                 char v1;
89                 echo_info4 info4;
90         } echo_info7;
91
92         typedef union {
93                 [case(1)]  echo_info1 info1;
94                 [case(2)]  echo_info2 info2;
95                 [case(3)]  echo_info3 info3;
96                 [case(4)]  echo_info4 info4;
97                 [case(5)]  echo_info5 info5;
98                 [case(6)]  echo_info6 info6;
99                 [case(7)]  echo_info7 info7;
100         } echo_Info;
101
102         long TestCall2 (
103                 [in]                     uint16 level,
104                 [out,switch_is(level)]   echo_Info **info
105                 );
106
107         long TestSleep(
108                 [in] long seconds
109                 );
110
111         typedef enum {
112                 ECHO_ENUM1 = 1,
113                 ECHO_ENUM2 = 2
114         } echo_Enum1;
115
116         typedef [v1_enum] enum {
117                 ECHO_ENUM1_32 = 1,
118                 ECHO_ENUM2_32 = 2
119         } echo_Enum1_32;
120
121         typedef struct {
122                 echo_Enum1 e1;
123                 echo_Enum1_32 e2;
124         } echo_Enum2;
125
126         typedef union {
127                 [case(ECHO_ENUM1)] echo_Enum1 e1;
128                 [case(ECHO_ENUM2)] echo_Enum2 e2;
129         } echo_Enum3;
130
131         void echo_TestEnum(
132                 [in,out,ref] echo_Enum1 *foo1,
133                 [in,out,ref] echo_Enum2 *foo2,
134                 [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
135                 );
136
137         typedef struct {
138                 long x;
139                 [size_is(x)] short surrounding[*];
140         } echo_Surrounding;
141
142         void echo_TestSurrounding(
143                 [in,out,ref] echo_Surrounding *data
144         );
145
146         short echo_TestDoublePointer([in] short ***data);
147 }