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 if (DEBUGLEVEL >= 10) {
43 NDR_PRINT_IN_DEBUG(echo_AddOne, &state->orig);
46 state->out_mem_ctx = talloc_named_const(state, 0,
47 "rpccli_echo_AddOne_out_memory");
48 if (tevent_req_nomem(state->out_mem_ctx, req)) {
49 return tevent_req_post(req, ev);
52 /* make a temporary copy, that we pass to the dispatch function */
53 state->tmp = state->orig;
55 subreq = cli->dispatch_send(state, ev, cli,
59 if (tevent_req_nomem(subreq, req)) {
60 return tevent_req_post(req, ev);
62 tevent_req_set_callback(subreq, rpccli_echo_AddOne_done, req);
66 static void rpccli_echo_AddOne_done(struct tevent_req *subreq)
68 struct tevent_req *req = tevent_req_callback_data(
69 subreq, struct tevent_req);
70 struct rpccli_echo_AddOne_state *state = tevent_req_data(
71 req, struct rpccli_echo_AddOne_state);
75 if (state->out_mem_ctx) {
76 mem_ctx = state->out_mem_ctx;
81 status = state->dispatch_recv(subreq, mem_ctx);
83 if (!NT_STATUS_IS_OK(status)) {
84 tevent_req_nterror(req, status);
88 /* Copy out parameters */
89 *state->orig.out.out_data = *state->tmp.out.out_data;
91 /* Reset temporary structure */
92 ZERO_STRUCT(state->tmp);
94 if (DEBUGLEVEL >= 10) {
95 NDR_PRINT_OUT_DEBUG(echo_AddOne, &state->orig);
101 NTSTATUS rpccli_echo_AddOne_recv(struct tevent_req *req,
104 struct rpccli_echo_AddOne_state *state = tevent_req_data(
105 req, struct rpccli_echo_AddOne_state);
108 if (tevent_req_is_nterror(req, &status)) {
109 tevent_req_received(req);
113 /* Steal possbile out parameters to the callers context */
114 talloc_steal(mem_ctx, state->out_mem_ctx);
116 tevent_req_received(req);
120 NTSTATUS rpccli_echo_AddOne(struct rpc_pipe_client *cli,
122 uint32_t in_data /* [in] */,
123 uint32_t *out_data /* [out] [ref] */)
125 struct echo_AddOne r;
129 r.in.in_data = in_data;
131 if (DEBUGLEVEL >= 10) {
132 NDR_PRINT_IN_DEBUG(echo_AddOne, &r);
135 status = cli->dispatch(cli,
141 if (!NT_STATUS_IS_OK(status)) {
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_OUT_DEBUG(echo_AddOne, &r);
149 if (NT_STATUS_IS_ERR(status)) {
153 /* Return variables */
154 *out_data = *r.out.out_data;
160 struct rpccli_echo_EchoData_state {
161 struct echo_EchoData orig;
162 struct echo_EchoData tmp;
163 TALLOC_CTX *out_mem_ctx;
164 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
167 static void rpccli_echo_EchoData_done(struct tevent_req *subreq);
169 struct tevent_req *rpccli_echo_EchoData_send(TALLOC_CTX *mem_ctx,
170 struct tevent_context *ev,
171 struct rpc_pipe_client *cli,
172 uint32_t _len /* [in] */,
173 uint8_t *_in_data /* [in] [size_is(len)] */,
174 uint8_t *_out_data /* [out] [size_is(len)] */)
176 struct tevent_req *req;
177 struct rpccli_echo_EchoData_state *state;
178 struct tevent_req *subreq;
180 req = tevent_req_create(mem_ctx, &state,
181 struct rpccli_echo_EchoData_state);
185 state->out_mem_ctx = NULL;
186 state->dispatch_recv = cli->dispatch_recv;
189 state->orig.in.len = _len;
190 state->orig.in.in_data = _in_data;
193 state->orig.out.out_data = _out_data;
195 if (DEBUGLEVEL >= 10) {
196 NDR_PRINT_IN_DEBUG(echo_EchoData, &state->orig);
199 state->out_mem_ctx = talloc_named_const(state, 0,
200 "rpccli_echo_EchoData_out_memory");
201 if (tevent_req_nomem(state->out_mem_ctx, req)) {
202 return tevent_req_post(req, ev);
205 /* make a temporary copy, that we pass to the dispatch function */
206 state->tmp = state->orig;
208 subreq = cli->dispatch_send(state, ev, cli,
212 if (tevent_req_nomem(subreq, req)) {
213 return tevent_req_post(req, ev);
215 tevent_req_set_callback(subreq, rpccli_echo_EchoData_done, req);
219 static void rpccli_echo_EchoData_done(struct tevent_req *subreq)
221 struct tevent_req *req = tevent_req_callback_data(
222 subreq, struct tevent_req);
223 struct rpccli_echo_EchoData_state *state = tevent_req_data(
224 req, struct rpccli_echo_EchoData_state);
228 if (state->out_mem_ctx) {
229 mem_ctx = state->out_mem_ctx;
234 status = state->dispatch_recv(subreq, mem_ctx);
236 if (!NT_STATUS_IS_OK(status)) {
237 tevent_req_nterror(req, status);
241 /* Copy out parameters */
242 memcpy(state->orig.out.out_data, state->tmp.out.out_data, state->tmp.in.len * sizeof(*state->orig.out.out_data));
244 /* Reset temporary structure */
245 ZERO_STRUCT(state->tmp);
247 if (DEBUGLEVEL >= 10) {
248 NDR_PRINT_OUT_DEBUG(echo_EchoData, &state->orig);
251 tevent_req_done(req);
254 NTSTATUS rpccli_echo_EchoData_recv(struct tevent_req *req,
257 struct rpccli_echo_EchoData_state *state = tevent_req_data(
258 req, struct rpccli_echo_EchoData_state);
261 if (tevent_req_is_nterror(req, &status)) {
262 tevent_req_received(req);
266 /* Steal possbile out parameters to the callers context */
267 talloc_steal(mem_ctx, state->out_mem_ctx);
269 tevent_req_received(req);
273 NTSTATUS rpccli_echo_EchoData(struct rpc_pipe_client *cli,
275 uint32_t len /* [in] */,
276 uint8_t *in_data /* [in] [size_is(len)] */,
277 uint8_t *out_data /* [out] [size_is(len)] */)
279 struct echo_EchoData r;
284 r.in.in_data = in_data;
286 if (DEBUGLEVEL >= 10) {
287 NDR_PRINT_IN_DEBUG(echo_EchoData, &r);
290 status = cli->dispatch(cli,
296 if (!NT_STATUS_IS_OK(status)) {
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_OUT_DEBUG(echo_EchoData, &r);
304 if (NT_STATUS_IS_ERR(status)) {
308 /* Return variables */
309 memcpy(out_data, r.out.out_data, r.in.len * sizeof(*out_data));
315 struct rpccli_echo_SinkData_state {
316 struct echo_SinkData orig;
317 struct echo_SinkData tmp;
318 TALLOC_CTX *out_mem_ctx;
319 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
322 static void rpccli_echo_SinkData_done(struct tevent_req *subreq);
324 struct tevent_req *rpccli_echo_SinkData_send(TALLOC_CTX *mem_ctx,
325 struct tevent_context *ev,
326 struct rpc_pipe_client *cli,
327 uint32_t _len /* [in] */,
328 uint8_t *_data /* [in] [size_is(len)] */)
330 struct tevent_req *req;
331 struct rpccli_echo_SinkData_state *state;
332 struct tevent_req *subreq;
334 req = tevent_req_create(mem_ctx, &state,
335 struct rpccli_echo_SinkData_state);
339 state->out_mem_ctx = NULL;
340 state->dispatch_recv = cli->dispatch_recv;
343 state->orig.in.len = _len;
344 state->orig.in.data = _data;
348 if (DEBUGLEVEL >= 10) {
349 NDR_PRINT_IN_DEBUG(echo_SinkData, &state->orig);
352 /* make a temporary copy, that we pass to the dispatch function */
353 state->tmp = state->orig;
355 subreq = cli->dispatch_send(state, ev, cli,
359 if (tevent_req_nomem(subreq, req)) {
360 return tevent_req_post(req, ev);
362 tevent_req_set_callback(subreq, rpccli_echo_SinkData_done, req);
366 static void rpccli_echo_SinkData_done(struct tevent_req *subreq)
368 struct tevent_req *req = tevent_req_callback_data(
369 subreq, struct tevent_req);
370 struct rpccli_echo_SinkData_state *state = tevent_req_data(
371 req, struct rpccli_echo_SinkData_state);
375 if (state->out_mem_ctx) {
376 mem_ctx = state->out_mem_ctx;
381 status = state->dispatch_recv(subreq, mem_ctx);
383 if (!NT_STATUS_IS_OK(status)) {
384 tevent_req_nterror(req, status);
388 /* Copy out parameters */
390 /* Reset temporary structure */
391 ZERO_STRUCT(state->tmp);
393 if (DEBUGLEVEL >= 10) {
394 NDR_PRINT_OUT_DEBUG(echo_SinkData, &state->orig);
397 tevent_req_done(req);
400 NTSTATUS rpccli_echo_SinkData_recv(struct tevent_req *req,
403 struct rpccli_echo_SinkData_state *state = tevent_req_data(
404 req, struct rpccli_echo_SinkData_state);
407 if (tevent_req_is_nterror(req, &status)) {
408 tevent_req_received(req);
412 /* Steal possbile out parameters to the callers context */
413 talloc_steal(mem_ctx, state->out_mem_ctx);
415 tevent_req_received(req);
419 NTSTATUS rpccli_echo_SinkData(struct rpc_pipe_client *cli,
421 uint32_t len /* [in] */,
422 uint8_t *data /* [in] [size_is(len)] */)
424 struct echo_SinkData r;
431 if (DEBUGLEVEL >= 10) {
432 NDR_PRINT_IN_DEBUG(echo_SinkData, &r);
435 status = cli->dispatch(cli,
441 if (!NT_STATUS_IS_OK(status)) {
445 if (DEBUGLEVEL >= 10) {
446 NDR_PRINT_OUT_DEBUG(echo_SinkData, &r);
449 if (NT_STATUS_IS_ERR(status)) {
453 /* Return variables */
459 struct rpccli_echo_SourceData_state {
460 struct echo_SourceData orig;
461 struct echo_SourceData tmp;
462 TALLOC_CTX *out_mem_ctx;
463 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
466 static void rpccli_echo_SourceData_done(struct tevent_req *subreq);
468 struct tevent_req *rpccli_echo_SourceData_send(TALLOC_CTX *mem_ctx,
469 struct tevent_context *ev,
470 struct rpc_pipe_client *cli,
471 uint32_t _len /* [in] */,
472 uint8_t *_data /* [out] [size_is(len)] */)
474 struct tevent_req *req;
475 struct rpccli_echo_SourceData_state *state;
476 struct tevent_req *subreq;
478 req = tevent_req_create(mem_ctx, &state,
479 struct rpccli_echo_SourceData_state);
483 state->out_mem_ctx = NULL;
484 state->dispatch_recv = cli->dispatch_recv;
487 state->orig.in.len = _len;
490 state->orig.out.data = _data;
492 if (DEBUGLEVEL >= 10) {
493 NDR_PRINT_IN_DEBUG(echo_SourceData, &state->orig);
496 state->out_mem_ctx = talloc_named_const(state, 0,
497 "rpccli_echo_SourceData_out_memory");
498 if (tevent_req_nomem(state->out_mem_ctx, req)) {
499 return tevent_req_post(req, ev);
502 /* make a temporary copy, that we pass to the dispatch function */
503 state->tmp = state->orig;
505 subreq = cli->dispatch_send(state, ev, cli,
509 if (tevent_req_nomem(subreq, req)) {
510 return tevent_req_post(req, ev);
512 tevent_req_set_callback(subreq, rpccli_echo_SourceData_done, req);
516 static void rpccli_echo_SourceData_done(struct tevent_req *subreq)
518 struct tevent_req *req = tevent_req_callback_data(
519 subreq, struct tevent_req);
520 struct rpccli_echo_SourceData_state *state = tevent_req_data(
521 req, struct rpccli_echo_SourceData_state);
525 if (state->out_mem_ctx) {
526 mem_ctx = state->out_mem_ctx;
531 status = state->dispatch_recv(subreq, mem_ctx);
533 if (!NT_STATUS_IS_OK(status)) {
534 tevent_req_nterror(req, status);
538 /* Copy out parameters */
539 memcpy(state->orig.out.data, state->tmp.out.data, state->tmp.in.len * sizeof(*state->orig.out.data));
541 /* Reset temporary structure */
542 ZERO_STRUCT(state->tmp);
544 if (DEBUGLEVEL >= 10) {
545 NDR_PRINT_OUT_DEBUG(echo_SourceData, &state->orig);
548 tevent_req_done(req);
551 NTSTATUS rpccli_echo_SourceData_recv(struct tevent_req *req,
554 struct rpccli_echo_SourceData_state *state = tevent_req_data(
555 req, struct rpccli_echo_SourceData_state);
558 if (tevent_req_is_nterror(req, &status)) {
559 tevent_req_received(req);
563 /* Steal possbile out parameters to the callers context */
564 talloc_steal(mem_ctx, state->out_mem_ctx);
566 tevent_req_received(req);
570 NTSTATUS rpccli_echo_SourceData(struct rpc_pipe_client *cli,
572 uint32_t len /* [in] */,
573 uint8_t *data /* [out] [size_is(len)] */)
575 struct echo_SourceData r;
581 if (DEBUGLEVEL >= 10) {
582 NDR_PRINT_IN_DEBUG(echo_SourceData, &r);
585 status = cli->dispatch(cli,
591 if (!NT_STATUS_IS_OK(status)) {
595 if (DEBUGLEVEL >= 10) {
596 NDR_PRINT_OUT_DEBUG(echo_SourceData, &r);
599 if (NT_STATUS_IS_ERR(status)) {
603 /* Return variables */
604 memcpy(data, r.out.data, r.in.len * sizeof(*data));
610 struct rpccli_echo_TestCall_state {
611 struct echo_TestCall orig;
612 struct echo_TestCall tmp;
613 TALLOC_CTX *out_mem_ctx;
614 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
617 static void rpccli_echo_TestCall_done(struct tevent_req *subreq);
619 struct tevent_req *rpccli_echo_TestCall_send(TALLOC_CTX *mem_ctx,
620 struct tevent_context *ev,
621 struct rpc_pipe_client *cli,
622 const char *_s1 /* [in] [ref,charset(UTF16)] */,
623 const char **_s2 /* [out] [ref,charset(UTF16)] */)
625 struct tevent_req *req;
626 struct rpccli_echo_TestCall_state *state;
627 struct tevent_req *subreq;
629 req = tevent_req_create(mem_ctx, &state,
630 struct rpccli_echo_TestCall_state);
634 state->out_mem_ctx = NULL;
635 state->dispatch_recv = cli->dispatch_recv;
638 state->orig.in.s1 = _s1;
641 state->orig.out.s2 = _s2;
643 if (DEBUGLEVEL >= 10) {
644 NDR_PRINT_IN_DEBUG(echo_TestCall, &state->orig);
647 state->out_mem_ctx = talloc_named_const(state, 0,
648 "rpccli_echo_TestCall_out_memory");
649 if (tevent_req_nomem(state->out_mem_ctx, req)) {
650 return tevent_req_post(req, ev);
653 /* make a temporary copy, that we pass to the dispatch function */
654 state->tmp = state->orig;
656 subreq = cli->dispatch_send(state, ev, cli,
660 if (tevent_req_nomem(subreq, req)) {
661 return tevent_req_post(req, ev);
663 tevent_req_set_callback(subreq, rpccli_echo_TestCall_done, req);
667 static void rpccli_echo_TestCall_done(struct tevent_req *subreq)
669 struct tevent_req *req = tevent_req_callback_data(
670 subreq, struct tevent_req);
671 struct rpccli_echo_TestCall_state *state = tevent_req_data(
672 req, struct rpccli_echo_TestCall_state);
676 if (state->out_mem_ctx) {
677 mem_ctx = state->out_mem_ctx;
682 status = state->dispatch_recv(subreq, mem_ctx);
684 if (!NT_STATUS_IS_OK(status)) {
685 tevent_req_nterror(req, status);
689 /* Copy out parameters */
690 *state->orig.out.s2 = *state->tmp.out.s2;
692 /* Reset temporary structure */
693 ZERO_STRUCT(state->tmp);
695 if (DEBUGLEVEL >= 10) {
696 NDR_PRINT_OUT_DEBUG(echo_TestCall, &state->orig);
699 tevent_req_done(req);
702 NTSTATUS rpccli_echo_TestCall_recv(struct tevent_req *req,
705 struct rpccli_echo_TestCall_state *state = tevent_req_data(
706 req, struct rpccli_echo_TestCall_state);
709 if (tevent_req_is_nterror(req, &status)) {
710 tevent_req_received(req);
714 /* Steal possbile out parameters to the callers context */
715 talloc_steal(mem_ctx, state->out_mem_ctx);
717 tevent_req_received(req);
721 NTSTATUS rpccli_echo_TestCall(struct rpc_pipe_client *cli,
723 const char *s1 /* [in] [ref,charset(UTF16)] */,
724 const char **s2 /* [out] [ref,charset(UTF16)] */)
726 struct echo_TestCall r;
732 if (DEBUGLEVEL >= 10) {
733 NDR_PRINT_IN_DEBUG(echo_TestCall, &r);
736 status = cli->dispatch(cli,
742 if (!NT_STATUS_IS_OK(status)) {
746 if (DEBUGLEVEL >= 10) {
747 NDR_PRINT_OUT_DEBUG(echo_TestCall, &r);
750 if (NT_STATUS_IS_ERR(status)) {
754 /* Return variables */
761 struct rpccli_echo_TestCall2_state {
762 struct echo_TestCall2 orig;
763 struct echo_TestCall2 tmp;
764 TALLOC_CTX *out_mem_ctx;
765 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
768 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq);
770 struct tevent_req *rpccli_echo_TestCall2_send(TALLOC_CTX *mem_ctx,
771 struct tevent_context *ev,
772 struct rpc_pipe_client *cli,
773 uint16_t _level /* [in] */,
774 union echo_Info *_info /* [out] [ref,switch_is(level)] */)
776 struct tevent_req *req;
777 struct rpccli_echo_TestCall2_state *state;
778 struct tevent_req *subreq;
780 req = tevent_req_create(mem_ctx, &state,
781 struct rpccli_echo_TestCall2_state);
785 state->out_mem_ctx = NULL;
786 state->dispatch_recv = cli->dispatch_recv;
789 state->orig.in.level = _level;
792 state->orig.out.info = _info;
795 ZERO_STRUCT(state->orig.out.result);
797 if (DEBUGLEVEL >= 10) {
798 NDR_PRINT_IN_DEBUG(echo_TestCall2, &state->orig);
801 state->out_mem_ctx = talloc_named_const(state, 0,
802 "rpccli_echo_TestCall2_out_memory");
803 if (tevent_req_nomem(state->out_mem_ctx, req)) {
804 return tevent_req_post(req, ev);
807 /* make a temporary copy, that we pass to the dispatch function */
808 state->tmp = state->orig;
810 subreq = cli->dispatch_send(state, ev, cli,
814 if (tevent_req_nomem(subreq, req)) {
815 return tevent_req_post(req, ev);
817 tevent_req_set_callback(subreq, rpccli_echo_TestCall2_done, req);
821 static void rpccli_echo_TestCall2_done(struct tevent_req *subreq)
823 struct tevent_req *req = tevent_req_callback_data(
824 subreq, struct tevent_req);
825 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
826 req, struct rpccli_echo_TestCall2_state);
830 if (state->out_mem_ctx) {
831 mem_ctx = state->out_mem_ctx;
836 status = state->dispatch_recv(subreq, mem_ctx);
838 if (!NT_STATUS_IS_OK(status)) {
839 tevent_req_nterror(req, status);
843 /* Copy out parameters */
844 *state->orig.out.info = *state->tmp.out.info;
847 state->orig.out.result = state->tmp.out.result;
849 /* Reset temporary structure */
850 ZERO_STRUCT(state->tmp);
852 if (DEBUGLEVEL >= 10) {
853 NDR_PRINT_OUT_DEBUG(echo_TestCall2, &state->orig);
856 tevent_req_done(req);
859 NTSTATUS rpccli_echo_TestCall2_recv(struct tevent_req *req,
863 struct rpccli_echo_TestCall2_state *state = tevent_req_data(
864 req, struct rpccli_echo_TestCall2_state);
867 if (tevent_req_is_nterror(req, &status)) {
868 tevent_req_received(req);
872 /* Steal possbile out parameters to the callers context */
873 talloc_steal(mem_ctx, state->out_mem_ctx);
876 *result = state->orig.out.result;
878 tevent_req_received(req);
882 NTSTATUS rpccli_echo_TestCall2(struct rpc_pipe_client *cli,
884 uint16_t level /* [in] */,
885 union echo_Info *info /* [out] [ref,switch_is(level)] */)
887 struct echo_TestCall2 r;
893 if (DEBUGLEVEL >= 10) {
894 NDR_PRINT_IN_DEBUG(echo_TestCall2, &r);
897 status = cli->dispatch(cli,
903 if (!NT_STATUS_IS_OK(status)) {
907 if (DEBUGLEVEL >= 10) {
908 NDR_PRINT_OUT_DEBUG(echo_TestCall2, &r);
911 if (NT_STATUS_IS_ERR(status)) {
915 /* Return variables */
922 struct rpccli_echo_TestSleep_state {
923 struct echo_TestSleep orig;
924 struct echo_TestSleep tmp;
925 TALLOC_CTX *out_mem_ctx;
926 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
929 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq);
931 struct tevent_req *rpccli_echo_TestSleep_send(TALLOC_CTX *mem_ctx,
932 struct tevent_context *ev,
933 struct rpc_pipe_client *cli,
934 uint32_t _seconds /* [in] */)
936 struct tevent_req *req;
937 struct rpccli_echo_TestSleep_state *state;
938 struct tevent_req *subreq;
940 req = tevent_req_create(mem_ctx, &state,
941 struct rpccli_echo_TestSleep_state);
945 state->out_mem_ctx = NULL;
946 state->dispatch_recv = cli->dispatch_recv;
949 state->orig.in.seconds = _seconds;
954 ZERO_STRUCT(state->orig.out.result);
956 if (DEBUGLEVEL >= 10) {
957 NDR_PRINT_IN_DEBUG(echo_TestSleep, &state->orig);
960 /* make a temporary copy, that we pass to the dispatch function */
961 state->tmp = state->orig;
963 subreq = cli->dispatch_send(state, ev, cli,
967 if (tevent_req_nomem(subreq, req)) {
968 return tevent_req_post(req, ev);
970 tevent_req_set_callback(subreq, rpccli_echo_TestSleep_done, req);
974 static void rpccli_echo_TestSleep_done(struct tevent_req *subreq)
976 struct tevent_req *req = tevent_req_callback_data(
977 subreq, struct tevent_req);
978 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
979 req, struct rpccli_echo_TestSleep_state);
983 if (state->out_mem_ctx) {
984 mem_ctx = state->out_mem_ctx;
989 status = state->dispatch_recv(subreq, mem_ctx);
991 if (!NT_STATUS_IS_OK(status)) {
992 tevent_req_nterror(req, status);
996 /* Copy out parameters */
999 state->orig.out.result = state->tmp.out.result;
1001 /* Reset temporary structure */
1002 ZERO_STRUCT(state->tmp);
1004 if (DEBUGLEVEL >= 10) {
1005 NDR_PRINT_OUT_DEBUG(echo_TestSleep, &state->orig);
1008 tevent_req_done(req);
1011 NTSTATUS rpccli_echo_TestSleep_recv(struct tevent_req *req,
1012 TALLOC_CTX *mem_ctx,
1015 struct rpccli_echo_TestSleep_state *state = tevent_req_data(
1016 req, struct rpccli_echo_TestSleep_state);
1019 if (tevent_req_is_nterror(req, &status)) {
1020 tevent_req_received(req);
1024 /* Steal possbile out parameters to the callers context */
1025 talloc_steal(mem_ctx, state->out_mem_ctx);
1028 *result = state->orig.out.result;
1030 tevent_req_received(req);
1031 return NT_STATUS_OK;
1034 NTSTATUS rpccli_echo_TestSleep(struct rpc_pipe_client *cli,
1035 TALLOC_CTX *mem_ctx,
1036 uint32_t seconds /* [in] */)
1038 struct echo_TestSleep r;
1042 r.in.seconds = seconds;
1044 if (DEBUGLEVEL >= 10) {
1045 NDR_PRINT_IN_DEBUG(echo_TestSleep, &r);
1048 status = cli->dispatch(cli,
1054 if (!NT_STATUS_IS_OK(status)) {
1058 if (DEBUGLEVEL >= 10) {
1059 NDR_PRINT_OUT_DEBUG(echo_TestSleep, &r);
1062 if (NT_STATUS_IS_ERR(status)) {
1066 /* Return variables */
1069 return NT_STATUS_OK;
1072 struct rpccli_echo_TestEnum_state {
1073 struct echo_TestEnum orig;
1074 struct echo_TestEnum tmp;
1075 TALLOC_CTX *out_mem_ctx;
1076 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1079 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq);
1081 struct tevent_req *rpccli_echo_TestEnum_send(TALLOC_CTX *mem_ctx,
1082 struct tevent_context *ev,
1083 struct rpc_pipe_client *cli,
1084 enum echo_Enum1 *_foo1 /* [in,out] [ref] */,
1085 struct echo_Enum2 *_foo2 /* [in,out] [ref] */,
1086 union echo_Enum3 *_foo3 /* [in,out] [ref,switch_is(*foo1)] */)
1088 struct tevent_req *req;
1089 struct rpccli_echo_TestEnum_state *state;
1090 struct tevent_req *subreq;
1092 req = tevent_req_create(mem_ctx, &state,
1093 struct rpccli_echo_TestEnum_state);
1097 state->out_mem_ctx = NULL;
1098 state->dispatch_recv = cli->dispatch_recv;
1101 state->orig.in.foo1 = _foo1;
1102 state->orig.in.foo2 = _foo2;
1103 state->orig.in.foo3 = _foo3;
1105 /* Out parameters */
1106 state->orig.out.foo1 = _foo1;
1107 state->orig.out.foo2 = _foo2;
1108 state->orig.out.foo3 = _foo3;
1110 if (DEBUGLEVEL >= 10) {
1111 NDR_PRINT_IN_DEBUG(echo_TestEnum, &state->orig);
1114 state->out_mem_ctx = talloc_named_const(state, 0,
1115 "rpccli_echo_TestEnum_out_memory");
1116 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1117 return tevent_req_post(req, ev);
1120 /* make a temporary copy, that we pass to the dispatch function */
1121 state->tmp = state->orig;
1123 subreq = cli->dispatch_send(state, ev, cli,
1127 if (tevent_req_nomem(subreq, req)) {
1128 return tevent_req_post(req, ev);
1130 tevent_req_set_callback(subreq, rpccli_echo_TestEnum_done, req);
1134 static void rpccli_echo_TestEnum_done(struct tevent_req *subreq)
1136 struct tevent_req *req = tevent_req_callback_data(
1137 subreq, struct tevent_req);
1138 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1139 req, struct rpccli_echo_TestEnum_state);
1141 TALLOC_CTX *mem_ctx;
1143 if (state->out_mem_ctx) {
1144 mem_ctx = state->out_mem_ctx;
1149 status = state->dispatch_recv(subreq, mem_ctx);
1150 TALLOC_FREE(subreq);
1151 if (!NT_STATUS_IS_OK(status)) {
1152 tevent_req_nterror(req, status);
1156 /* Copy out parameters */
1157 *state->orig.out.foo1 = *state->tmp.out.foo1;
1158 *state->orig.out.foo2 = *state->tmp.out.foo2;
1159 *state->orig.out.foo3 = *state->tmp.out.foo3;
1161 /* Reset temporary structure */
1162 ZERO_STRUCT(state->tmp);
1164 if (DEBUGLEVEL >= 10) {
1165 NDR_PRINT_OUT_DEBUG(echo_TestEnum, &state->orig);
1168 tevent_req_done(req);
1171 NTSTATUS rpccli_echo_TestEnum_recv(struct tevent_req *req,
1172 TALLOC_CTX *mem_ctx)
1174 struct rpccli_echo_TestEnum_state *state = tevent_req_data(
1175 req, struct rpccli_echo_TestEnum_state);
1178 if (tevent_req_is_nterror(req, &status)) {
1179 tevent_req_received(req);
1183 /* Steal possbile out parameters to the callers context */
1184 talloc_steal(mem_ctx, state->out_mem_ctx);
1186 tevent_req_received(req);
1187 return NT_STATUS_OK;
1190 NTSTATUS rpccli_echo_TestEnum(struct rpc_pipe_client *cli,
1191 TALLOC_CTX *mem_ctx,
1192 enum echo_Enum1 *foo1 /* [in,out] [ref] */,
1193 struct echo_Enum2 *foo2 /* [in,out] [ref] */,
1194 union echo_Enum3 *foo3 /* [in,out] [ref,switch_is(*foo1)] */)
1196 struct echo_TestEnum r;
1204 if (DEBUGLEVEL >= 10) {
1205 NDR_PRINT_IN_DEBUG(echo_TestEnum, &r);
1208 status = cli->dispatch(cli,
1214 if (!NT_STATUS_IS_OK(status)) {
1218 if (DEBUGLEVEL >= 10) {
1219 NDR_PRINT_OUT_DEBUG(echo_TestEnum, &r);
1222 if (NT_STATUS_IS_ERR(status)) {
1226 /* Return variables */
1227 *foo1 = *r.out.foo1;
1228 *foo2 = *r.out.foo2;
1229 *foo3 = *r.out.foo3;
1232 return NT_STATUS_OK;
1235 struct rpccli_echo_TestSurrounding_state {
1236 struct echo_TestSurrounding orig;
1237 struct echo_TestSurrounding tmp;
1238 TALLOC_CTX *out_mem_ctx;
1239 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1242 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq);
1244 struct tevent_req *rpccli_echo_TestSurrounding_send(TALLOC_CTX *mem_ctx,
1245 struct tevent_context *ev,
1246 struct rpc_pipe_client *cli,
1247 struct echo_Surrounding *_data /* [in,out] [ref] */)
1249 struct tevent_req *req;
1250 struct rpccli_echo_TestSurrounding_state *state;
1251 struct tevent_req *subreq;
1253 req = tevent_req_create(mem_ctx, &state,
1254 struct rpccli_echo_TestSurrounding_state);
1258 state->out_mem_ctx = NULL;
1259 state->dispatch_recv = cli->dispatch_recv;
1262 state->orig.in.data = _data;
1264 /* Out parameters */
1265 state->orig.out.data = _data;
1267 if (DEBUGLEVEL >= 10) {
1268 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &state->orig);
1271 state->out_mem_ctx = talloc_named_const(state, 0,
1272 "rpccli_echo_TestSurrounding_out_memory");
1273 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1274 return tevent_req_post(req, ev);
1277 /* make a temporary copy, that we pass to the dispatch function */
1278 state->tmp = state->orig;
1280 subreq = cli->dispatch_send(state, ev, cli,
1282 NDR_ECHO_TESTSURROUNDING,
1284 if (tevent_req_nomem(subreq, req)) {
1285 return tevent_req_post(req, ev);
1287 tevent_req_set_callback(subreq, rpccli_echo_TestSurrounding_done, req);
1291 static void rpccli_echo_TestSurrounding_done(struct tevent_req *subreq)
1293 struct tevent_req *req = tevent_req_callback_data(
1294 subreq, struct tevent_req);
1295 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1296 req, struct rpccli_echo_TestSurrounding_state);
1298 TALLOC_CTX *mem_ctx;
1300 if (state->out_mem_ctx) {
1301 mem_ctx = state->out_mem_ctx;
1306 status = state->dispatch_recv(subreq, mem_ctx);
1307 TALLOC_FREE(subreq);
1308 if (!NT_STATUS_IS_OK(status)) {
1309 tevent_req_nterror(req, status);
1313 /* Copy out parameters */
1314 *state->orig.out.data = *state->tmp.out.data;
1316 /* Reset temporary structure */
1317 ZERO_STRUCT(state->tmp);
1319 if (DEBUGLEVEL >= 10) {
1320 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &state->orig);
1323 tevent_req_done(req);
1326 NTSTATUS rpccli_echo_TestSurrounding_recv(struct tevent_req *req,
1327 TALLOC_CTX *mem_ctx)
1329 struct rpccli_echo_TestSurrounding_state *state = tevent_req_data(
1330 req, struct rpccli_echo_TestSurrounding_state);
1333 if (tevent_req_is_nterror(req, &status)) {
1334 tevent_req_received(req);
1338 /* Steal possbile out parameters to the callers context */
1339 talloc_steal(mem_ctx, state->out_mem_ctx);
1341 tevent_req_received(req);
1342 return NT_STATUS_OK;
1345 NTSTATUS rpccli_echo_TestSurrounding(struct rpc_pipe_client *cli,
1346 TALLOC_CTX *mem_ctx,
1347 struct echo_Surrounding *data /* [in,out] [ref] */)
1349 struct echo_TestSurrounding r;
1355 if (DEBUGLEVEL >= 10) {
1356 NDR_PRINT_IN_DEBUG(echo_TestSurrounding, &r);
1359 status = cli->dispatch(cli,
1362 NDR_ECHO_TESTSURROUNDING,
1365 if (!NT_STATUS_IS_OK(status)) {
1369 if (DEBUGLEVEL >= 10) {
1370 NDR_PRINT_OUT_DEBUG(echo_TestSurrounding, &r);
1373 if (NT_STATUS_IS_ERR(status)) {
1377 /* Return variables */
1378 *data = *r.out.data;
1381 return NT_STATUS_OK;
1384 struct rpccli_echo_TestDoublePointer_state {
1385 struct echo_TestDoublePointer orig;
1386 struct echo_TestDoublePointer tmp;
1387 TALLOC_CTX *out_mem_ctx;
1388 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1391 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq);
1393 struct tevent_req *rpccli_echo_TestDoublePointer_send(TALLOC_CTX *mem_ctx,
1394 struct tevent_context *ev,
1395 struct rpc_pipe_client *cli,
1396 uint16_t ***_data /* [in] [ref] */)
1398 struct tevent_req *req;
1399 struct rpccli_echo_TestDoublePointer_state *state;
1400 struct tevent_req *subreq;
1402 req = tevent_req_create(mem_ctx, &state,
1403 struct rpccli_echo_TestDoublePointer_state);
1407 state->out_mem_ctx = NULL;
1408 state->dispatch_recv = cli->dispatch_recv;
1411 state->orig.in.data = _data;
1413 /* Out parameters */
1416 ZERO_STRUCT(state->orig.out.result);
1418 if (DEBUGLEVEL >= 10) {
1419 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &state->orig);
1422 /* make a temporary copy, that we pass to the dispatch function */
1423 state->tmp = state->orig;
1425 subreq = cli->dispatch_send(state, ev, cli,
1427 NDR_ECHO_TESTDOUBLEPOINTER,
1429 if (tevent_req_nomem(subreq, req)) {
1430 return tevent_req_post(req, ev);
1432 tevent_req_set_callback(subreq, rpccli_echo_TestDoublePointer_done, req);
1436 static void rpccli_echo_TestDoublePointer_done(struct tevent_req *subreq)
1438 struct tevent_req *req = tevent_req_callback_data(
1439 subreq, struct tevent_req);
1440 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1441 req, struct rpccli_echo_TestDoublePointer_state);
1443 TALLOC_CTX *mem_ctx;
1445 if (state->out_mem_ctx) {
1446 mem_ctx = state->out_mem_ctx;
1451 status = state->dispatch_recv(subreq, mem_ctx);
1452 TALLOC_FREE(subreq);
1453 if (!NT_STATUS_IS_OK(status)) {
1454 tevent_req_nterror(req, status);
1458 /* Copy out parameters */
1461 state->orig.out.result = state->tmp.out.result;
1463 /* Reset temporary structure */
1464 ZERO_STRUCT(state->tmp);
1466 if (DEBUGLEVEL >= 10) {
1467 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &state->orig);
1470 tevent_req_done(req);
1473 NTSTATUS rpccli_echo_TestDoublePointer_recv(struct tevent_req *req,
1474 TALLOC_CTX *mem_ctx,
1477 struct rpccli_echo_TestDoublePointer_state *state = tevent_req_data(
1478 req, struct rpccli_echo_TestDoublePointer_state);
1481 if (tevent_req_is_nterror(req, &status)) {
1482 tevent_req_received(req);
1486 /* Steal possbile out parameters to the callers context */
1487 talloc_steal(mem_ctx, state->out_mem_ctx);
1490 *result = state->orig.out.result;
1492 tevent_req_received(req);
1493 return NT_STATUS_OK;
1496 NTSTATUS rpccli_echo_TestDoublePointer(struct rpc_pipe_client *cli,
1497 TALLOC_CTX *mem_ctx,
1498 uint16_t ***data /* [in] [ref] */)
1500 struct echo_TestDoublePointer r;
1506 if (DEBUGLEVEL >= 10) {
1507 NDR_PRINT_IN_DEBUG(echo_TestDoublePointer, &r);
1510 status = cli->dispatch(cli,
1513 NDR_ECHO_TESTDOUBLEPOINTER,
1516 if (!NT_STATUS_IS_OK(status)) {
1520 if (DEBUGLEVEL >= 10) {
1521 NDR_PRINT_OUT_DEBUG(echo_TestDoublePointer, &r);
1524 if (NT_STATUS_IS_ERR(status)) {
1528 /* Return variables */
1531 return NT_STATUS_OK;