summaryrefslogtreecommitdiff
path: root/source4/librpc/idl/echo.idl
blob: 80123f992246e2935e4695431848d5f0e2ce2967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

[
  uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
  endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
  pointer_default(unique),
  version(1.0),
  helpstring("Simple echo pipe"),
  keepref
]
interface rpcecho
{
	/* Add one to an integer */
	void echo_AddOne(
		[in] uint32 in_data,
		[out] uint32 *out_data
	);
	/* Echo an array of bytes back at the caller */
	void echo_EchoData(
		[in] uint32 len,
		[in] [size_is(len)] uint8 in_data[],
		[out] [size_is(len)] uint8 out_data[]
	);
	/* Sink data to the server */
	void echo_SinkData(
		[in] uint32 len,
		[in,size_is(len)] uint8 data[]
	);
	/* Source data from server */
	void echo_SourceData(
		[in] uint32 len,
		[out,size_is(len)] uint8 data[]
	);

	/* test strings */
 	void echo_TestCall (
		[in,string,charset(UTF16)]       uint16 *s1,
		[out,string,charset(UTF16)]      uint16 **s2
 		);


	/* test some alignment issues */
	typedef struct {
		uint8 v;
	} echo_info1;

	typedef struct {
		uint16 v;
	} echo_info2;

	typedef struct {
		uint32 v;
	} echo_info3;

	typedef struct {
		hyper v;
	} echo_info4;

	typedef struct {
		uint8 v1;
		hyper v2;
	} echo_info5;

	typedef struct {
		uint8 v1;
		echo_info1 info1;
	} echo_info6;

	typedef struct {
		uint8 v1;
		echo_info4 info4;
	} echo_info7;

	typedef [switch_type(uint16)] union {
		[case(1)]  echo_info1 info1;
		[case(2)]  echo_info2 info2;
		[case(3)]  echo_info3 info3;
		[case(4)]  echo_info4 info4;
		[case(5)]  echo_info5 info5;
		[case(6)]  echo_info6 info6;
		[case(7)]  echo_info7 info7;
	} echo_Info;

	NTSTATUS echo_TestCall2 (
		     [in]                    uint16 level,
		     [out,switch_is(level)]  echo_Info *info
		);

	uint32 echo_TestSleep(
		[in] uint32 seconds
		);

	typedef enum {
		ECHO_ENUM1 = 1,
		ECHO_ENUM2 = 2
	} echo_Enum1;

	typedef [v1_enum] enum {
		ECHO_ENUM1_32 = 1,
		ECHO_ENUM2_32 = 2
	} echo_Enum1_32;

	typedef struct {
		echo_Enum1 e1;
		echo_Enum1_32 e2;
	} echo_Enum2;

	typedef [switch_type(uint16)] union {
		[case(ECHO_ENUM1)] echo_Enum1 e1;
		[case(ECHO_ENUM2)] echo_Enum2 e2;
	} echo_Enum3;

	void echo_TestEnum(
		[in,out,ref] echo_Enum1 *foo1,
		[in,out,ref] echo_Enum2 *foo2,
		[in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
		);

	typedef struct {
		uint32 x;
		[size_is(x)] uint16 surrounding[*];
	} echo_Surrounding;

	void echo_TestSurrounding(
		[in,out,ref] echo_Surrounding *data
	);

	uint16 echo_TestDoublePointer([in] uint16 ***data);
}