ReactOS 0.4.16-dev-1946-g52006dd
server.idl
Go to the documentation of this file.
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
24import "objidl.idl";
25
26#include "server_defines.h"
27
28#ifndef IFACE_NAME
29#define IFACE_NAME IMixedServer
30#endif
31
32#ifndef IFACE_HANDLE
33#define IFACE_HANDLE IMixedServer_IfHandle
34#endif
35
36#ifndef ISERVER_UUID
37#define ISERVER_UUID 00000000-4114-0704-2301-000000000000
38#endif
39
40cpp_quote("#ifndef SKIP_TYPE_DECLS")
42{
43 int x;
44 int y;
45 int z;
47
48typedef int fnprintf(const char *format, ...);
49cpp_quote("#endif")
50
51[
54]
55interface IFACE_NAME
56{
57cpp_quote("#if 0")
58 typedef wchar_t WCHAR;
59cpp_quote("#endif")
60
61cpp_quote("#ifndef SKIP_TYPE_DECLS")
62 typedef [string] char *str_t;
63 typedef [string] WCHAR *wstr_t;
64
65 typedef struct
66 {
67 int *pi;
68 int **ppi;
69 int ***pppi;
70 } pints_t;
71
72 typedef struct
73 {
74 char *pc;
75 short *ps;
76 long *pl;
77 float *pf;
78 double *pd;
79 } ptypes_t;
80
81 typedef struct
82 {
83 vector_t *pu;
84 vector_t **pv;
85 } pvectors_t;
86
87 typedef struct
88 {
89 [switch_is(s)] union
90 {
91 [case(SUN_I)] int i;
92 [case(SUN_F1, SUN_F2)] float f;
93 [case(SUN_PI)] int *pi;
94 } u;
95
96 int s;
97 } sun_t;
98
99 typedef struct
100 {
101 signed char a, b, c, d, e;
102 } chars_t;
103
104 typedef struct
105 {
106 int i;
107 hyper j;
108 } ints_t;
109
110 typedef struct
111 {
112 int i;
113 float f;
114 } flts_t;
115
116 typedef struct
117 {
118 int i;
119 double d;
120 } dbls_t;
121cpp_quote("#endif")
122
123 int int_return(void);
124 int square(int x);
125 int sum(int x, int y);
126 signed char sum_char(signed char x, signed char y);
127 short sum_short(short x, short y);
128 int sum_float(float x, float y);
129 int sum_double_int(int x, double y);
130 hyper sum_hyper(hyper x, hyper y);
131 int sum_hyper_int(hyper x, hyper y);
132 int sum_char_hyper(signed char x, hyper y);
133 int sum_ints(int a, ints_t x, ints_t y);
134 int sum_chars(int a, chars_t x, chars_t y);
135 int sum_flts(int a, flts_t x, flts_t y);
136 int sum_dbls(int a, dbls_t x, dbls_t y);
137 int sum_iiff(int x0, int y0, float x1, float y1);
138 int sum_ifif(int x0, float y0, int x1, float y1);
139 int sum_iidd(int x0, int y0, double x1, double y1);
140 int sum_idid(int x0, double y0, int x1, double y1);
141 int sum_ififififififif(int x0, float y0, int x1, float y1, int x2, float y2, int x3, float y3, int x4, float y4, int x5, float y5, int x6, float y6);
142 int sum_ididididididid(int x0, double y0, int x1, double y1, int x2, double y2, int x3, double y3, int x4, double y4, int x5, double y5, int x6, double y6);
143 int sum_idfdifdfifdfidifdidf(int x0, double y0, float z0, double y1, int x1, float z1, double y2, float z2, int x2, float z3, double y3, float z4, int x3, double y4, int x4, float z5, double y5, int x5, double y6, float z6);
144 int sum_ididididididididididid(int x0, double y0, int x1, double y1, int x2, double y2, int x3, double y3, int x4, double y4, int x5, double y5, int x6, double y6, int x7, double y7, int x8, double y8);
145 int sum_iidiidiidiidiidiidiidiidiidiidiid(int x0, int x1, double y0, int x2, int x3, double y1, int x4, int x5, double y2, int x6, int x7, double y3, int x8, int x9, double y4, int x10, int x11, double y5, int x12, int x13, double y6, int x14, int x15, double y7, int x16, int x17, double y8);
146 int sum_iyiy(int x0, hyper y0, int x1, hyper y1);
147 void square_out(int x, [out] int *y);
148 void square_ref([in, out] int *x);
149 int str_length([string] const char *s);
150 int str_t_length(str_t s);
151 int cstr_length([string, size_is(n)] const char *s, int n);
152 int dot_self(vector_t *v);
153 double square_half(double x, [out] double *y);
154 float square_half_float(float x, [out] float *y);
155 long square_half_long(long x, [out] long *y);
156 int sum_fixed_array(int a[5]);
157 int pints_sum(pints_t *pints);
158 double ptypes_sum(ptypes_t *ptypes);
159 int dot_pvectors(pvectors_t *pvectors);
160
161cpp_quote("#ifndef SKIP_TYPE_DECLS")
162 /* don't use this anywhere except in sp_t */
163 typedef struct
164 {
165 int x;
166 } sp_inner_t;
167
168 typedef struct
169 {
170 int x;
171 sp_inner_t *s;
172 } sp_t;
173cpp_quote("#endif")
174
175 int sum_sp(sp_t *sp);
176 double square_sun(sun_t *su);
177
178cpp_quote("#ifndef SKIP_TYPE_DECLS")
179 typedef struct test_list
180 {
181 int t;
182 [switch_is(t)] union
183 {
184 [case(TL_NULL)] char x; /* end of list */
185 [case(TL_LIST)] struct test_list *tail;
186 } u;
187 } test_list_t;
188
189 typedef [ref] int *refpint_t;
190cpp_quote("#endif")
191
192 int test_list_length(test_list_t *ls);
193 int sum_fixed_int_3d(int m[2][3][4]);
194 int sum_conf_array([size_is(n)] int x[], int n);
195 int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
196 int sum_unique_conf_array([size_is(n), unique] int x[], int n);
197 int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
198 int sum_var_array([length_is(n)] int x[20], int n);
199 int dot_two_vectors(vector_t vs[2]);
200 void get_number_array([out, length_is(*n)] int x[20], [out] int *n);
201
202cpp_quote("#ifndef SKIP_TYPE_DECLS")
203 typedef struct
204 {
205 int n;
206 [size_is(n)] int ca[];
207 } cs_t;
208
209 typedef struct
210 {
211 int n;
212 [size_is(n)] int *ca;
213 } cs_blob_t;
214
215 typedef struct
216 {
217/* FIXME: widl generates incorrect correlation descriptor and the tests crash */
218#if 0
219 int dummy[1]; /* to make offset to conformant array unique */
220#endif
221 cs_blob_t blob;
222 } cs_data_t;
223
224 typedef struct
225 {
226/* FIXME: widl generates incorrect correlation descriptor and the tests crash */
227#if 0
228 int dummy[2]; /* to make offset to conformant array unique */
229#endif
230 cs_data_t data;
231 } cs_container_t;
232
233 typedef struct
234 {
235 int *pn;
236 [size_is(*pn)] int *ca1;
237 [size_is(n * 2)] int *ca2;
238 int n;
239 } cps_t;
240
241 typedef struct
242 {
243 [size_is(c ? a : b)] int *ca;
244 int a;
245 int b;
246 int c;
247 } cpsc_t;
248cpp_quote("#endif")
249
250 int sum_cs(cs_t *cs);
251 int sum_cps(cps_t *cps);
252 int sum_cpsc(cpsc_t *cpsc);
253 int get_cpsc(int n, [out] cpsc_t *cpsc );
254 int sum_complex_array(int n, [size_is(n)] refpint_t pi[]);
255 int sum_blob([in] cs_blob_t *blob);
256 int sum_data([in] cs_data_t *data);
257 int sum_container([in] cs_container_t *container);
258
259cpp_quote("#ifndef SKIP_TYPE_DECLS")
260 typedef [wire_marshal(int)] void *puint_t;
261cpp_quote("#endif")
262 int square_puint(puint_t p);
263
264cpp_quote("#ifndef SKIP_TYPE_DECLS")
265 typedef struct
266 {
267 [size_is(n)] puint_t *ps;
268 int n;
269 } puints_t;
270
271 /* Same thing as puints_t, but make it complex (needs padding). */
272 typedef struct
273 {
274 [size_is(n)] puint_t *ps;
275 char n;
276 } cpuints_t;
277cpp_quote("#endif")
278
279 int sum_puints(puints_t *p);
280 int sum_cpuints(cpuints_t *p);
281 int dot_copy_vectors(vector_t u, vector_t v);
282
283cpp_quote("#ifndef SKIP_TYPE_DECLS")
284 typedef struct wire_us *wire_us_t;
285 typedef [wire_marshal(wire_us_t)] struct us us_t;
286 struct us
287 {
288 void *x;
289 };
290 struct wire_us
291 {
292 int x;
293 };
294 typedef struct
295 {
296 us_t us;
297 } test_us_t;
298cpp_quote("#endif")
299
300 int square_test_us(test_us_t *tus);
301
302cpp_quote("#ifndef SKIP_TYPE_DECLS")
303 typedef union encu switch (int t)
304 {
305 case ENCU_I: int i;
306 case ENCU_F: float f;
307 } encu_t;
308
309 typedef [switch_type(int)] union unencu
310 {
311 [case (ENCU_I)] int i;
312 [case (ENCU_F)] float f;
313 } unencu_t;
314
315 typedef enum
316 {
317 E1 = 23,
318 E2 = 4,
319 E3 = 0,
320 E4 = 64
321 } e_t;
322
323 typedef union encue switch (e_t t)
324 {
325 case E1: int i1;
326 case E2: float f2;
327 } encue_t;
328
329 typedef struct
330 {
331 e_t f;
332 } se_t;
333cpp_quote("#endif")
334
335 double square_encu(encu_t *eu);
336 double square_unencu(int t, [switch_is(t)] unencu_t *eu);
337 int sum_parr(int *a[3]);
338 int sum_pcarr([size_is(n)] int *a[], int n);
339 int enum_ord(e_t e);
340 double square_encue(encue_t *eue);
341 void check_se2(se_t *s);
342
343 int sum_toplev_conf_2n([size_is(n * 2)] int *x, int n);
344 int sum_toplev_conf_cond([size_is(c ? a : b)] int *x, int a, int b, int c);
345
346cpp_quote("#ifndef SKIP_TYPE_DECLS")
347 typedef struct
348 {
349 char c;
350 int i;
351 short s;
352 double d;
353 } aligns_t;
354cpp_quote("#endif")
355
356 double sum_aligns(aligns_t *a);
357
358cpp_quote("#ifndef SKIP_TYPE_DECLS")
359 typedef struct
360 {
361 int i;
362 char c;
363 } padded_t;
364cpp_quote("#endif")
365
366 int sum_padded(padded_t *p);
367 int sum_padded2(padded_t ps[2]);
368 int sum_padded_conf([size_is(n)] padded_t *ps, int n);
369
370cpp_quote("#ifndef SKIP_TYPE_DECLS")
371 typedef struct
372 {
373 int *p1;
374 } bogus_helper_t;
375
376 typedef struct
377 {
378 bogus_helper_t h;
379 int *p2;
380 int *p3;
381 char c;
382 } bogus_t;
383cpp_quote("#endif")
384
385 int sum_bogus(bogus_t *b);
386 void check_null([unique] int *null);
387
388cpp_quote("#ifndef SKIP_TYPE_DECLS")
389 typedef struct
390 {
391 str_t s;
392 } str_struct_t;
393
394 typedef struct
395 {
396 wstr_t s;
397 } wstr_struct_t;
398cpp_quote("#endif")
399
400 int str_struct_len(str_struct_t *s);
401 int wstr_struct_len(wstr_struct_t *s);
402
403cpp_quote("#ifndef SKIP_TYPE_DECLS")
404 typedef struct
405 {
406 unsigned int n;
407 [size_is(n)] byte a[];
408 } doub_carr_1_t;
409
410 typedef struct
411 {
412 int n;
413 [size_is(n)] doub_carr_1_t *a[];
414 } doub_carr_t;
415cpp_quote("#endif")
416
417 int sum_doub_carr(doub_carr_t *dc);
418 void make_pyramid_doub_carr(unsigned char n, [out] doub_carr_t **dc);
419
420cpp_quote("#ifndef SKIP_TYPE_DECLS")
421 typedef struct
422 {
423 short n;
424 [size_is(n)] short data[];
425 } user_bstr_t;
426
427 typedef [unique] user_bstr_t *wire_bstr_t;
428 typedef [wire_marshal(wire_bstr_t)] short *bstr_t;
429cpp_quote("#endif")
430 unsigned hash_bstr(bstr_t s);
431 void get_a_bstr([out]bstr_t *s);
432cpp_quote("#ifndef SKIP_TYPE_DECLS")
433 typedef struct
434 {
435 [string, size_is(size)] char *name;
436 unsigned int size;
437 } name_t;
438cpp_quote("#endif")
439 void get_name([in,out] name_t *name);
440
441cpp_quote("#ifndef SKIP_TYPE_DECLS")
442 typedef char **str_array_t;
443 typedef WCHAR **wstr_array_t;
444cpp_quote("#endif")
445 void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names);
446 void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names);
447
448 int sum_pcarr2(int n, [size_is(, n)] int **pa);
449 int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
450
451cpp_quote("#ifndef SKIP_TYPE_DECLS")
452 /* Don't use this except in the get_s123 test. */
453 typedef struct
454 {
455 int f1;
456 int f2;
457 int f3;
458 } s123_t;
459cpp_quote("#endif")
460
461 /* Make sure WIDL generates a type format string for a previously unseen
462 type as a return value. */
463 s123_t *get_s123(void);
464
465cpp_quote("#ifndef SKIP_TYPE_DECLS")
466 typedef struct
467 {
468 unsigned int length;
469 unsigned int size;
470 [size_is(size), length_is(length)] pints_t numbers[];
471 } numbers_struct_t;
472cpp_quote("#endif")
473
474 void get_numbers([in] int length, [in] int size, [out, length_is(length), size_is(size)] pints_t pn[]);
475 void get_numbers_struct([out] numbers_struct_t **ns);
476
477 str_t get_filename(void);
478
479cpp_quote("#ifndef SKIP_TYPE_DECLS")
480 enum renum
481 {
482 RE0,
483 RE1,
484 RE2,
485 RE3,
486 };
487 const int RE_MIN = RE0;
488 const int RE_MAX = RE3;
489 typedef [range(RE_MIN, RE_MAX)] enum renum renum_t;
490 typedef [range(0, 100)] int rint_t;
491cpp_quote("#endif")
492 rint_t echo_ranged_int([range(0, 10)] int i, [range(0, 20)] int j, [range(0, 100)] int k);
493 rint_t echo_ranged_int2([range(0, 40)] int i);
494 void get_ranged_enum([out] renum_t *re);
495
496 void context_handle_test(void);
497
498 void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
499 void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
500
501 void authinfo_test(unsigned int protseq, int secure);
502
503 void stop(void);
504 void stop_autolisten(void);
505
506cpp_quote("#ifndef SKIP_TYPE_DECLS")
507 typedef union ipu switch(int t)
508 {
509 default: IStream *stream;
510 } ipu_t;
511cpp_quote("#endif")
512
513 void ip_test([in] ipu_t *a);
514
515 int sum_ptr_array([in] int *a[2]);
516 int sum_array_ptr([in] int (*a)[2]);
517
518cpp_quote("#ifndef SKIP_TYPE_DECLS")
519 typedef [context_handle] void *ctx_handle_t;
520cpp_quote("#endif")
521
522 ctx_handle_t get_handle();
523 void get_handle_by_ptr([out] ctx_handle_t *r);
524 void test_handle(ctx_handle_t ctx_handle);
525
526 void test_I_RpcBindingInqLocalClientPID([in] unsigned int protseq, [in] handle_t binding);
527}
implicit_handle(handle_t browser_hBinding)] interface browser
Definition: browser.idl:136
CD3D10_BUFFER_DESC D3D10_BUFFER_DESC cpp_quote(" ~CD3D10_BUFFER_DESC() {}") operator const D3D10_BUFFER_DESC &() const
Definition: d3d10.idl:491
wchar_t WCHAR
Definition: server.idl:58
Definition: msctf.idl:532
struct tag_vector vector_t
#define IFACE_HANDLE
Definition: server.idl:33
int fnprintf(const char *format,...)
Definition: server.idl:48
#define ISERVER_UUID
Definition: server.idl:37
Definition: format.c:58