Regenerate DCE/RPC client code after fixing memcpy() length bug in pidl.
[Samba.git] / source / librpc / gen_ndr / cli_echo.c
blob23a8907de3b5b6e69a774e4886428d38db938147
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_echo.h"
9 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
10 TALLOC_CTX *mem_ctx,
11 uint32_t in_data /* [in] */,
12 uint32_t *out_data /* [out] [ref] */)
14 struct echo_AddOne r;
15 NTSTATUS status;
17 /* In parameters */
18 r.in.in_data = in_data;
20 if (DEBUGLEVEL >= 10) {
21 NDR_PRINT_IN_DEBUG(echo_AddOne, &r);
24 status = cli_do_rpc_ndr(cli,
25 mem_ctx,
26 PI_RPCECHO,
27 &ndr_table_rpcecho,
28 NDR_ECHO_ADDONE,
29 &r);
31 if (!NT_STATUS_IS_OK(status)) {
32 return status;
35 if (DEBUGLEVEL >= 10) {
36 NDR_PRINT_OUT_DEBUG(echo_AddOne, &r);
39 if (NT_STATUS_IS_ERR(status)) {
40 return status;
43 /* Return variables */
44 *out_data = *r.out.out_data;
46 /* Return result */
47 return NT_STATUS_OK;
50 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
51 TALLOC_CTX *mem_ctx,
52 uint32_t len /* [in] */,
53 uint8_t *in_data /* [in] [size_is(len)] */,
54 uint8_t *out_data /* [out] [size_is(len)] */)
56 struct echo_EchoData r;
57 NTSTATUS status;
59 /* In parameters */
60 r.in.len = len;
61 r.in.in_data = in_data;
63 if (DEBUGLEVEL >= 10) {
64 NDR_PRINT_IN_DEBUG(echo_EchoData, &r);
67 status = cli_do_rpc_ndr(cli,
68 mem_ctx,
69 PI_RPCECHO,
70 &ndr_table_rpcecho,
71 NDR_ECHO_ECHODATA,
72 &r);
74 if (!NT_STATUS_IS_OK(status)) {
75 return status;
78 if (DEBUGLEVEL >= 10) {
79 NDR_PRINT_OUT_DEBUG(echo_EchoData, &r);
82 if (NT_STATUS_IS_ERR(status)) {
83 return status;
86 /* Return variables */
87 memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data));
89 /* Return result */
90 return NT_STATUS_OK;
93 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
94 TALLOC_CTX *mem_ctx,
95 uint32_t len /* [in] */,
96 uint8_t *data /* [in] [size_is(len)] */)
98 struct echo_SinkData r;
99 NTSTATUS status;
101 /* In parameters */
102 r.in.len = len;
103 r.in.data = data;
105 if (DEBUGLEVEL >= 10) {
106 NDR_PRINT_IN_DEBUG(echo_SinkData, &r);
109 status = cli_do_rpc_ndr(cli,
110 mem_ctx,
111 PI_RPCECHO,
112 &ndr_table_rpcecho,
113 NDR_ECHO_SINKDATA,
114 &r);
116 if (!NT_STATUS_IS_OK(status)) {
117 return status;
120 if (DEBUGLEVEL >= 10) {
121 NDR_PRINT_OUT_DEBUG(echo_SinkData, &r);
124 if (NT_STATUS_IS_ERR(status)) {
125 return status;
128 /* Return variables */
130 /* Return result */
131 return NT_STATUS_OK;
134 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
135 TALLOC_CTX *mem_ctx,
136 uint32_t len /* [in] */,
137 uint8_t *data /* [out] [size_is(len)] */)
139 struct echo_SourceData r;
140 NTSTATUS status;
142 /* In parameters */
143 r.in.len = len;
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_IN_DEBUG(echo_SourceData, &r);
149 status = cli_do_rpc_ndr(cli,
150 mem_ctx,
151 PI_RPCECHO,
152 &ndr_table_rpcecho,
153 NDR_ECHO_SOURCEDATA,
154 &r);
156 if (!NT_STATUS_IS_OK(status)) {
157 return status;
160 if (DEBUGLEVEL >= 10) {
161 NDR_PRINT_OUT_DEBUG(echo_SourceData, &r);
164 if (NT_STATUS_IS_ERR(status)) {
165 return status;
168 /* Return variables */
169 memcpy(data, r.out.data, r.in.len * sizeof(*data));
171 /* Return result */
172 return NT_STATUS_OK;
175 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
176 TALLOC_CTX *mem_ctx,
177 const char *s1 /* [in] [ref,charset(UTF16)] */,
178 const char **s2 /* [out] [ref,charset(UTF16)] */)
180 struct echo_TestCall r;
181 NTSTATUS status;
183 /* In parameters */
184 r.in.s1 = s1;
186 if (DEBUGLEVEL >= 10) {
187 NDR_PRINT_IN_DEBUG(echo_TestCall, &r);
190 status = cli_do_rpc_ndr(cli,
191 mem_ctx,
192 PI_RPCECHO,
193 &ndr_table_rpcecho,
194 NDR_ECHO_TESTCALL,
195 &r);
197 if (!NT_STATUS_IS_OK(status)) {
198 return status;
201 if (DEBUGLEVEL >= 10) {
202 NDR_PRINT_OUT_DEBUG(echo_TestCall, &r);
205 if (NT_STATUS_IS_ERR(status)) {
206 return status;
209 /* Return variables */
210 *s2 = *r.out.s2;
212 /* Return result */
213 return NT_STATUS_OK;
216 NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
217 TALLOC_CTX *mem_ctx,
218 uint16_t level /* [in] */,
219 union echo_Info *info /* [out] [ref,switch_is(level)] */)
221 struct echo_TestCall2 r;
222 NTSTATUS status;
224 /* In parameters */
225 r.in.level = level;
227 if (DEBUGLEVEL >= 10) {
228 NDR_PRINT_IN_DEBUG(echo_TestCall2, &r);
231 status = cli_do_rpc_ndr(cli,
232 mem_ctx,
233 PI_RPCECHO,
234 &ndr_table_rpcecho,
235 NDR_ECHO_TESTCALL2,
236 &r);
238 if (!NT_STATUS_IS_OK(status)) {
239 return status;
242 if (DEBUGLEVEL >= 10) {
243 NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r);
246 if (NT_STATUS_IS_ERR(status)) {
247 return status;
250 /* Return variables */
251 *info = *r.out.info;
253 /* Return result */
254 return r.out.result;
257 NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
258 TALLOC_CTX *mem_ctx,
259 uint32_t seconds /* [in] */)
261 struct echo_TestSleep r;
262 NTSTATUS status;
264 /* In parameters */
265 r.in.seconds = seconds;
267 if (DEBUGLEVEL >= 10) {
268 NDR_PRINT_IN_DEBUG(echo_TestSleep, &r);
271 status = cli_do_rpc_ndr(cli,
272 mem_ctx,
273 PI_RPCECHO,
274 &ndr_table_rpcecho,
275 NDR_ECHO_TESTSLEEP,
276 &r);
278 if (!NT_STATUS_IS_OK(status)) {
279 return status;
282 if (DEBUGLEVEL >= 10) {
283 NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r);
286 if (NT_STATUS_IS_ERR(status)) {
287 return status;
290 /* Return variables */
292 /* Return result */
293 return NT_STATUS_OK;
296 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
297 TALLOC_CTX *mem_ctx,
298 enum echo_Enum1 *foo1 /* [in,out] [ref] */,
299 struct echo_Enum2 *foo2 /* [in,out] [ref] */,
300 union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */)
302 struct echo_TestEnum r;
303 NTSTATUS status;
305 /* In parameters */
306 r.in.foo1 = foo1;
307 r.in.foo2 = foo2;
308 r.in.foo3 = foo3;
310 if (DEBUGLEVEL >= 10) {
311 NDR_PRINT_IN_DEBUG(echo_TestEnum, &r);
314 status = cli_do_rpc_ndr(cli,
315 mem_ctx,
316 PI_RPCECHO,
317 &ndr_table_rpcecho,
318 NDR_ECHO_TESTENUM,
319 &r);
321 if (!NT_STATUS_IS_OK(status)) {
322 return status;
325 if (DEBUGLEVEL >= 10) {
326 NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r);
329 if (NT_STATUS_IS_ERR(status)) {
330 return status;
333 /* Return variables */
334 *foo1 = *r.out.foo1;
335 *foo2 = *r.out.foo2;
336 *foo3 = *r.out.foo3;
338 /* Return result */
339 return NT_STATUS_OK;
342 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
343 TALLOC_CTX *mem_ctx,
344 struct echo_Surrounding *data /* [in,out] [ref] */)
346 struct echo_TestSurrounding r;
347 NTSTATUS status;
349 /* In parameters */
350 r.in.data = data;
352 if (DEBUGLEVEL >= 10) {
353 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r);
356 status = cli_do_rpc_ndr(cli,
357 mem_ctx,
358 PI_RPCECHO,
359 &ndr_table_rpcecho,
360 NDR_ECHO_TESTSURROUNDING,
361 &r);
363 if (!NT_STATUS_IS_OK(status)) {
364 return status;
367 if (DEBUGLEVEL >= 10) {
368 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r);
371 if (NT_STATUS_IS_ERR(status)) {
372 return status;
375 /* Return variables */
376 *data = *r.out.data;
378 /* Return result */
379 return NT_STATUS_OK;
382 NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli,
383 TALLOC_CTX *mem_ctx,
384 uint16_t ***data /* [in] [ref] */)
386 struct echo_TestDoublePointer r;
387 NTSTATUS status;
389 /* In parameters */
390 r.in.data = data;
392 if (DEBUGLEVEL >= 10) {
393 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r);
396 status = cli_do_rpc_ndr(cli,
397 mem_ctx,
398 PI_RPCECHO,
399 &ndr_table_rpcecho,
400 NDR_ECHO_TESTDOUBLEPOINTER,
401 &r);
403 if (!NT_STATUS_IS_OK(status)) {
404 return status;
407 if (DEBUGLEVEL >= 10) {
408 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r);
411 if (NT_STATUS_IS_ERR(status)) {
412 return status;
415 /* Return variables */
417 /* Return result */
418 return NT_STATUS_OK;