[KERNEL32]: Improve RtlUnwind spec export.
[reactos.git] / rostests / winetests / rpcrt4 / server.idl
1 /*
2 * A simple interface to test the RPC server.
3 *
4 * Copyright (C) Google 2007 (Dan Hipschman)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #pragma makedep client
22 #pragma makedep server
23
24 #include "server_defines.h"
25
26 typedef struct tag_vector
27 {
28 int x;
29 int y;
30 int z;
31 } vector_t;
32
33 typedef int fnprintf(const char *format, ...);
34
35 [
36 uuid(00000000-4114-0704-2301-000000000000),
37 implicit_handle(handle_t IServer_IfHandle)
38 ]
39 interface IServer
40 {
41 cpp_quote("#if 0")
42 typedef wchar_t WCHAR;
43 cpp_quote("#endif")
44
45 typedef [string] char *str_t;
46 typedef [string] WCHAR *wstr_t;
47
48 typedef struct
49 {
50 int *pi;
51 int **ppi;
52 int ***pppi;
53 } pints_t;
54
55 typedef struct
56 {
57 char *pc;
58 short *ps;
59 long *pl;
60 float *pf;
61 double *pd;
62 } ptypes_t;
63
64 typedef struct
65 {
66 vector_t *pu;
67 vector_t **pv;
68 } pvectors_t;
69
70 typedef struct
71 {
72 [switch_is(s)] union
73 {
74 [case(SUN_I)] int i;
75 [case(SUN_F1, SUN_F2)] float f;
76 [case(SUN_PI)] int *pi;
77 } u;
78
79 int s;
80 } sun_t;
81
82 int int_return(void);
83 int square(int x);
84 int sum(int x, int y);
85 signed char sum_char(signed char x, signed char y);
86 short sum_short(short x, short y);
87 int sum_float(float x, float y);
88 int sum_double_int(int x, double y);
89 hyper sum_hyper(hyper x, hyper y);
90 int sum_hyper_int(hyper x, hyper y);
91 int sum_char_hyper(signed char x, hyper y);
92 void square_out(int x, [out] int *y);
93 void square_ref([in, out] int *x);
94 int str_length([string] const char *s);
95 int str_t_length(str_t s);
96 int cstr_length([string, size_is(n)] const char *s, int n);
97 int dot_self(vector_t *v);
98 double square_half(double x, [out] double *y);
99 float square_half_float(float x, [out] float *y);
100 long square_half_long(long x, [out] long *y);
101 int sum_fixed_array(int a[5]);
102 int pints_sum(pints_t *pints);
103 double ptypes_sum(ptypes_t *ptypes);
104 int dot_pvectors(pvectors_t *pvectors);
105
106 /* don't use this anywhere except in sp_t */
107 typedef struct
108 {
109 int x;
110 } sp_inner_t;
111
112 typedef struct
113 {
114 int x;
115 sp_inner_t *s;
116 } sp_t;
117
118 int sum_sp(sp_t *sp);
119 double square_sun(sun_t *su);
120
121 typedef struct test_list
122 {
123 int t;
124 [switch_is(t)] union
125 {
126 [case(TL_NULL)] char x; /* end of list */
127 [case(TL_LIST)] struct test_list *tail;
128 } u;
129 } test_list_t;
130
131 typedef [ref] int *refpint_t;
132
133 int test_list_length(test_list_t *ls);
134 int sum_fixed_int_3d(int m[2][3][4]);
135 int sum_conf_array([size_is(n)] int x[], int n);
136 int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
137 int sum_unique_conf_array([size_is(n), unique] int x[], int n);
138 int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
139 int sum_var_array([length_is(n)] int x[20], int n);
140 int dot_two_vectors(vector_t vs[2]);
141 void get_number_array([out, length_is(*n)] int x[20], [out] int *n);
142
143 typedef struct
144 {
145 int n;
146 [size_is(n)] int ca[];
147 } cs_t;
148
149 typedef struct
150 {
151 int *pn;
152 [size_is(*pn)] int *ca1;
153 [size_is(n * 2)] int *ca2;
154 int n;
155 } cps_t;
156
157 typedef struct
158 {
159 [size_is(c ? a : b)] int *ca;
160 int a;
161 int b;
162 int c;
163 } cpsc_t;
164
165 int sum_cs(cs_t *cs);
166 int sum_cps(cps_t *cps);
167 int sum_cpsc(cpsc_t *cpsc);
168 int get_cpsc(int n, [out] cpsc_t *cpsc );
169 int sum_complex_array(int n, [size_is(n)] refpint_t pi[]);
170
171 typedef [wire_marshal(int)] void *puint_t;
172 int square_puint(puint_t p);
173
174 typedef struct
175 {
176 [size_is(n)] puint_t *ps;
177 int n;
178 } puints_t;
179
180 /* Same thing as puints_t, but make it complex (needs padding). */
181 typedef struct
182 {
183 [size_is(n)] puint_t *ps;
184 char n;
185 } cpuints_t;
186
187 int sum_puints(puints_t *p);
188 int sum_cpuints(cpuints_t *p);
189 int dot_copy_vectors(vector_t u, vector_t v);
190
191 typedef struct wire_us *wire_us_t;
192 typedef [wire_marshal(wire_us_t)] struct us us_t;
193 struct us
194 {
195 void *x;
196 };
197 struct wire_us
198 {
199 int x;
200 };
201 typedef struct
202 {
203 us_t us;
204 } test_us_t;
205
206 int square_test_us(test_us_t *tus);
207
208 typedef union encu switch (int t)
209 {
210 case ENCU_I: int i;
211 case ENCU_F: float f;
212 } encu_t;
213
214 typedef [switch_type(int)] union unencu
215 {
216 [case (ENCU_I)] int i;
217 [case (ENCU_F)] float f;
218 } unencu_t;
219
220 typedef enum
221 {
222 E1 = 23,
223 E2 = 4,
224 E3 = 0,
225 E4 = 64
226 } e_t;
227
228 typedef union encue switch (e_t t)
229 {
230 case E1: int i1;
231 case E2: float f2;
232 } encue_t;
233
234 typedef struct
235 {
236 e_t f;
237 } se_t;
238
239 double square_encu(encu_t *eu);
240 double square_unencu(int t, [switch_is(t)] unencu_t *eu);
241 int sum_parr(int *a[3]);
242 int sum_pcarr([size_is(n)] int *a[], int n);
243 int enum_ord(e_t e);
244 double square_encue(encue_t *eue);
245 void check_se2(se_t *s);
246
247 int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
248 int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
249
250 typedef struct
251 {
252 char c;
253 int i;
254 short s;
255 double d;
256 } aligns_t;
257
258 double sum_aligns(aligns_t *a);
259
260 typedef struct
261 {
262 int i;
263 char c;
264 } padded_t;
265
266 int sum_padded(padded_t *p);
267 int sum_padded2(padded_t ps[2]);
268 int sum_padded_conf([size_is(n)] padded_t *ps, int n);
269
270 typedef struct
271 {
272 int *p1;
273 } bogus_helper_t;
274
275 typedef struct
276 {
277 bogus_helper_t h;
278 int *p2;
279 int *p3;
280 char c;
281 } bogus_t;
282
283 int sum_bogus(bogus_t *b);
284 void check_null([unique] int *null);
285
286 typedef struct
287 {
288 str_t s;
289 } str_struct_t;
290
291 typedef struct
292 {
293 wstr_t s;
294 } wstr_struct_t;
295
296 int str_struct_len(str_struct_t *s);
297 int wstr_struct_len(wstr_struct_t *s);
298
299 typedef struct
300 {
301 unsigned int n;
302 [size_is(n)] byte a[];
303 } doub_carr_1_t;
304
305 typedef struct
306 {
307 int n;
308 [size_is(n)] doub_carr_1_t *a[];
309 } doub_carr_t;
310
311 int sum_doub_carr(doub_carr_t *dc);
312 void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
313
314 typedef struct
315 {
316 short n;
317 [size_is(n)] short data[];
318 } user_bstr_t;
319
320 typedef [unique] user_bstr_t *wire_bstr_t;
321 typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
322 unsigned hash_bstr(bstr_t s);
323 void get_a_bstr([out]bstr_t *s);
324 typedef struct
325 {
326 [string, size_is(size)] char *name;
327 unsigned int size;
328 } name_t;
329 void get_name([in,out] name_t *name);
330
331 typedef char **str_array_t;
332 void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names);
333 typedef WCHAR **wstr_array_t;
334 void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names);
335
336 int sum_pcarr2(int n, [size_is(, n)] int **pa);
337 int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
338
339 /* Don't use this except in the get_s123 test. */
340 typedef struct
341 {
342 int f1;
343 int f2;
344 int f3;
345 } s123_t;
346
347 /* Make sure WIDL generates a type format string for a previously unseen
348 type as a return value. */
349 s123_t *get_s123(void);
350
351 typedef struct
352 {
353 unsigned int length;
354 unsigned int size;
355 [size_is(size), length_is(length)] pints_t numbers[];
356 } numbers_struct_t;
357
358 void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
359 void get_numbers_struct([out] numbers_struct_t **ns);
360
361 str_t get_filename(void);
362
363 enum renum
364 {
365 RE0,
366 RE1,
367 RE2,
368 RE3,
369 };
370 const int RE_MIN = RE0;
371 const int RE_MAX = RE3;
372 typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
373 typedef [range(0, 100)] int rint_t;
374 rint_t echo_ranged_int([range(0, 10)] int i, [range(0, 20)] int j, [range(0, 100)] int k);
375 rint_t echo_ranged_int2([range(0, 40)] int i);
376 void get_ranged_enum([out] renum_t *re);
377
378 void context_handle_test(void);
379
380 void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
381 void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
382
383 void authinfo_test(unsigned int protseq, int secure);
384
385 void stop(void);
386 }