2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
7 #include "../librpc/gen_ndr/cli_echo.h"
9 struct rpccli_echo_AddOne_state
{
10 struct echo_AddOne orig
;
11 struct echo_AddOne tmp
;
12 TALLOC_CTX
*out_mem_ctx
;
13 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16 static void rpccli_echo_AddOne_done(struct tevent_req
*subreq
);
18 struct tevent_req
*rpccli_echo_AddOne_send(TALLOC_CTX
*mem_ctx
,
19 struct tevent_context
*ev
,
20 struct rpc_pipe_client
*cli
,
21 uint32_t _in_data
/* [in] */,
22 uint32_t *_out_data
/* [out] [ref] */)
24 struct tevent_req
*req
;
25 struct rpccli_echo_AddOne_state
*state
;
26 struct tevent_req
*subreq
;
28 req
= tevent_req_create(mem_ctx
, &state
,
29 struct rpccli_echo_AddOne_state
);
33 state
->out_mem_ctx
= NULL
;
34 state
->dispatch_recv
= cli
->dispatch_recv
;
37 state
->orig
.in
.in_data
= _in_data
;
40 state
->orig
.out
.out_data
= _out_data
;
42 state
->out_mem_ctx
= talloc_named_const(state
, 0,
43 "rpccli_echo_AddOne_out_memory");
44 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
45 return tevent_req_post(req
, ev
);
48 /* make a temporary copy, that we pass to the dispatch function */
49 state
->tmp
= state
->orig
;
51 subreq
= cli
->dispatch_send(state
, ev
, cli
,
55 if (tevent_req_nomem(subreq
, req
)) {
56 return tevent_req_post(req
, ev
);
58 tevent_req_set_callback(subreq
, rpccli_echo_AddOne_done
, req
);
62 static void rpccli_echo_AddOne_done(struct tevent_req
*subreq
)
64 struct tevent_req
*req
= tevent_req_callback_data(
65 subreq
, struct tevent_req
);
66 struct rpccli_echo_AddOne_state
*state
= tevent_req_data(
67 req
, struct rpccli_echo_AddOne_state
);
71 if (state
->out_mem_ctx
) {
72 mem_ctx
= state
->out_mem_ctx
;
77 status
= state
->dispatch_recv(subreq
, mem_ctx
);
79 if (!NT_STATUS_IS_OK(status
)) {
80 tevent_req_nterror(req
, status
);
84 /* Copy out parameters */
85 *state
->orig
.out
.out_data
= *state
->tmp
.out
.out_data
;
87 /* Reset temporary structure */
88 ZERO_STRUCT(state
->tmp
);
93 NTSTATUS
rpccli_echo_AddOne_recv(struct tevent_req
*req
,
96 struct rpccli_echo_AddOne_state
*state
= tevent_req_data(
97 req
, struct rpccli_echo_AddOne_state
);
100 if (tevent_req_is_nterror(req
, &status
)) {
101 tevent_req_received(req
);
105 /* Steal possbile out parameters to the callers context */
106 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
108 tevent_req_received(req
);
112 NTSTATUS
rpccli_echo_AddOne(struct rpc_pipe_client
*cli
,
114 uint32_t in_data
/* [in] */,
115 uint32_t *out_data
/* [out] [ref] */)
117 struct echo_AddOne r
;
121 r
.in
.in_data
= in_data
;
123 status
= cli
->dispatch(cli
,
129 if (!NT_STATUS_IS_OK(status
)) {
133 if (NT_STATUS_IS_ERR(status
)) {
137 /* Return variables */
138 *out_data
= *r
.out
.out_data
;
144 struct rpccli_echo_EchoData_state
{
145 struct echo_EchoData orig
;
146 struct echo_EchoData tmp
;
147 TALLOC_CTX
*out_mem_ctx
;
148 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
151 static void rpccli_echo_EchoData_done(struct tevent_req
*subreq
);
153 struct tevent_req
*rpccli_echo_EchoData_send(TALLOC_CTX
*mem_ctx
,
154 struct tevent_context
*ev
,
155 struct rpc_pipe_client
*cli
,
156 uint32_t _len
/* [in] */,
157 uint8_t *_in_data
/* [in] [size_is(len)] */,
158 uint8_t *_out_data
/* [out] [size_is(len)] */)
160 struct tevent_req
*req
;
161 struct rpccli_echo_EchoData_state
*state
;
162 struct tevent_req
*subreq
;
164 req
= tevent_req_create(mem_ctx
, &state
,
165 struct rpccli_echo_EchoData_state
);
169 state
->out_mem_ctx
= NULL
;
170 state
->dispatch_recv
= cli
->dispatch_recv
;
173 state
->orig
.in
.len
= _len
;
174 state
->orig
.in
.in_data
= _in_data
;
177 state
->orig
.out
.out_data
= _out_data
;
179 state
->out_mem_ctx
= talloc_named_const(state
, 0,
180 "rpccli_echo_EchoData_out_memory");
181 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
182 return tevent_req_post(req
, ev
);
185 /* make a temporary copy, that we pass to the dispatch function */
186 state
->tmp
= state
->orig
;
188 subreq
= cli
->dispatch_send(state
, ev
, cli
,
192 if (tevent_req_nomem(subreq
, req
)) {
193 return tevent_req_post(req
, ev
);
195 tevent_req_set_callback(subreq
, rpccli_echo_EchoData_done
, req
);
199 static void rpccli_echo_EchoData_done(struct tevent_req
*subreq
)
201 struct tevent_req
*req
= tevent_req_callback_data(
202 subreq
, struct tevent_req
);
203 struct rpccli_echo_EchoData_state
*state
= tevent_req_data(
204 req
, struct rpccli_echo_EchoData_state
);
208 if (state
->out_mem_ctx
) {
209 mem_ctx
= state
->out_mem_ctx
;
214 status
= state
->dispatch_recv(subreq
, mem_ctx
);
216 if (!NT_STATUS_IS_OK(status
)) {
217 tevent_req_nterror(req
, status
);
221 /* Copy out parameters */
222 memcpy(state
->orig
.out
.out_data
, state
->tmp
.out
.out_data
, (state
->tmp
.in
.len
) * sizeof(*state
->orig
.out
.out_data
));
224 /* Reset temporary structure */
225 ZERO_STRUCT(state
->tmp
);
227 tevent_req_done(req
);
230 NTSTATUS
rpccli_echo_EchoData_recv(struct tevent_req
*req
,
233 struct rpccli_echo_EchoData_state
*state
= tevent_req_data(
234 req
, struct rpccli_echo_EchoData_state
);
237 if (tevent_req_is_nterror(req
, &status
)) {
238 tevent_req_received(req
);
242 /* Steal possbile out parameters to the callers context */
243 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
245 tevent_req_received(req
);
249 NTSTATUS
rpccli_echo_EchoData(struct rpc_pipe_client
*cli
,
251 uint32_t len
/* [in] */,
252 uint8_t *in_data
/* [in] [size_is(len)] */,
253 uint8_t *out_data
/* [out] [size_is(len)] */)
255 struct echo_EchoData r
;
260 r
.in
.in_data
= in_data
;
262 status
= cli
->dispatch(cli
,
268 if (!NT_STATUS_IS_OK(status
)) {
272 if (NT_STATUS_IS_ERR(status
)) {
276 /* Return variables */
277 memcpy(out_data
, r
.out
.out_data
, (r
.in
.len
) * sizeof(*out_data
));
283 struct rpccli_echo_SinkData_state
{
284 struct echo_SinkData orig
;
285 struct echo_SinkData tmp
;
286 TALLOC_CTX
*out_mem_ctx
;
287 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
290 static void rpccli_echo_SinkData_done(struct tevent_req
*subreq
);
292 struct tevent_req
*rpccli_echo_SinkData_send(TALLOC_CTX
*mem_ctx
,
293 struct tevent_context
*ev
,
294 struct rpc_pipe_client
*cli
,
295 uint32_t _len
/* [in] */,
296 uint8_t *_data
/* [in] [size_is(len)] */)
298 struct tevent_req
*req
;
299 struct rpccli_echo_SinkData_state
*state
;
300 struct tevent_req
*subreq
;
302 req
= tevent_req_create(mem_ctx
, &state
,
303 struct rpccli_echo_SinkData_state
);
307 state
->out_mem_ctx
= NULL
;
308 state
->dispatch_recv
= cli
->dispatch_recv
;
311 state
->orig
.in
.len
= _len
;
312 state
->orig
.in
.data
= _data
;
316 /* make a temporary copy, that we pass to the dispatch function */
317 state
->tmp
= state
->orig
;
319 subreq
= cli
->dispatch_send(state
, ev
, cli
,
323 if (tevent_req_nomem(subreq
, req
)) {
324 return tevent_req_post(req
, ev
);
326 tevent_req_set_callback(subreq
, rpccli_echo_SinkData_done
, req
);
330 static void rpccli_echo_SinkData_done(struct tevent_req
*subreq
)
332 struct tevent_req
*req
= tevent_req_callback_data(
333 subreq
, struct tevent_req
);
334 struct rpccli_echo_SinkData_state
*state
= tevent_req_data(
335 req
, struct rpccli_echo_SinkData_state
);
339 if (state
->out_mem_ctx
) {
340 mem_ctx
= state
->out_mem_ctx
;
345 status
= state
->dispatch_recv(subreq
, mem_ctx
);
347 if (!NT_STATUS_IS_OK(status
)) {
348 tevent_req_nterror(req
, status
);
352 /* Copy out parameters */
354 /* Reset temporary structure */
355 ZERO_STRUCT(state
->tmp
);
357 tevent_req_done(req
);
360 NTSTATUS
rpccli_echo_SinkData_recv(struct tevent_req
*req
,
363 struct rpccli_echo_SinkData_state
*state
= tevent_req_data(
364 req
, struct rpccli_echo_SinkData_state
);
367 if (tevent_req_is_nterror(req
, &status
)) {
368 tevent_req_received(req
);
372 /* Steal possbile out parameters to the callers context */
373 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
375 tevent_req_received(req
);
379 NTSTATUS
rpccli_echo_SinkData(struct rpc_pipe_client
*cli
,
381 uint32_t len
/* [in] */,
382 uint8_t *data
/* [in] [size_is(len)] */)
384 struct echo_SinkData r
;
391 status
= cli
->dispatch(cli
,
397 if (!NT_STATUS_IS_OK(status
)) {
401 if (NT_STATUS_IS_ERR(status
)) {
405 /* Return variables */
411 struct rpccli_echo_SourceData_state
{
412 struct echo_SourceData orig
;
413 struct echo_SourceData tmp
;
414 TALLOC_CTX
*out_mem_ctx
;
415 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
418 static void rpccli_echo_SourceData_done(struct tevent_req
*subreq
);
420 struct tevent_req
*rpccli_echo_SourceData_send(TALLOC_CTX
*mem_ctx
,
421 struct tevent_context
*ev
,
422 struct rpc_pipe_client
*cli
,
423 uint32_t _len
/* [in] */,
424 uint8_t *_data
/* [out] [size_is(len)] */)
426 struct tevent_req
*req
;
427 struct rpccli_echo_SourceData_state
*state
;
428 struct tevent_req
*subreq
;
430 req
= tevent_req_create(mem_ctx
, &state
,
431 struct rpccli_echo_SourceData_state
);
435 state
->out_mem_ctx
= NULL
;
436 state
->dispatch_recv
= cli
->dispatch_recv
;
439 state
->orig
.in
.len
= _len
;
442 state
->orig
.out
.data
= _data
;
444 state
->out_mem_ctx
= talloc_named_const(state
, 0,
445 "rpccli_echo_SourceData_out_memory");
446 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
447 return tevent_req_post(req
, ev
);
450 /* make a temporary copy, that we pass to the dispatch function */
451 state
->tmp
= state
->orig
;
453 subreq
= cli
->dispatch_send(state
, ev
, cli
,
457 if (tevent_req_nomem(subreq
, req
)) {
458 return tevent_req_post(req
, ev
);
460 tevent_req_set_callback(subreq
, rpccli_echo_SourceData_done
, req
);
464 static void rpccli_echo_SourceData_done(struct tevent_req
*subreq
)
466 struct tevent_req
*req
= tevent_req_callback_data(
467 subreq
, struct tevent_req
);
468 struct rpccli_echo_SourceData_state
*state
= tevent_req_data(
469 req
, struct rpccli_echo_SourceData_state
);
473 if (state
->out_mem_ctx
) {
474 mem_ctx
= state
->out_mem_ctx
;
479 status
= state
->dispatch_recv(subreq
, mem_ctx
);
481 if (!NT_STATUS_IS_OK(status
)) {
482 tevent_req_nterror(req
, status
);
486 /* Copy out parameters */
487 memcpy(state
->orig
.out
.data
, state
->tmp
.out
.data
, (state
->tmp
.in
.len
) * sizeof(*state
->orig
.out
.data
));
489 /* Reset temporary structure */
490 ZERO_STRUCT(state
->tmp
);
492 tevent_req_done(req
);
495 NTSTATUS
rpccli_echo_SourceData_recv(struct tevent_req
*req
,
498 struct rpccli_echo_SourceData_state
*state
= tevent_req_data(
499 req
, struct rpccli_echo_SourceData_state
);
502 if (tevent_req_is_nterror(req
, &status
)) {
503 tevent_req_received(req
);
507 /* Steal possbile out parameters to the callers context */
508 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
510 tevent_req_received(req
);
514 NTSTATUS
rpccli_echo_SourceData(struct rpc_pipe_client
*cli
,
516 uint32_t len
/* [in] */,
517 uint8_t *data
/* [out] [size_is(len)] */)
519 struct echo_SourceData r
;
525 status
= cli
->dispatch(cli
,
531 if (!NT_STATUS_IS_OK(status
)) {
535 if (NT_STATUS_IS_ERR(status
)) {
539 /* Return variables */
540 memcpy(data
, r
.out
.data
, (r
.in
.len
) * sizeof(*data
));
546 struct rpccli_echo_TestCall_state
{
547 struct echo_TestCall orig
;
548 struct echo_TestCall tmp
;
549 TALLOC_CTX
*out_mem_ctx
;
550 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
553 static void rpccli_echo_TestCall_done(struct tevent_req
*subreq
);
555 struct tevent_req
*rpccli_echo_TestCall_send(TALLOC_CTX
*mem_ctx
,
556 struct tevent_context
*ev
,
557 struct rpc_pipe_client
*cli
,
558 const char *_s1
/* [in] [ref,charset(UTF16)] */,
559 const char **_s2
/* [out] [ref,charset(UTF16)] */)
561 struct tevent_req
*req
;
562 struct rpccli_echo_TestCall_state
*state
;
563 struct tevent_req
*subreq
;
565 req
= tevent_req_create(mem_ctx
, &state
,
566 struct rpccli_echo_TestCall_state
);
570 state
->out_mem_ctx
= NULL
;
571 state
->dispatch_recv
= cli
->dispatch_recv
;
574 state
->orig
.in
.s1
= _s1
;
577 state
->orig
.out
.s2
= _s2
;
579 state
->out_mem_ctx
= talloc_named_const(state
, 0,
580 "rpccli_echo_TestCall_out_memory");
581 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
582 return tevent_req_post(req
, ev
);
585 /* make a temporary copy, that we pass to the dispatch function */
586 state
->tmp
= state
->orig
;
588 subreq
= cli
->dispatch_send(state
, ev
, cli
,
592 if (tevent_req_nomem(subreq
, req
)) {
593 return tevent_req_post(req
, ev
);
595 tevent_req_set_callback(subreq
, rpccli_echo_TestCall_done
, req
);
599 static void rpccli_echo_TestCall_done(struct tevent_req
*subreq
)
601 struct tevent_req
*req
= tevent_req_callback_data(
602 subreq
, struct tevent_req
);
603 struct rpccli_echo_TestCall_state
*state
= tevent_req_data(
604 req
, struct rpccli_echo_TestCall_state
);
608 if (state
->out_mem_ctx
) {
609 mem_ctx
= state
->out_mem_ctx
;
614 status
= state
->dispatch_recv(subreq
, mem_ctx
);
616 if (!NT_STATUS_IS_OK(status
)) {
617 tevent_req_nterror(req
, status
);
621 /* Copy out parameters */
622 *state
->orig
.out
.s2
= *state
->tmp
.out
.s2
;
624 /* Reset temporary structure */
625 ZERO_STRUCT(state
->tmp
);
627 tevent_req_done(req
);
630 NTSTATUS
rpccli_echo_TestCall_recv(struct tevent_req
*req
,
633 struct rpccli_echo_TestCall_state
*state
= tevent_req_data(
634 req
, struct rpccli_echo_TestCall_state
);
637 if (tevent_req_is_nterror(req
, &status
)) {
638 tevent_req_received(req
);
642 /* Steal possbile out parameters to the callers context */
643 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
645 tevent_req_received(req
);
649 NTSTATUS
rpccli_echo_TestCall(struct rpc_pipe_client
*cli
,
651 const char *s1
/* [in] [ref,charset(UTF16)] */,
652 const char **s2
/* [out] [ref,charset(UTF16)] */)
654 struct echo_TestCall r
;
660 status
= cli
->dispatch(cli
,
666 if (!NT_STATUS_IS_OK(status
)) {
670 if (NT_STATUS_IS_ERR(status
)) {
674 /* Return variables */
681 struct rpccli_echo_TestCall2_state
{
682 struct echo_TestCall2 orig
;
683 struct echo_TestCall2 tmp
;
684 TALLOC_CTX
*out_mem_ctx
;
685 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
688 static void rpccli_echo_TestCall2_done(struct tevent_req
*subreq
);
690 struct tevent_req
*rpccli_echo_TestCall2_send(TALLOC_CTX
*mem_ctx
,
691 struct tevent_context
*ev
,
692 struct rpc_pipe_client
*cli
,
693 uint16_t _level
/* [in] */,
694 union echo_Info
*_info
/* [out] [ref,switch_is(level)] */)
696 struct tevent_req
*req
;
697 struct rpccli_echo_TestCall2_state
*state
;
698 struct tevent_req
*subreq
;
700 req
= tevent_req_create(mem_ctx
, &state
,
701 struct rpccli_echo_TestCall2_state
);
705 state
->out_mem_ctx
= NULL
;
706 state
->dispatch_recv
= cli
->dispatch_recv
;
709 state
->orig
.in
.level
= _level
;
712 state
->orig
.out
.info
= _info
;
715 ZERO_STRUCT(state
->orig
.out
.result
);
717 state
->out_mem_ctx
= talloc_named_const(state
, 0,
718 "rpccli_echo_TestCall2_out_memory");
719 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
720 return tevent_req_post(req
, ev
);
723 /* make a temporary copy, that we pass to the dispatch function */
724 state
->tmp
= state
->orig
;
726 subreq
= cli
->dispatch_send(state
, ev
, cli
,
730 if (tevent_req_nomem(subreq
, req
)) {
731 return tevent_req_post(req
, ev
);
733 tevent_req_set_callback(subreq
, rpccli_echo_TestCall2_done
, req
);
737 static void rpccli_echo_TestCall2_done(struct tevent_req
*subreq
)
739 struct tevent_req
*req
= tevent_req_callback_data(
740 subreq
, struct tevent_req
);
741 struct rpccli_echo_TestCall2_state
*state
= tevent_req_data(
742 req
, struct rpccli_echo_TestCall2_state
);
746 if (state
->out_mem_ctx
) {
747 mem_ctx
= state
->out_mem_ctx
;
752 status
= state
->dispatch_recv(subreq
, mem_ctx
);
754 if (!NT_STATUS_IS_OK(status
)) {
755 tevent_req_nterror(req
, status
);
759 /* Copy out parameters */
760 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
763 state
->orig
.out
.result
= state
->tmp
.out
.result
;
765 /* Reset temporary structure */
766 ZERO_STRUCT(state
->tmp
);
768 tevent_req_done(req
);
771 NTSTATUS
rpccli_echo_TestCall2_recv(struct tevent_req
*req
,
775 struct rpccli_echo_TestCall2_state
*state
= tevent_req_data(
776 req
, struct rpccli_echo_TestCall2_state
);
779 if (tevent_req_is_nterror(req
, &status
)) {
780 tevent_req_received(req
);
784 /* Steal possbile out parameters to the callers context */
785 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
788 *result
= state
->orig
.out
.result
;
790 tevent_req_received(req
);
794 NTSTATUS
rpccli_echo_TestCall2(struct rpc_pipe_client
*cli
,
796 uint16_t level
/* [in] */,
797 union echo_Info
*info
/* [out] [ref,switch_is(level)] */)
799 struct echo_TestCall2 r
;
805 status
= cli
->dispatch(cli
,
811 if (!NT_STATUS_IS_OK(status
)) {
815 if (NT_STATUS_IS_ERR(status
)) {
819 /* Return variables */
826 struct rpccli_echo_TestSleep_state
{
827 struct echo_TestSleep orig
;
828 struct echo_TestSleep tmp
;
829 TALLOC_CTX
*out_mem_ctx
;
830 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
833 static void rpccli_echo_TestSleep_done(struct tevent_req
*subreq
);
835 struct tevent_req
*rpccli_echo_TestSleep_send(TALLOC_CTX
*mem_ctx
,
836 struct tevent_context
*ev
,
837 struct rpc_pipe_client
*cli
,
838 uint32_t _seconds
/* [in] */)
840 struct tevent_req
*req
;
841 struct rpccli_echo_TestSleep_state
*state
;
842 struct tevent_req
*subreq
;
844 req
= tevent_req_create(mem_ctx
, &state
,
845 struct rpccli_echo_TestSleep_state
);
849 state
->out_mem_ctx
= NULL
;
850 state
->dispatch_recv
= cli
->dispatch_recv
;
853 state
->orig
.in
.seconds
= _seconds
;
858 ZERO_STRUCT(state
->orig
.out
.result
);
860 /* make a temporary copy, that we pass to the dispatch function */
861 state
->tmp
= state
->orig
;
863 subreq
= cli
->dispatch_send(state
, ev
, cli
,
867 if (tevent_req_nomem(subreq
, req
)) {
868 return tevent_req_post(req
, ev
);
870 tevent_req_set_callback(subreq
, rpccli_echo_TestSleep_done
, req
);
874 static void rpccli_echo_TestSleep_done(struct tevent_req
*subreq
)
876 struct tevent_req
*req
= tevent_req_callback_data(
877 subreq
, struct tevent_req
);
878 struct rpccli_echo_TestSleep_state
*state
= tevent_req_data(
879 req
, struct rpccli_echo_TestSleep_state
);
883 if (state
->out_mem_ctx
) {
884 mem_ctx
= state
->out_mem_ctx
;
889 status
= state
->dispatch_recv(subreq
, mem_ctx
);
891 if (!NT_STATUS_IS_OK(status
)) {
892 tevent_req_nterror(req
, status
);
896 /* Copy out parameters */
899 state
->orig
.out
.result
= state
->tmp
.out
.result
;
901 /* Reset temporary structure */
902 ZERO_STRUCT(state
->tmp
);
904 tevent_req_done(req
);
907 NTSTATUS
rpccli_echo_TestSleep_recv(struct tevent_req
*req
,
911 struct rpccli_echo_TestSleep_state
*state
= tevent_req_data(
912 req
, struct rpccli_echo_TestSleep_state
);
915 if (tevent_req_is_nterror(req
, &status
)) {
916 tevent_req_received(req
);
920 /* Steal possbile out parameters to the callers context */
921 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
924 *result
= state
->orig
.out
.result
;
926 tevent_req_received(req
);
930 NTSTATUS
rpccli_echo_TestSleep(struct rpc_pipe_client
*cli
,
932 uint32_t seconds
/* [in] */)
934 struct echo_TestSleep r
;
938 r
.in
.seconds
= seconds
;
940 status
= cli
->dispatch(cli
,
946 if (!NT_STATUS_IS_OK(status
)) {
950 if (NT_STATUS_IS_ERR(status
)) {
954 /* Return variables */
960 struct rpccli_echo_TestEnum_state
{
961 struct echo_TestEnum orig
;
962 struct echo_TestEnum tmp
;
963 TALLOC_CTX
*out_mem_ctx
;
964 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
967 static void rpccli_echo_TestEnum_done(struct tevent_req
*subreq
);
969 struct tevent_req
*rpccli_echo_TestEnum_send(TALLOC_CTX
*mem_ctx
,
970 struct tevent_context
*ev
,
971 struct rpc_pipe_client
*cli
,
972 enum echo_Enum1
*_foo1
/* [in,out] [ref] */,
973 struct echo_Enum2
*_foo2
/* [in,out] [ref] */,
974 union echo_Enum3
*_foo3
/* [in,out] [ref,switch_is(*foo1)] */)
976 struct tevent_req
*req
;
977 struct rpccli_echo_TestEnum_state
*state
;
978 struct tevent_req
*subreq
;
980 req
= tevent_req_create(mem_ctx
, &state
,
981 struct rpccli_echo_TestEnum_state
);
985 state
->out_mem_ctx
= NULL
;
986 state
->dispatch_recv
= cli
->dispatch_recv
;
989 state
->orig
.in
.foo1
= _foo1
;
990 state
->orig
.in
.foo2
= _foo2
;
991 state
->orig
.in
.foo3
= _foo3
;
994 state
->orig
.out
.foo1
= _foo1
;
995 state
->orig
.out
.foo2
= _foo2
;
996 state
->orig
.out
.foo3
= _foo3
;
998 state
->out_mem_ctx
= talloc_named_const(state
, 0,
999 "rpccli_echo_TestEnum_out_memory");
1000 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1001 return tevent_req_post(req
, ev
);
1004 /* make a temporary copy, that we pass to the dispatch function */
1005 state
->tmp
= state
->orig
;
1007 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1011 if (tevent_req_nomem(subreq
, req
)) {
1012 return tevent_req_post(req
, ev
);
1014 tevent_req_set_callback(subreq
, rpccli_echo_TestEnum_done
, req
);
1018 static void rpccli_echo_TestEnum_done(struct tevent_req
*subreq
)
1020 struct tevent_req
*req
= tevent_req_callback_data(
1021 subreq
, struct tevent_req
);
1022 struct rpccli_echo_TestEnum_state
*state
= tevent_req_data(
1023 req
, struct rpccli_echo_TestEnum_state
);
1025 TALLOC_CTX
*mem_ctx
;
1027 if (state
->out_mem_ctx
) {
1028 mem_ctx
= state
->out_mem_ctx
;
1033 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1034 TALLOC_FREE(subreq
);
1035 if (!NT_STATUS_IS_OK(status
)) {
1036 tevent_req_nterror(req
, status
);
1040 /* Copy out parameters */
1041 *state
->orig
.out
.foo1
= *state
->tmp
.out
.foo1
;
1042 *state
->orig
.out
.foo2
= *state
->tmp
.out
.foo2
;
1043 *state
->orig
.out
.foo3
= *state
->tmp
.out
.foo3
;
1045 /* Reset temporary structure */
1046 ZERO_STRUCT(state
->tmp
);
1048 tevent_req_done(req
);
1051 NTSTATUS
rpccli_echo_TestEnum_recv(struct tevent_req
*req
,
1052 TALLOC_CTX
*mem_ctx
)
1054 struct rpccli_echo_TestEnum_state
*state
= tevent_req_data(
1055 req
, struct rpccli_echo_TestEnum_state
);
1058 if (tevent_req_is_nterror(req
, &status
)) {
1059 tevent_req_received(req
);
1063 /* Steal possbile out parameters to the callers context */
1064 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1066 tevent_req_received(req
);
1067 return NT_STATUS_OK
;
1070 NTSTATUS
rpccli_echo_TestEnum(struct rpc_pipe_client
*cli
,
1071 TALLOC_CTX
*mem_ctx
,
1072 enum echo_Enum1
*foo1
/* [in,out] [ref] */,
1073 struct echo_Enum2
*foo2
/* [in,out] [ref] */,
1074 union echo_Enum3
*foo3
/* [in,out] [ref,switch_is(*foo1)] */)
1076 struct echo_TestEnum r
;
1084 status
= cli
->dispatch(cli
,
1090 if (!NT_STATUS_IS_OK(status
)) {
1094 if (NT_STATUS_IS_ERR(status
)) {
1098 /* Return variables */
1099 *foo1
= *r
.out
.foo1
;
1100 *foo2
= *r
.out
.foo2
;
1101 *foo3
= *r
.out
.foo3
;
1104 return NT_STATUS_OK
;
1107 struct rpccli_echo_TestSurrounding_state
{
1108 struct echo_TestSurrounding orig
;
1109 struct echo_TestSurrounding tmp
;
1110 TALLOC_CTX
*out_mem_ctx
;
1111 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1114 static void rpccli_echo_TestSurrounding_done(struct tevent_req
*subreq
);
1116 struct tevent_req
*rpccli_echo_TestSurrounding_send(TALLOC_CTX
*mem_ctx
,
1117 struct tevent_context
*ev
,
1118 struct rpc_pipe_client
*cli
,
1119 struct echo_Surrounding
*_data
/* [in,out] [ref] */)
1121 struct tevent_req
*req
;
1122 struct rpccli_echo_TestSurrounding_state
*state
;
1123 struct tevent_req
*subreq
;
1125 req
= tevent_req_create(mem_ctx
, &state
,
1126 struct rpccli_echo_TestSurrounding_state
);
1130 state
->out_mem_ctx
= NULL
;
1131 state
->dispatch_recv
= cli
->dispatch_recv
;
1134 state
->orig
.in
.data
= _data
;
1136 /* Out parameters */
1137 state
->orig
.out
.data
= _data
;
1139 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1140 "rpccli_echo_TestSurrounding_out_memory");
1141 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1142 return tevent_req_post(req
, ev
);
1145 /* make a temporary copy, that we pass to the dispatch function */
1146 state
->tmp
= state
->orig
;
1148 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1150 NDR_ECHO_TESTSURROUNDING
,
1152 if (tevent_req_nomem(subreq
, req
)) {
1153 return tevent_req_post(req
, ev
);
1155 tevent_req_set_callback(subreq
, rpccli_echo_TestSurrounding_done
, req
);
1159 static void rpccli_echo_TestSurrounding_done(struct tevent_req
*subreq
)
1161 struct tevent_req
*req
= tevent_req_callback_data(
1162 subreq
, struct tevent_req
);
1163 struct rpccli_echo_TestSurrounding_state
*state
= tevent_req_data(
1164 req
, struct rpccli_echo_TestSurrounding_state
);
1166 TALLOC_CTX
*mem_ctx
;
1168 if (state
->out_mem_ctx
) {
1169 mem_ctx
= state
->out_mem_ctx
;
1174 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1175 TALLOC_FREE(subreq
);
1176 if (!NT_STATUS_IS_OK(status
)) {
1177 tevent_req_nterror(req
, status
);
1181 /* Copy out parameters */
1182 *state
->orig
.out
.data
= *state
->tmp
.out
.data
;
1184 /* Reset temporary structure */
1185 ZERO_STRUCT(state
->tmp
);
1187 tevent_req_done(req
);
1190 NTSTATUS
rpccli_echo_TestSurrounding_recv(struct tevent_req
*req
,
1191 TALLOC_CTX
*mem_ctx
)
1193 struct rpccli_echo_TestSurrounding_state
*state
= tevent_req_data(
1194 req
, struct rpccli_echo_TestSurrounding_state
);
1197 if (tevent_req_is_nterror(req
, &status
)) {
1198 tevent_req_received(req
);
1202 /* Steal possbile out parameters to the callers context */
1203 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1205 tevent_req_received(req
);
1206 return NT_STATUS_OK
;
1209 NTSTATUS
rpccli_echo_TestSurrounding(struct rpc_pipe_client
*cli
,
1210 TALLOC_CTX
*mem_ctx
,
1211 struct echo_Surrounding
*data
/* [in,out] [ref] */)
1213 struct echo_TestSurrounding r
;
1219 status
= cli
->dispatch(cli
,
1222 NDR_ECHO_TESTSURROUNDING
,
1225 if (!NT_STATUS_IS_OK(status
)) {
1229 if (NT_STATUS_IS_ERR(status
)) {
1233 /* Return variables */
1234 *data
= *r
.out
.data
;
1237 return NT_STATUS_OK
;
1240 struct rpccli_echo_TestDoublePointer_state
{
1241 struct echo_TestDoublePointer orig
;
1242 struct echo_TestDoublePointer tmp
;
1243 TALLOC_CTX
*out_mem_ctx
;
1244 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1247 static void rpccli_echo_TestDoublePointer_done(struct tevent_req
*subreq
);
1249 struct tevent_req
*rpccli_echo_TestDoublePointer_send(TALLOC_CTX
*mem_ctx
,
1250 struct tevent_context
*ev
,
1251 struct rpc_pipe_client
*cli
,
1252 uint16_t ***_data
/* [in] [ref] */)
1254 struct tevent_req
*req
;
1255 struct rpccli_echo_TestDoublePointer_state
*state
;
1256 struct tevent_req
*subreq
;
1258 req
= tevent_req_create(mem_ctx
, &state
,
1259 struct rpccli_echo_TestDoublePointer_state
);
1263 state
->out_mem_ctx
= NULL
;
1264 state
->dispatch_recv
= cli
->dispatch_recv
;
1267 state
->orig
.in
.data
= _data
;
1269 /* Out parameters */
1272 ZERO_STRUCT(state
->orig
.out
.result
);
1274 /* make a temporary copy, that we pass to the dispatch function */
1275 state
->tmp
= state
->orig
;
1277 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1279 NDR_ECHO_TESTDOUBLEPOINTER
,
1281 if (tevent_req_nomem(subreq
, req
)) {
1282 return tevent_req_post(req
, ev
);
1284 tevent_req_set_callback(subreq
, rpccli_echo_TestDoublePointer_done
, req
);
1288 static void rpccli_echo_TestDoublePointer_done(struct tevent_req
*subreq
)
1290 struct tevent_req
*req
= tevent_req_callback_data(
1291 subreq
, struct tevent_req
);
1292 struct rpccli_echo_TestDoublePointer_state
*state
= tevent_req_data(
1293 req
, struct rpccli_echo_TestDoublePointer_state
);
1295 TALLOC_CTX
*mem_ctx
;
1297 if (state
->out_mem_ctx
) {
1298 mem_ctx
= state
->out_mem_ctx
;
1303 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1304 TALLOC_FREE(subreq
);
1305 if (!NT_STATUS_IS_OK(status
)) {
1306 tevent_req_nterror(req
, status
);
1310 /* Copy out parameters */
1313 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1315 /* Reset temporary structure */
1316 ZERO_STRUCT(state
->tmp
);
1318 tevent_req_done(req
);
1321 NTSTATUS
rpccli_echo_TestDoublePointer_recv(struct tevent_req
*req
,
1322 TALLOC_CTX
*mem_ctx
,
1325 struct rpccli_echo_TestDoublePointer_state
*state
= tevent_req_data(
1326 req
, struct rpccli_echo_TestDoublePointer_state
);
1329 if (tevent_req_is_nterror(req
, &status
)) {
1330 tevent_req_received(req
);
1334 /* Steal possbile out parameters to the callers context */
1335 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1338 *result
= state
->orig
.out
.result
;
1340 tevent_req_received(req
);
1341 return NT_STATUS_OK
;
1344 NTSTATUS
rpccli_echo_TestDoublePointer(struct rpc_pipe_client
*cli
,
1345 TALLOC_CTX
*mem_ctx
,
1346 uint16_t ***data
/* [in] [ref] */)
1348 struct echo_TestDoublePointer r
;
1354 status
= cli
->dispatch(cli
,
1357 NDR_ECHO_TESTDOUBLEPOINTER
,
1360 if (!NT_STATUS_IS_OK(status
)) {
1364 if (NT_STATUS_IS_ERR(status
)) {
1368 /* Return variables */
1371 return NT_STATUS_OK
;