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