include: Add transact.idl to oledb.idl.
[wine.git] / dlls / rpcrt4 / tests / server.idl
blob4d945dcca3e1cab35f38312367e13af8e200071c
1 /*
2 * A simple interface to test the RPC server.
4 * Copyright (C) Google 2007 (Dan Hipschman)
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.
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.
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
21 #pragma makedep client
22 #pragma makedep server
24 import "objidl.idl";
26 #include "server_defines.h"
28 #ifndef IFACE_NAME
29 #define IFACE_NAME IMixedServer
30 #endif
32 #ifndef IFACE_HANDLE
33 #define IFACE_HANDLE IMixedServer_IfHandle
34 #endif
36 #ifndef ISERVER_UUID
37 #define ISERVER_UUID 00000000-4114-0704-2301-000000000000
38 #endif
40 cpp_quote("#ifndef SKIP_TYPE_DECLS")
41 typedef struct tag_vector
43 int x;
44 int y;
45 int z;
46 } vector_t;
48 typedef int fnprintf(const char *format, ...);
49 cpp_quote("#endif")
52 uuid(ISERVER_UUID),
53 implicit_handle(handle_t IFACE_HANDLE)
55 interface IFACE_NAME
57 cpp_quote("#if 0")
58 typedef wchar_t WCHAR;
59 cpp_quote("#endif")
61 cpp_quote("#ifndef SKIP_TYPE_DECLS")
62 typedef [string] char *str_t;
63 typedef [string] WCHAR *wstr_t;
65 typedef struct
67 int *pi;
68 int **ppi;
69 int ***pppi;
70 } pints_t;
72 typedef struct
74 char *pc;
75 short *ps;
76 long *pl;
77 float *pf;
78 double *pd;
79 } ptypes_t;
81 typedef struct
83 vector_t *pu;
84 vector_t **pv;
85 } pvectors_t;
87 typedef struct
89 [switch_is(s)] union
91 [case(SUN_I)] int i;
92 [case(SUN_F1, SUN_F2)] float f;
93 [case(SUN_PI)] int *pi;
94 } u;
96 int s;
97 } sun_t;
98 cpp_quote("#endif")
100 int int_return(void);
101 int square(int x);
102 int sum(int x, int y);
103 signed char sum_char(signed char x, signed char y);
104 short sum_short(short x, short y);
105 int sum_float(float x, float y);
106 int sum_double_int(int x, double y);
107 hyper sum_hyper(hyper x, hyper y);
108 int sum_hyper_int(hyper x, hyper y);
109 int sum_char_hyper(signed char x, hyper y);
110 void square_out(int x, [out] int *y);
111 void square_ref([in, out] int *x);
112 int str_length([string] const char *s);
113 int str_t_length(str_t s);
114 int cstr_length([string, size_is(n)] const char *s, int n);
115 int dot_self(vector_t *v);
116 double square_half(double x, [out] double *y);
117 float square_half_float(float x, [out] float *y);
118 long square_half_long(long x, [out] long *y);
119 int sum_fixed_array(int a[5]);
120 int pints_sum(pints_t *pints);
121 double ptypes_sum(ptypes_t *ptypes);
122 int dot_pvectors(pvectors_t *pvectors);
124 cpp_quote("#ifndef SKIP_TYPE_DECLS")
125 /* don't use this anywhere except in sp_t */
126 typedef struct
128 int x;
129 } sp_inner_t;
131 typedef struct
133 int x;
134 sp_inner_t *s;
135 } sp_t;
136 cpp_quote("#endif")
138 int sum_sp(sp_t *sp);
139 double square_sun(sun_t *su);
141 cpp_quote("#ifndef SKIP_TYPE_DECLS")
142 typedef struct test_list
144 int t;
145 [switch_is(t)] union
147 [case(TL_NULL)] char x; /* end of list */
148 [case(TL_LIST)] struct test_list *tail;
149 } u;
150 } test_list_t;
152 typedef [ref] int *refpint_t;
153 cpp_quote("#endif")
155 int test_list_length(test_list_t *ls);
156 int sum_fixed_int_3d(int m[2][3][4]);
157 int sum_conf_array([size_is(n)] int x[], int n);
158 int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
159 int sum_unique_conf_array([size_is(n), unique] int x[], int n);
160 int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
161 int sum_var_array([length_is(n)] int x[20], int n);
162 int dot_two_vectors(vector_t vs[2]);
163 void get_number_array([out, length_is(*n)] int x[20], [out] int *n);
165 cpp_quote("#ifndef SKIP_TYPE_DECLS")
166 typedef struct
168 int n;
169 [size_is(n)] int ca[];
170 } cs_t;
172 typedef struct
174 int n;
175 [size_is(n)] int *ca;
176 } cs_blob_t;
178 typedef struct
180 /* FIXME: widl generates incorrect correlation descriptor and the tests crash */
181 #if 0
182 int dummy[1]; /* to make offset to conformant array unique */
183 #endif
184 cs_blob_t blob;
185 } cs_data_t;
187 typedef struct
189 /* FIXME: widl generates incorrect correlation descriptor and the tests crash */
190 #if 0
191 int dummy[2]; /* to make offset to conformant array unique */
192 #endif
193 cs_data_t data;
194 } cs_container_t;
196 typedef struct
198 int *pn;
199 [size_is(*pn)] int *ca1;
200 [size_is(n * 2)] int *ca2;
201 int n;
202 } cps_t;
204 typedef struct
206 [size_is(c ? a : b)] int *ca;
207 int a;
208 int b;
209 int c;
210 } cpsc_t;
211 cpp_quote("#endif")
213 int sum_cs(cs_t *cs);
214 int sum_cps(cps_t *cps);
215 int sum_cpsc(cpsc_t *cpsc);
216 int get_cpsc(int n, [out] cpsc_t *cpsc );
217 int sum_complex_array(int n, [size_is(n)] refpint_t pi[]);
218 int sum_blob([in] cs_blob_t *blob);
219 int sum_data([in] cs_data_t *data);
220 int sum_container([in] cs_container_t *container);
222 cpp_quote("#ifndef SKIP_TYPE_DECLS")
223 typedef [wire_marshal(int)] void *puint_t;
224 cpp_quote("#endif")
225 int square_puint(puint_t p);
227 cpp_quote("#ifndef SKIP_TYPE_DECLS")
228 typedef struct
230 [size_is(n)] puint_t *ps;
231 int n;
232 } puints_t;
234 /* Same thing as puints_t, but make it complex (needs padding). */
235 typedef struct
237 [size_is(n)] puint_t *ps;
238 char n;
239 } cpuints_t;
240 cpp_quote("#endif")
242 int sum_puints(puints_t *p);
243 int sum_cpuints(cpuints_t *p);
244 int dot_copy_vectors(vector_t u, vector_t v);
246 cpp_quote("#ifndef SKIP_TYPE_DECLS")
247 typedef struct wire_us *wire_us_t;
248 typedef [wire_marshal(wire_us_t)] struct us us_t;
249 struct us
251 void *x;
253 struct wire_us
255 int x;
257 typedef struct
259 us_t us;
260 } test_us_t;
261 cpp_quote("#endif")
263 int square_test_us(test_us_t *tus);
265 cpp_quote("#ifndef SKIP_TYPE_DECLS")
266 typedef union encu switch (int t)
268 case ENCU_I: int i;
269 case ENCU_F: float f;
270 } encu_t;
272 typedef [switch_type(int)] union unencu
274 [case (ENCU_I)] int i;
275 [case (ENCU_F)] float f;
276 } unencu_t;
278 typedef enum
280 E1 = 23,
281 E2 = 4,
282 E3 = 0,
283 E4 = 64
284 } e_t;
286 typedef union encue switch (e_t t)
288 case E1: int i1;
289 case E2: float f2;
290 } encue_t;
292 typedef struct
294 e_t f;
295 } se_t;
296 cpp_quote("#endif")
298 double square_encu(encu_t *eu);
299 double square_unencu(int t, [switch_is(t)] unencu_t *eu);
300 int sum_parr(int *a[3]);
301 int sum_pcarr([size_is(n)] int *a[], int n);
302 int enum_ord(e_t e);
303 double square_encue(encue_t *eue);
304 void check_se2(se_t *s);
306 int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
307 int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
309 cpp_quote("#ifndef SKIP_TYPE_DECLS")
310 typedef struct
312 char c;
313 int i;
314 short s;
315 double d;
316 } aligns_t;
317 cpp_quote("#endif")
319 double sum_aligns(aligns_t *a);
321 cpp_quote("#ifndef SKIP_TYPE_DECLS")
322 typedef struct
324 int i;
325 char c;
326 } padded_t;
327 cpp_quote("#endif")
329 int sum_padded(padded_t *p);
330 int sum_padded2(padded_t ps[2]);
331 int sum_padded_conf([size_is(n)] padded_t *ps, int n);
333 cpp_quote("#ifndef SKIP_TYPE_DECLS")
334 typedef struct
336 int *p1;
337 } bogus_helper_t;
339 typedef struct
341 bogus_helper_t h;
342 int *p2;
343 int *p3;
344 char c;
345 } bogus_t;
346 cpp_quote("#endif")
348 int sum_bogus(bogus_t *b);
349 void check_null([unique] int *null);
351 cpp_quote("#ifndef SKIP_TYPE_DECLS")
352 typedef struct
354 str_t s;
355 } str_struct_t;
357 typedef struct
359 wstr_t s;
360 } wstr_struct_t;
361 cpp_quote("#endif")
363 int str_struct_len(str_struct_t *s);
364 int wstr_struct_len(wstr_struct_t *s);
366 cpp_quote("#ifndef SKIP_TYPE_DECLS")
367 typedef struct
369 unsigned int n;
370 [size_is(n)] byte a[];
371 } doub_carr_1_t;
373 typedef struct
375 int n;
376 [size_is(n)] doub_carr_1_t *a[];
377 } doub_carr_t;
378 cpp_quote("#endif")
380 int sum_doub_carr(doub_carr_t *dc);
381 void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
383 cpp_quote("#ifndef SKIP_TYPE_DECLS")
384 typedef struct
386 short n;
387 [size_is(n)] short data[];
388 } user_bstr_t;
390 typedef [unique] user_bstr_t *wire_bstr_t;
391 typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
392 cpp_quote("#endif")
393 unsigned hash_bstr(bstr_t s);
394 void get_a_bstr([out]bstr_t *s);
395 cpp_quote("#ifndef SKIP_TYPE_DECLS")
396 typedef struct
398 [string, size_is(size)] char *name;
399 unsigned int size;
400 } name_t;
401 cpp_quote("#endif")
402 void get_name([in,out] name_t *name);
404 cpp_quote("#ifndef SKIP_TYPE_DECLS")
405 typedef char **str_array_t;
406 typedef WCHAR **wstr_array_t;
407 cpp_quote("#endif")
408 void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names);
409 void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names);
411 int sum_pcarr2(int n, [size_is(, n)] int **pa);
412 int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
414 cpp_quote("#ifndef SKIP_TYPE_DECLS")
415 /* Don't use this except in the get_s123 test. */
416 typedef struct
418 int f1;
419 int f2;
420 int f3;
421 } s123_t;
422 cpp_quote("#endif")
424 /* Make sure WIDL generates a type format string for a previously unseen
425 type as a return value. */
426 s123_t *get_s123(void);
428 cpp_quote("#ifndef SKIP_TYPE_DECLS")
429 typedef struct
431 unsigned int length;
432 unsigned int size;
433 [size_is(size), length_is(length)] pints_t numbers[];
434 } numbers_struct_t;
435 cpp_quote("#endif")
437 void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
438 void get_numbers_struct([out] numbers_struct_t **ns);
440 str_t get_filename(void);
442 cpp_quote("#ifndef SKIP_TYPE_DECLS")
443 enum renum
445 RE0,
446 RE1,
447 RE2,
448 RE3,
450 const int RE_MIN = RE0;
451 const int RE_MAX = RE3;
452 typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
453 typedef [range(0, 100)] int rint_t;
454 cpp_quote("#endif")
455 rint_t echo_ranged_int([range(0, 10)] int i, [range(0, 20)] int j, [range(0, 100)] int k);
456 rint_t echo_ranged_int2([range(0, 40)] int i);
457 void get_ranged_enum([out] renum_t *re);
459 void context_handle_test(void);
461 void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
462 void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
464 void authinfo_test(unsigned int protseq, int secure);
466 void stop(void);
467 void stop_autolisten(void);
469 cpp_quote("#ifndef SKIP_TYPE_DECLS")
470 typedef union ipu switch(int t)
472 default: IStream *stream;
473 } ipu_t;
474 cpp_quote("#endif")
476 void ip_test([in] ipu_t *a);
478 int sum_ptr_array([in] int *a[2]);
479 int sum_array_ptr([in] int (*a)[2]);
481 cpp_quote("#ifndef SKIP_TYPE_DECLS")
482 typedef [context_handle] void *ctx_handle_t;
483 cpp_quote("#endif")
485 ctx_handle_t get_handle();
486 void get_handle_by_ptr([out] ctx_handle_t *r);
487 void test_handle(ctx_handle_t ctx_handle);