Fix release script with newer versins of git
[Samba/bb.git] / librpc / gen_ndr / cli_drsuapi.c
blobc261a79f62c1b63b55731e3d61a8c6f541ecc718
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_drsuapi.h"
9 struct rpccli_drsuapi_DsBind_state {
10 struct drsuapi_DsBind orig;
11 struct drsuapi_DsBind tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_drsuapi_DsBind_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_drsuapi_DsBind_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 struct GUID *_bind_guid /* [in] [unique] */,
22 struct drsuapi_DsBindInfoCtr *_bind_info /* [in,out] [unique] */,
23 struct policy_handle *_bind_handle /* [out] [ref] */)
25 struct tevent_req *req;
26 struct rpccli_drsuapi_DsBind_state *state;
27 struct tevent_req *subreq;
29 req = tevent_req_create(mem_ctx, &state,
30 struct rpccli_drsuapi_DsBind_state);
31 if (req == NULL) {
32 return NULL;
34 state->out_mem_ctx = NULL;
35 state->dispatch_recv = cli->dispatch_recv;
37 /* In parameters */
38 state->orig.in.bind_guid = _bind_guid;
39 state->orig.in.bind_info = _bind_info;
41 /* Out parameters */
42 state->orig.out.bind_info = _bind_info;
43 state->orig.out.bind_handle = _bind_handle;
45 /* Result */
46 ZERO_STRUCT(state->orig.out.result);
48 state->out_mem_ctx = talloc_named_const(state, 0,
49 "rpccli_drsuapi_DsBind_out_memory");
50 if (tevent_req_nomem(state->out_mem_ctx, req)) {
51 return tevent_req_post(req, ev);
54 /* make a temporary copy, that we pass to the dispatch function */
55 state->tmp = state->orig;
57 subreq = cli->dispatch_send(state, ev, cli,
58 &ndr_table_drsuapi,
59 NDR_DRSUAPI_DSBIND,
60 &state->tmp);
61 if (tevent_req_nomem(subreq, req)) {
62 return tevent_req_post(req, ev);
64 tevent_req_set_callback(subreq, rpccli_drsuapi_DsBind_done, req);
65 return req;
68 static void rpccli_drsuapi_DsBind_done(struct tevent_req *subreq)
70 struct tevent_req *req = tevent_req_callback_data(
71 subreq, struct tevent_req);
72 struct rpccli_drsuapi_DsBind_state *state = tevent_req_data(
73 req, struct rpccli_drsuapi_DsBind_state);
74 NTSTATUS status;
75 TALLOC_CTX *mem_ctx;
77 if (state->out_mem_ctx) {
78 mem_ctx = state->out_mem_ctx;
79 } else {
80 mem_ctx = state;
83 status = state->dispatch_recv(subreq, mem_ctx);
84 TALLOC_FREE(subreq);
85 if (!NT_STATUS_IS_OK(status)) {
86 tevent_req_nterror(req, status);
87 return;
90 /* Copy out parameters */
91 if (state->orig.out.bind_info && state->tmp.out.bind_info) {
92 *state->orig.out.bind_info = *state->tmp.out.bind_info;
94 *state->orig.out.bind_handle = *state->tmp.out.bind_handle;
96 /* Copy result */
97 state->orig.out.result = state->tmp.out.result;
99 /* Reset temporary structure */
100 ZERO_STRUCT(state->tmp);
102 tevent_req_done(req);
105 NTSTATUS rpccli_drsuapi_DsBind_recv(struct tevent_req *req,
106 TALLOC_CTX *mem_ctx,
107 WERROR *result)
109 struct rpccli_drsuapi_DsBind_state *state = tevent_req_data(
110 req, struct rpccli_drsuapi_DsBind_state);
111 NTSTATUS status;
113 if (tevent_req_is_nterror(req, &status)) {
114 tevent_req_received(req);
115 return status;
118 /* Steal possbile out parameters to the callers context */
119 talloc_steal(mem_ctx, state->out_mem_ctx);
121 /* Return result */
122 *result = state->orig.out.result;
124 tevent_req_received(req);
125 return NT_STATUS_OK;
128 NTSTATUS rpccli_drsuapi_DsBind(struct rpc_pipe_client *cli,
129 TALLOC_CTX *mem_ctx,
130 struct GUID *bind_guid /* [in] [unique] */,
131 struct drsuapi_DsBindInfoCtr *bind_info /* [in,out] [unique] */,
132 struct policy_handle *bind_handle /* [out] [ref] */,
133 WERROR *werror)
135 struct drsuapi_DsBind r;
136 NTSTATUS status;
138 /* In parameters */
139 r.in.bind_guid = bind_guid;
140 r.in.bind_info = bind_info;
142 status = cli->dispatch(cli,
143 mem_ctx,
144 &ndr_table_drsuapi,
145 NDR_DRSUAPI_DSBIND,
146 &r);
148 if (!NT_STATUS_IS_OK(status)) {
149 return status;
152 if (NT_STATUS_IS_ERR(status)) {
153 return status;
156 /* Return variables */
157 if (bind_info && r.out.bind_info) {
158 *bind_info = *r.out.bind_info;
160 *bind_handle = *r.out.bind_handle;
162 /* Return result */
163 if (werror) {
164 *werror = r.out.result;
167 return werror_to_ntstatus(r.out.result);
170 struct rpccli_drsuapi_DsUnbind_state {
171 struct drsuapi_DsUnbind orig;
172 struct drsuapi_DsUnbind tmp;
173 TALLOC_CTX *out_mem_ctx;
174 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
177 static void rpccli_drsuapi_DsUnbind_done(struct tevent_req *subreq);
179 struct tevent_req *rpccli_drsuapi_DsUnbind_send(TALLOC_CTX *mem_ctx,
180 struct tevent_context *ev,
181 struct rpc_pipe_client *cli,
182 struct policy_handle *_bind_handle /* [in,out] [ref] */)
184 struct tevent_req *req;
185 struct rpccli_drsuapi_DsUnbind_state *state;
186 struct tevent_req *subreq;
188 req = tevent_req_create(mem_ctx, &state,
189 struct rpccli_drsuapi_DsUnbind_state);
190 if (req == NULL) {
191 return NULL;
193 state->out_mem_ctx = NULL;
194 state->dispatch_recv = cli->dispatch_recv;
196 /* In parameters */
197 state->orig.in.bind_handle = _bind_handle;
199 /* Out parameters */
200 state->orig.out.bind_handle = _bind_handle;
202 /* Result */
203 ZERO_STRUCT(state->orig.out.result);
205 state->out_mem_ctx = talloc_named_const(state, 0,
206 "rpccli_drsuapi_DsUnbind_out_memory");
207 if (tevent_req_nomem(state->out_mem_ctx, req)) {
208 return tevent_req_post(req, ev);
211 /* make a temporary copy, that we pass to the dispatch function */
212 state->tmp = state->orig;
214 subreq = cli->dispatch_send(state, ev, cli,
215 &ndr_table_drsuapi,
216 NDR_DRSUAPI_DSUNBIND,
217 &state->tmp);
218 if (tevent_req_nomem(subreq, req)) {
219 return tevent_req_post(req, ev);
221 tevent_req_set_callback(subreq, rpccli_drsuapi_DsUnbind_done, req);
222 return req;
225 static void rpccli_drsuapi_DsUnbind_done(struct tevent_req *subreq)
227 struct tevent_req *req = tevent_req_callback_data(
228 subreq, struct tevent_req);
229 struct rpccli_drsuapi_DsUnbind_state *state = tevent_req_data(
230 req, struct rpccli_drsuapi_DsUnbind_state);
231 NTSTATUS status;
232 TALLOC_CTX *mem_ctx;
234 if (state->out_mem_ctx) {
235 mem_ctx = state->out_mem_ctx;
236 } else {
237 mem_ctx = state;
240 status = state->dispatch_recv(subreq, mem_ctx);
241 TALLOC_FREE(subreq);
242 if (!NT_STATUS_IS_OK(status)) {
243 tevent_req_nterror(req, status);
244 return;
247 /* Copy out parameters */
248 *state->orig.out.bind_handle = *state->tmp.out.bind_handle;
250 /* Copy result */
251 state->orig.out.result = state->tmp.out.result;
253 /* Reset temporary structure */
254 ZERO_STRUCT(state->tmp);
256 tevent_req_done(req);
259 NTSTATUS rpccli_drsuapi_DsUnbind_recv(struct tevent_req *req,
260 TALLOC_CTX *mem_ctx,
261 WERROR *result)
263 struct rpccli_drsuapi_DsUnbind_state *state = tevent_req_data(
264 req, struct rpccli_drsuapi_DsUnbind_state);
265 NTSTATUS status;
267 if (tevent_req_is_nterror(req, &status)) {
268 tevent_req_received(req);
269 return status;
272 /* Steal possbile out parameters to the callers context */
273 talloc_steal(mem_ctx, state->out_mem_ctx);
275 /* Return result */
276 *result = state->orig.out.result;
278 tevent_req_received(req);
279 return NT_STATUS_OK;
282 NTSTATUS rpccli_drsuapi_DsUnbind(struct rpc_pipe_client *cli,
283 TALLOC_CTX *mem_ctx,
284 struct policy_handle *bind_handle /* [in,out] [ref] */,
285 WERROR *werror)
287 struct drsuapi_DsUnbind r;
288 NTSTATUS status;
290 /* In parameters */
291 r.in.bind_handle = bind_handle;
293 status = cli->dispatch(cli,
294 mem_ctx,
295 &ndr_table_drsuapi,
296 NDR_DRSUAPI_DSUNBIND,
297 &r);
299 if (!NT_STATUS_IS_OK(status)) {
300 return status;
303 if (NT_STATUS_IS_ERR(status)) {
304 return status;
307 /* Return variables */
308 *bind_handle = *r.out.bind_handle;
310 /* Return result */
311 if (werror) {
312 *werror = r.out.result;
315 return werror_to_ntstatus(r.out.result);
318 struct rpccli_drsuapi_DsReplicaSync_state {
319 struct drsuapi_DsReplicaSync orig;
320 struct drsuapi_DsReplicaSync tmp;
321 TALLOC_CTX *out_mem_ctx;
322 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
325 static void rpccli_drsuapi_DsReplicaSync_done(struct tevent_req *subreq);
327 struct tevent_req *rpccli_drsuapi_DsReplicaSync_send(TALLOC_CTX *mem_ctx,
328 struct tevent_context *ev,
329 struct rpc_pipe_client *cli,
330 struct policy_handle *_bind_handle /* [in] [ref] */,
331 int32_t _level /* [in] */,
332 union drsuapi_DsReplicaSyncRequest _req /* [in] [switch_is(level)] */)
334 struct tevent_req *req;
335 struct rpccli_drsuapi_DsReplicaSync_state *state;
336 struct tevent_req *subreq;
338 req = tevent_req_create(mem_ctx, &state,
339 struct rpccli_drsuapi_DsReplicaSync_state);
340 if (req == NULL) {
341 return NULL;
343 state->out_mem_ctx = NULL;
344 state->dispatch_recv = cli->dispatch_recv;
346 /* In parameters */
347 state->orig.in.bind_handle = _bind_handle;
348 state->orig.in.level = _level;
349 state->orig.in.req = _req;
351 /* Out parameters */
353 /* Result */
354 ZERO_STRUCT(state->orig.out.result);
356 /* make a temporary copy, that we pass to the dispatch function */
357 state->tmp = state->orig;
359 subreq = cli->dispatch_send(state, ev, cli,
360 &ndr_table_drsuapi,
361 NDR_DRSUAPI_DSREPLICASYNC,
362 &state->tmp);
363 if (tevent_req_nomem(subreq, req)) {
364 return tevent_req_post(req, ev);
366 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaSync_done, req);
367 return req;
370 static void rpccli_drsuapi_DsReplicaSync_done(struct tevent_req *subreq)
372 struct tevent_req *req = tevent_req_callback_data(
373 subreq, struct tevent_req);
374 struct rpccli_drsuapi_DsReplicaSync_state *state = tevent_req_data(
375 req, struct rpccli_drsuapi_DsReplicaSync_state);
376 NTSTATUS status;
377 TALLOC_CTX *mem_ctx;
379 if (state->out_mem_ctx) {
380 mem_ctx = state->out_mem_ctx;
381 } else {
382 mem_ctx = state;
385 status = state->dispatch_recv(subreq, mem_ctx);
386 TALLOC_FREE(subreq);
387 if (!NT_STATUS_IS_OK(status)) {
388 tevent_req_nterror(req, status);
389 return;
392 /* Copy out parameters */
394 /* Copy result */
395 state->orig.out.result = state->tmp.out.result;
397 /* Reset temporary structure */
398 ZERO_STRUCT(state->tmp);
400 tevent_req_done(req);
403 NTSTATUS rpccli_drsuapi_DsReplicaSync_recv(struct tevent_req *req,
404 TALLOC_CTX *mem_ctx,
405 WERROR *result)
407 struct rpccli_drsuapi_DsReplicaSync_state *state = tevent_req_data(
408 req, struct rpccli_drsuapi_DsReplicaSync_state);
409 NTSTATUS status;
411 if (tevent_req_is_nterror(req, &status)) {
412 tevent_req_received(req);
413 return status;
416 /* Steal possbile out parameters to the callers context */
417 talloc_steal(mem_ctx, state->out_mem_ctx);
419 /* Return result */
420 *result = state->orig.out.result;
422 tevent_req_received(req);
423 return NT_STATUS_OK;
426 NTSTATUS rpccli_drsuapi_DsReplicaSync(struct rpc_pipe_client *cli,
427 TALLOC_CTX *mem_ctx,
428 struct policy_handle *bind_handle /* [in] [ref] */,
429 int32_t level /* [in] */,
430 union drsuapi_DsReplicaSyncRequest req /* [in] [switch_is(level)] */,
431 WERROR *werror)
433 struct drsuapi_DsReplicaSync r;
434 NTSTATUS status;
436 /* In parameters */
437 r.in.bind_handle = bind_handle;
438 r.in.level = level;
439 r.in.req = req;
441 status = cli->dispatch(cli,
442 mem_ctx,
443 &ndr_table_drsuapi,
444 NDR_DRSUAPI_DSREPLICASYNC,
445 &r);
447 if (!NT_STATUS_IS_OK(status)) {
448 return status;
451 if (NT_STATUS_IS_ERR(status)) {
452 return status;
455 /* Return variables */
457 /* Return result */
458 if (werror) {
459 *werror = r.out.result;
462 return werror_to_ntstatus(r.out.result);
465 struct rpccli_drsuapi_DsGetNCChanges_state {
466 struct drsuapi_DsGetNCChanges orig;
467 struct drsuapi_DsGetNCChanges tmp;
468 TALLOC_CTX *out_mem_ctx;
469 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
472 static void rpccli_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq);
474 struct tevent_req *rpccli_drsuapi_DsGetNCChanges_send(TALLOC_CTX *mem_ctx,
475 struct tevent_context *ev,
476 struct rpc_pipe_client *cli,
477 struct policy_handle *_bind_handle /* [in] [ref] */,
478 int32_t _level /* [in] */,
479 union drsuapi_DsGetNCChangesRequest *_req /* [in] [ref,switch_is(level)] */,
480 int32_t *_level_out /* [out] [ref] */,
481 union drsuapi_DsGetNCChangesCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
483 struct tevent_req *req;
484 struct rpccli_drsuapi_DsGetNCChanges_state *state;
485 struct tevent_req *subreq;
487 req = tevent_req_create(mem_ctx, &state,
488 struct rpccli_drsuapi_DsGetNCChanges_state);
489 if (req == NULL) {
490 return NULL;
492 state->out_mem_ctx = NULL;
493 state->dispatch_recv = cli->dispatch_recv;
495 /* In parameters */
496 state->orig.in.bind_handle = _bind_handle;
497 state->orig.in.level = _level;
498 state->orig.in.req = _req;
500 /* Out parameters */
501 state->orig.out.level_out = _level_out;
502 state->orig.out.ctr = _ctr;
504 /* Result */
505 ZERO_STRUCT(state->orig.out.result);
507 state->out_mem_ctx = talloc_named_const(state, 0,
508 "rpccli_drsuapi_DsGetNCChanges_out_memory");
509 if (tevent_req_nomem(state->out_mem_ctx, req)) {
510 return tevent_req_post(req, ev);
513 /* make a temporary copy, that we pass to the dispatch function */
514 state->tmp = state->orig;
516 subreq = cli->dispatch_send(state, ev, cli,
517 &ndr_table_drsuapi,
518 NDR_DRSUAPI_DSGETNCCHANGES,
519 &state->tmp);
520 if (tevent_req_nomem(subreq, req)) {
521 return tevent_req_post(req, ev);
523 tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetNCChanges_done, req);
524 return req;
527 static void rpccli_drsuapi_DsGetNCChanges_done(struct tevent_req *subreq)
529 struct tevent_req *req = tevent_req_callback_data(
530 subreq, struct tevent_req);
531 struct rpccli_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
532 req, struct rpccli_drsuapi_DsGetNCChanges_state);
533 NTSTATUS status;
534 TALLOC_CTX *mem_ctx;
536 if (state->out_mem_ctx) {
537 mem_ctx = state->out_mem_ctx;
538 } else {
539 mem_ctx = state;
542 status = state->dispatch_recv(subreq, mem_ctx);
543 TALLOC_FREE(subreq);
544 if (!NT_STATUS_IS_OK(status)) {
545 tevent_req_nterror(req, status);
546 return;
549 /* Copy out parameters */
550 *state->orig.out.level_out = *state->tmp.out.level_out;
551 *state->orig.out.ctr = *state->tmp.out.ctr;
553 /* Copy result */
554 state->orig.out.result = state->tmp.out.result;
556 /* Reset temporary structure */
557 ZERO_STRUCT(state->tmp);
559 tevent_req_done(req);
562 NTSTATUS rpccli_drsuapi_DsGetNCChanges_recv(struct tevent_req *req,
563 TALLOC_CTX *mem_ctx,
564 WERROR *result)
566 struct rpccli_drsuapi_DsGetNCChanges_state *state = tevent_req_data(
567 req, struct rpccli_drsuapi_DsGetNCChanges_state);
568 NTSTATUS status;
570 if (tevent_req_is_nterror(req, &status)) {
571 tevent_req_received(req);
572 return status;
575 /* Steal possbile out parameters to the callers context */
576 talloc_steal(mem_ctx, state->out_mem_ctx);
578 /* Return result */
579 *result = state->orig.out.result;
581 tevent_req_received(req);
582 return NT_STATUS_OK;
585 NTSTATUS rpccli_drsuapi_DsGetNCChanges(struct rpc_pipe_client *cli,
586 TALLOC_CTX *mem_ctx,
587 struct policy_handle *bind_handle /* [in] [ref] */,
588 int32_t level /* [in] */,
589 union drsuapi_DsGetNCChangesRequest *req /* [in] [ref,switch_is(level)] */,
590 int32_t *level_out /* [out] [ref] */,
591 union drsuapi_DsGetNCChangesCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
592 WERROR *werror)
594 struct drsuapi_DsGetNCChanges r;
595 NTSTATUS status;
597 /* In parameters */
598 r.in.bind_handle = bind_handle;
599 r.in.level = level;
600 r.in.req = req;
602 status = cli->dispatch(cli,
603 mem_ctx,
604 &ndr_table_drsuapi,
605 NDR_DRSUAPI_DSGETNCCHANGES,
606 &r);
608 if (!NT_STATUS_IS_OK(status)) {
609 return status;
612 if (NT_STATUS_IS_ERR(status)) {
613 return status;
616 /* Return variables */
617 *level_out = *r.out.level_out;
618 *ctr = *r.out.ctr;
620 /* Return result */
621 if (werror) {
622 *werror = r.out.result;
625 return werror_to_ntstatus(r.out.result);
628 struct rpccli_drsuapi_DsReplicaUpdateRefs_state {
629 struct drsuapi_DsReplicaUpdateRefs orig;
630 struct drsuapi_DsReplicaUpdateRefs tmp;
631 TALLOC_CTX *out_mem_ctx;
632 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
635 static void rpccli_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq);
637 struct tevent_req *rpccli_drsuapi_DsReplicaUpdateRefs_send(TALLOC_CTX *mem_ctx,
638 struct tevent_context *ev,
639 struct rpc_pipe_client *cli,
640 struct policy_handle *_bind_handle /* [in] [ref] */,
641 int32_t _level /* [in] */,
642 union drsuapi_DsReplicaUpdateRefsRequest _req /* [in] [switch_is(level)] */)
644 struct tevent_req *req;
645 struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state;
646 struct tevent_req *subreq;
648 req = tevent_req_create(mem_ctx, &state,
649 struct rpccli_drsuapi_DsReplicaUpdateRefs_state);
650 if (req == NULL) {
651 return NULL;
653 state->out_mem_ctx = NULL;
654 state->dispatch_recv = cli->dispatch_recv;
656 /* In parameters */
657 state->orig.in.bind_handle = _bind_handle;
658 state->orig.in.level = _level;
659 state->orig.in.req = _req;
661 /* Out parameters */
663 /* Result */
664 ZERO_STRUCT(state->orig.out.result);
666 /* make a temporary copy, that we pass to the dispatch function */
667 state->tmp = state->orig;
669 subreq = cli->dispatch_send(state, ev, cli,
670 &ndr_table_drsuapi,
671 NDR_DRSUAPI_DSREPLICAUPDATEREFS,
672 &state->tmp);
673 if (tevent_req_nomem(subreq, req)) {
674 return tevent_req_post(req, ev);
676 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaUpdateRefs_done, req);
677 return req;
680 static void rpccli_drsuapi_DsReplicaUpdateRefs_done(struct tevent_req *subreq)
682 struct tevent_req *req = tevent_req_callback_data(
683 subreq, struct tevent_req);
684 struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
685 req, struct rpccli_drsuapi_DsReplicaUpdateRefs_state);
686 NTSTATUS status;
687 TALLOC_CTX *mem_ctx;
689 if (state->out_mem_ctx) {
690 mem_ctx = state->out_mem_ctx;
691 } else {
692 mem_ctx = state;
695 status = state->dispatch_recv(subreq, mem_ctx);
696 TALLOC_FREE(subreq);
697 if (!NT_STATUS_IS_OK(status)) {
698 tevent_req_nterror(req, status);
699 return;
702 /* Copy out parameters */
704 /* Copy result */
705 state->orig.out.result = state->tmp.out.result;
707 /* Reset temporary structure */
708 ZERO_STRUCT(state->tmp);
710 tevent_req_done(req);
713 NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs_recv(struct tevent_req *req,
714 TALLOC_CTX *mem_ctx,
715 WERROR *result)
717 struct rpccli_drsuapi_DsReplicaUpdateRefs_state *state = tevent_req_data(
718 req, struct rpccli_drsuapi_DsReplicaUpdateRefs_state);
719 NTSTATUS status;
721 if (tevent_req_is_nterror(req, &status)) {
722 tevent_req_received(req);
723 return status;
726 /* Steal possbile out parameters to the callers context */
727 talloc_steal(mem_ctx, state->out_mem_ctx);
729 /* Return result */
730 *result = state->orig.out.result;
732 tevent_req_received(req);
733 return NT_STATUS_OK;
736 NTSTATUS rpccli_drsuapi_DsReplicaUpdateRefs(struct rpc_pipe_client *cli,
737 TALLOC_CTX *mem_ctx,
738 struct policy_handle *bind_handle /* [in] [ref] */,
739 int32_t level /* [in] */,
740 union drsuapi_DsReplicaUpdateRefsRequest req /* [in] [switch_is(level)] */,
741 WERROR *werror)
743 struct drsuapi_DsReplicaUpdateRefs r;
744 NTSTATUS status;
746 /* In parameters */
747 r.in.bind_handle = bind_handle;
748 r.in.level = level;
749 r.in.req = req;
751 status = cli->dispatch(cli,
752 mem_ctx,
753 &ndr_table_drsuapi,
754 NDR_DRSUAPI_DSREPLICAUPDATEREFS,
755 &r);
757 if (!NT_STATUS_IS_OK(status)) {
758 return status;
761 if (NT_STATUS_IS_ERR(status)) {
762 return status;
765 /* Return variables */
767 /* Return result */
768 if (werror) {
769 *werror = r.out.result;
772 return werror_to_ntstatus(r.out.result);
775 struct rpccli_drsuapi_DsReplicaAdd_state {
776 struct drsuapi_DsReplicaAdd orig;
777 struct drsuapi_DsReplicaAdd tmp;
778 TALLOC_CTX *out_mem_ctx;
779 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
782 static void rpccli_drsuapi_DsReplicaAdd_done(struct tevent_req *subreq);
784 struct tevent_req *rpccli_drsuapi_DsReplicaAdd_send(TALLOC_CTX *mem_ctx,
785 struct tevent_context *ev,
786 struct rpc_pipe_client *cli,
787 struct policy_handle *_bind_handle /* [in] [ref] */,
788 int32_t _level /* [in] */,
789 union drsuapi_DsReplicaAddRequest _req /* [in] [switch_is(level)] */)
791 struct tevent_req *req;
792 struct rpccli_drsuapi_DsReplicaAdd_state *state;
793 struct tevent_req *subreq;
795 req = tevent_req_create(mem_ctx, &state,
796 struct rpccli_drsuapi_DsReplicaAdd_state);
797 if (req == NULL) {
798 return NULL;
800 state->out_mem_ctx = NULL;
801 state->dispatch_recv = cli->dispatch_recv;
803 /* In parameters */
804 state->orig.in.bind_handle = _bind_handle;
805 state->orig.in.level = _level;
806 state->orig.in.req = _req;
808 /* Out parameters */
810 /* Result */
811 ZERO_STRUCT(state->orig.out.result);
813 /* make a temporary copy, that we pass to the dispatch function */
814 state->tmp = state->orig;
816 subreq = cli->dispatch_send(state, ev, cli,
817 &ndr_table_drsuapi,
818 NDR_DRSUAPI_DSREPLICAADD,
819 &state->tmp);
820 if (tevent_req_nomem(subreq, req)) {
821 return tevent_req_post(req, ev);
823 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaAdd_done, req);
824 return req;
827 static void rpccli_drsuapi_DsReplicaAdd_done(struct tevent_req *subreq)
829 struct tevent_req *req = tevent_req_callback_data(
830 subreq, struct tevent_req);
831 struct rpccli_drsuapi_DsReplicaAdd_state *state = tevent_req_data(
832 req, struct rpccli_drsuapi_DsReplicaAdd_state);
833 NTSTATUS status;
834 TALLOC_CTX *mem_ctx;
836 if (state->out_mem_ctx) {
837 mem_ctx = state->out_mem_ctx;
838 } else {
839 mem_ctx = state;
842 status = state->dispatch_recv(subreq, mem_ctx);
843 TALLOC_FREE(subreq);
844 if (!NT_STATUS_IS_OK(status)) {
845 tevent_req_nterror(req, status);
846 return;
849 /* Copy out parameters */
851 /* Copy result */
852 state->orig.out.result = state->tmp.out.result;
854 /* Reset temporary structure */
855 ZERO_STRUCT(state->tmp);
857 tevent_req_done(req);
860 NTSTATUS rpccli_drsuapi_DsReplicaAdd_recv(struct tevent_req *req,
861 TALLOC_CTX *mem_ctx,
862 WERROR *result)
864 struct rpccli_drsuapi_DsReplicaAdd_state *state = tevent_req_data(
865 req, struct rpccli_drsuapi_DsReplicaAdd_state);
866 NTSTATUS status;
868 if (tevent_req_is_nterror(req, &status)) {
869 tevent_req_received(req);
870 return status;
873 /* Steal possbile out parameters to the callers context */
874 talloc_steal(mem_ctx, state->out_mem_ctx);
876 /* Return result */
877 *result = state->orig.out.result;
879 tevent_req_received(req);
880 return NT_STATUS_OK;
883 NTSTATUS rpccli_drsuapi_DsReplicaAdd(struct rpc_pipe_client *cli,
884 TALLOC_CTX *mem_ctx,
885 struct policy_handle *bind_handle /* [in] [ref] */,
886 int32_t level /* [in] */,
887 union drsuapi_DsReplicaAddRequest req /* [in] [switch_is(level)] */,
888 WERROR *werror)
890 struct drsuapi_DsReplicaAdd r;
891 NTSTATUS status;
893 /* In parameters */
894 r.in.bind_handle = bind_handle;
895 r.in.level = level;
896 r.in.req = req;
898 status = cli->dispatch(cli,
899 mem_ctx,
900 &ndr_table_drsuapi,
901 NDR_DRSUAPI_DSREPLICAADD,
902 &r);
904 if (!NT_STATUS_IS_OK(status)) {
905 return status;
908 if (NT_STATUS_IS_ERR(status)) {
909 return status;
912 /* Return variables */
914 /* Return result */
915 if (werror) {
916 *werror = r.out.result;
919 return werror_to_ntstatus(r.out.result);
922 struct rpccli_drsuapi_DsReplicaDel_state {
923 struct drsuapi_DsReplicaDel orig;
924 struct drsuapi_DsReplicaDel tmp;
925 TALLOC_CTX *out_mem_ctx;
926 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
929 static void rpccli_drsuapi_DsReplicaDel_done(struct tevent_req *subreq);
931 struct tevent_req *rpccli_drsuapi_DsReplicaDel_send(TALLOC_CTX *mem_ctx,
932 struct tevent_context *ev,
933 struct rpc_pipe_client *cli,
934 struct policy_handle *_bind_handle /* [in] [ref] */,
935 int32_t _level /* [in] */,
936 union drsuapi_DsReplicaDelRequest _req /* [in] [switch_is(level)] */)
938 struct tevent_req *req;
939 struct rpccli_drsuapi_DsReplicaDel_state *state;
940 struct tevent_req *subreq;
942 req = tevent_req_create(mem_ctx, &state,
943 struct rpccli_drsuapi_DsReplicaDel_state);
944 if (req == NULL) {
945 return NULL;
947 state->out_mem_ctx = NULL;
948 state->dispatch_recv = cli->dispatch_recv;
950 /* In parameters */
951 state->orig.in.bind_handle = _bind_handle;
952 state->orig.in.level = _level;
953 state->orig.in.req = _req;
955 /* Out parameters */
957 /* Result */
958 ZERO_STRUCT(state->orig.out.result);
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,
964 &ndr_table_drsuapi,
965 NDR_DRSUAPI_DSREPLICADEL,
966 &state->tmp);
967 if (tevent_req_nomem(subreq, req)) {
968 return tevent_req_post(req, ev);
970 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaDel_done, req);
971 return req;
974 static void rpccli_drsuapi_DsReplicaDel_done(struct tevent_req *subreq)
976 struct tevent_req *req = tevent_req_callback_data(
977 subreq, struct tevent_req);
978 struct rpccli_drsuapi_DsReplicaDel_state *state = tevent_req_data(
979 req, struct rpccli_drsuapi_DsReplicaDel_state);
980 NTSTATUS status;
981 TALLOC_CTX *mem_ctx;
983 if (state->out_mem_ctx) {
984 mem_ctx = state->out_mem_ctx;
985 } else {
986 mem_ctx = state;
989 status = state->dispatch_recv(subreq, mem_ctx);
990 TALLOC_FREE(subreq);
991 if (!NT_STATUS_IS_OK(status)) {
992 tevent_req_nterror(req, status);
993 return;
996 /* Copy out parameters */
998 /* Copy result */
999 state->orig.out.result = state->tmp.out.result;
1001 /* Reset temporary structure */
1002 ZERO_STRUCT(state->tmp);
1004 tevent_req_done(req);
1007 NTSTATUS rpccli_drsuapi_DsReplicaDel_recv(struct tevent_req *req,
1008 TALLOC_CTX *mem_ctx,
1009 WERROR *result)
1011 struct rpccli_drsuapi_DsReplicaDel_state *state = tevent_req_data(
1012 req, struct rpccli_drsuapi_DsReplicaDel_state);
1013 NTSTATUS status;
1015 if (tevent_req_is_nterror(req, &status)) {
1016 tevent_req_received(req);
1017 return status;
1020 /* Steal possbile out parameters to the callers context */
1021 talloc_steal(mem_ctx, state->out_mem_ctx);
1023 /* Return result */
1024 *result = state->orig.out.result;
1026 tevent_req_received(req);
1027 return NT_STATUS_OK;
1030 NTSTATUS rpccli_drsuapi_DsReplicaDel(struct rpc_pipe_client *cli,
1031 TALLOC_CTX *mem_ctx,
1032 struct policy_handle *bind_handle /* [in] [ref] */,
1033 int32_t level /* [in] */,
1034 union drsuapi_DsReplicaDelRequest req /* [in] [switch_is(level)] */,
1035 WERROR *werror)
1037 struct drsuapi_DsReplicaDel r;
1038 NTSTATUS status;
1040 /* In parameters */
1041 r.in.bind_handle = bind_handle;
1042 r.in.level = level;
1043 r.in.req = req;
1045 status = cli->dispatch(cli,
1046 mem_ctx,
1047 &ndr_table_drsuapi,
1048 NDR_DRSUAPI_DSREPLICADEL,
1049 &r);
1051 if (!NT_STATUS_IS_OK(status)) {
1052 return status;
1055 if (NT_STATUS_IS_ERR(status)) {
1056 return status;
1059 /* Return variables */
1061 /* Return result */
1062 if (werror) {
1063 *werror = r.out.result;
1066 return werror_to_ntstatus(r.out.result);
1069 struct rpccli_drsuapi_DsReplicaMod_state {
1070 struct drsuapi_DsReplicaMod orig;
1071 struct drsuapi_DsReplicaMod tmp;
1072 TALLOC_CTX *out_mem_ctx;
1073 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1076 static void rpccli_drsuapi_DsReplicaMod_done(struct tevent_req *subreq);
1078 struct tevent_req *rpccli_drsuapi_DsReplicaMod_send(TALLOC_CTX *mem_ctx,
1079 struct tevent_context *ev,
1080 struct rpc_pipe_client *cli,
1081 struct policy_handle *_bind_handle /* [in] [ref] */,
1082 int32_t _level /* [in] */,
1083 union drsuapi_DsReplicaModRequest _req /* [in] [switch_is(level)] */)
1085 struct tevent_req *req;
1086 struct rpccli_drsuapi_DsReplicaMod_state *state;
1087 struct tevent_req *subreq;
1089 req = tevent_req_create(mem_ctx, &state,
1090 struct rpccli_drsuapi_DsReplicaMod_state);
1091 if (req == NULL) {
1092 return NULL;
1094 state->out_mem_ctx = NULL;
1095 state->dispatch_recv = cli->dispatch_recv;
1097 /* In parameters */
1098 state->orig.in.bind_handle = _bind_handle;
1099 state->orig.in.level = _level;
1100 state->orig.in.req = _req;
1102 /* Out parameters */
1104 /* Result */
1105 ZERO_STRUCT(state->orig.out.result);
1107 /* make a temporary copy, that we pass to the dispatch function */
1108 state->tmp = state->orig;
1110 subreq = cli->dispatch_send(state, ev, cli,
1111 &ndr_table_drsuapi,
1112 NDR_DRSUAPI_DSREPLICAMOD,
1113 &state->tmp);
1114 if (tevent_req_nomem(subreq, req)) {
1115 return tevent_req_post(req, ev);
1117 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaMod_done, req);
1118 return req;
1121 static void rpccli_drsuapi_DsReplicaMod_done(struct tevent_req *subreq)
1123 struct tevent_req *req = tevent_req_callback_data(
1124 subreq, struct tevent_req);
1125 struct rpccli_drsuapi_DsReplicaMod_state *state = tevent_req_data(
1126 req, struct rpccli_drsuapi_DsReplicaMod_state);
1127 NTSTATUS status;
1128 TALLOC_CTX *mem_ctx;
1130 if (state->out_mem_ctx) {
1131 mem_ctx = state->out_mem_ctx;
1132 } else {
1133 mem_ctx = state;
1136 status = state->dispatch_recv(subreq, mem_ctx);
1137 TALLOC_FREE(subreq);
1138 if (!NT_STATUS_IS_OK(status)) {
1139 tevent_req_nterror(req, status);
1140 return;
1143 /* Copy out parameters */
1145 /* Copy result */
1146 state->orig.out.result = state->tmp.out.result;
1148 /* Reset temporary structure */
1149 ZERO_STRUCT(state->tmp);
1151 tevent_req_done(req);
1154 NTSTATUS rpccli_drsuapi_DsReplicaMod_recv(struct tevent_req *req,
1155 TALLOC_CTX *mem_ctx,
1156 WERROR *result)
1158 struct rpccli_drsuapi_DsReplicaMod_state *state = tevent_req_data(
1159 req, struct rpccli_drsuapi_DsReplicaMod_state);
1160 NTSTATUS status;
1162 if (tevent_req_is_nterror(req, &status)) {
1163 tevent_req_received(req);
1164 return status;
1167 /* Steal possbile out parameters to the callers context */
1168 talloc_steal(mem_ctx, state->out_mem_ctx);
1170 /* Return result */
1171 *result = state->orig.out.result;
1173 tevent_req_received(req);
1174 return NT_STATUS_OK;
1177 NTSTATUS rpccli_drsuapi_DsReplicaMod(struct rpc_pipe_client *cli,
1178 TALLOC_CTX *mem_ctx,
1179 struct policy_handle *bind_handle /* [in] [ref] */,
1180 int32_t level /* [in] */,
1181 union drsuapi_DsReplicaModRequest req /* [in] [switch_is(level)] */,
1182 WERROR *werror)
1184 struct drsuapi_DsReplicaMod r;
1185 NTSTATUS status;
1187 /* In parameters */
1188 r.in.bind_handle = bind_handle;
1189 r.in.level = level;
1190 r.in.req = req;
1192 status = cli->dispatch(cli,
1193 mem_ctx,
1194 &ndr_table_drsuapi,
1195 NDR_DRSUAPI_DSREPLICAMOD,
1196 &r);
1198 if (!NT_STATUS_IS_OK(status)) {
1199 return status;
1202 if (NT_STATUS_IS_ERR(status)) {
1203 return status;
1206 /* Return variables */
1208 /* Return result */
1209 if (werror) {
1210 *werror = r.out.result;
1213 return werror_to_ntstatus(r.out.result);
1216 struct rpccli_DRSUAPI_VERIFY_NAMES_state {
1217 struct DRSUAPI_VERIFY_NAMES orig;
1218 struct DRSUAPI_VERIFY_NAMES tmp;
1219 TALLOC_CTX *out_mem_ctx;
1220 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1223 static void rpccli_DRSUAPI_VERIFY_NAMES_done(struct tevent_req *subreq);
1225 struct tevent_req *rpccli_DRSUAPI_VERIFY_NAMES_send(TALLOC_CTX *mem_ctx,
1226 struct tevent_context *ev,
1227 struct rpc_pipe_client *cli)
1229 struct tevent_req *req;
1230 struct rpccli_DRSUAPI_VERIFY_NAMES_state *state;
1231 struct tevent_req *subreq;
1233 req = tevent_req_create(mem_ctx, &state,
1234 struct rpccli_DRSUAPI_VERIFY_NAMES_state);
1235 if (req == NULL) {
1236 return NULL;
1238 state->out_mem_ctx = NULL;
1239 state->dispatch_recv = cli->dispatch_recv;
1241 /* In parameters */
1243 /* Out parameters */
1245 /* Result */
1246 ZERO_STRUCT(state->orig.out.result);
1248 /* make a temporary copy, that we pass to the dispatch function */
1249 state->tmp = state->orig;
1251 subreq = cli->dispatch_send(state, ev, cli,
1252 &ndr_table_drsuapi,
1253 NDR_DRSUAPI_VERIFY_NAMES,
1254 &state->tmp);
1255 if (tevent_req_nomem(subreq, req)) {
1256 return tevent_req_post(req, ev);
1258 tevent_req_set_callback(subreq, rpccli_DRSUAPI_VERIFY_NAMES_done, req);
1259 return req;
1262 static void rpccli_DRSUAPI_VERIFY_NAMES_done(struct tevent_req *subreq)
1264 struct tevent_req *req = tevent_req_callback_data(
1265 subreq, struct tevent_req);
1266 struct rpccli_DRSUAPI_VERIFY_NAMES_state *state = tevent_req_data(
1267 req, struct rpccli_DRSUAPI_VERIFY_NAMES_state);
1268 NTSTATUS status;
1269 TALLOC_CTX *mem_ctx;
1271 if (state->out_mem_ctx) {
1272 mem_ctx = state->out_mem_ctx;
1273 } else {
1274 mem_ctx = state;
1277 status = state->dispatch_recv(subreq, mem_ctx);
1278 TALLOC_FREE(subreq);
1279 if (!NT_STATUS_IS_OK(status)) {
1280 tevent_req_nterror(req, status);
1281 return;
1284 /* Copy out parameters */
1286 /* Copy result */
1287 state->orig.out.result = state->tmp.out.result;
1289 /* Reset temporary structure */
1290 ZERO_STRUCT(state->tmp);
1292 tevent_req_done(req);
1295 NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES_recv(struct tevent_req *req,
1296 TALLOC_CTX *mem_ctx,
1297 WERROR *result)
1299 struct rpccli_DRSUAPI_VERIFY_NAMES_state *state = tevent_req_data(
1300 req, struct rpccli_DRSUAPI_VERIFY_NAMES_state);
1301 NTSTATUS status;
1303 if (tevent_req_is_nterror(req, &status)) {
1304 tevent_req_received(req);
1305 return status;
1308 /* Steal possbile out parameters to the callers context */
1309 talloc_steal(mem_ctx, state->out_mem_ctx);
1311 /* Return result */
1312 *result = state->orig.out.result;
1314 tevent_req_received(req);
1315 return NT_STATUS_OK;
1318 NTSTATUS rpccli_DRSUAPI_VERIFY_NAMES(struct rpc_pipe_client *cli,
1319 TALLOC_CTX *mem_ctx,
1320 WERROR *werror)
1322 struct DRSUAPI_VERIFY_NAMES r;
1323 NTSTATUS status;
1325 /* In parameters */
1327 status = cli->dispatch(cli,
1328 mem_ctx,
1329 &ndr_table_drsuapi,
1330 NDR_DRSUAPI_VERIFY_NAMES,
1331 &r);
1333 if (!NT_STATUS_IS_OK(status)) {
1334 return status;
1337 if (NT_STATUS_IS_ERR(status)) {
1338 return status;
1341 /* Return variables */
1343 /* Return result */
1344 if (werror) {
1345 *werror = r.out.result;
1348 return werror_to_ntstatus(r.out.result);
1351 struct rpccli_drsuapi_DsGetMemberships_state {
1352 struct drsuapi_DsGetMemberships orig;
1353 struct drsuapi_DsGetMemberships tmp;
1354 TALLOC_CTX *out_mem_ctx;
1355 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1358 static void rpccli_drsuapi_DsGetMemberships_done(struct tevent_req *subreq);
1360 struct tevent_req *rpccli_drsuapi_DsGetMemberships_send(TALLOC_CTX *mem_ctx,
1361 struct tevent_context *ev,
1362 struct rpc_pipe_client *cli,
1363 struct policy_handle *_bind_handle /* [in] [ref] */,
1364 int32_t _level /* [in] */,
1365 union drsuapi_DsGetMembershipsRequest *_req /* [in] [ref,switch_is(level)] */,
1366 int32_t *_level_out /* [out] [ref] */,
1367 union drsuapi_DsGetMembershipsCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
1369 struct tevent_req *req;
1370 struct rpccli_drsuapi_DsGetMemberships_state *state;
1371 struct tevent_req *subreq;
1373 req = tevent_req_create(mem_ctx, &state,
1374 struct rpccli_drsuapi_DsGetMemberships_state);
1375 if (req == NULL) {
1376 return NULL;
1378 state->out_mem_ctx = NULL;
1379 state->dispatch_recv = cli->dispatch_recv;
1381 /* In parameters */
1382 state->orig.in.bind_handle = _bind_handle;
1383 state->orig.in.level = _level;
1384 state->orig.in.req = _req;
1386 /* Out parameters */
1387 state->orig.out.level_out = _level_out;
1388 state->orig.out.ctr = _ctr;
1390 /* Result */
1391 ZERO_STRUCT(state->orig.out.result);
1393 state->out_mem_ctx = talloc_named_const(state, 0,
1394 "rpccli_drsuapi_DsGetMemberships_out_memory");
1395 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1396 return tevent_req_post(req, ev);
1399 /* make a temporary copy, that we pass to the dispatch function */
1400 state->tmp = state->orig;
1402 subreq = cli->dispatch_send(state, ev, cli,
1403 &ndr_table_drsuapi,
1404 NDR_DRSUAPI_DSGETMEMBERSHIPS,
1405 &state->tmp);
1406 if (tevent_req_nomem(subreq, req)) {
1407 return tevent_req_post(req, ev);
1409 tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetMemberships_done, req);
1410 return req;
1413 static void rpccli_drsuapi_DsGetMemberships_done(struct tevent_req *subreq)
1415 struct tevent_req *req = tevent_req_callback_data(
1416 subreq, struct tevent_req);
1417 struct rpccli_drsuapi_DsGetMemberships_state *state = tevent_req_data(
1418 req, struct rpccli_drsuapi_DsGetMemberships_state);
1419 NTSTATUS status;
1420 TALLOC_CTX *mem_ctx;
1422 if (state->out_mem_ctx) {
1423 mem_ctx = state->out_mem_ctx;
1424 } else {
1425 mem_ctx = state;
1428 status = state->dispatch_recv(subreq, mem_ctx);
1429 TALLOC_FREE(subreq);
1430 if (!NT_STATUS_IS_OK(status)) {
1431 tevent_req_nterror(req, status);
1432 return;
1435 /* Copy out parameters */
1436 *state->orig.out.level_out = *state->tmp.out.level_out;
1437 *state->orig.out.ctr = *state->tmp.out.ctr;
1439 /* Copy result */
1440 state->orig.out.result = state->tmp.out.result;
1442 /* Reset temporary structure */
1443 ZERO_STRUCT(state->tmp);
1445 tevent_req_done(req);
1448 NTSTATUS rpccli_drsuapi_DsGetMemberships_recv(struct tevent_req *req,
1449 TALLOC_CTX *mem_ctx,
1450 WERROR *result)
1452 struct rpccli_drsuapi_DsGetMemberships_state *state = tevent_req_data(
1453 req, struct rpccli_drsuapi_DsGetMemberships_state);
1454 NTSTATUS status;
1456 if (tevent_req_is_nterror(req, &status)) {
1457 tevent_req_received(req);
1458 return status;
1461 /* Steal possbile out parameters to the callers context */
1462 talloc_steal(mem_ctx, state->out_mem_ctx);
1464 /* Return result */
1465 *result = state->orig.out.result;
1467 tevent_req_received(req);
1468 return NT_STATUS_OK;
1471 NTSTATUS rpccli_drsuapi_DsGetMemberships(struct rpc_pipe_client *cli,
1472 TALLOC_CTX *mem_ctx,
1473 struct policy_handle *bind_handle /* [in] [ref] */,
1474 int32_t level /* [in] */,
1475 union drsuapi_DsGetMembershipsRequest *req /* [in] [ref,switch_is(level)] */,
1476 int32_t *level_out /* [out] [ref] */,
1477 union drsuapi_DsGetMembershipsCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
1478 WERROR *werror)
1480 struct drsuapi_DsGetMemberships r;
1481 NTSTATUS status;
1483 /* In parameters */
1484 r.in.bind_handle = bind_handle;
1485 r.in.level = level;
1486 r.in.req = req;
1488 status = cli->dispatch(cli,
1489 mem_ctx,
1490 &ndr_table_drsuapi,
1491 NDR_DRSUAPI_DSGETMEMBERSHIPS,
1492 &r);
1494 if (!NT_STATUS_IS_OK(status)) {
1495 return status;
1498 if (NT_STATUS_IS_ERR(status)) {
1499 return status;
1502 /* Return variables */
1503 *level_out = *r.out.level_out;
1504 *ctr = *r.out.ctr;
1506 /* Return result */
1507 if (werror) {
1508 *werror = r.out.result;
1511 return werror_to_ntstatus(r.out.result);
1514 struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state {
1515 struct DRSUAPI_INTER_DOMAIN_MOVE orig;
1516 struct DRSUAPI_INTER_DOMAIN_MOVE tmp;
1517 TALLOC_CTX *out_mem_ctx;
1518 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1521 static void rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done(struct tevent_req *subreq);
1523 struct tevent_req *rpccli_DRSUAPI_INTER_DOMAIN_MOVE_send(TALLOC_CTX *mem_ctx,
1524 struct tevent_context *ev,
1525 struct rpc_pipe_client *cli)
1527 struct tevent_req *req;
1528 struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state;
1529 struct tevent_req *subreq;
1531 req = tevent_req_create(mem_ctx, &state,
1532 struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state);
1533 if (req == NULL) {
1534 return NULL;
1536 state->out_mem_ctx = NULL;
1537 state->dispatch_recv = cli->dispatch_recv;
1539 /* In parameters */
1541 /* Out parameters */
1543 /* Result */
1544 ZERO_STRUCT(state->orig.out.result);
1546 /* make a temporary copy, that we pass to the dispatch function */
1547 state->tmp = state->orig;
1549 subreq = cli->dispatch_send(state, ev, cli,
1550 &ndr_table_drsuapi,
1551 NDR_DRSUAPI_INTER_DOMAIN_MOVE,
1552 &state->tmp);
1553 if (tevent_req_nomem(subreq, req)) {
1554 return tevent_req_post(req, ev);
1556 tevent_req_set_callback(subreq, rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done, req);
1557 return req;
1560 static void rpccli_DRSUAPI_INTER_DOMAIN_MOVE_done(struct tevent_req *subreq)
1562 struct tevent_req *req = tevent_req_callback_data(
1563 subreq, struct tevent_req);
1564 struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state = tevent_req_data(
1565 req, struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state);
1566 NTSTATUS status;
1567 TALLOC_CTX *mem_ctx;
1569 if (state->out_mem_ctx) {
1570 mem_ctx = state->out_mem_ctx;
1571 } else {
1572 mem_ctx = state;
1575 status = state->dispatch_recv(subreq, mem_ctx);
1576 TALLOC_FREE(subreq);
1577 if (!NT_STATUS_IS_OK(status)) {
1578 tevent_req_nterror(req, status);
1579 return;
1582 /* Copy out parameters */
1584 /* Copy result */
1585 state->orig.out.result = state->tmp.out.result;
1587 /* Reset temporary structure */
1588 ZERO_STRUCT(state->tmp);
1590 tevent_req_done(req);
1593 NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE_recv(struct tevent_req *req,
1594 TALLOC_CTX *mem_ctx,
1595 WERROR *result)
1597 struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state *state = tevent_req_data(
1598 req, struct rpccli_DRSUAPI_INTER_DOMAIN_MOVE_state);
1599 NTSTATUS status;
1601 if (tevent_req_is_nterror(req, &status)) {
1602 tevent_req_received(req);
1603 return status;
1606 /* Steal possbile out parameters to the callers context */
1607 talloc_steal(mem_ctx, state->out_mem_ctx);
1609 /* Return result */
1610 *result = state->orig.out.result;
1612 tevent_req_received(req);
1613 return NT_STATUS_OK;
1616 NTSTATUS rpccli_DRSUAPI_INTER_DOMAIN_MOVE(struct rpc_pipe_client *cli,
1617 TALLOC_CTX *mem_ctx,
1618 WERROR *werror)
1620 struct DRSUAPI_INTER_DOMAIN_MOVE r;
1621 NTSTATUS status;
1623 /* In parameters */
1625 status = cli->dispatch(cli,
1626 mem_ctx,
1627 &ndr_table_drsuapi,
1628 NDR_DRSUAPI_INTER_DOMAIN_MOVE,
1629 &r);
1631 if (!NT_STATUS_IS_OK(status)) {
1632 return status;
1635 if (NT_STATUS_IS_ERR(status)) {
1636 return status;
1639 /* Return variables */
1641 /* Return result */
1642 if (werror) {
1643 *werror = r.out.result;
1646 return werror_to_ntstatus(r.out.result);
1649 struct rpccli_drsuapi_DsGetNT4ChangeLog_state {
1650 struct drsuapi_DsGetNT4ChangeLog orig;
1651 struct drsuapi_DsGetNT4ChangeLog tmp;
1652 TALLOC_CTX *out_mem_ctx;
1653 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1656 static void rpccli_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq);
1658 struct tevent_req *rpccli_drsuapi_DsGetNT4ChangeLog_send(TALLOC_CTX *mem_ctx,
1659 struct tevent_context *ev,
1660 struct rpc_pipe_client *cli,
1661 struct policy_handle *_bind_handle /* [in] [ref] */,
1662 uint32_t _level /* [in] */,
1663 union drsuapi_DsGetNT4ChangeLogRequest *_req /* [in] [ref,switch_is(level)] */,
1664 uint32_t *_level_out /* [out] [ref] */,
1665 union drsuapi_DsGetNT4ChangeLogInfo *_info /* [out] [ref,switch_is(*level_out)] */)
1667 struct tevent_req *req;
1668 struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state;
1669 struct tevent_req *subreq;
1671 req = tevent_req_create(mem_ctx, &state,
1672 struct rpccli_drsuapi_DsGetNT4ChangeLog_state);
1673 if (req == NULL) {
1674 return NULL;
1676 state->out_mem_ctx = NULL;
1677 state->dispatch_recv = cli->dispatch_recv;
1679 /* In parameters */
1680 state->orig.in.bind_handle = _bind_handle;
1681 state->orig.in.level = _level;
1682 state->orig.in.req = _req;
1684 /* Out parameters */
1685 state->orig.out.level_out = _level_out;
1686 state->orig.out.info = _info;
1688 /* Result */
1689 ZERO_STRUCT(state->orig.out.result);
1691 state->out_mem_ctx = talloc_named_const(state, 0,
1692 "rpccli_drsuapi_DsGetNT4ChangeLog_out_memory");
1693 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1694 return tevent_req_post(req, ev);
1697 /* make a temporary copy, that we pass to the dispatch function */
1698 state->tmp = state->orig;
1700 subreq = cli->dispatch_send(state, ev, cli,
1701 &ndr_table_drsuapi,
1702 NDR_DRSUAPI_DSGETNT4CHANGELOG,
1703 &state->tmp);
1704 if (tevent_req_nomem(subreq, req)) {
1705 return tevent_req_post(req, ev);
1707 tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetNT4ChangeLog_done, req);
1708 return req;
1711 static void rpccli_drsuapi_DsGetNT4ChangeLog_done(struct tevent_req *subreq)
1713 struct tevent_req *req = tevent_req_callback_data(
1714 subreq, struct tevent_req);
1715 struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
1716 req, struct rpccli_drsuapi_DsGetNT4ChangeLog_state);
1717 NTSTATUS status;
1718 TALLOC_CTX *mem_ctx;
1720 if (state->out_mem_ctx) {
1721 mem_ctx = state->out_mem_ctx;
1722 } else {
1723 mem_ctx = state;
1726 status = state->dispatch_recv(subreq, mem_ctx);
1727 TALLOC_FREE(subreq);
1728 if (!NT_STATUS_IS_OK(status)) {
1729 tevent_req_nterror(req, status);
1730 return;
1733 /* Copy out parameters */
1734 *state->orig.out.level_out = *state->tmp.out.level_out;
1735 *state->orig.out.info = *state->tmp.out.info;
1737 /* Copy result */
1738 state->orig.out.result = state->tmp.out.result;
1740 /* Reset temporary structure */
1741 ZERO_STRUCT(state->tmp);
1743 tevent_req_done(req);
1746 NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog_recv(struct tevent_req *req,
1747 TALLOC_CTX *mem_ctx,
1748 WERROR *result)
1750 struct rpccli_drsuapi_DsGetNT4ChangeLog_state *state = tevent_req_data(
1751 req, struct rpccli_drsuapi_DsGetNT4ChangeLog_state);
1752 NTSTATUS status;
1754 if (tevent_req_is_nterror(req, &status)) {
1755 tevent_req_received(req);
1756 return status;
1759 /* Steal possbile out parameters to the callers context */
1760 talloc_steal(mem_ctx, state->out_mem_ctx);
1762 /* Return result */
1763 *result = state->orig.out.result;
1765 tevent_req_received(req);
1766 return NT_STATUS_OK;
1769 NTSTATUS rpccli_drsuapi_DsGetNT4ChangeLog(struct rpc_pipe_client *cli,
1770 TALLOC_CTX *mem_ctx,
1771 struct policy_handle *bind_handle /* [in] [ref] */,
1772 uint32_t level /* [in] */,
1773 union drsuapi_DsGetNT4ChangeLogRequest *req /* [in] [ref,switch_is(level)] */,
1774 uint32_t *level_out /* [out] [ref] */,
1775 union drsuapi_DsGetNT4ChangeLogInfo *info /* [out] [ref,switch_is(*level_out)] */,
1776 WERROR *werror)
1778 struct drsuapi_DsGetNT4ChangeLog r;
1779 NTSTATUS status;
1781 /* In parameters */
1782 r.in.bind_handle = bind_handle;
1783 r.in.level = level;
1784 r.in.req = req;
1786 status = cli->dispatch(cli,
1787 mem_ctx,
1788 &ndr_table_drsuapi,
1789 NDR_DRSUAPI_DSGETNT4CHANGELOG,
1790 &r);
1792 if (!NT_STATUS_IS_OK(status)) {
1793 return status;
1796 if (NT_STATUS_IS_ERR(status)) {
1797 return status;
1800 /* Return variables */
1801 *level_out = *r.out.level_out;
1802 *info = *r.out.info;
1804 /* Return result */
1805 if (werror) {
1806 *werror = r.out.result;
1809 return werror_to_ntstatus(r.out.result);
1812 struct rpccli_drsuapi_DsCrackNames_state {
1813 struct drsuapi_DsCrackNames orig;
1814 struct drsuapi_DsCrackNames tmp;
1815 TALLOC_CTX *out_mem_ctx;
1816 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1819 static void rpccli_drsuapi_DsCrackNames_done(struct tevent_req *subreq);
1821 struct tevent_req *rpccli_drsuapi_DsCrackNames_send(TALLOC_CTX *mem_ctx,
1822 struct tevent_context *ev,
1823 struct rpc_pipe_client *cli,
1824 struct policy_handle *_bind_handle /* [in] [ref] */,
1825 int32_t _level /* [in] */,
1826 union drsuapi_DsNameRequest *_req /* [in] [ref,switch_is(level)] */,
1827 int32_t *_level_out /* [out] [ref] */,
1828 union drsuapi_DsNameCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
1830 struct tevent_req *req;
1831 struct rpccli_drsuapi_DsCrackNames_state *state;
1832 struct tevent_req *subreq;
1834 req = tevent_req_create(mem_ctx, &state,
1835 struct rpccli_drsuapi_DsCrackNames_state);
1836 if (req == NULL) {
1837 return NULL;
1839 state->out_mem_ctx = NULL;
1840 state->dispatch_recv = cli->dispatch_recv;
1842 /* In parameters */
1843 state->orig.in.bind_handle = _bind_handle;
1844 state->orig.in.level = _level;
1845 state->orig.in.req = _req;
1847 /* Out parameters */
1848 state->orig.out.level_out = _level_out;
1849 state->orig.out.ctr = _ctr;
1851 /* Result */
1852 ZERO_STRUCT(state->orig.out.result);
1854 state->out_mem_ctx = talloc_named_const(state, 0,
1855 "rpccli_drsuapi_DsCrackNames_out_memory");
1856 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1857 return tevent_req_post(req, ev);
1860 /* make a temporary copy, that we pass to the dispatch function */
1861 state->tmp = state->orig;
1863 subreq = cli->dispatch_send(state, ev, cli,
1864 &ndr_table_drsuapi,
1865 NDR_DRSUAPI_DSCRACKNAMES,
1866 &state->tmp);
1867 if (tevent_req_nomem(subreq, req)) {
1868 return tevent_req_post(req, ev);
1870 tevent_req_set_callback(subreq, rpccli_drsuapi_DsCrackNames_done, req);
1871 return req;
1874 static void rpccli_drsuapi_DsCrackNames_done(struct tevent_req *subreq)
1876 struct tevent_req *req = tevent_req_callback_data(
1877 subreq, struct tevent_req);
1878 struct rpccli_drsuapi_DsCrackNames_state *state = tevent_req_data(
1879 req, struct rpccli_drsuapi_DsCrackNames_state);
1880 NTSTATUS status;
1881 TALLOC_CTX *mem_ctx;
1883 if (state->out_mem_ctx) {
1884 mem_ctx = state->out_mem_ctx;
1885 } else {
1886 mem_ctx = state;
1889 status = state->dispatch_recv(subreq, mem_ctx);
1890 TALLOC_FREE(subreq);
1891 if (!NT_STATUS_IS_OK(status)) {
1892 tevent_req_nterror(req, status);
1893 return;
1896 /* Copy out parameters */
1897 *state->orig.out.level_out = *state->tmp.out.level_out;
1898 *state->orig.out.ctr = *state->tmp.out.ctr;
1900 /* Copy result */
1901 state->orig.out.result = state->tmp.out.result;
1903 /* Reset temporary structure */
1904 ZERO_STRUCT(state->tmp);
1906 tevent_req_done(req);
1909 NTSTATUS rpccli_drsuapi_DsCrackNames_recv(struct tevent_req *req,
1910 TALLOC_CTX *mem_ctx,
1911 WERROR *result)
1913 struct rpccli_drsuapi_DsCrackNames_state *state = tevent_req_data(
1914 req, struct rpccli_drsuapi_DsCrackNames_state);
1915 NTSTATUS status;
1917 if (tevent_req_is_nterror(req, &status)) {
1918 tevent_req_received(req);
1919 return status;
1922 /* Steal possbile out parameters to the callers context */
1923 talloc_steal(mem_ctx, state->out_mem_ctx);
1925 /* Return result */
1926 *result = state->orig.out.result;
1928 tevent_req_received(req);
1929 return NT_STATUS_OK;
1932 NTSTATUS rpccli_drsuapi_DsCrackNames(struct rpc_pipe_client *cli,
1933 TALLOC_CTX *mem_ctx,
1934 struct policy_handle *bind_handle /* [in] [ref] */,
1935 int32_t level /* [in] */,
1936 union drsuapi_DsNameRequest *req /* [in] [ref,switch_is(level)] */,
1937 int32_t *level_out /* [out] [ref] */,
1938 union drsuapi_DsNameCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
1939 WERROR *werror)
1941 struct drsuapi_DsCrackNames r;
1942 NTSTATUS status;
1944 /* In parameters */
1945 r.in.bind_handle = bind_handle;
1946 r.in.level = level;
1947 r.in.req = req;
1949 status = cli->dispatch(cli,
1950 mem_ctx,
1951 &ndr_table_drsuapi,
1952 NDR_DRSUAPI_DSCRACKNAMES,
1953 &r);
1955 if (!NT_STATUS_IS_OK(status)) {
1956 return status;
1959 if (NT_STATUS_IS_ERR(status)) {
1960 return status;
1963 /* Return variables */
1964 *level_out = *r.out.level_out;
1965 *ctr = *r.out.ctr;
1967 /* Return result */
1968 if (werror) {
1969 *werror = r.out.result;
1972 return werror_to_ntstatus(r.out.result);
1975 struct rpccli_drsuapi_DsWriteAccountSpn_state {
1976 struct drsuapi_DsWriteAccountSpn orig;
1977 struct drsuapi_DsWriteAccountSpn tmp;
1978 TALLOC_CTX *out_mem_ctx;
1979 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1982 static void rpccli_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq);
1984 struct tevent_req *rpccli_drsuapi_DsWriteAccountSpn_send(TALLOC_CTX *mem_ctx,
1985 struct tevent_context *ev,
1986 struct rpc_pipe_client *cli,
1987 struct policy_handle *_bind_handle /* [in] [ref] */,
1988 int32_t _level /* [in] */,
1989 union drsuapi_DsWriteAccountSpnRequest *_req /* [in] [ref,switch_is(level)] */,
1990 int32_t *_level_out /* [out] [ref] */,
1991 union drsuapi_DsWriteAccountSpnResult *_res /* [out] [ref,switch_is(*level_out)] */)
1993 struct tevent_req *req;
1994 struct rpccli_drsuapi_DsWriteAccountSpn_state *state;
1995 struct tevent_req *subreq;
1997 req = tevent_req_create(mem_ctx, &state,
1998 struct rpccli_drsuapi_DsWriteAccountSpn_state);
1999 if (req == NULL) {
2000 return NULL;
2002 state->out_mem_ctx = NULL;
2003 state->dispatch_recv = cli->dispatch_recv;
2005 /* In parameters */
2006 state->orig.in.bind_handle = _bind_handle;
2007 state->orig.in.level = _level;
2008 state->orig.in.req = _req;
2010 /* Out parameters */
2011 state->orig.out.level_out = _level_out;
2012 state->orig.out.res = _res;
2014 /* Result */
2015 ZERO_STRUCT(state->orig.out.result);
2017 state->out_mem_ctx = talloc_named_const(state, 0,
2018 "rpccli_drsuapi_DsWriteAccountSpn_out_memory");
2019 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2020 return tevent_req_post(req, ev);
2023 /* make a temporary copy, that we pass to the dispatch function */
2024 state->tmp = state->orig;
2026 subreq = cli->dispatch_send(state, ev, cli,
2027 &ndr_table_drsuapi,
2028 NDR_DRSUAPI_DSWRITEACCOUNTSPN,
2029 &state->tmp);
2030 if (tevent_req_nomem(subreq, req)) {
2031 return tevent_req_post(req, ev);
2033 tevent_req_set_callback(subreq, rpccli_drsuapi_DsWriteAccountSpn_done, req);
2034 return req;
2037 static void rpccli_drsuapi_DsWriteAccountSpn_done(struct tevent_req *subreq)
2039 struct tevent_req *req = tevent_req_callback_data(
2040 subreq, struct tevent_req);
2041 struct rpccli_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
2042 req, struct rpccli_drsuapi_DsWriteAccountSpn_state);
2043 NTSTATUS status;
2044 TALLOC_CTX *mem_ctx;
2046 if (state->out_mem_ctx) {
2047 mem_ctx = state->out_mem_ctx;
2048 } else {
2049 mem_ctx = state;
2052 status = state->dispatch_recv(subreq, mem_ctx);
2053 TALLOC_FREE(subreq);
2054 if (!NT_STATUS_IS_OK(status)) {
2055 tevent_req_nterror(req, status);
2056 return;
2059 /* Copy out parameters */
2060 *state->orig.out.level_out = *state->tmp.out.level_out;
2061 *state->orig.out.res = *state->tmp.out.res;
2063 /* Copy result */
2064 state->orig.out.result = state->tmp.out.result;
2066 /* Reset temporary structure */
2067 ZERO_STRUCT(state->tmp);
2069 tevent_req_done(req);
2072 NTSTATUS rpccli_drsuapi_DsWriteAccountSpn_recv(struct tevent_req *req,
2073 TALLOC_CTX *mem_ctx,
2074 WERROR *result)
2076 struct rpccli_drsuapi_DsWriteAccountSpn_state *state = tevent_req_data(
2077 req, struct rpccli_drsuapi_DsWriteAccountSpn_state);
2078 NTSTATUS status;
2080 if (tevent_req_is_nterror(req, &status)) {
2081 tevent_req_received(req);
2082 return status;
2085 /* Steal possbile out parameters to the callers context */
2086 talloc_steal(mem_ctx, state->out_mem_ctx);
2088 /* Return result */
2089 *result = state->orig.out.result;
2091 tevent_req_received(req);
2092 return NT_STATUS_OK;
2095 NTSTATUS rpccli_drsuapi_DsWriteAccountSpn(struct rpc_pipe_client *cli,
2096 TALLOC_CTX *mem_ctx,
2097 struct policy_handle *bind_handle /* [in] [ref] */,
2098 int32_t level /* [in] */,
2099 union drsuapi_DsWriteAccountSpnRequest *req /* [in] [ref,switch_is(level)] */,
2100 int32_t *level_out /* [out] [ref] */,
2101 union drsuapi_DsWriteAccountSpnResult *res /* [out] [ref,switch_is(*level_out)] */,
2102 WERROR *werror)
2104 struct drsuapi_DsWriteAccountSpn r;
2105 NTSTATUS status;
2107 /* In parameters */
2108 r.in.bind_handle = bind_handle;
2109 r.in.level = level;
2110 r.in.req = req;
2112 status = cli->dispatch(cli,
2113 mem_ctx,
2114 &ndr_table_drsuapi,
2115 NDR_DRSUAPI_DSWRITEACCOUNTSPN,
2116 &r);
2118 if (!NT_STATUS_IS_OK(status)) {
2119 return status;
2122 if (NT_STATUS_IS_ERR(status)) {
2123 return status;
2126 /* Return variables */
2127 *level_out = *r.out.level_out;
2128 *res = *r.out.res;
2130 /* Return result */
2131 if (werror) {
2132 *werror = r.out.result;
2135 return werror_to_ntstatus(r.out.result);
2138 struct rpccli_drsuapi_DsRemoveDSServer_state {
2139 struct drsuapi_DsRemoveDSServer orig;
2140 struct drsuapi_DsRemoveDSServer tmp;
2141 TALLOC_CTX *out_mem_ctx;
2142 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2145 static void rpccli_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq);
2147 struct tevent_req *rpccli_drsuapi_DsRemoveDSServer_send(TALLOC_CTX *mem_ctx,
2148 struct tevent_context *ev,
2149 struct rpc_pipe_client *cli,
2150 struct policy_handle *_bind_handle /* [in] [ref] */,
2151 int32_t _level /* [in] */,
2152 union drsuapi_DsRemoveDSServerRequest *_req /* [in] [ref,switch_is(level)] */,
2153 int32_t *_level_out /* [out] [ref] */,
2154 union drsuapi_DsRemoveDSServerResult *_res /* [out] [ref,switch_is(*level_out)] */)
2156 struct tevent_req *req;
2157 struct rpccli_drsuapi_DsRemoveDSServer_state *state;
2158 struct tevent_req *subreq;
2160 req = tevent_req_create(mem_ctx, &state,
2161 struct rpccli_drsuapi_DsRemoveDSServer_state);
2162 if (req == NULL) {
2163 return NULL;
2165 state->out_mem_ctx = NULL;
2166 state->dispatch_recv = cli->dispatch_recv;
2168 /* In parameters */
2169 state->orig.in.bind_handle = _bind_handle;
2170 state->orig.in.level = _level;
2171 state->orig.in.req = _req;
2173 /* Out parameters */
2174 state->orig.out.level_out = _level_out;
2175 state->orig.out.res = _res;
2177 /* Result */
2178 ZERO_STRUCT(state->orig.out.result);
2180 state->out_mem_ctx = talloc_named_const(state, 0,
2181 "rpccli_drsuapi_DsRemoveDSServer_out_memory");
2182 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2183 return tevent_req_post(req, ev);
2186 /* make a temporary copy, that we pass to the dispatch function */
2187 state->tmp = state->orig;
2189 subreq = cli->dispatch_send(state, ev, cli,
2190 &ndr_table_drsuapi,
2191 NDR_DRSUAPI_DSREMOVEDSSERVER,
2192 &state->tmp);
2193 if (tevent_req_nomem(subreq, req)) {
2194 return tevent_req_post(req, ev);
2196 tevent_req_set_callback(subreq, rpccli_drsuapi_DsRemoveDSServer_done, req);
2197 return req;
2200 static void rpccli_drsuapi_DsRemoveDSServer_done(struct tevent_req *subreq)
2202 struct tevent_req *req = tevent_req_callback_data(
2203 subreq, struct tevent_req);
2204 struct rpccli_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
2205 req, struct rpccli_drsuapi_DsRemoveDSServer_state);
2206 NTSTATUS status;
2207 TALLOC_CTX *mem_ctx;
2209 if (state->out_mem_ctx) {
2210 mem_ctx = state->out_mem_ctx;
2211 } else {
2212 mem_ctx = state;
2215 status = state->dispatch_recv(subreq, mem_ctx);
2216 TALLOC_FREE(subreq);
2217 if (!NT_STATUS_IS_OK(status)) {
2218 tevent_req_nterror(req, status);
2219 return;
2222 /* Copy out parameters */
2223 *state->orig.out.level_out = *state->tmp.out.level_out;
2224 *state->orig.out.res = *state->tmp.out.res;
2226 /* Copy result */
2227 state->orig.out.result = state->tmp.out.result;
2229 /* Reset temporary structure */
2230 ZERO_STRUCT(state->tmp);
2232 tevent_req_done(req);
2235 NTSTATUS rpccli_drsuapi_DsRemoveDSServer_recv(struct tevent_req *req,
2236 TALLOC_CTX *mem_ctx,
2237 WERROR *result)
2239 struct rpccli_drsuapi_DsRemoveDSServer_state *state = tevent_req_data(
2240 req, struct rpccli_drsuapi_DsRemoveDSServer_state);
2241 NTSTATUS status;
2243 if (tevent_req_is_nterror(req, &status)) {
2244 tevent_req_received(req);
2245 return status;
2248 /* Steal possbile out parameters to the callers context */
2249 talloc_steal(mem_ctx, state->out_mem_ctx);
2251 /* Return result */
2252 *result = state->orig.out.result;
2254 tevent_req_received(req);
2255 return NT_STATUS_OK;
2258 NTSTATUS rpccli_drsuapi_DsRemoveDSServer(struct rpc_pipe_client *cli,
2259 TALLOC_CTX *mem_ctx,
2260 struct policy_handle *bind_handle /* [in] [ref] */,
2261 int32_t level /* [in] */,
2262 union drsuapi_DsRemoveDSServerRequest *req /* [in] [ref,switch_is(level)] */,
2263 int32_t *level_out /* [out] [ref] */,
2264 union drsuapi_DsRemoveDSServerResult *res /* [out] [ref,switch_is(*level_out)] */,
2265 WERROR *werror)
2267 struct drsuapi_DsRemoveDSServer r;
2268 NTSTATUS status;
2270 /* In parameters */
2271 r.in.bind_handle = bind_handle;
2272 r.in.level = level;
2273 r.in.req = req;
2275 status = cli->dispatch(cli,
2276 mem_ctx,
2277 &ndr_table_drsuapi,
2278 NDR_DRSUAPI_DSREMOVEDSSERVER,
2279 &r);
2281 if (!NT_STATUS_IS_OK(status)) {
2282 return status;
2285 if (NT_STATUS_IS_ERR(status)) {
2286 return status;
2289 /* Return variables */
2290 *level_out = *r.out.level_out;
2291 *res = *r.out.res;
2293 /* Return result */
2294 if (werror) {
2295 *werror = r.out.result;
2298 return werror_to_ntstatus(r.out.result);
2301 struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state {
2302 struct DRSUAPI_REMOVE_DS_DOMAIN orig;
2303 struct DRSUAPI_REMOVE_DS_DOMAIN tmp;
2304 TALLOC_CTX *out_mem_ctx;
2305 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2308 static void rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done(struct tevent_req *subreq);
2310 struct tevent_req *rpccli_DRSUAPI_REMOVE_DS_DOMAIN_send(TALLOC_CTX *mem_ctx,
2311 struct tevent_context *ev,
2312 struct rpc_pipe_client *cli)
2314 struct tevent_req *req;
2315 struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state;
2316 struct tevent_req *subreq;
2318 req = tevent_req_create(mem_ctx, &state,
2319 struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state);
2320 if (req == NULL) {
2321 return NULL;
2323 state->out_mem_ctx = NULL;
2324 state->dispatch_recv = cli->dispatch_recv;
2326 /* In parameters */
2328 /* Out parameters */
2330 /* Result */
2331 ZERO_STRUCT(state->orig.out.result);
2333 /* make a temporary copy, that we pass to the dispatch function */
2334 state->tmp = state->orig;
2336 subreq = cli->dispatch_send(state, ev, cli,
2337 &ndr_table_drsuapi,
2338 NDR_DRSUAPI_REMOVE_DS_DOMAIN,
2339 &state->tmp);
2340 if (tevent_req_nomem(subreq, req)) {
2341 return tevent_req_post(req, ev);
2343 tevent_req_set_callback(subreq, rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done, req);
2344 return req;
2347 static void rpccli_DRSUAPI_REMOVE_DS_DOMAIN_done(struct tevent_req *subreq)
2349 struct tevent_req *req = tevent_req_callback_data(
2350 subreq, struct tevent_req);
2351 struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state = tevent_req_data(
2352 req, struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state);
2353 NTSTATUS status;
2354 TALLOC_CTX *mem_ctx;
2356 if (state->out_mem_ctx) {
2357 mem_ctx = state->out_mem_ctx;
2358 } else {
2359 mem_ctx = state;
2362 status = state->dispatch_recv(subreq, mem_ctx);
2363 TALLOC_FREE(subreq);
2364 if (!NT_STATUS_IS_OK(status)) {
2365 tevent_req_nterror(req, status);
2366 return;
2369 /* Copy out parameters */
2371 /* Copy result */
2372 state->orig.out.result = state->tmp.out.result;
2374 /* Reset temporary structure */
2375 ZERO_STRUCT(state->tmp);
2377 tevent_req_done(req);
2380 NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN_recv(struct tevent_req *req,
2381 TALLOC_CTX *mem_ctx,
2382 WERROR *result)
2384 struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state *state = tevent_req_data(
2385 req, struct rpccli_DRSUAPI_REMOVE_DS_DOMAIN_state);
2386 NTSTATUS status;
2388 if (tevent_req_is_nterror(req, &status)) {
2389 tevent_req_received(req);
2390 return status;
2393 /* Steal possbile out parameters to the callers context */
2394 talloc_steal(mem_ctx, state->out_mem_ctx);
2396 /* Return result */
2397 *result = state->orig.out.result;
2399 tevent_req_received(req);
2400 return NT_STATUS_OK;
2403 NTSTATUS rpccli_DRSUAPI_REMOVE_DS_DOMAIN(struct rpc_pipe_client *cli,
2404 TALLOC_CTX *mem_ctx,
2405 WERROR *werror)
2407 struct DRSUAPI_REMOVE_DS_DOMAIN r;
2408 NTSTATUS status;
2410 /* In parameters */
2412 status = cli->dispatch(cli,
2413 mem_ctx,
2414 &ndr_table_drsuapi,
2415 NDR_DRSUAPI_REMOVE_DS_DOMAIN,
2416 &r);
2418 if (!NT_STATUS_IS_OK(status)) {
2419 return status;
2422 if (NT_STATUS_IS_ERR(status)) {
2423 return status;
2426 /* Return variables */
2428 /* Return result */
2429 if (werror) {
2430 *werror = r.out.result;
2433 return werror_to_ntstatus(r.out.result);
2436 struct rpccli_drsuapi_DsGetDomainControllerInfo_state {
2437 struct drsuapi_DsGetDomainControllerInfo orig;
2438 struct drsuapi_DsGetDomainControllerInfo tmp;
2439 TALLOC_CTX *out_mem_ctx;
2440 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2443 static void rpccli_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq);
2445 struct tevent_req *rpccli_drsuapi_DsGetDomainControllerInfo_send(TALLOC_CTX *mem_ctx,
2446 struct tevent_context *ev,
2447 struct rpc_pipe_client *cli,
2448 struct policy_handle *_bind_handle /* [in] [ref] */,
2449 int32_t _level /* [in] */,
2450 union drsuapi_DsGetDCInfoRequest *_req /* [in] [ref,switch_is(level)] */,
2451 int32_t *_level_out /* [out] [ref] */,
2452 union drsuapi_DsGetDCInfoCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
2454 struct tevent_req *req;
2455 struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state;
2456 struct tevent_req *subreq;
2458 req = tevent_req_create(mem_ctx, &state,
2459 struct rpccli_drsuapi_DsGetDomainControllerInfo_state);
2460 if (req == NULL) {
2461 return NULL;
2463 state->out_mem_ctx = NULL;
2464 state->dispatch_recv = cli->dispatch_recv;
2466 /* In parameters */
2467 state->orig.in.bind_handle = _bind_handle;
2468 state->orig.in.level = _level;
2469 state->orig.in.req = _req;
2471 /* Out parameters */
2472 state->orig.out.level_out = _level_out;
2473 state->orig.out.ctr = _ctr;
2475 /* Result */
2476 ZERO_STRUCT(state->orig.out.result);
2478 state->out_mem_ctx = talloc_named_const(state, 0,
2479 "rpccli_drsuapi_DsGetDomainControllerInfo_out_memory");
2480 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2481 return tevent_req_post(req, ev);
2484 /* make a temporary copy, that we pass to the dispatch function */
2485 state->tmp = state->orig;
2487 subreq = cli->dispatch_send(state, ev, cli,
2488 &ndr_table_drsuapi,
2489 NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO,
2490 &state->tmp);
2491 if (tevent_req_nomem(subreq, req)) {
2492 return tevent_req_post(req, ev);
2494 tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetDomainControllerInfo_done, req);
2495 return req;
2498 static void rpccli_drsuapi_DsGetDomainControllerInfo_done(struct tevent_req *subreq)
2500 struct tevent_req *req = tevent_req_callback_data(
2501 subreq, struct tevent_req);
2502 struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
2503 req, struct rpccli_drsuapi_DsGetDomainControllerInfo_state);
2504 NTSTATUS status;
2505 TALLOC_CTX *mem_ctx;
2507 if (state->out_mem_ctx) {
2508 mem_ctx = state->out_mem_ctx;
2509 } else {
2510 mem_ctx = state;
2513 status = state->dispatch_recv(subreq, mem_ctx);
2514 TALLOC_FREE(subreq);
2515 if (!NT_STATUS_IS_OK(status)) {
2516 tevent_req_nterror(req, status);
2517 return;
2520 /* Copy out parameters */
2521 *state->orig.out.level_out = *state->tmp.out.level_out;
2522 *state->orig.out.ctr = *state->tmp.out.ctr;
2524 /* Copy result */
2525 state->orig.out.result = state->tmp.out.result;
2527 /* Reset temporary structure */
2528 ZERO_STRUCT(state->tmp);
2530 tevent_req_done(req);
2533 NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo_recv(struct tevent_req *req,
2534 TALLOC_CTX *mem_ctx,
2535 WERROR *result)
2537 struct rpccli_drsuapi_DsGetDomainControllerInfo_state *state = tevent_req_data(
2538 req, struct rpccli_drsuapi_DsGetDomainControllerInfo_state);
2539 NTSTATUS status;
2541 if (tevent_req_is_nterror(req, &status)) {
2542 tevent_req_received(req);
2543 return status;
2546 /* Steal possbile out parameters to the callers context */
2547 talloc_steal(mem_ctx, state->out_mem_ctx);
2549 /* Return result */
2550 *result = state->orig.out.result;
2552 tevent_req_received(req);
2553 return NT_STATUS_OK;
2556 NTSTATUS rpccli_drsuapi_DsGetDomainControllerInfo(struct rpc_pipe_client *cli,
2557 TALLOC_CTX *mem_ctx,
2558 struct policy_handle *bind_handle /* [in] [ref] */,
2559 int32_t level /* [in] */,
2560 union drsuapi_DsGetDCInfoRequest *req /* [in] [ref,switch_is(level)] */,
2561 int32_t *level_out /* [out] [ref] */,
2562 union drsuapi_DsGetDCInfoCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
2563 WERROR *werror)
2565 struct drsuapi_DsGetDomainControllerInfo r;
2566 NTSTATUS status;
2568 /* In parameters */
2569 r.in.bind_handle = bind_handle;
2570 r.in.level = level;
2571 r.in.req = req;
2573 status = cli->dispatch(cli,
2574 mem_ctx,
2575 &ndr_table_drsuapi,
2576 NDR_DRSUAPI_DSGETDOMAINCONTROLLERINFO,
2577 &r);
2579 if (!NT_STATUS_IS_OK(status)) {
2580 return status;
2583 if (NT_STATUS_IS_ERR(status)) {
2584 return status;
2587 /* Return variables */
2588 *level_out = *r.out.level_out;
2589 *ctr = *r.out.ctr;
2591 /* Return result */
2592 if (werror) {
2593 *werror = r.out.result;
2596 return werror_to_ntstatus(r.out.result);
2599 struct rpccli_drsuapi_DsAddEntry_state {
2600 struct drsuapi_DsAddEntry orig;
2601 struct drsuapi_DsAddEntry tmp;
2602 TALLOC_CTX *out_mem_ctx;
2603 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2606 static void rpccli_drsuapi_DsAddEntry_done(struct tevent_req *subreq);
2608 struct tevent_req *rpccli_drsuapi_DsAddEntry_send(TALLOC_CTX *mem_ctx,
2609 struct tevent_context *ev,
2610 struct rpc_pipe_client *cli,
2611 struct policy_handle *_bind_handle /* [in] [ref] */,
2612 int32_t _level /* [in] */,
2613 union drsuapi_DsAddEntryRequest *_req /* [in] [ref,switch_is(level)] */,
2614 int32_t *_level_out /* [out] [ref] */,
2615 union drsuapi_DsAddEntryCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
2617 struct tevent_req *req;
2618 struct rpccli_drsuapi_DsAddEntry_state *state;
2619 struct tevent_req *subreq;
2621 req = tevent_req_create(mem_ctx, &state,
2622 struct rpccli_drsuapi_DsAddEntry_state);
2623 if (req == NULL) {
2624 return NULL;
2626 state->out_mem_ctx = NULL;
2627 state->dispatch_recv = cli->dispatch_recv;
2629 /* In parameters */
2630 state->orig.in.bind_handle = _bind_handle;
2631 state->orig.in.level = _level;
2632 state->orig.in.req = _req;
2634 /* Out parameters */
2635 state->orig.out.level_out = _level_out;
2636 state->orig.out.ctr = _ctr;
2638 /* Result */
2639 ZERO_STRUCT(state->orig.out.result);
2641 state->out_mem_ctx = talloc_named_const(state, 0,
2642 "rpccli_drsuapi_DsAddEntry_out_memory");
2643 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2644 return tevent_req_post(req, ev);
2647 /* make a temporary copy, that we pass to the dispatch function */
2648 state->tmp = state->orig;
2650 subreq = cli->dispatch_send(state, ev, cli,
2651 &ndr_table_drsuapi,
2652 NDR_DRSUAPI_DSADDENTRY,
2653 &state->tmp);
2654 if (tevent_req_nomem(subreq, req)) {
2655 return tevent_req_post(req, ev);
2657 tevent_req_set_callback(subreq, rpccli_drsuapi_DsAddEntry_done, req);
2658 return req;
2661 static void rpccli_drsuapi_DsAddEntry_done(struct tevent_req *subreq)
2663 struct tevent_req *req = tevent_req_callback_data(
2664 subreq, struct tevent_req);
2665 struct rpccli_drsuapi_DsAddEntry_state *state = tevent_req_data(
2666 req, struct rpccli_drsuapi_DsAddEntry_state);
2667 NTSTATUS status;
2668 TALLOC_CTX *mem_ctx;
2670 if (state->out_mem_ctx) {
2671 mem_ctx = state->out_mem_ctx;
2672 } else {
2673 mem_ctx = state;
2676 status = state->dispatch_recv(subreq, mem_ctx);
2677 TALLOC_FREE(subreq);
2678 if (!NT_STATUS_IS_OK(status)) {
2679 tevent_req_nterror(req, status);
2680 return;
2683 /* Copy out parameters */
2684 *state->orig.out.level_out = *state->tmp.out.level_out;
2685 *state->orig.out.ctr = *state->tmp.out.ctr;
2687 /* Copy result */
2688 state->orig.out.result = state->tmp.out.result;
2690 /* Reset temporary structure */
2691 ZERO_STRUCT(state->tmp);
2693 tevent_req_done(req);
2696 NTSTATUS rpccli_drsuapi_DsAddEntry_recv(struct tevent_req *req,
2697 TALLOC_CTX *mem_ctx,
2698 WERROR *result)
2700 struct rpccli_drsuapi_DsAddEntry_state *state = tevent_req_data(
2701 req, struct rpccli_drsuapi_DsAddEntry_state);
2702 NTSTATUS status;
2704 if (tevent_req_is_nterror(req, &status)) {
2705 tevent_req_received(req);
2706 return status;
2709 /* Steal possbile out parameters to the callers context */
2710 talloc_steal(mem_ctx, state->out_mem_ctx);
2712 /* Return result */
2713 *result = state->orig.out.result;
2715 tevent_req_received(req);
2716 return NT_STATUS_OK;
2719 NTSTATUS rpccli_drsuapi_DsAddEntry(struct rpc_pipe_client *cli,
2720 TALLOC_CTX *mem_ctx,
2721 struct policy_handle *bind_handle /* [in] [ref] */,
2722 int32_t level /* [in] */,
2723 union drsuapi_DsAddEntryRequest *req /* [in] [ref,switch_is(level)] */,
2724 int32_t *level_out /* [out] [ref] */,
2725 union drsuapi_DsAddEntryCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
2726 WERROR *werror)
2728 struct drsuapi_DsAddEntry r;
2729 NTSTATUS status;
2731 /* In parameters */
2732 r.in.bind_handle = bind_handle;
2733 r.in.level = level;
2734 r.in.req = req;
2736 status = cli->dispatch(cli,
2737 mem_ctx,
2738 &ndr_table_drsuapi,
2739 NDR_DRSUAPI_DSADDENTRY,
2740 &r);
2742 if (!NT_STATUS_IS_OK(status)) {
2743 return status;
2746 if (NT_STATUS_IS_ERR(status)) {
2747 return status;
2750 /* Return variables */
2751 *level_out = *r.out.level_out;
2752 *ctr = *r.out.ctr;
2754 /* Return result */
2755 if (werror) {
2756 *werror = r.out.result;
2759 return werror_to_ntstatus(r.out.result);
2762 struct rpccli_drsuapi_DsExecuteKCC_state {
2763 struct drsuapi_DsExecuteKCC orig;
2764 struct drsuapi_DsExecuteKCC tmp;
2765 TALLOC_CTX *out_mem_ctx;
2766 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2769 static void rpccli_drsuapi_DsExecuteKCC_done(struct tevent_req *subreq);
2771 struct tevent_req *rpccli_drsuapi_DsExecuteKCC_send(TALLOC_CTX *mem_ctx,
2772 struct tevent_context *ev,
2773 struct rpc_pipe_client *cli,
2774 struct policy_handle *_bind_handle /* [in] [ref] */,
2775 uint32_t _level /* [in] */,
2776 union drsuapi_DsExecuteKCCRequest *_req /* [in] [ref,switch_is(level)] */)
2778 struct tevent_req *req;
2779 struct rpccli_drsuapi_DsExecuteKCC_state *state;
2780 struct tevent_req *subreq;
2782 req = tevent_req_create(mem_ctx, &state,
2783 struct rpccli_drsuapi_DsExecuteKCC_state);
2784 if (req == NULL) {
2785 return NULL;
2787 state->out_mem_ctx = NULL;
2788 state->dispatch_recv = cli->dispatch_recv;
2790 /* In parameters */
2791 state->orig.in.bind_handle = _bind_handle;
2792 state->orig.in.level = _level;
2793 state->orig.in.req = _req;
2795 /* Out parameters */
2797 /* Result */
2798 ZERO_STRUCT(state->orig.out.result);
2800 /* make a temporary copy, that we pass to the dispatch function */
2801 state->tmp = state->orig;
2803 subreq = cli->dispatch_send(state, ev, cli,
2804 &ndr_table_drsuapi,
2805 NDR_DRSUAPI_DSEXECUTEKCC,
2806 &state->tmp);
2807 if (tevent_req_nomem(subreq, req)) {
2808 return tevent_req_post(req, ev);
2810 tevent_req_set_callback(subreq, rpccli_drsuapi_DsExecuteKCC_done, req);
2811 return req;
2814 static void rpccli_drsuapi_DsExecuteKCC_done(struct tevent_req *subreq)
2816 struct tevent_req *req = tevent_req_callback_data(
2817 subreq, struct tevent_req);
2818 struct rpccli_drsuapi_DsExecuteKCC_state *state = tevent_req_data(
2819 req, struct rpccli_drsuapi_DsExecuteKCC_state);
2820 NTSTATUS status;
2821 TALLOC_CTX *mem_ctx;
2823 if (state->out_mem_ctx) {
2824 mem_ctx = state->out_mem_ctx;
2825 } else {
2826 mem_ctx = state;
2829 status = state->dispatch_recv(subreq, mem_ctx);
2830 TALLOC_FREE(subreq);
2831 if (!NT_STATUS_IS_OK(status)) {
2832 tevent_req_nterror(req, status);
2833 return;
2836 /* Copy out parameters */
2838 /* Copy result */
2839 state->orig.out.result = state->tmp.out.result;
2841 /* Reset temporary structure */
2842 ZERO_STRUCT(state->tmp);
2844 tevent_req_done(req);
2847 NTSTATUS rpccli_drsuapi_DsExecuteKCC_recv(struct tevent_req *req,
2848 TALLOC_CTX *mem_ctx,
2849 WERROR *result)
2851 struct rpccli_drsuapi_DsExecuteKCC_state *state = tevent_req_data(
2852 req, struct rpccli_drsuapi_DsExecuteKCC_state);
2853 NTSTATUS status;
2855 if (tevent_req_is_nterror(req, &status)) {
2856 tevent_req_received(req);
2857 return status;
2860 /* Steal possbile out parameters to the callers context */
2861 talloc_steal(mem_ctx, state->out_mem_ctx);
2863 /* Return result */
2864 *result = state->orig.out.result;
2866 tevent_req_received(req);
2867 return NT_STATUS_OK;
2870 NTSTATUS rpccli_drsuapi_DsExecuteKCC(struct rpc_pipe_client *cli,
2871 TALLOC_CTX *mem_ctx,
2872 struct policy_handle *bind_handle /* [in] [ref] */,
2873 uint32_t level /* [in] */,
2874 union drsuapi_DsExecuteKCCRequest *req /* [in] [ref,switch_is(level)] */,
2875 WERROR *werror)
2877 struct drsuapi_DsExecuteKCC r;
2878 NTSTATUS status;
2880 /* In parameters */
2881 r.in.bind_handle = bind_handle;
2882 r.in.level = level;
2883 r.in.req = req;
2885 status = cli->dispatch(cli,
2886 mem_ctx,
2887 &ndr_table_drsuapi,
2888 NDR_DRSUAPI_DSEXECUTEKCC,
2889 &r);
2891 if (!NT_STATUS_IS_OK(status)) {
2892 return status;
2895 if (NT_STATUS_IS_ERR(status)) {
2896 return status;
2899 /* Return variables */
2901 /* Return result */
2902 if (werror) {
2903 *werror = r.out.result;
2906 return werror_to_ntstatus(r.out.result);
2909 struct rpccli_drsuapi_DsReplicaGetInfo_state {
2910 struct drsuapi_DsReplicaGetInfo orig;
2911 struct drsuapi_DsReplicaGetInfo tmp;
2912 TALLOC_CTX *out_mem_ctx;
2913 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2916 static void rpccli_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq);
2918 struct tevent_req *rpccli_drsuapi_DsReplicaGetInfo_send(TALLOC_CTX *mem_ctx,
2919 struct tevent_context *ev,
2920 struct rpc_pipe_client *cli,
2921 struct policy_handle *_bind_handle /* [in] [ref] */,
2922 enum drsuapi_DsReplicaGetInfoLevel _level /* [in] */,
2923 union drsuapi_DsReplicaGetInfoRequest *_req /* [in] [ref,switch_is(level)] */,
2924 enum drsuapi_DsReplicaInfoType *_info_type /* [out] [ref] */,
2925 union drsuapi_DsReplicaInfo *_info /* [out] [ref,switch_is(*info_type)] */)
2927 struct tevent_req *req;
2928 struct rpccli_drsuapi_DsReplicaGetInfo_state *state;
2929 struct tevent_req *subreq;
2931 req = tevent_req_create(mem_ctx, &state,
2932 struct rpccli_drsuapi_DsReplicaGetInfo_state);
2933 if (req == NULL) {
2934 return NULL;
2936 state->out_mem_ctx = NULL;
2937 state->dispatch_recv = cli->dispatch_recv;
2939 /* In parameters */
2940 state->orig.in.bind_handle = _bind_handle;
2941 state->orig.in.level = _level;
2942 state->orig.in.req = _req;
2944 /* Out parameters */
2945 state->orig.out.info_type = _info_type;
2946 state->orig.out.info = _info;
2948 /* Result */
2949 ZERO_STRUCT(state->orig.out.result);
2951 state->out_mem_ctx = talloc_named_const(state, 0,
2952 "rpccli_drsuapi_DsReplicaGetInfo_out_memory");
2953 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2954 return tevent_req_post(req, ev);
2957 /* make a temporary copy, that we pass to the dispatch function */
2958 state->tmp = state->orig;
2960 subreq = cli->dispatch_send(state, ev, cli,
2961 &ndr_table_drsuapi,
2962 NDR_DRSUAPI_DSREPLICAGETINFO,
2963 &state->tmp);
2964 if (tevent_req_nomem(subreq, req)) {
2965 return tevent_req_post(req, ev);
2967 tevent_req_set_callback(subreq, rpccli_drsuapi_DsReplicaGetInfo_done, req);
2968 return req;
2971 static void rpccli_drsuapi_DsReplicaGetInfo_done(struct tevent_req *subreq)
2973 struct tevent_req *req = tevent_req_callback_data(
2974 subreq, struct tevent_req);
2975 struct rpccli_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
2976 req, struct rpccli_drsuapi_DsReplicaGetInfo_state);
2977 NTSTATUS status;
2978 TALLOC_CTX *mem_ctx;
2980 if (state->out_mem_ctx) {
2981 mem_ctx = state->out_mem_ctx;
2982 } else {
2983 mem_ctx = state;
2986 status = state->dispatch_recv(subreq, mem_ctx);
2987 TALLOC_FREE(subreq);
2988 if (!NT_STATUS_IS_OK(status)) {
2989 tevent_req_nterror(req, status);
2990 return;
2993 /* Copy out parameters */
2994 *state->orig.out.info_type = *state->tmp.out.info_type;
2995 *state->orig.out.info = *state->tmp.out.info;
2997 /* Copy result */
2998 state->orig.out.result = state->tmp.out.result;
3000 /* Reset temporary structure */
3001 ZERO_STRUCT(state->tmp);
3003 tevent_req_done(req);
3006 NTSTATUS rpccli_drsuapi_DsReplicaGetInfo_recv(struct tevent_req *req,
3007 TALLOC_CTX *mem_ctx,
3008 WERROR *result)
3010 struct rpccli_drsuapi_DsReplicaGetInfo_state *state = tevent_req_data(
3011 req, struct rpccli_drsuapi_DsReplicaGetInfo_state);
3012 NTSTATUS status;
3014 if (tevent_req_is_nterror(req, &status)) {
3015 tevent_req_received(req);
3016 return status;
3019 /* Steal possbile out parameters to the callers context */
3020 talloc_steal(mem_ctx, state->out_mem_ctx);
3022 /* Return result */
3023 *result = state->orig.out.result;
3025 tevent_req_received(req);
3026 return NT_STATUS_OK;
3029 NTSTATUS rpccli_drsuapi_DsReplicaGetInfo(struct rpc_pipe_client *cli,
3030 TALLOC_CTX *mem_ctx,
3031 struct policy_handle *bind_handle /* [in] [ref] */,
3032 enum drsuapi_DsReplicaGetInfoLevel level /* [in] */,
3033 union drsuapi_DsReplicaGetInfoRequest *req /* [in] [ref,switch_is(level)] */,
3034 enum drsuapi_DsReplicaInfoType *info_type /* [out] [ref] */,
3035 union drsuapi_DsReplicaInfo *info /* [out] [ref,switch_is(*info_type)] */,
3036 WERROR *werror)
3038 struct drsuapi_DsReplicaGetInfo r;
3039 NTSTATUS status;
3041 /* In parameters */
3042 r.in.bind_handle = bind_handle;
3043 r.in.level = level;
3044 r.in.req = req;
3046 status = cli->dispatch(cli,
3047 mem_ctx,
3048 &ndr_table_drsuapi,
3049 NDR_DRSUAPI_DSREPLICAGETINFO,
3050 &r);
3052 if (!NT_STATUS_IS_OK(status)) {
3053 return status;
3056 if (NT_STATUS_IS_ERR(status)) {
3057 return status;
3060 /* Return variables */
3061 *info_type = *r.out.info_type;
3062 *info = *r.out.info;
3064 /* Return result */
3065 if (werror) {
3066 *werror = r.out.result;
3069 return werror_to_ntstatus(r.out.result);
3072 struct rpccli_DRSUAPI_ADD_SID_HISTORY_state {
3073 struct DRSUAPI_ADD_SID_HISTORY orig;
3074 struct DRSUAPI_ADD_SID_HISTORY tmp;
3075 TALLOC_CTX *out_mem_ctx;
3076 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3079 static void rpccli_DRSUAPI_ADD_SID_HISTORY_done(struct tevent_req *subreq);
3081 struct tevent_req *rpccli_DRSUAPI_ADD_SID_HISTORY_send(TALLOC_CTX *mem_ctx,
3082 struct tevent_context *ev,
3083 struct rpc_pipe_client *cli)
3085 struct tevent_req *req;
3086 struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state;
3087 struct tevent_req *subreq;
3089 req = tevent_req_create(mem_ctx, &state,
3090 struct rpccli_DRSUAPI_ADD_SID_HISTORY_state);
3091 if (req == NULL) {
3092 return NULL;
3094 state->out_mem_ctx = NULL;
3095 state->dispatch_recv = cli->dispatch_recv;
3097 /* In parameters */
3099 /* Out parameters */
3101 /* Result */
3102 ZERO_STRUCT(state->orig.out.result);
3104 /* make a temporary copy, that we pass to the dispatch function */
3105 state->tmp = state->orig;
3107 subreq = cli->dispatch_send(state, ev, cli,
3108 &ndr_table_drsuapi,
3109 NDR_DRSUAPI_ADD_SID_HISTORY,
3110 &state->tmp);
3111 if (tevent_req_nomem(subreq, req)) {
3112 return tevent_req_post(req, ev);
3114 tevent_req_set_callback(subreq, rpccli_DRSUAPI_ADD_SID_HISTORY_done, req);
3115 return req;
3118 static void rpccli_DRSUAPI_ADD_SID_HISTORY_done(struct tevent_req *subreq)
3120 struct tevent_req *req = tevent_req_callback_data(
3121 subreq, struct tevent_req);
3122 struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state = tevent_req_data(
3123 req, struct rpccli_DRSUAPI_ADD_SID_HISTORY_state);
3124 NTSTATUS status;
3125 TALLOC_CTX *mem_ctx;
3127 if (state->out_mem_ctx) {
3128 mem_ctx = state->out_mem_ctx;
3129 } else {
3130 mem_ctx = state;
3133 status = state->dispatch_recv(subreq, mem_ctx);
3134 TALLOC_FREE(subreq);
3135 if (!NT_STATUS_IS_OK(status)) {
3136 tevent_req_nterror(req, status);
3137 return;
3140 /* Copy out parameters */
3142 /* Copy result */
3143 state->orig.out.result = state->tmp.out.result;
3145 /* Reset temporary structure */
3146 ZERO_STRUCT(state->tmp);
3148 tevent_req_done(req);
3151 NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY_recv(struct tevent_req *req,
3152 TALLOC_CTX *mem_ctx,
3153 WERROR *result)
3155 struct rpccli_DRSUAPI_ADD_SID_HISTORY_state *state = tevent_req_data(
3156 req, struct rpccli_DRSUAPI_ADD_SID_HISTORY_state);
3157 NTSTATUS status;
3159 if (tevent_req_is_nterror(req, &status)) {
3160 tevent_req_received(req);
3161 return status;
3164 /* Steal possbile out parameters to the callers context */
3165 talloc_steal(mem_ctx, state->out_mem_ctx);
3167 /* Return result */
3168 *result = state->orig.out.result;
3170 tevent_req_received(req);
3171 return NT_STATUS_OK;
3174 NTSTATUS rpccli_DRSUAPI_ADD_SID_HISTORY(struct rpc_pipe_client *cli,
3175 TALLOC_CTX *mem_ctx,
3176 WERROR *werror)
3178 struct DRSUAPI_ADD_SID_HISTORY r;
3179 NTSTATUS status;
3181 /* In parameters */
3183 status = cli->dispatch(cli,
3184 mem_ctx,
3185 &ndr_table_drsuapi,
3186 NDR_DRSUAPI_ADD_SID_HISTORY,
3187 &r);
3189 if (!NT_STATUS_IS_OK(status)) {
3190 return status;
3193 if (NT_STATUS_IS_ERR(status)) {
3194 return status;
3197 /* Return variables */
3199 /* Return result */
3200 if (werror) {
3201 *werror = r.out.result;
3204 return werror_to_ntstatus(r.out.result);
3207 struct rpccli_drsuapi_DsGetMemberships2_state {
3208 struct drsuapi_DsGetMemberships2 orig;
3209 struct drsuapi_DsGetMemberships2 tmp;
3210 TALLOC_CTX *out_mem_ctx;
3211 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3214 static void rpccli_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq);
3216 struct tevent_req *rpccli_drsuapi_DsGetMemberships2_send(TALLOC_CTX *mem_ctx,
3217 struct tevent_context *ev,
3218 struct rpc_pipe_client *cli,
3219 struct policy_handle *_bind_handle /* [in] [ref] */,
3220 int32_t _level /* [in] */,
3221 union drsuapi_DsGetMemberships2Request *_req /* [in] [ref,switch_is(level)] */,
3222 int32_t *_level_out /* [out] [ref] */,
3223 union drsuapi_DsGetMemberships2Ctr *_ctr /* [out] [ref,switch_is(*level_out)] */)
3225 struct tevent_req *req;
3226 struct rpccli_drsuapi_DsGetMemberships2_state *state;
3227 struct tevent_req *subreq;
3229 req = tevent_req_create(mem_ctx, &state,
3230 struct rpccli_drsuapi_DsGetMemberships2_state);
3231 if (req == NULL) {
3232 return NULL;
3234 state->out_mem_ctx = NULL;
3235 state->dispatch_recv = cli->dispatch_recv;
3237 /* In parameters */
3238 state->orig.in.bind_handle = _bind_handle;
3239 state->orig.in.level = _level;
3240 state->orig.in.req = _req;
3242 /* Out parameters */
3243 state->orig.out.level_out = _level_out;
3244 state->orig.out.ctr = _ctr;
3246 /* Result */
3247 ZERO_STRUCT(state->orig.out.result);
3249 state->out_mem_ctx = talloc_named_const(state, 0,
3250 "rpccli_drsuapi_DsGetMemberships2_out_memory");
3251 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3252 return tevent_req_post(req, ev);
3255 /* make a temporary copy, that we pass to the dispatch function */
3256 state->tmp = state->orig;
3258 subreq = cli->dispatch_send(state, ev, cli,
3259 &ndr_table_drsuapi,
3260 NDR_DRSUAPI_DSGETMEMBERSHIPS2,
3261 &state->tmp);
3262 if (tevent_req_nomem(subreq, req)) {
3263 return tevent_req_post(req, ev);
3265 tevent_req_set_callback(subreq, rpccli_drsuapi_DsGetMemberships2_done, req);
3266 return req;
3269 static void rpccli_drsuapi_DsGetMemberships2_done(struct tevent_req *subreq)
3271 struct tevent_req *req = tevent_req_callback_data(
3272 subreq, struct tevent_req);
3273 struct rpccli_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
3274 req, struct rpccli_drsuapi_DsGetMemberships2_state);
3275 NTSTATUS status;
3276 TALLOC_CTX *mem_ctx;
3278 if (state->out_mem_ctx) {
3279 mem_ctx = state->out_mem_ctx;
3280 } else {
3281 mem_ctx = state;
3284 status = state->dispatch_recv(subreq, mem_ctx);
3285 TALLOC_FREE(subreq);
3286 if (!NT_STATUS_IS_OK(status)) {
3287 tevent_req_nterror(req, status);
3288 return;
3291 /* Copy out parameters */
3292 *state->orig.out.level_out = *state->tmp.out.level_out;
3293 *state->orig.out.ctr = *state->tmp.out.ctr;
3295 /* Copy result */
3296 state->orig.out.result = state->tmp.out.result;
3298 /* Reset temporary structure */
3299 ZERO_STRUCT(state->tmp);
3301 tevent_req_done(req);
3304 NTSTATUS rpccli_drsuapi_DsGetMemberships2_recv(struct tevent_req *req,
3305 TALLOC_CTX *mem_ctx,
3306 WERROR *result)
3308 struct rpccli_drsuapi_DsGetMemberships2_state *state = tevent_req_data(
3309 req, struct rpccli_drsuapi_DsGetMemberships2_state);
3310 NTSTATUS status;
3312 if (tevent_req_is_nterror(req, &status)) {
3313 tevent_req_received(req);
3314 return status;
3317 /* Steal possbile out parameters to the callers context */
3318 talloc_steal(mem_ctx, state->out_mem_ctx);
3320 /* Return result */
3321 *result = state->orig.out.result;
3323 tevent_req_received(req);
3324 return NT_STATUS_OK;
3327 NTSTATUS rpccli_drsuapi_DsGetMemberships2(struct rpc_pipe_client *cli,
3328 TALLOC_CTX *mem_ctx,
3329 struct policy_handle *bind_handle /* [in] [ref] */,
3330 int32_t level /* [in] */,
3331 union drsuapi_DsGetMemberships2Request *req /* [in] [ref,switch_is(level)] */,
3332 int32_t *level_out /* [out] [ref] */,
3333 union drsuapi_DsGetMemberships2Ctr *ctr /* [out] [ref,switch_is(*level_out)] */,
3334 WERROR *werror)
3336 struct drsuapi_DsGetMemberships2 r;
3337 NTSTATUS status;
3339 /* In parameters */
3340 r.in.bind_handle = bind_handle;
3341 r.in.level = level;
3342 r.in.req = req;
3344 status = cli->dispatch(cli,
3345 mem_ctx,
3346 &ndr_table_drsuapi,
3347 NDR_DRSUAPI_DSGETMEMBERSHIPS2,
3348 &r);
3350 if (!NT_STATUS_IS_OK(status)) {
3351 return status;
3354 if (NT_STATUS_IS_ERR(status)) {
3355 return status;
3358 /* Return variables */
3359 *level_out = *r.out.level_out;
3360 *ctr = *r.out.ctr;
3362 /* Return result */
3363 if (werror) {
3364 *werror = r.out.result;
3367 return werror_to_ntstatus(r.out.result);
3370 struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state {
3371 struct DRSUAPI_REPLICA_VERIFY_OBJECTS orig;
3372 struct DRSUAPI_REPLICA_VERIFY_OBJECTS tmp;
3373 TALLOC_CTX *out_mem_ctx;
3374 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3377 static void rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done(struct tevent_req *subreq);
3379 struct tevent_req *rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_send(TALLOC_CTX *mem_ctx,
3380 struct tevent_context *ev,
3381 struct rpc_pipe_client *cli)
3383 struct tevent_req *req;
3384 struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state;
3385 struct tevent_req *subreq;
3387 req = tevent_req_create(mem_ctx, &state,
3388 struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state);
3389 if (req == NULL) {
3390 return NULL;
3392 state->out_mem_ctx = NULL;
3393 state->dispatch_recv = cli->dispatch_recv;
3395 /* In parameters */
3397 /* Out parameters */
3399 /* Result */
3400 ZERO_STRUCT(state->orig.out.result);
3402 /* make a temporary copy, that we pass to the dispatch function */
3403 state->tmp = state->orig;
3405 subreq = cli->dispatch_send(state, ev, cli,
3406 &ndr_table_drsuapi,
3407 NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS,
3408 &state->tmp);
3409 if (tevent_req_nomem(subreq, req)) {
3410 return tevent_req_post(req, ev);
3412 tevent_req_set_callback(subreq, rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done, req);
3413 return req;
3416 static void rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_done(struct tevent_req *subreq)
3418 struct tevent_req *req = tevent_req_callback_data(
3419 subreq, struct tevent_req);
3420 struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state = tevent_req_data(
3421 req, struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state);
3422 NTSTATUS status;
3423 TALLOC_CTX *mem_ctx;
3425 if (state->out_mem_ctx) {
3426 mem_ctx = state->out_mem_ctx;
3427 } else {
3428 mem_ctx = state;
3431 status = state->dispatch_recv(subreq, mem_ctx);
3432 TALLOC_FREE(subreq);
3433 if (!NT_STATUS_IS_OK(status)) {
3434 tevent_req_nterror(req, status);
3435 return;
3438 /* Copy out parameters */
3440 /* Copy result */
3441 state->orig.out.result = state->tmp.out.result;
3443 /* Reset temporary structure */
3444 ZERO_STRUCT(state->tmp);
3446 tevent_req_done(req);
3449 NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_recv(struct tevent_req *req,
3450 TALLOC_CTX *mem_ctx,
3451 WERROR *result)
3453 struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state *state = tevent_req_data(
3454 req, struct rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS_state);
3455 NTSTATUS status;
3457 if (tevent_req_is_nterror(req, &status)) {
3458 tevent_req_received(req);
3459 return status;
3462 /* Steal possbile out parameters to the callers context */
3463 talloc_steal(mem_ctx, state->out_mem_ctx);
3465 /* Return result */
3466 *result = state->orig.out.result;
3468 tevent_req_received(req);
3469 return NT_STATUS_OK;
3472 NTSTATUS rpccli_DRSUAPI_REPLICA_VERIFY_OBJECTS(struct rpc_pipe_client *cli,
3473 TALLOC_CTX *mem_ctx,
3474 WERROR *werror)
3476 struct DRSUAPI_REPLICA_VERIFY_OBJECTS r;
3477 NTSTATUS status;
3479 /* In parameters */
3481 status = cli->dispatch(cli,
3482 mem_ctx,
3483 &ndr_table_drsuapi,
3484 NDR_DRSUAPI_REPLICA_VERIFY_OBJECTS,
3485 &r);
3487 if (!NT_STATUS_IS_OK(status)) {
3488 return status;
3491 if (NT_STATUS_IS_ERR(status)) {
3492 return status;
3495 /* Return variables */
3497 /* Return result */
3498 if (werror) {
3499 *werror = r.out.result;
3502 return werror_to_ntstatus(r.out.result);
3505 struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state {
3506 struct DRSUAPI_GET_OBJECT_EXISTENCE orig;
3507 struct DRSUAPI_GET_OBJECT_EXISTENCE tmp;
3508 TALLOC_CTX *out_mem_ctx;
3509 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3512 static void rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done(struct tevent_req *subreq);
3514 struct tevent_req *rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_send(TALLOC_CTX *mem_ctx,
3515 struct tevent_context *ev,
3516 struct rpc_pipe_client *cli)
3518 struct tevent_req *req;
3519 struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state;
3520 struct tevent_req *subreq;
3522 req = tevent_req_create(mem_ctx, &state,
3523 struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state);
3524 if (req == NULL) {
3525 return NULL;
3527 state->out_mem_ctx = NULL;
3528 state->dispatch_recv = cli->dispatch_recv;
3530 /* In parameters */
3532 /* Out parameters */
3534 /* Result */
3535 ZERO_STRUCT(state->orig.out.result);
3537 /* make a temporary copy, that we pass to the dispatch function */
3538 state->tmp = state->orig;
3540 subreq = cli->dispatch_send(state, ev, cli,
3541 &ndr_table_drsuapi,
3542 NDR_DRSUAPI_GET_OBJECT_EXISTENCE,
3543 &state->tmp);
3544 if (tevent_req_nomem(subreq, req)) {
3545 return tevent_req_post(req, ev);
3547 tevent_req_set_callback(subreq, rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done, req);
3548 return req;
3551 static void rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_done(struct tevent_req *subreq)
3553 struct tevent_req *req = tevent_req_callback_data(
3554 subreq, struct tevent_req);
3555 struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state = tevent_req_data(
3556 req, struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state);
3557 NTSTATUS status;
3558 TALLOC_CTX *mem_ctx;
3560 if (state->out_mem_ctx) {
3561 mem_ctx = state->out_mem_ctx;
3562 } else {
3563 mem_ctx = state;
3566 status = state->dispatch_recv(subreq, mem_ctx);
3567 TALLOC_FREE(subreq);
3568 if (!NT_STATUS_IS_OK(status)) {
3569 tevent_req_nterror(req, status);
3570 return;
3573 /* Copy out parameters */
3575 /* Copy result */
3576 state->orig.out.result = state->tmp.out.result;
3578 /* Reset temporary structure */
3579 ZERO_STRUCT(state->tmp);
3581 tevent_req_done(req);
3584 NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_recv(struct tevent_req *req,
3585 TALLOC_CTX *mem_ctx,
3586 WERROR *result)
3588 struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state *state = tevent_req_data(
3589 req, struct rpccli_DRSUAPI_GET_OBJECT_EXISTENCE_state);
3590 NTSTATUS status;
3592 if (tevent_req_is_nterror(req, &status)) {
3593 tevent_req_received(req);
3594 return status;
3597 /* Steal possbile out parameters to the callers context */
3598 talloc_steal(mem_ctx, state->out_mem_ctx);
3600 /* Return result */
3601 *result = state->orig.out.result;
3603 tevent_req_received(req);
3604 return NT_STATUS_OK;
3607 NTSTATUS rpccli_DRSUAPI_GET_OBJECT_EXISTENCE(struct rpc_pipe_client *cli,
3608 TALLOC_CTX *mem_ctx,
3609 WERROR *werror)
3611 struct DRSUAPI_GET_OBJECT_EXISTENCE r;
3612 NTSTATUS status;
3614 /* In parameters */
3616 status = cli->dispatch(cli,
3617 mem_ctx,
3618 &ndr_table_drsuapi,
3619 NDR_DRSUAPI_GET_OBJECT_EXISTENCE,
3620 &r);
3622 if (!NT_STATUS_IS_OK(status)) {
3623 return status;
3626 if (NT_STATUS_IS_ERR(status)) {
3627 return status;
3630 /* Return variables */
3632 /* Return result */
3633 if (werror) {
3634 *werror = r.out.result;
3637 return werror_to_ntstatus(r.out.result);
3640 struct rpccli_drsuapi_QuerySitesByCost_state {
3641 struct drsuapi_QuerySitesByCost orig;
3642 struct drsuapi_QuerySitesByCost tmp;
3643 TALLOC_CTX *out_mem_ctx;
3644 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3647 static void rpccli_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq);
3649 struct tevent_req *rpccli_drsuapi_QuerySitesByCost_send(TALLOC_CTX *mem_ctx,
3650 struct tevent_context *ev,
3651 struct rpc_pipe_client *cli,
3652 struct policy_handle *_bind_handle /* [in] [ref] */,
3653 int32_t _level /* [in] */,
3654 union drsuapi_QuerySitesByCostRequest *_req /* [in] [ref,switch_is(level)] */,
3655 int32_t *_level_out /* [out] [ref] */,
3656 union drsuapi_QuerySitesByCostCtr *_ctr /* [out] [ref,switch_is(*level_out)] */)
3658 struct tevent_req *req;
3659 struct rpccli_drsuapi_QuerySitesByCost_state *state;
3660 struct tevent_req *subreq;
3662 req = tevent_req_create(mem_ctx, &state,
3663 struct rpccli_drsuapi_QuerySitesByCost_state);
3664 if (req == NULL) {
3665 return NULL;
3667 state->out_mem_ctx = NULL;
3668 state->dispatch_recv = cli->dispatch_recv;
3670 /* In parameters */
3671 state->orig.in.bind_handle = _bind_handle;
3672 state->orig.in.level = _level;
3673 state->orig.in.req = _req;
3675 /* Out parameters */
3676 state->orig.out.level_out = _level_out;
3677 state->orig.out.ctr = _ctr;
3679 /* Result */
3680 ZERO_STRUCT(state->orig.out.result);
3682 state->out_mem_ctx = talloc_named_const(state, 0,
3683 "rpccli_drsuapi_QuerySitesByCost_out_memory");
3684 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3685 return tevent_req_post(req, ev);
3688 /* make a temporary copy, that we pass to the dispatch function */
3689 state->tmp = state->orig;
3691 subreq = cli->dispatch_send(state, ev, cli,
3692 &ndr_table_drsuapi,
3693 NDR_DRSUAPI_QUERYSITESBYCOST,
3694 &state->tmp);
3695 if (tevent_req_nomem(subreq, req)) {
3696 return tevent_req_post(req, ev);
3698 tevent_req_set_callback(subreq, rpccli_drsuapi_QuerySitesByCost_done, req);
3699 return req;
3702 static void rpccli_drsuapi_QuerySitesByCost_done(struct tevent_req *subreq)
3704 struct tevent_req *req = tevent_req_callback_data(
3705 subreq, struct tevent_req);
3706 struct rpccli_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
3707 req, struct rpccli_drsuapi_QuerySitesByCost_state);
3708 NTSTATUS status;
3709 TALLOC_CTX *mem_ctx;
3711 if (state->out_mem_ctx) {
3712 mem_ctx = state->out_mem_ctx;
3713 } else {
3714 mem_ctx = state;
3717 status = state->dispatch_recv(subreq, mem_ctx);
3718 TALLOC_FREE(subreq);
3719 if (!NT_STATUS_IS_OK(status)) {
3720 tevent_req_nterror(req, status);
3721 return;
3724 /* Copy out parameters */
3725 *state->orig.out.level_out = *state->tmp.out.level_out;
3726 *state->orig.out.ctr = *state->tmp.out.ctr;
3728 /* Copy result */
3729 state->orig.out.result = state->tmp.out.result;
3731 /* Reset temporary structure */
3732 ZERO_STRUCT(state->tmp);
3734 tevent_req_done(req);
3737 NTSTATUS rpccli_drsuapi_QuerySitesByCost_recv(struct tevent_req *req,
3738 TALLOC_CTX *mem_ctx,
3739 WERROR *result)
3741 struct rpccli_drsuapi_QuerySitesByCost_state *state = tevent_req_data(
3742 req, struct rpccli_drsuapi_QuerySitesByCost_state);
3743 NTSTATUS status;
3745 if (tevent_req_is_nterror(req, &status)) {
3746 tevent_req_received(req);
3747 return status;
3750 /* Steal possbile out parameters to the callers context */
3751 talloc_steal(mem_ctx, state->out_mem_ctx);
3753 /* Return result */
3754 *result = state->orig.out.result;
3756 tevent_req_received(req);
3757 return NT_STATUS_OK;
3760 NTSTATUS rpccli_drsuapi_QuerySitesByCost(struct rpc_pipe_client *cli,
3761 TALLOC_CTX *mem_ctx,
3762 struct policy_handle *bind_handle /* [in] [ref] */,
3763 int32_t level /* [in] */,
3764 union drsuapi_QuerySitesByCostRequest *req /* [in] [ref,switch_is(level)] */,
3765 int32_t *level_out /* [out] [ref] */,
3766 union drsuapi_QuerySitesByCostCtr *ctr /* [out] [ref,switch_is(*level_out)] */,
3767 WERROR *werror)
3769 struct drsuapi_QuerySitesByCost r;
3770 NTSTATUS status;
3772 /* In parameters */
3773 r.in.bind_handle = bind_handle;
3774 r.in.level = level;
3775 r.in.req = req;
3777 status = cli->dispatch(cli,
3778 mem_ctx,
3779 &ndr_table_drsuapi,
3780 NDR_DRSUAPI_QUERYSITESBYCOST,
3781 &r);
3783 if (!NT_STATUS_IS_OK(status)) {
3784 return status;
3787 if (NT_STATUS_IS_ERR(status)) {
3788 return status;
3791 /* Return variables */
3792 *level_out = *r.out.level_out;
3793 *ctr = *r.out.ctr;
3795 /* Return result */
3796 if (werror) {
3797 *werror = r.out.result;
3800 return werror_to_ntstatus(r.out.result);