WHATSNEW: Update release notes.
[Samba/bb.git] / librpc / gen_ndr / cli_samr.c
blobe828222cbe11976ead9d6d50b9f9a849003cedba
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_samr.h"
9 struct rpccli_samr_Connect_state {
10 struct samr_Connect orig;
11 struct samr_Connect tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_samr_Connect_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_samr_Connect_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint16_t *_system_name /* [in] [unique] */,
22 uint32_t _access_mask /* [in] */,
23 struct policy_handle *_connect_handle /* [out] [ref] */)
25 struct tevent_req *req;
26 struct rpccli_samr_Connect_state *state;
27 struct tevent_req *subreq;
29 req = tevent_req_create(mem_ctx, &state,
30 struct rpccli_samr_Connect_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.system_name = _system_name;
39 state->orig.in.access_mask = _access_mask;
41 /* Out parameters */
42 state->orig.out.connect_handle = _connect_handle;
44 /* Result */
45 ZERO_STRUCT(state->orig.out.result);
47 state->out_mem_ctx = talloc_named_const(state, 0,
48 "rpccli_samr_Connect_out_memory");
49 if (tevent_req_nomem(state->out_mem_ctx, req)) {
50 return tevent_req_post(req, ev);
53 /* make a temporary copy, that we pass to the dispatch function */
54 state->tmp = state->orig;
56 subreq = cli->dispatch_send(state, ev, cli,
57 &ndr_table_samr,
58 NDR_SAMR_CONNECT,
59 &state->tmp);
60 if (tevent_req_nomem(subreq, req)) {
61 return tevent_req_post(req, ev);
63 tevent_req_set_callback(subreq, rpccli_samr_Connect_done, req);
64 return req;
67 static void rpccli_samr_Connect_done(struct tevent_req *subreq)
69 struct tevent_req *req = tevent_req_callback_data(
70 subreq, struct tevent_req);
71 struct rpccli_samr_Connect_state *state = tevent_req_data(
72 req, struct rpccli_samr_Connect_state);
73 NTSTATUS status;
74 TALLOC_CTX *mem_ctx;
76 if (state->out_mem_ctx) {
77 mem_ctx = state->out_mem_ctx;
78 } else {
79 mem_ctx = state;
82 status = state->dispatch_recv(subreq, mem_ctx);
83 TALLOC_FREE(subreq);
84 if (!NT_STATUS_IS_OK(status)) {
85 tevent_req_nterror(req, status);
86 return;
89 /* Copy out parameters */
90 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
92 /* Copy result */
93 state->orig.out.result = state->tmp.out.result;
95 /* Reset temporary structure */
96 ZERO_STRUCT(state->tmp);
98 tevent_req_done(req);
101 NTSTATUS rpccli_samr_Connect_recv(struct tevent_req *req,
102 TALLOC_CTX *mem_ctx,
103 NTSTATUS *result)
105 struct rpccli_samr_Connect_state *state = tevent_req_data(
106 req, struct rpccli_samr_Connect_state);
107 NTSTATUS status;
109 if (tevent_req_is_nterror(req, &status)) {
110 tevent_req_received(req);
111 return status;
114 /* Steal possbile out parameters to the callers context */
115 talloc_steal(mem_ctx, state->out_mem_ctx);
117 /* Return result */
118 *result = state->orig.out.result;
120 tevent_req_received(req);
121 return NT_STATUS_OK;
124 NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
125 TALLOC_CTX *mem_ctx,
126 uint16_t *system_name /* [in] [unique] */,
127 uint32_t access_mask /* [in] */,
128 struct policy_handle *connect_handle /* [out] [ref] */)
130 struct samr_Connect r;
131 NTSTATUS status;
133 /* In parameters */
134 r.in.system_name = system_name;
135 r.in.access_mask = access_mask;
137 status = cli->dispatch(cli,
138 mem_ctx,
139 &ndr_table_samr,
140 NDR_SAMR_CONNECT,
141 &r);
143 if (!NT_STATUS_IS_OK(status)) {
144 return status;
147 if (NT_STATUS_IS_ERR(status)) {
148 return status;
151 /* Return variables */
152 *connect_handle = *r.out.connect_handle;
154 /* Return result */
155 return r.out.result;
158 struct rpccli_samr_Close_state {
159 struct samr_Close orig;
160 struct samr_Close tmp;
161 TALLOC_CTX *out_mem_ctx;
162 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
165 static void rpccli_samr_Close_done(struct tevent_req *subreq);
167 struct tevent_req *rpccli_samr_Close_send(TALLOC_CTX *mem_ctx,
168 struct tevent_context *ev,
169 struct rpc_pipe_client *cli,
170 struct policy_handle *_handle /* [in,out] [ref] */)
172 struct tevent_req *req;
173 struct rpccli_samr_Close_state *state;
174 struct tevent_req *subreq;
176 req = tevent_req_create(mem_ctx, &state,
177 struct rpccli_samr_Close_state);
178 if (req == NULL) {
179 return NULL;
181 state->out_mem_ctx = NULL;
182 state->dispatch_recv = cli->dispatch_recv;
184 /* In parameters */
185 state->orig.in.handle = _handle;
187 /* Out parameters */
188 state->orig.out.handle = _handle;
190 /* Result */
191 ZERO_STRUCT(state->orig.out.result);
193 state->out_mem_ctx = talloc_named_const(state, 0,
194 "rpccli_samr_Close_out_memory");
195 if (tevent_req_nomem(state->out_mem_ctx, req)) {
196 return tevent_req_post(req, ev);
199 /* make a temporary copy, that we pass to the dispatch function */
200 state->tmp = state->orig;
202 subreq = cli->dispatch_send(state, ev, cli,
203 &ndr_table_samr,
204 NDR_SAMR_CLOSE,
205 &state->tmp);
206 if (tevent_req_nomem(subreq, req)) {
207 return tevent_req_post(req, ev);
209 tevent_req_set_callback(subreq, rpccli_samr_Close_done, req);
210 return req;
213 static void rpccli_samr_Close_done(struct tevent_req *subreq)
215 struct tevent_req *req = tevent_req_callback_data(
216 subreq, struct tevent_req);
217 struct rpccli_samr_Close_state *state = tevent_req_data(
218 req, struct rpccli_samr_Close_state);
219 NTSTATUS status;
220 TALLOC_CTX *mem_ctx;
222 if (state->out_mem_ctx) {
223 mem_ctx = state->out_mem_ctx;
224 } else {
225 mem_ctx = state;
228 status = state->dispatch_recv(subreq, mem_ctx);
229 TALLOC_FREE(subreq);
230 if (!NT_STATUS_IS_OK(status)) {
231 tevent_req_nterror(req, status);
232 return;
235 /* Copy out parameters */
236 *state->orig.out.handle = *state->tmp.out.handle;
238 /* Copy result */
239 state->orig.out.result = state->tmp.out.result;
241 /* Reset temporary structure */
242 ZERO_STRUCT(state->tmp);
244 tevent_req_done(req);
247 NTSTATUS rpccli_samr_Close_recv(struct tevent_req *req,
248 TALLOC_CTX *mem_ctx,
249 NTSTATUS *result)
251 struct rpccli_samr_Close_state *state = tevent_req_data(
252 req, struct rpccli_samr_Close_state);
253 NTSTATUS status;
255 if (tevent_req_is_nterror(req, &status)) {
256 tevent_req_received(req);
257 return status;
260 /* Steal possbile out parameters to the callers context */
261 talloc_steal(mem_ctx, state->out_mem_ctx);
263 /* Return result */
264 *result = state->orig.out.result;
266 tevent_req_received(req);
267 return NT_STATUS_OK;
270 NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
271 TALLOC_CTX *mem_ctx,
272 struct policy_handle *handle /* [in,out] [ref] */)
274 struct samr_Close r;
275 NTSTATUS status;
277 /* In parameters */
278 r.in.handle = handle;
280 status = cli->dispatch(cli,
281 mem_ctx,
282 &ndr_table_samr,
283 NDR_SAMR_CLOSE,
284 &r);
286 if (!NT_STATUS_IS_OK(status)) {
287 return status;
290 if (NT_STATUS_IS_ERR(status)) {
291 return status;
294 /* Return variables */
295 *handle = *r.out.handle;
297 /* Return result */
298 return r.out.result;
301 struct rpccli_samr_SetSecurity_state {
302 struct samr_SetSecurity orig;
303 struct samr_SetSecurity tmp;
304 TALLOC_CTX *out_mem_ctx;
305 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
308 static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq);
310 struct tevent_req *rpccli_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
311 struct tevent_context *ev,
312 struct rpc_pipe_client *cli,
313 struct policy_handle *_handle /* [in] [ref] */,
314 uint32_t _sec_info /* [in] */,
315 struct sec_desc_buf *_sdbuf /* [in] [ref] */)
317 struct tevent_req *req;
318 struct rpccli_samr_SetSecurity_state *state;
319 struct tevent_req *subreq;
321 req = tevent_req_create(mem_ctx, &state,
322 struct rpccli_samr_SetSecurity_state);
323 if (req == NULL) {
324 return NULL;
326 state->out_mem_ctx = NULL;
327 state->dispatch_recv = cli->dispatch_recv;
329 /* In parameters */
330 state->orig.in.handle = _handle;
331 state->orig.in.sec_info = _sec_info;
332 state->orig.in.sdbuf = _sdbuf;
334 /* Out parameters */
336 /* Result */
337 ZERO_STRUCT(state->orig.out.result);
339 /* make a temporary copy, that we pass to the dispatch function */
340 state->tmp = state->orig;
342 subreq = cli->dispatch_send(state, ev, cli,
343 &ndr_table_samr,
344 NDR_SAMR_SETSECURITY,
345 &state->tmp);
346 if (tevent_req_nomem(subreq, req)) {
347 return tevent_req_post(req, ev);
349 tevent_req_set_callback(subreq, rpccli_samr_SetSecurity_done, req);
350 return req;
353 static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq)
355 struct tevent_req *req = tevent_req_callback_data(
356 subreq, struct tevent_req);
357 struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
358 req, struct rpccli_samr_SetSecurity_state);
359 NTSTATUS status;
360 TALLOC_CTX *mem_ctx;
362 if (state->out_mem_ctx) {
363 mem_ctx = state->out_mem_ctx;
364 } else {
365 mem_ctx = state;
368 status = state->dispatch_recv(subreq, mem_ctx);
369 TALLOC_FREE(subreq);
370 if (!NT_STATUS_IS_OK(status)) {
371 tevent_req_nterror(req, status);
372 return;
375 /* Copy out parameters */
377 /* Copy result */
378 state->orig.out.result = state->tmp.out.result;
380 /* Reset temporary structure */
381 ZERO_STRUCT(state->tmp);
383 tevent_req_done(req);
386 NTSTATUS rpccli_samr_SetSecurity_recv(struct tevent_req *req,
387 TALLOC_CTX *mem_ctx,
388 NTSTATUS *result)
390 struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
391 req, struct rpccli_samr_SetSecurity_state);
392 NTSTATUS status;
394 if (tevent_req_is_nterror(req, &status)) {
395 tevent_req_received(req);
396 return status;
399 /* Steal possbile out parameters to the callers context */
400 talloc_steal(mem_ctx, state->out_mem_ctx);
402 /* Return result */
403 *result = state->orig.out.result;
405 tevent_req_received(req);
406 return NT_STATUS_OK;
409 NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
410 TALLOC_CTX *mem_ctx,
411 struct policy_handle *handle /* [in] [ref] */,
412 uint32_t sec_info /* [in] */,
413 struct sec_desc_buf *sdbuf /* [in] [ref] */)
415 struct samr_SetSecurity r;
416 NTSTATUS status;
418 /* In parameters */
419 r.in.handle = handle;
420 r.in.sec_info = sec_info;
421 r.in.sdbuf = sdbuf;
423 status = cli->dispatch(cli,
424 mem_ctx,
425 &ndr_table_samr,
426 NDR_SAMR_SETSECURITY,
427 &r);
429 if (!NT_STATUS_IS_OK(status)) {
430 return status;
433 if (NT_STATUS_IS_ERR(status)) {
434 return status;
437 /* Return variables */
439 /* Return result */
440 return r.out.result;
443 struct rpccli_samr_QuerySecurity_state {
444 struct samr_QuerySecurity orig;
445 struct samr_QuerySecurity tmp;
446 TALLOC_CTX *out_mem_ctx;
447 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
450 static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq);
452 struct tevent_req *rpccli_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
453 struct tevent_context *ev,
454 struct rpc_pipe_client *cli,
455 struct policy_handle *_handle /* [in] [ref] */,
456 uint32_t _sec_info /* [in] */,
457 struct sec_desc_buf **_sdbuf /* [out] [ref] */)
459 struct tevent_req *req;
460 struct rpccli_samr_QuerySecurity_state *state;
461 struct tevent_req *subreq;
463 req = tevent_req_create(mem_ctx, &state,
464 struct rpccli_samr_QuerySecurity_state);
465 if (req == NULL) {
466 return NULL;
468 state->out_mem_ctx = NULL;
469 state->dispatch_recv = cli->dispatch_recv;
471 /* In parameters */
472 state->orig.in.handle = _handle;
473 state->orig.in.sec_info = _sec_info;
475 /* Out parameters */
476 state->orig.out.sdbuf = _sdbuf;
478 /* Result */
479 ZERO_STRUCT(state->orig.out.result);
481 state->out_mem_ctx = talloc_named_const(state, 0,
482 "rpccli_samr_QuerySecurity_out_memory");
483 if (tevent_req_nomem(state->out_mem_ctx, req)) {
484 return tevent_req_post(req, ev);
487 /* make a temporary copy, that we pass to the dispatch function */
488 state->tmp = state->orig;
490 subreq = cli->dispatch_send(state, ev, cli,
491 &ndr_table_samr,
492 NDR_SAMR_QUERYSECURITY,
493 &state->tmp);
494 if (tevent_req_nomem(subreq, req)) {
495 return tevent_req_post(req, ev);
497 tevent_req_set_callback(subreq, rpccli_samr_QuerySecurity_done, req);
498 return req;
501 static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq)
503 struct tevent_req *req = tevent_req_callback_data(
504 subreq, struct tevent_req);
505 struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
506 req, struct rpccli_samr_QuerySecurity_state);
507 NTSTATUS status;
508 TALLOC_CTX *mem_ctx;
510 if (state->out_mem_ctx) {
511 mem_ctx = state->out_mem_ctx;
512 } else {
513 mem_ctx = state;
516 status = state->dispatch_recv(subreq, mem_ctx);
517 TALLOC_FREE(subreq);
518 if (!NT_STATUS_IS_OK(status)) {
519 tevent_req_nterror(req, status);
520 return;
523 /* Copy out parameters */
524 *state->orig.out.sdbuf = *state->tmp.out.sdbuf;
526 /* Copy result */
527 state->orig.out.result = state->tmp.out.result;
529 /* Reset temporary structure */
530 ZERO_STRUCT(state->tmp);
532 tevent_req_done(req);
535 NTSTATUS rpccli_samr_QuerySecurity_recv(struct tevent_req *req,
536 TALLOC_CTX *mem_ctx,
537 NTSTATUS *result)
539 struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
540 req, struct rpccli_samr_QuerySecurity_state);
541 NTSTATUS status;
543 if (tevent_req_is_nterror(req, &status)) {
544 tevent_req_received(req);
545 return status;
548 /* Steal possbile out parameters to the callers context */
549 talloc_steal(mem_ctx, state->out_mem_ctx);
551 /* Return result */
552 *result = state->orig.out.result;
554 tevent_req_received(req);
555 return NT_STATUS_OK;
558 NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
559 TALLOC_CTX *mem_ctx,
560 struct policy_handle *handle /* [in] [ref] */,
561 uint32_t sec_info /* [in] */,
562 struct sec_desc_buf **sdbuf /* [out] [ref] */)
564 struct samr_QuerySecurity r;
565 NTSTATUS status;
567 /* In parameters */
568 r.in.handle = handle;
569 r.in.sec_info = sec_info;
571 status = cli->dispatch(cli,
572 mem_ctx,
573 &ndr_table_samr,
574 NDR_SAMR_QUERYSECURITY,
575 &r);
577 if (!NT_STATUS_IS_OK(status)) {
578 return status;
581 if (NT_STATUS_IS_ERR(status)) {
582 return status;
585 /* Return variables */
586 *sdbuf = *r.out.sdbuf;
588 /* Return result */
589 return r.out.result;
592 struct rpccli_samr_Shutdown_state {
593 struct samr_Shutdown orig;
594 struct samr_Shutdown tmp;
595 TALLOC_CTX *out_mem_ctx;
596 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
599 static void rpccli_samr_Shutdown_done(struct tevent_req *subreq);
601 struct tevent_req *rpccli_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
602 struct tevent_context *ev,
603 struct rpc_pipe_client *cli,
604 struct policy_handle *_connect_handle /* [in] [ref] */)
606 struct tevent_req *req;
607 struct rpccli_samr_Shutdown_state *state;
608 struct tevent_req *subreq;
610 req = tevent_req_create(mem_ctx, &state,
611 struct rpccli_samr_Shutdown_state);
612 if (req == NULL) {
613 return NULL;
615 state->out_mem_ctx = NULL;
616 state->dispatch_recv = cli->dispatch_recv;
618 /* In parameters */
619 state->orig.in.connect_handle = _connect_handle;
621 /* Out parameters */
623 /* Result */
624 ZERO_STRUCT(state->orig.out.result);
626 /* make a temporary copy, that we pass to the dispatch function */
627 state->tmp = state->orig;
629 subreq = cli->dispatch_send(state, ev, cli,
630 &ndr_table_samr,
631 NDR_SAMR_SHUTDOWN,
632 &state->tmp);
633 if (tevent_req_nomem(subreq, req)) {
634 return tevent_req_post(req, ev);
636 tevent_req_set_callback(subreq, rpccli_samr_Shutdown_done, req);
637 return req;
640 static void rpccli_samr_Shutdown_done(struct tevent_req *subreq)
642 struct tevent_req *req = tevent_req_callback_data(
643 subreq, struct tevent_req);
644 struct rpccli_samr_Shutdown_state *state = tevent_req_data(
645 req, struct rpccli_samr_Shutdown_state);
646 NTSTATUS status;
647 TALLOC_CTX *mem_ctx;
649 if (state->out_mem_ctx) {
650 mem_ctx = state->out_mem_ctx;
651 } else {
652 mem_ctx = state;
655 status = state->dispatch_recv(subreq, mem_ctx);
656 TALLOC_FREE(subreq);
657 if (!NT_STATUS_IS_OK(status)) {
658 tevent_req_nterror(req, status);
659 return;
662 /* Copy out parameters */
664 /* Copy result */
665 state->orig.out.result = state->tmp.out.result;
667 /* Reset temporary structure */
668 ZERO_STRUCT(state->tmp);
670 tevent_req_done(req);
673 NTSTATUS rpccli_samr_Shutdown_recv(struct tevent_req *req,
674 TALLOC_CTX *mem_ctx,
675 NTSTATUS *result)
677 struct rpccli_samr_Shutdown_state *state = tevent_req_data(
678 req, struct rpccli_samr_Shutdown_state);
679 NTSTATUS status;
681 if (tevent_req_is_nterror(req, &status)) {
682 tevent_req_received(req);
683 return status;
686 /* Steal possbile out parameters to the callers context */
687 talloc_steal(mem_ctx, state->out_mem_ctx);
689 /* Return result */
690 *result = state->orig.out.result;
692 tevent_req_received(req);
693 return NT_STATUS_OK;
696 NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
697 TALLOC_CTX *mem_ctx,
698 struct policy_handle *connect_handle /* [in] [ref] */)
700 struct samr_Shutdown r;
701 NTSTATUS status;
703 /* In parameters */
704 r.in.connect_handle = connect_handle;
706 status = cli->dispatch(cli,
707 mem_ctx,
708 &ndr_table_samr,
709 NDR_SAMR_SHUTDOWN,
710 &r);
712 if (!NT_STATUS_IS_OK(status)) {
713 return status;
716 if (NT_STATUS_IS_ERR(status)) {
717 return status;
720 /* Return variables */
722 /* Return result */
723 return r.out.result;
726 struct rpccli_samr_LookupDomain_state {
727 struct samr_LookupDomain orig;
728 struct samr_LookupDomain tmp;
729 TALLOC_CTX *out_mem_ctx;
730 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
733 static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq);
735 struct tevent_req *rpccli_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
736 struct tevent_context *ev,
737 struct rpc_pipe_client *cli,
738 struct policy_handle *_connect_handle /* [in] [ref] */,
739 struct lsa_String *_domain_name /* [in] [ref] */,
740 struct dom_sid2 **_sid /* [out] [ref] */)
742 struct tevent_req *req;
743 struct rpccli_samr_LookupDomain_state *state;
744 struct tevent_req *subreq;
746 req = tevent_req_create(mem_ctx, &state,
747 struct rpccli_samr_LookupDomain_state);
748 if (req == NULL) {
749 return NULL;
751 state->out_mem_ctx = NULL;
752 state->dispatch_recv = cli->dispatch_recv;
754 /* In parameters */
755 state->orig.in.connect_handle = _connect_handle;
756 state->orig.in.domain_name = _domain_name;
758 /* Out parameters */
759 state->orig.out.sid = _sid;
761 /* Result */
762 ZERO_STRUCT(state->orig.out.result);
764 state->out_mem_ctx = talloc_named_const(state, 0,
765 "rpccli_samr_LookupDomain_out_memory");
766 if (tevent_req_nomem(state->out_mem_ctx, req)) {
767 return tevent_req_post(req, ev);
770 /* make a temporary copy, that we pass to the dispatch function */
771 state->tmp = state->orig;
773 subreq = cli->dispatch_send(state, ev, cli,
774 &ndr_table_samr,
775 NDR_SAMR_LOOKUPDOMAIN,
776 &state->tmp);
777 if (tevent_req_nomem(subreq, req)) {
778 return tevent_req_post(req, ev);
780 tevent_req_set_callback(subreq, rpccli_samr_LookupDomain_done, req);
781 return req;
784 static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq)
786 struct tevent_req *req = tevent_req_callback_data(
787 subreq, struct tevent_req);
788 struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
789 req, struct rpccli_samr_LookupDomain_state);
790 NTSTATUS status;
791 TALLOC_CTX *mem_ctx;
793 if (state->out_mem_ctx) {
794 mem_ctx = state->out_mem_ctx;
795 } else {
796 mem_ctx = state;
799 status = state->dispatch_recv(subreq, mem_ctx);
800 TALLOC_FREE(subreq);
801 if (!NT_STATUS_IS_OK(status)) {
802 tevent_req_nterror(req, status);
803 return;
806 /* Copy out parameters */
807 *state->orig.out.sid = *state->tmp.out.sid;
809 /* Copy result */
810 state->orig.out.result = state->tmp.out.result;
812 /* Reset temporary structure */
813 ZERO_STRUCT(state->tmp);
815 tevent_req_done(req);
818 NTSTATUS rpccli_samr_LookupDomain_recv(struct tevent_req *req,
819 TALLOC_CTX *mem_ctx,
820 NTSTATUS *result)
822 struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
823 req, struct rpccli_samr_LookupDomain_state);
824 NTSTATUS status;
826 if (tevent_req_is_nterror(req, &status)) {
827 tevent_req_received(req);
828 return status;
831 /* Steal possbile out parameters to the callers context */
832 talloc_steal(mem_ctx, state->out_mem_ctx);
834 /* Return result */
835 *result = state->orig.out.result;
837 tevent_req_received(req);
838 return NT_STATUS_OK;
841 NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
842 TALLOC_CTX *mem_ctx,
843 struct policy_handle *connect_handle /* [in] [ref] */,
844 struct lsa_String *domain_name /* [in] [ref] */,
845 struct dom_sid2 **sid /* [out] [ref] */)
847 struct samr_LookupDomain r;
848 NTSTATUS status;
850 /* In parameters */
851 r.in.connect_handle = connect_handle;
852 r.in.domain_name = domain_name;
854 status = cli->dispatch(cli,
855 mem_ctx,
856 &ndr_table_samr,
857 NDR_SAMR_LOOKUPDOMAIN,
858 &r);
860 if (!NT_STATUS_IS_OK(status)) {
861 return status;
864 if (NT_STATUS_IS_ERR(status)) {
865 return status;
868 /* Return variables */
869 *sid = *r.out.sid;
871 /* Return result */
872 return r.out.result;
875 struct rpccli_samr_EnumDomains_state {
876 struct samr_EnumDomains orig;
877 struct samr_EnumDomains tmp;
878 TALLOC_CTX *out_mem_ctx;
879 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
882 static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq);
884 struct tevent_req *rpccli_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
885 struct tevent_context *ev,
886 struct rpc_pipe_client *cli,
887 struct policy_handle *_connect_handle /* [in] [ref] */,
888 uint32_t *_resume_handle /* [in,out] [ref] */,
889 struct samr_SamArray **_sam /* [out] [ref] */,
890 uint32_t _buf_size /* [in] */,
891 uint32_t *_num_entries /* [out] [ref] */)
893 struct tevent_req *req;
894 struct rpccli_samr_EnumDomains_state *state;
895 struct tevent_req *subreq;
897 req = tevent_req_create(mem_ctx, &state,
898 struct rpccli_samr_EnumDomains_state);
899 if (req == NULL) {
900 return NULL;
902 state->out_mem_ctx = NULL;
903 state->dispatch_recv = cli->dispatch_recv;
905 /* In parameters */
906 state->orig.in.connect_handle = _connect_handle;
907 state->orig.in.resume_handle = _resume_handle;
908 state->orig.in.buf_size = _buf_size;
910 /* Out parameters */
911 state->orig.out.resume_handle = _resume_handle;
912 state->orig.out.sam = _sam;
913 state->orig.out.num_entries = _num_entries;
915 /* Result */
916 ZERO_STRUCT(state->orig.out.result);
918 state->out_mem_ctx = talloc_named_const(state, 0,
919 "rpccli_samr_EnumDomains_out_memory");
920 if (tevent_req_nomem(state->out_mem_ctx, req)) {
921 return tevent_req_post(req, ev);
924 /* make a temporary copy, that we pass to the dispatch function */
925 state->tmp = state->orig;
927 subreq = cli->dispatch_send(state, ev, cli,
928 &ndr_table_samr,
929 NDR_SAMR_ENUMDOMAINS,
930 &state->tmp);
931 if (tevent_req_nomem(subreq, req)) {
932 return tevent_req_post(req, ev);
934 tevent_req_set_callback(subreq, rpccli_samr_EnumDomains_done, req);
935 return req;
938 static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq)
940 struct tevent_req *req = tevent_req_callback_data(
941 subreq, struct tevent_req);
942 struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
943 req, struct rpccli_samr_EnumDomains_state);
944 NTSTATUS status;
945 TALLOC_CTX *mem_ctx;
947 if (state->out_mem_ctx) {
948 mem_ctx = state->out_mem_ctx;
949 } else {
950 mem_ctx = state;
953 status = state->dispatch_recv(subreq, mem_ctx);
954 TALLOC_FREE(subreq);
955 if (!NT_STATUS_IS_OK(status)) {
956 tevent_req_nterror(req, status);
957 return;
960 /* Copy out parameters */
961 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
962 *state->orig.out.sam = *state->tmp.out.sam;
963 *state->orig.out.num_entries = *state->tmp.out.num_entries;
965 /* Copy result */
966 state->orig.out.result = state->tmp.out.result;
968 /* Reset temporary structure */
969 ZERO_STRUCT(state->tmp);
971 tevent_req_done(req);
974 NTSTATUS rpccli_samr_EnumDomains_recv(struct tevent_req *req,
975 TALLOC_CTX *mem_ctx,
976 NTSTATUS *result)
978 struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
979 req, struct rpccli_samr_EnumDomains_state);
980 NTSTATUS status;
982 if (tevent_req_is_nterror(req, &status)) {
983 tevent_req_received(req);
984 return status;
987 /* Steal possbile out parameters to the callers context */
988 talloc_steal(mem_ctx, state->out_mem_ctx);
990 /* Return result */
991 *result = state->orig.out.result;
993 tevent_req_received(req);
994 return NT_STATUS_OK;
997 NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
998 TALLOC_CTX *mem_ctx,
999 struct policy_handle *connect_handle /* [in] [ref] */,
1000 uint32_t *resume_handle /* [in,out] [ref] */,
1001 struct samr_SamArray **sam /* [out] [ref] */,
1002 uint32_t buf_size /* [in] */,
1003 uint32_t *num_entries /* [out] [ref] */)
1005 struct samr_EnumDomains r;
1006 NTSTATUS status;
1008 /* In parameters */
1009 r.in.connect_handle = connect_handle;
1010 r.in.resume_handle = resume_handle;
1011 r.in.buf_size = buf_size;
1013 status = cli->dispatch(cli,
1014 mem_ctx,
1015 &ndr_table_samr,
1016 NDR_SAMR_ENUMDOMAINS,
1017 &r);
1019 if (!NT_STATUS_IS_OK(status)) {
1020 return status;
1023 if (NT_STATUS_IS_ERR(status)) {
1024 return status;
1027 /* Return variables */
1028 *resume_handle = *r.out.resume_handle;
1029 *sam = *r.out.sam;
1030 *num_entries = *r.out.num_entries;
1032 /* Return result */
1033 return r.out.result;
1036 struct rpccli_samr_OpenDomain_state {
1037 struct samr_OpenDomain orig;
1038 struct samr_OpenDomain tmp;
1039 TALLOC_CTX *out_mem_ctx;
1040 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1043 static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq);
1045 struct tevent_req *rpccli_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
1046 struct tevent_context *ev,
1047 struct rpc_pipe_client *cli,
1048 struct policy_handle *_connect_handle /* [in] [ref] */,
1049 uint32_t _access_mask /* [in] */,
1050 struct dom_sid2 *_sid /* [in] [ref] */,
1051 struct policy_handle *_domain_handle /* [out] [ref] */)
1053 struct tevent_req *req;
1054 struct rpccli_samr_OpenDomain_state *state;
1055 struct tevent_req *subreq;
1057 req = tevent_req_create(mem_ctx, &state,
1058 struct rpccli_samr_OpenDomain_state);
1059 if (req == NULL) {
1060 return NULL;
1062 state->out_mem_ctx = NULL;
1063 state->dispatch_recv = cli->dispatch_recv;
1065 /* In parameters */
1066 state->orig.in.connect_handle = _connect_handle;
1067 state->orig.in.access_mask = _access_mask;
1068 state->orig.in.sid = _sid;
1070 /* Out parameters */
1071 state->orig.out.domain_handle = _domain_handle;
1073 /* Result */
1074 ZERO_STRUCT(state->orig.out.result);
1076 state->out_mem_ctx = talloc_named_const(state, 0,
1077 "rpccli_samr_OpenDomain_out_memory");
1078 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1079 return tevent_req_post(req, ev);
1082 /* make a temporary copy, that we pass to the dispatch function */
1083 state->tmp = state->orig;
1085 subreq = cli->dispatch_send(state, ev, cli,
1086 &ndr_table_samr,
1087 NDR_SAMR_OPENDOMAIN,
1088 &state->tmp);
1089 if (tevent_req_nomem(subreq, req)) {
1090 return tevent_req_post(req, ev);
1092 tevent_req_set_callback(subreq, rpccli_samr_OpenDomain_done, req);
1093 return req;
1096 static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq)
1098 struct tevent_req *req = tevent_req_callback_data(
1099 subreq, struct tevent_req);
1100 struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
1101 req, struct rpccli_samr_OpenDomain_state);
1102 NTSTATUS status;
1103 TALLOC_CTX *mem_ctx;
1105 if (state->out_mem_ctx) {
1106 mem_ctx = state->out_mem_ctx;
1107 } else {
1108 mem_ctx = state;
1111 status = state->dispatch_recv(subreq, mem_ctx);
1112 TALLOC_FREE(subreq);
1113 if (!NT_STATUS_IS_OK(status)) {
1114 tevent_req_nterror(req, status);
1115 return;
1118 /* Copy out parameters */
1119 *state->orig.out.domain_handle = *state->tmp.out.domain_handle;
1121 /* Copy result */
1122 state->orig.out.result = state->tmp.out.result;
1124 /* Reset temporary structure */
1125 ZERO_STRUCT(state->tmp);
1127 tevent_req_done(req);
1130 NTSTATUS rpccli_samr_OpenDomain_recv(struct tevent_req *req,
1131 TALLOC_CTX *mem_ctx,
1132 NTSTATUS *result)
1134 struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
1135 req, struct rpccli_samr_OpenDomain_state);
1136 NTSTATUS status;
1138 if (tevent_req_is_nterror(req, &status)) {
1139 tevent_req_received(req);
1140 return status;
1143 /* Steal possbile out parameters to the callers context */
1144 talloc_steal(mem_ctx, state->out_mem_ctx);
1146 /* Return result */
1147 *result = state->orig.out.result;
1149 tevent_req_received(req);
1150 return NT_STATUS_OK;
1153 NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
1154 TALLOC_CTX *mem_ctx,
1155 struct policy_handle *connect_handle /* [in] [ref] */,
1156 uint32_t access_mask /* [in] */,
1157 struct dom_sid2 *sid /* [in] [ref] */,
1158 struct policy_handle *domain_handle /* [out] [ref] */)
1160 struct samr_OpenDomain r;
1161 NTSTATUS status;
1163 /* In parameters */
1164 r.in.connect_handle = connect_handle;
1165 r.in.access_mask = access_mask;
1166 r.in.sid = sid;
1168 status = cli->dispatch(cli,
1169 mem_ctx,
1170 &ndr_table_samr,
1171 NDR_SAMR_OPENDOMAIN,
1172 &r);
1174 if (!NT_STATUS_IS_OK(status)) {
1175 return status;
1178 if (NT_STATUS_IS_ERR(status)) {
1179 return status;
1182 /* Return variables */
1183 *domain_handle = *r.out.domain_handle;
1185 /* Return result */
1186 return r.out.result;
1189 struct rpccli_samr_QueryDomainInfo_state {
1190 struct samr_QueryDomainInfo orig;
1191 struct samr_QueryDomainInfo tmp;
1192 TALLOC_CTX *out_mem_ctx;
1193 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1196 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq);
1198 struct tevent_req *rpccli_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
1199 struct tevent_context *ev,
1200 struct rpc_pipe_client *cli,
1201 struct policy_handle *_domain_handle /* [in] [ref] */,
1202 enum samr_DomainInfoClass _level /* [in] */,
1203 union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
1205 struct tevent_req *req;
1206 struct rpccli_samr_QueryDomainInfo_state *state;
1207 struct tevent_req *subreq;
1209 req = tevent_req_create(mem_ctx, &state,
1210 struct rpccli_samr_QueryDomainInfo_state);
1211 if (req == NULL) {
1212 return NULL;
1214 state->out_mem_ctx = NULL;
1215 state->dispatch_recv = cli->dispatch_recv;
1217 /* In parameters */
1218 state->orig.in.domain_handle = _domain_handle;
1219 state->orig.in.level = _level;
1221 /* Out parameters */
1222 state->orig.out.info = _info;
1224 /* Result */
1225 ZERO_STRUCT(state->orig.out.result);
1227 state->out_mem_ctx = talloc_named_const(state, 0,
1228 "rpccli_samr_QueryDomainInfo_out_memory");
1229 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1230 return tevent_req_post(req, ev);
1233 /* make a temporary copy, that we pass to the dispatch function */
1234 state->tmp = state->orig;
1236 subreq = cli->dispatch_send(state, ev, cli,
1237 &ndr_table_samr,
1238 NDR_SAMR_QUERYDOMAININFO,
1239 &state->tmp);
1240 if (tevent_req_nomem(subreq, req)) {
1241 return tevent_req_post(req, ev);
1243 tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo_done, req);
1244 return req;
1247 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq)
1249 struct tevent_req *req = tevent_req_callback_data(
1250 subreq, struct tevent_req);
1251 struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
1252 req, struct rpccli_samr_QueryDomainInfo_state);
1253 NTSTATUS status;
1254 TALLOC_CTX *mem_ctx;
1256 if (state->out_mem_ctx) {
1257 mem_ctx = state->out_mem_ctx;
1258 } else {
1259 mem_ctx = state;
1262 status = state->dispatch_recv(subreq, mem_ctx);
1263 TALLOC_FREE(subreq);
1264 if (!NT_STATUS_IS_OK(status)) {
1265 tevent_req_nterror(req, status);
1266 return;
1269 /* Copy out parameters */
1270 *state->orig.out.info = *state->tmp.out.info;
1272 /* Copy result */
1273 state->orig.out.result = state->tmp.out.result;
1275 /* Reset temporary structure */
1276 ZERO_STRUCT(state->tmp);
1278 tevent_req_done(req);
1281 NTSTATUS rpccli_samr_QueryDomainInfo_recv(struct tevent_req *req,
1282 TALLOC_CTX *mem_ctx,
1283 NTSTATUS *result)
1285 struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
1286 req, struct rpccli_samr_QueryDomainInfo_state);
1287 NTSTATUS status;
1289 if (tevent_req_is_nterror(req, &status)) {
1290 tevent_req_received(req);
1291 return status;
1294 /* Steal possbile out parameters to the callers context */
1295 talloc_steal(mem_ctx, state->out_mem_ctx);
1297 /* Return result */
1298 *result = state->orig.out.result;
1300 tevent_req_received(req);
1301 return NT_STATUS_OK;
1304 NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
1305 TALLOC_CTX *mem_ctx,
1306 struct policy_handle *domain_handle /* [in] [ref] */,
1307 enum samr_DomainInfoClass level /* [in] */,
1308 union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
1310 struct samr_QueryDomainInfo r;
1311 NTSTATUS status;
1313 /* In parameters */
1314 r.in.domain_handle = domain_handle;
1315 r.in.level = level;
1317 status = cli->dispatch(cli,
1318 mem_ctx,
1319 &ndr_table_samr,
1320 NDR_SAMR_QUERYDOMAININFO,
1321 &r);
1323 if (!NT_STATUS_IS_OK(status)) {
1324 return status;
1327 if (NT_STATUS_IS_ERR(status)) {
1328 return status;
1331 /* Return variables */
1332 *info = *r.out.info;
1334 /* Return result */
1335 return r.out.result;
1338 struct rpccli_samr_SetDomainInfo_state {
1339 struct samr_SetDomainInfo orig;
1340 struct samr_SetDomainInfo tmp;
1341 TALLOC_CTX *out_mem_ctx;
1342 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1345 static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq);
1347 struct tevent_req *rpccli_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
1348 struct tevent_context *ev,
1349 struct rpc_pipe_client *cli,
1350 struct policy_handle *_domain_handle /* [in] [ref] */,
1351 enum samr_DomainInfoClass _level /* [in] */,
1352 union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */)
1354 struct tevent_req *req;
1355 struct rpccli_samr_SetDomainInfo_state *state;
1356 struct tevent_req *subreq;
1358 req = tevent_req_create(mem_ctx, &state,
1359 struct rpccli_samr_SetDomainInfo_state);
1360 if (req == NULL) {
1361 return NULL;
1363 state->out_mem_ctx = NULL;
1364 state->dispatch_recv = cli->dispatch_recv;
1366 /* In parameters */
1367 state->orig.in.domain_handle = _domain_handle;
1368 state->orig.in.level = _level;
1369 state->orig.in.info = _info;
1371 /* Out parameters */
1373 /* Result */
1374 ZERO_STRUCT(state->orig.out.result);
1376 /* make a temporary copy, that we pass to the dispatch function */
1377 state->tmp = state->orig;
1379 subreq = cli->dispatch_send(state, ev, cli,
1380 &ndr_table_samr,
1381 NDR_SAMR_SETDOMAININFO,
1382 &state->tmp);
1383 if (tevent_req_nomem(subreq, req)) {
1384 return tevent_req_post(req, ev);
1386 tevent_req_set_callback(subreq, rpccli_samr_SetDomainInfo_done, req);
1387 return req;
1390 static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq)
1392 struct tevent_req *req = tevent_req_callback_data(
1393 subreq, struct tevent_req);
1394 struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
1395 req, struct rpccli_samr_SetDomainInfo_state);
1396 NTSTATUS status;
1397 TALLOC_CTX *mem_ctx;
1399 if (state->out_mem_ctx) {
1400 mem_ctx = state->out_mem_ctx;
1401 } else {
1402 mem_ctx = state;
1405 status = state->dispatch_recv(subreq, mem_ctx);
1406 TALLOC_FREE(subreq);
1407 if (!NT_STATUS_IS_OK(status)) {
1408 tevent_req_nterror(req, status);
1409 return;
1412 /* Copy out parameters */
1414 /* Copy result */
1415 state->orig.out.result = state->tmp.out.result;
1417 /* Reset temporary structure */
1418 ZERO_STRUCT(state->tmp);
1420 tevent_req_done(req);
1423 NTSTATUS rpccli_samr_SetDomainInfo_recv(struct tevent_req *req,
1424 TALLOC_CTX *mem_ctx,
1425 NTSTATUS *result)
1427 struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
1428 req, struct rpccli_samr_SetDomainInfo_state);
1429 NTSTATUS status;
1431 if (tevent_req_is_nterror(req, &status)) {
1432 tevent_req_received(req);
1433 return status;
1436 /* Steal possbile out parameters to the callers context */
1437 talloc_steal(mem_ctx, state->out_mem_ctx);
1439 /* Return result */
1440 *result = state->orig.out.result;
1442 tevent_req_received(req);
1443 return NT_STATUS_OK;
1446 NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
1447 TALLOC_CTX *mem_ctx,
1448 struct policy_handle *domain_handle /* [in] [ref] */,
1449 enum samr_DomainInfoClass level /* [in] */,
1450 union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
1452 struct samr_SetDomainInfo r;
1453 NTSTATUS status;
1455 /* In parameters */
1456 r.in.domain_handle = domain_handle;
1457 r.in.level = level;
1458 r.in.info = info;
1460 status = cli->dispatch(cli,
1461 mem_ctx,
1462 &ndr_table_samr,
1463 NDR_SAMR_SETDOMAININFO,
1464 &r);
1466 if (!NT_STATUS_IS_OK(status)) {
1467 return status;
1470 if (NT_STATUS_IS_ERR(status)) {
1471 return status;
1474 /* Return variables */
1476 /* Return result */
1477 return r.out.result;
1480 struct rpccli_samr_CreateDomainGroup_state {
1481 struct samr_CreateDomainGroup orig;
1482 struct samr_CreateDomainGroup tmp;
1483 TALLOC_CTX *out_mem_ctx;
1484 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1487 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq);
1489 struct tevent_req *rpccli_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
1490 struct tevent_context *ev,
1491 struct rpc_pipe_client *cli,
1492 struct policy_handle *_domain_handle /* [in] [ref] */,
1493 struct lsa_String *_name /* [in] [ref] */,
1494 uint32_t _access_mask /* [in] */,
1495 struct policy_handle *_group_handle /* [out] [ref] */,
1496 uint32_t *_rid /* [out] [ref] */)
1498 struct tevent_req *req;
1499 struct rpccli_samr_CreateDomainGroup_state *state;
1500 struct tevent_req *subreq;
1502 req = tevent_req_create(mem_ctx, &state,
1503 struct rpccli_samr_CreateDomainGroup_state);
1504 if (req == NULL) {
1505 return NULL;
1507 state->out_mem_ctx = NULL;
1508 state->dispatch_recv = cli->dispatch_recv;
1510 /* In parameters */
1511 state->orig.in.domain_handle = _domain_handle;
1512 state->orig.in.name = _name;
1513 state->orig.in.access_mask = _access_mask;
1515 /* Out parameters */
1516 state->orig.out.group_handle = _group_handle;
1517 state->orig.out.rid = _rid;
1519 /* Result */
1520 ZERO_STRUCT(state->orig.out.result);
1522 state->out_mem_ctx = talloc_named_const(state, 0,
1523 "rpccli_samr_CreateDomainGroup_out_memory");
1524 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1525 return tevent_req_post(req, ev);
1528 /* make a temporary copy, that we pass to the dispatch function */
1529 state->tmp = state->orig;
1531 subreq = cli->dispatch_send(state, ev, cli,
1532 &ndr_table_samr,
1533 NDR_SAMR_CREATEDOMAINGROUP,
1534 &state->tmp);
1535 if (tevent_req_nomem(subreq, req)) {
1536 return tevent_req_post(req, ev);
1538 tevent_req_set_callback(subreq, rpccli_samr_CreateDomainGroup_done, req);
1539 return req;
1542 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq)
1544 struct tevent_req *req = tevent_req_callback_data(
1545 subreq, struct tevent_req);
1546 struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
1547 req, struct rpccli_samr_CreateDomainGroup_state);
1548 NTSTATUS status;
1549 TALLOC_CTX *mem_ctx;
1551 if (state->out_mem_ctx) {
1552 mem_ctx = state->out_mem_ctx;
1553 } else {
1554 mem_ctx = state;
1557 status = state->dispatch_recv(subreq, mem_ctx);
1558 TALLOC_FREE(subreq);
1559 if (!NT_STATUS_IS_OK(status)) {
1560 tevent_req_nterror(req, status);
1561 return;
1564 /* Copy out parameters */
1565 *state->orig.out.group_handle = *state->tmp.out.group_handle;
1566 *state->orig.out.rid = *state->tmp.out.rid;
1568 /* Copy result */
1569 state->orig.out.result = state->tmp.out.result;
1571 /* Reset temporary structure */
1572 ZERO_STRUCT(state->tmp);
1574 tevent_req_done(req);
1577 NTSTATUS rpccli_samr_CreateDomainGroup_recv(struct tevent_req *req,
1578 TALLOC_CTX *mem_ctx,
1579 NTSTATUS *result)
1581 struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
1582 req, struct rpccli_samr_CreateDomainGroup_state);
1583 NTSTATUS status;
1585 if (tevent_req_is_nterror(req, &status)) {
1586 tevent_req_received(req);
1587 return status;
1590 /* Steal possbile out parameters to the callers context */
1591 talloc_steal(mem_ctx, state->out_mem_ctx);
1593 /* Return result */
1594 *result = state->orig.out.result;
1596 tevent_req_received(req);
1597 return NT_STATUS_OK;
1600 NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
1601 TALLOC_CTX *mem_ctx,
1602 struct policy_handle *domain_handle /* [in] [ref] */,
1603 struct lsa_String *name /* [in] [ref] */,
1604 uint32_t access_mask /* [in] */,
1605 struct policy_handle *group_handle /* [out] [ref] */,
1606 uint32_t *rid /* [out] [ref] */)
1608 struct samr_CreateDomainGroup r;
1609 NTSTATUS status;
1611 /* In parameters */
1612 r.in.domain_handle = domain_handle;
1613 r.in.name = name;
1614 r.in.access_mask = access_mask;
1616 status = cli->dispatch(cli,
1617 mem_ctx,
1618 &ndr_table_samr,
1619 NDR_SAMR_CREATEDOMAINGROUP,
1620 &r);
1622 if (!NT_STATUS_IS_OK(status)) {
1623 return status;
1626 if (NT_STATUS_IS_ERR(status)) {
1627 return status;
1630 /* Return variables */
1631 *group_handle = *r.out.group_handle;
1632 *rid = *r.out.rid;
1634 /* Return result */
1635 return r.out.result;
1638 struct rpccli_samr_EnumDomainGroups_state {
1639 struct samr_EnumDomainGroups orig;
1640 struct samr_EnumDomainGroups tmp;
1641 TALLOC_CTX *out_mem_ctx;
1642 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1645 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq);
1647 struct tevent_req *rpccli_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
1648 struct tevent_context *ev,
1649 struct rpc_pipe_client *cli,
1650 struct policy_handle *_domain_handle /* [in] [ref] */,
1651 uint32_t *_resume_handle /* [in,out] [ref] */,
1652 struct samr_SamArray **_sam /* [out] [ref] */,
1653 uint32_t _max_size /* [in] */,
1654 uint32_t *_num_entries /* [out] [ref] */)
1656 struct tevent_req *req;
1657 struct rpccli_samr_EnumDomainGroups_state *state;
1658 struct tevent_req *subreq;
1660 req = tevent_req_create(mem_ctx, &state,
1661 struct rpccli_samr_EnumDomainGroups_state);
1662 if (req == NULL) {
1663 return NULL;
1665 state->out_mem_ctx = NULL;
1666 state->dispatch_recv = cli->dispatch_recv;
1668 /* In parameters */
1669 state->orig.in.domain_handle = _domain_handle;
1670 state->orig.in.resume_handle = _resume_handle;
1671 state->orig.in.max_size = _max_size;
1673 /* Out parameters */
1674 state->orig.out.resume_handle = _resume_handle;
1675 state->orig.out.sam = _sam;
1676 state->orig.out.num_entries = _num_entries;
1678 /* Result */
1679 ZERO_STRUCT(state->orig.out.result);
1681 state->out_mem_ctx = talloc_named_const(state, 0,
1682 "rpccli_samr_EnumDomainGroups_out_memory");
1683 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1684 return tevent_req_post(req, ev);
1687 /* make a temporary copy, that we pass to the dispatch function */
1688 state->tmp = state->orig;
1690 subreq = cli->dispatch_send(state, ev, cli,
1691 &ndr_table_samr,
1692 NDR_SAMR_ENUMDOMAINGROUPS,
1693 &state->tmp);
1694 if (tevent_req_nomem(subreq, req)) {
1695 return tevent_req_post(req, ev);
1697 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainGroups_done, req);
1698 return req;
1701 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq)
1703 struct tevent_req *req = tevent_req_callback_data(
1704 subreq, struct tevent_req);
1705 struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
1706 req, struct rpccli_samr_EnumDomainGroups_state);
1707 NTSTATUS status;
1708 TALLOC_CTX *mem_ctx;
1710 if (state->out_mem_ctx) {
1711 mem_ctx = state->out_mem_ctx;
1712 } else {
1713 mem_ctx = state;
1716 status = state->dispatch_recv(subreq, mem_ctx);
1717 TALLOC_FREE(subreq);
1718 if (!NT_STATUS_IS_OK(status)) {
1719 tevent_req_nterror(req, status);
1720 return;
1723 /* Copy out parameters */
1724 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
1725 *state->orig.out.sam = *state->tmp.out.sam;
1726 *state->orig.out.num_entries = *state->tmp.out.num_entries;
1728 /* Copy result */
1729 state->orig.out.result = state->tmp.out.result;
1731 /* Reset temporary structure */
1732 ZERO_STRUCT(state->tmp);
1734 tevent_req_done(req);
1737 NTSTATUS rpccli_samr_EnumDomainGroups_recv(struct tevent_req *req,
1738 TALLOC_CTX *mem_ctx,
1739 NTSTATUS *result)
1741 struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
1742 req, struct rpccli_samr_EnumDomainGroups_state);
1743 NTSTATUS status;
1745 if (tevent_req_is_nterror(req, &status)) {
1746 tevent_req_received(req);
1747 return status;
1750 /* Steal possbile out parameters to the callers context */
1751 talloc_steal(mem_ctx, state->out_mem_ctx);
1753 /* Return result */
1754 *result = state->orig.out.result;
1756 tevent_req_received(req);
1757 return NT_STATUS_OK;
1760 NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
1761 TALLOC_CTX *mem_ctx,
1762 struct policy_handle *domain_handle /* [in] [ref] */,
1763 uint32_t *resume_handle /* [in,out] [ref] */,
1764 struct samr_SamArray **sam /* [out] [ref] */,
1765 uint32_t max_size /* [in] */,
1766 uint32_t *num_entries /* [out] [ref] */)
1768 struct samr_EnumDomainGroups r;
1769 NTSTATUS status;
1771 /* In parameters */
1772 r.in.domain_handle = domain_handle;
1773 r.in.resume_handle = resume_handle;
1774 r.in.max_size = max_size;
1776 status = cli->dispatch(cli,
1777 mem_ctx,
1778 &ndr_table_samr,
1779 NDR_SAMR_ENUMDOMAINGROUPS,
1780 &r);
1782 if (!NT_STATUS_IS_OK(status)) {
1783 return status;
1786 if (NT_STATUS_IS_ERR(status)) {
1787 return status;
1790 /* Return variables */
1791 *resume_handle = *r.out.resume_handle;
1792 *sam = *r.out.sam;
1793 *num_entries = *r.out.num_entries;
1795 /* Return result */
1796 return r.out.result;
1799 struct rpccli_samr_CreateUser_state {
1800 struct samr_CreateUser orig;
1801 struct samr_CreateUser tmp;
1802 TALLOC_CTX *out_mem_ctx;
1803 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1806 static void rpccli_samr_CreateUser_done(struct tevent_req *subreq);
1808 struct tevent_req *rpccli_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
1809 struct tevent_context *ev,
1810 struct rpc_pipe_client *cli,
1811 struct policy_handle *_domain_handle /* [in] [ref] */,
1812 struct lsa_String *_account_name /* [in] [ref] */,
1813 uint32_t _access_mask /* [in] */,
1814 struct policy_handle *_user_handle /* [out] [ref] */,
1815 uint32_t *_rid /* [out] [ref] */)
1817 struct tevent_req *req;
1818 struct rpccli_samr_CreateUser_state *state;
1819 struct tevent_req *subreq;
1821 req = tevent_req_create(mem_ctx, &state,
1822 struct rpccli_samr_CreateUser_state);
1823 if (req == NULL) {
1824 return NULL;
1826 state->out_mem_ctx = NULL;
1827 state->dispatch_recv = cli->dispatch_recv;
1829 /* In parameters */
1830 state->orig.in.domain_handle = _domain_handle;
1831 state->orig.in.account_name = _account_name;
1832 state->orig.in.access_mask = _access_mask;
1834 /* Out parameters */
1835 state->orig.out.user_handle = _user_handle;
1836 state->orig.out.rid = _rid;
1838 /* Result */
1839 ZERO_STRUCT(state->orig.out.result);
1841 state->out_mem_ctx = talloc_named_const(state, 0,
1842 "rpccli_samr_CreateUser_out_memory");
1843 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1844 return tevent_req_post(req, ev);
1847 /* make a temporary copy, that we pass to the dispatch function */
1848 state->tmp = state->orig;
1850 subreq = cli->dispatch_send(state, ev, cli,
1851 &ndr_table_samr,
1852 NDR_SAMR_CREATEUSER,
1853 &state->tmp);
1854 if (tevent_req_nomem(subreq, req)) {
1855 return tevent_req_post(req, ev);
1857 tevent_req_set_callback(subreq, rpccli_samr_CreateUser_done, req);
1858 return req;
1861 static void rpccli_samr_CreateUser_done(struct tevent_req *subreq)
1863 struct tevent_req *req = tevent_req_callback_data(
1864 subreq, struct tevent_req);
1865 struct rpccli_samr_CreateUser_state *state = tevent_req_data(
1866 req, struct rpccli_samr_CreateUser_state);
1867 NTSTATUS status;
1868 TALLOC_CTX *mem_ctx;
1870 if (state->out_mem_ctx) {
1871 mem_ctx = state->out_mem_ctx;
1872 } else {
1873 mem_ctx = state;
1876 status = state->dispatch_recv(subreq, mem_ctx);
1877 TALLOC_FREE(subreq);
1878 if (!NT_STATUS_IS_OK(status)) {
1879 tevent_req_nterror(req, status);
1880 return;
1883 /* Copy out parameters */
1884 *state->orig.out.user_handle = *state->tmp.out.user_handle;
1885 *state->orig.out.rid = *state->tmp.out.rid;
1887 /* Copy result */
1888 state->orig.out.result = state->tmp.out.result;
1890 /* Reset temporary structure */
1891 ZERO_STRUCT(state->tmp);
1893 tevent_req_done(req);
1896 NTSTATUS rpccli_samr_CreateUser_recv(struct tevent_req *req,
1897 TALLOC_CTX *mem_ctx,
1898 NTSTATUS *result)
1900 struct rpccli_samr_CreateUser_state *state = tevent_req_data(
1901 req, struct rpccli_samr_CreateUser_state);
1902 NTSTATUS status;
1904 if (tevent_req_is_nterror(req, &status)) {
1905 tevent_req_received(req);
1906 return status;
1909 /* Steal possbile out parameters to the callers context */
1910 talloc_steal(mem_ctx, state->out_mem_ctx);
1912 /* Return result */
1913 *result = state->orig.out.result;
1915 tevent_req_received(req);
1916 return NT_STATUS_OK;
1919 NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
1920 TALLOC_CTX *mem_ctx,
1921 struct policy_handle *domain_handle /* [in] [ref] */,
1922 struct lsa_String *account_name /* [in] [ref] */,
1923 uint32_t access_mask /* [in] */,
1924 struct policy_handle *user_handle /* [out] [ref] */,
1925 uint32_t *rid /* [out] [ref] */)
1927 struct samr_CreateUser r;
1928 NTSTATUS status;
1930 /* In parameters */
1931 r.in.domain_handle = domain_handle;
1932 r.in.account_name = account_name;
1933 r.in.access_mask = access_mask;
1935 status = cli->dispatch(cli,
1936 mem_ctx,
1937 &ndr_table_samr,
1938 NDR_SAMR_CREATEUSER,
1939 &r);
1941 if (!NT_STATUS_IS_OK(status)) {
1942 return status;
1945 if (NT_STATUS_IS_ERR(status)) {
1946 return status;
1949 /* Return variables */
1950 *user_handle = *r.out.user_handle;
1951 *rid = *r.out.rid;
1953 /* Return result */
1954 return r.out.result;
1957 struct rpccli_samr_EnumDomainUsers_state {
1958 struct samr_EnumDomainUsers orig;
1959 struct samr_EnumDomainUsers tmp;
1960 TALLOC_CTX *out_mem_ctx;
1961 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1964 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq);
1966 struct tevent_req *rpccli_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
1967 struct tevent_context *ev,
1968 struct rpc_pipe_client *cli,
1969 struct policy_handle *_domain_handle /* [in] [ref] */,
1970 uint32_t *_resume_handle /* [in,out] [ref] */,
1971 uint32_t _acct_flags /* [in] */,
1972 struct samr_SamArray **_sam /* [out] [ref] */,
1973 uint32_t _max_size /* [in] */,
1974 uint32_t *_num_entries /* [out] [ref] */)
1976 struct tevent_req *req;
1977 struct rpccli_samr_EnumDomainUsers_state *state;
1978 struct tevent_req *subreq;
1980 req = tevent_req_create(mem_ctx, &state,
1981 struct rpccli_samr_EnumDomainUsers_state);
1982 if (req == NULL) {
1983 return NULL;
1985 state->out_mem_ctx = NULL;
1986 state->dispatch_recv = cli->dispatch_recv;
1988 /* In parameters */
1989 state->orig.in.domain_handle = _domain_handle;
1990 state->orig.in.resume_handle = _resume_handle;
1991 state->orig.in.acct_flags = _acct_flags;
1992 state->orig.in.max_size = _max_size;
1994 /* Out parameters */
1995 state->orig.out.resume_handle = _resume_handle;
1996 state->orig.out.sam = _sam;
1997 state->orig.out.num_entries = _num_entries;
1999 /* Result */
2000 ZERO_STRUCT(state->orig.out.result);
2002 state->out_mem_ctx = talloc_named_const(state, 0,
2003 "rpccli_samr_EnumDomainUsers_out_memory");
2004 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2005 return tevent_req_post(req, ev);
2008 /* make a temporary copy, that we pass to the dispatch function */
2009 state->tmp = state->orig;
2011 subreq = cli->dispatch_send(state, ev, cli,
2012 &ndr_table_samr,
2013 NDR_SAMR_ENUMDOMAINUSERS,
2014 &state->tmp);
2015 if (tevent_req_nomem(subreq, req)) {
2016 return tevent_req_post(req, ev);
2018 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainUsers_done, req);
2019 return req;
2022 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq)
2024 struct tevent_req *req = tevent_req_callback_data(
2025 subreq, struct tevent_req);
2026 struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
2027 req, struct rpccli_samr_EnumDomainUsers_state);
2028 NTSTATUS status;
2029 TALLOC_CTX *mem_ctx;
2031 if (state->out_mem_ctx) {
2032 mem_ctx = state->out_mem_ctx;
2033 } else {
2034 mem_ctx = state;
2037 status = state->dispatch_recv(subreq, mem_ctx);
2038 TALLOC_FREE(subreq);
2039 if (!NT_STATUS_IS_OK(status)) {
2040 tevent_req_nterror(req, status);
2041 return;
2044 /* Copy out parameters */
2045 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2046 *state->orig.out.sam = *state->tmp.out.sam;
2047 *state->orig.out.num_entries = *state->tmp.out.num_entries;
2049 /* Copy result */
2050 state->orig.out.result = state->tmp.out.result;
2052 /* Reset temporary structure */
2053 ZERO_STRUCT(state->tmp);
2055 tevent_req_done(req);
2058 NTSTATUS rpccli_samr_EnumDomainUsers_recv(struct tevent_req *req,
2059 TALLOC_CTX *mem_ctx,
2060 NTSTATUS *result)
2062 struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
2063 req, struct rpccli_samr_EnumDomainUsers_state);
2064 NTSTATUS status;
2066 if (tevent_req_is_nterror(req, &status)) {
2067 tevent_req_received(req);
2068 return status;
2071 /* Steal possbile out parameters to the callers context */
2072 talloc_steal(mem_ctx, state->out_mem_ctx);
2074 /* Return result */
2075 *result = state->orig.out.result;
2077 tevent_req_received(req);
2078 return NT_STATUS_OK;
2081 NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
2082 TALLOC_CTX *mem_ctx,
2083 struct policy_handle *domain_handle /* [in] [ref] */,
2084 uint32_t *resume_handle /* [in,out] [ref] */,
2085 uint32_t acct_flags /* [in] */,
2086 struct samr_SamArray **sam /* [out] [ref] */,
2087 uint32_t max_size /* [in] */,
2088 uint32_t *num_entries /* [out] [ref] */)
2090 struct samr_EnumDomainUsers r;
2091 NTSTATUS status;
2093 /* In parameters */
2094 r.in.domain_handle = domain_handle;
2095 r.in.resume_handle = resume_handle;
2096 r.in.acct_flags = acct_flags;
2097 r.in.max_size = max_size;
2099 status = cli->dispatch(cli,
2100 mem_ctx,
2101 &ndr_table_samr,
2102 NDR_SAMR_ENUMDOMAINUSERS,
2103 &r);
2105 if (!NT_STATUS_IS_OK(status)) {
2106 return status;
2109 if (NT_STATUS_IS_ERR(status)) {
2110 return status;
2113 /* Return variables */
2114 *resume_handle = *r.out.resume_handle;
2115 *sam = *r.out.sam;
2116 *num_entries = *r.out.num_entries;
2118 /* Return result */
2119 return r.out.result;
2122 struct rpccli_samr_CreateDomAlias_state {
2123 struct samr_CreateDomAlias orig;
2124 struct samr_CreateDomAlias tmp;
2125 TALLOC_CTX *out_mem_ctx;
2126 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2129 static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq);
2131 struct tevent_req *rpccli_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
2132 struct tevent_context *ev,
2133 struct rpc_pipe_client *cli,
2134 struct policy_handle *_domain_handle /* [in] [ref] */,
2135 struct lsa_String *_alias_name /* [in] [ref] */,
2136 uint32_t _access_mask /* [in] */,
2137 struct policy_handle *_alias_handle /* [out] [ref] */,
2138 uint32_t *_rid /* [out] [ref] */)
2140 struct tevent_req *req;
2141 struct rpccli_samr_CreateDomAlias_state *state;
2142 struct tevent_req *subreq;
2144 req = tevent_req_create(mem_ctx, &state,
2145 struct rpccli_samr_CreateDomAlias_state);
2146 if (req == NULL) {
2147 return NULL;
2149 state->out_mem_ctx = NULL;
2150 state->dispatch_recv = cli->dispatch_recv;
2152 /* In parameters */
2153 state->orig.in.domain_handle = _domain_handle;
2154 state->orig.in.alias_name = _alias_name;
2155 state->orig.in.access_mask = _access_mask;
2157 /* Out parameters */
2158 state->orig.out.alias_handle = _alias_handle;
2159 state->orig.out.rid = _rid;
2161 /* Result */
2162 ZERO_STRUCT(state->orig.out.result);
2164 state->out_mem_ctx = talloc_named_const(state, 0,
2165 "rpccli_samr_CreateDomAlias_out_memory");
2166 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2167 return tevent_req_post(req, ev);
2170 /* make a temporary copy, that we pass to the dispatch function */
2171 state->tmp = state->orig;
2173 subreq = cli->dispatch_send(state, ev, cli,
2174 &ndr_table_samr,
2175 NDR_SAMR_CREATEDOMALIAS,
2176 &state->tmp);
2177 if (tevent_req_nomem(subreq, req)) {
2178 return tevent_req_post(req, ev);
2180 tevent_req_set_callback(subreq, rpccli_samr_CreateDomAlias_done, req);
2181 return req;
2184 static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq)
2186 struct tevent_req *req = tevent_req_callback_data(
2187 subreq, struct tevent_req);
2188 struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
2189 req, struct rpccli_samr_CreateDomAlias_state);
2190 NTSTATUS status;
2191 TALLOC_CTX *mem_ctx;
2193 if (state->out_mem_ctx) {
2194 mem_ctx = state->out_mem_ctx;
2195 } else {
2196 mem_ctx = state;
2199 status = state->dispatch_recv(subreq, mem_ctx);
2200 TALLOC_FREE(subreq);
2201 if (!NT_STATUS_IS_OK(status)) {
2202 tevent_req_nterror(req, status);
2203 return;
2206 /* Copy out parameters */
2207 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
2208 *state->orig.out.rid = *state->tmp.out.rid;
2210 /* Copy result */
2211 state->orig.out.result = state->tmp.out.result;
2213 /* Reset temporary structure */
2214 ZERO_STRUCT(state->tmp);
2216 tevent_req_done(req);
2219 NTSTATUS rpccli_samr_CreateDomAlias_recv(struct tevent_req *req,
2220 TALLOC_CTX *mem_ctx,
2221 NTSTATUS *result)
2223 struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
2224 req, struct rpccli_samr_CreateDomAlias_state);
2225 NTSTATUS status;
2227 if (tevent_req_is_nterror(req, &status)) {
2228 tevent_req_received(req);
2229 return status;
2232 /* Steal possbile out parameters to the callers context */
2233 talloc_steal(mem_ctx, state->out_mem_ctx);
2235 /* Return result */
2236 *result = state->orig.out.result;
2238 tevent_req_received(req);
2239 return NT_STATUS_OK;
2242 NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
2243 TALLOC_CTX *mem_ctx,
2244 struct policy_handle *domain_handle /* [in] [ref] */,
2245 struct lsa_String *alias_name /* [in] [ref] */,
2246 uint32_t access_mask /* [in] */,
2247 struct policy_handle *alias_handle /* [out] [ref] */,
2248 uint32_t *rid /* [out] [ref] */)
2250 struct samr_CreateDomAlias r;
2251 NTSTATUS status;
2253 /* In parameters */
2254 r.in.domain_handle = domain_handle;
2255 r.in.alias_name = alias_name;
2256 r.in.access_mask = access_mask;
2258 status = cli->dispatch(cli,
2259 mem_ctx,
2260 &ndr_table_samr,
2261 NDR_SAMR_CREATEDOMALIAS,
2262 &r);
2264 if (!NT_STATUS_IS_OK(status)) {
2265 return status;
2268 if (NT_STATUS_IS_ERR(status)) {
2269 return status;
2272 /* Return variables */
2273 *alias_handle = *r.out.alias_handle;
2274 *rid = *r.out.rid;
2276 /* Return result */
2277 return r.out.result;
2280 struct rpccli_samr_EnumDomainAliases_state {
2281 struct samr_EnumDomainAliases orig;
2282 struct samr_EnumDomainAliases tmp;
2283 TALLOC_CTX *out_mem_ctx;
2284 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2287 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq);
2289 struct tevent_req *rpccli_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
2290 struct tevent_context *ev,
2291 struct rpc_pipe_client *cli,
2292 struct policy_handle *_domain_handle /* [in] [ref] */,
2293 uint32_t *_resume_handle /* [in,out] [ref] */,
2294 struct samr_SamArray **_sam /* [out] [ref] */,
2295 uint32_t _max_size /* [in] */,
2296 uint32_t *_num_entries /* [out] [ref] */)
2298 struct tevent_req *req;
2299 struct rpccli_samr_EnumDomainAliases_state *state;
2300 struct tevent_req *subreq;
2302 req = tevent_req_create(mem_ctx, &state,
2303 struct rpccli_samr_EnumDomainAliases_state);
2304 if (req == NULL) {
2305 return NULL;
2307 state->out_mem_ctx = NULL;
2308 state->dispatch_recv = cli->dispatch_recv;
2310 /* In parameters */
2311 state->orig.in.domain_handle = _domain_handle;
2312 state->orig.in.resume_handle = _resume_handle;
2313 state->orig.in.max_size = _max_size;
2315 /* Out parameters */
2316 state->orig.out.resume_handle = _resume_handle;
2317 state->orig.out.sam = _sam;
2318 state->orig.out.num_entries = _num_entries;
2320 /* Result */
2321 ZERO_STRUCT(state->orig.out.result);
2323 state->out_mem_ctx = talloc_named_const(state, 0,
2324 "rpccli_samr_EnumDomainAliases_out_memory");
2325 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2326 return tevent_req_post(req, ev);
2329 /* make a temporary copy, that we pass to the dispatch function */
2330 state->tmp = state->orig;
2332 subreq = cli->dispatch_send(state, ev, cli,
2333 &ndr_table_samr,
2334 NDR_SAMR_ENUMDOMAINALIASES,
2335 &state->tmp);
2336 if (tevent_req_nomem(subreq, req)) {
2337 return tevent_req_post(req, ev);
2339 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainAliases_done, req);
2340 return req;
2343 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq)
2345 struct tevent_req *req = tevent_req_callback_data(
2346 subreq, struct tevent_req);
2347 struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
2348 req, struct rpccli_samr_EnumDomainAliases_state);
2349 NTSTATUS status;
2350 TALLOC_CTX *mem_ctx;
2352 if (state->out_mem_ctx) {
2353 mem_ctx = state->out_mem_ctx;
2354 } else {
2355 mem_ctx = state;
2358 status = state->dispatch_recv(subreq, mem_ctx);
2359 TALLOC_FREE(subreq);
2360 if (!NT_STATUS_IS_OK(status)) {
2361 tevent_req_nterror(req, status);
2362 return;
2365 /* Copy out parameters */
2366 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2367 *state->orig.out.sam = *state->tmp.out.sam;
2368 *state->orig.out.num_entries = *state->tmp.out.num_entries;
2370 /* Copy result */
2371 state->orig.out.result = state->tmp.out.result;
2373 /* Reset temporary structure */
2374 ZERO_STRUCT(state->tmp);
2376 tevent_req_done(req);
2379 NTSTATUS rpccli_samr_EnumDomainAliases_recv(struct tevent_req *req,
2380 TALLOC_CTX *mem_ctx,
2381 NTSTATUS *result)
2383 struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
2384 req, struct rpccli_samr_EnumDomainAliases_state);
2385 NTSTATUS status;
2387 if (tevent_req_is_nterror(req, &status)) {
2388 tevent_req_received(req);
2389 return status;
2392 /* Steal possbile out parameters to the callers context */
2393 talloc_steal(mem_ctx, state->out_mem_ctx);
2395 /* Return result */
2396 *result = state->orig.out.result;
2398 tevent_req_received(req);
2399 return NT_STATUS_OK;
2402 NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
2403 TALLOC_CTX *mem_ctx,
2404 struct policy_handle *domain_handle /* [in] [ref] */,
2405 uint32_t *resume_handle /* [in,out] [ref] */,
2406 struct samr_SamArray **sam /* [out] [ref] */,
2407 uint32_t max_size /* [in] */,
2408 uint32_t *num_entries /* [out] [ref] */)
2410 struct samr_EnumDomainAliases r;
2411 NTSTATUS status;
2413 /* In parameters */
2414 r.in.domain_handle = domain_handle;
2415 r.in.resume_handle = resume_handle;
2416 r.in.max_size = max_size;
2418 status = cli->dispatch(cli,
2419 mem_ctx,
2420 &ndr_table_samr,
2421 NDR_SAMR_ENUMDOMAINALIASES,
2422 &r);
2424 if (!NT_STATUS_IS_OK(status)) {
2425 return status;
2428 if (NT_STATUS_IS_ERR(status)) {
2429 return status;
2432 /* Return variables */
2433 *resume_handle = *r.out.resume_handle;
2434 *sam = *r.out.sam;
2435 *num_entries = *r.out.num_entries;
2437 /* Return result */
2438 return r.out.result;
2441 struct rpccli_samr_GetAliasMembership_state {
2442 struct samr_GetAliasMembership orig;
2443 struct samr_GetAliasMembership tmp;
2444 TALLOC_CTX *out_mem_ctx;
2445 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2448 static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq);
2450 struct tevent_req *rpccli_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
2451 struct tevent_context *ev,
2452 struct rpc_pipe_client *cli,
2453 struct policy_handle *_domain_handle /* [in] [ref] */,
2454 struct lsa_SidArray *_sids /* [in] [ref] */,
2455 struct samr_Ids *_rids /* [out] [ref] */)
2457 struct tevent_req *req;
2458 struct rpccli_samr_GetAliasMembership_state *state;
2459 struct tevent_req *subreq;
2461 req = tevent_req_create(mem_ctx, &state,
2462 struct rpccli_samr_GetAliasMembership_state);
2463 if (req == NULL) {
2464 return NULL;
2466 state->out_mem_ctx = NULL;
2467 state->dispatch_recv = cli->dispatch_recv;
2469 /* In parameters */
2470 state->orig.in.domain_handle = _domain_handle;
2471 state->orig.in.sids = _sids;
2473 /* Out parameters */
2474 state->orig.out.rids = _rids;
2476 /* Result */
2477 ZERO_STRUCT(state->orig.out.result);
2479 state->out_mem_ctx = talloc_named_const(state, 0,
2480 "rpccli_samr_GetAliasMembership_out_memory");
2481 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2482 return tevent_req_post(req, ev);
2485 /* make a temporary copy, that we pass to the dispatch function */
2486 state->tmp = state->orig;
2488 subreq = cli->dispatch_send(state, ev, cli,
2489 &ndr_table_samr,
2490 NDR_SAMR_GETALIASMEMBERSHIP,
2491 &state->tmp);
2492 if (tevent_req_nomem(subreq, req)) {
2493 return tevent_req_post(req, ev);
2495 tevent_req_set_callback(subreq, rpccli_samr_GetAliasMembership_done, req);
2496 return req;
2499 static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq)
2501 struct tevent_req *req = tevent_req_callback_data(
2502 subreq, struct tevent_req);
2503 struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
2504 req, struct rpccli_samr_GetAliasMembership_state);
2505 NTSTATUS status;
2506 TALLOC_CTX *mem_ctx;
2508 if (state->out_mem_ctx) {
2509 mem_ctx = state->out_mem_ctx;
2510 } else {
2511 mem_ctx = state;
2514 status = state->dispatch_recv(subreq, mem_ctx);
2515 TALLOC_FREE(subreq);
2516 if (!NT_STATUS_IS_OK(status)) {
2517 tevent_req_nterror(req, status);
2518 return;
2521 /* Copy out parameters */
2522 *state->orig.out.rids = *state->tmp.out.rids;
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_samr_GetAliasMembership_recv(struct tevent_req *req,
2534 TALLOC_CTX *mem_ctx,
2535 NTSTATUS *result)
2537 struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
2538 req, struct rpccli_samr_GetAliasMembership_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_samr_GetAliasMembership(struct rpc_pipe_client *cli,
2557 TALLOC_CTX *mem_ctx,
2558 struct policy_handle *domain_handle /* [in] [ref] */,
2559 struct lsa_SidArray *sids /* [in] [ref] */,
2560 struct samr_Ids *rids /* [out] [ref] */)
2562 struct samr_GetAliasMembership r;
2563 NTSTATUS status;
2565 /* In parameters */
2566 r.in.domain_handle = domain_handle;
2567 r.in.sids = sids;
2569 status = cli->dispatch(cli,
2570 mem_ctx,
2571 &ndr_table_samr,
2572 NDR_SAMR_GETALIASMEMBERSHIP,
2573 &r);
2575 if (!NT_STATUS_IS_OK(status)) {
2576 return status;
2579 if (NT_STATUS_IS_ERR(status)) {
2580 return status;
2583 /* Return variables */
2584 *rids = *r.out.rids;
2586 /* Return result */
2587 return r.out.result;
2590 struct rpccli_samr_LookupNames_state {
2591 struct samr_LookupNames orig;
2592 struct samr_LookupNames tmp;
2593 TALLOC_CTX *out_mem_ctx;
2594 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2597 static void rpccli_samr_LookupNames_done(struct tevent_req *subreq);
2599 struct tevent_req *rpccli_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
2600 struct tevent_context *ev,
2601 struct rpc_pipe_client *cli,
2602 struct policy_handle *_domain_handle /* [in] [ref] */,
2603 uint32_t _num_names /* [in] [range(0,1000)] */,
2604 struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
2605 struct samr_Ids *_rids /* [out] [ref] */,
2606 struct samr_Ids *_types /* [out] [ref] */)
2608 struct tevent_req *req;
2609 struct rpccli_samr_LookupNames_state *state;
2610 struct tevent_req *subreq;
2612 req = tevent_req_create(mem_ctx, &state,
2613 struct rpccli_samr_LookupNames_state);
2614 if (req == NULL) {
2615 return NULL;
2617 state->out_mem_ctx = NULL;
2618 state->dispatch_recv = cli->dispatch_recv;
2620 /* In parameters */
2621 state->orig.in.domain_handle = _domain_handle;
2622 state->orig.in.num_names = _num_names;
2623 state->orig.in.names = _names;
2625 /* Out parameters */
2626 state->orig.out.rids = _rids;
2627 state->orig.out.types = _types;
2629 /* Result */
2630 ZERO_STRUCT(state->orig.out.result);
2632 state->out_mem_ctx = talloc_named_const(state, 0,
2633 "rpccli_samr_LookupNames_out_memory");
2634 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2635 return tevent_req_post(req, ev);
2638 /* make a temporary copy, that we pass to the dispatch function */
2639 state->tmp = state->orig;
2641 subreq = cli->dispatch_send(state, ev, cli,
2642 &ndr_table_samr,
2643 NDR_SAMR_LOOKUPNAMES,
2644 &state->tmp);
2645 if (tevent_req_nomem(subreq, req)) {
2646 return tevent_req_post(req, ev);
2648 tevent_req_set_callback(subreq, rpccli_samr_LookupNames_done, req);
2649 return req;
2652 static void rpccli_samr_LookupNames_done(struct tevent_req *subreq)
2654 struct tevent_req *req = tevent_req_callback_data(
2655 subreq, struct tevent_req);
2656 struct rpccli_samr_LookupNames_state *state = tevent_req_data(
2657 req, struct rpccli_samr_LookupNames_state);
2658 NTSTATUS status;
2659 TALLOC_CTX *mem_ctx;
2661 if (state->out_mem_ctx) {
2662 mem_ctx = state->out_mem_ctx;
2663 } else {
2664 mem_ctx = state;
2667 status = state->dispatch_recv(subreq, mem_ctx);
2668 TALLOC_FREE(subreq);
2669 if (!NT_STATUS_IS_OK(status)) {
2670 tevent_req_nterror(req, status);
2671 return;
2674 /* Copy out parameters */
2675 *state->orig.out.rids = *state->tmp.out.rids;
2676 *state->orig.out.types = *state->tmp.out.types;
2678 /* Copy result */
2679 state->orig.out.result = state->tmp.out.result;
2681 /* Reset temporary structure */
2682 ZERO_STRUCT(state->tmp);
2684 tevent_req_done(req);
2687 NTSTATUS rpccli_samr_LookupNames_recv(struct tevent_req *req,
2688 TALLOC_CTX *mem_ctx,
2689 NTSTATUS *result)
2691 struct rpccli_samr_LookupNames_state *state = tevent_req_data(
2692 req, struct rpccli_samr_LookupNames_state);
2693 NTSTATUS status;
2695 if (tevent_req_is_nterror(req, &status)) {
2696 tevent_req_received(req);
2697 return status;
2700 /* Steal possbile out parameters to the callers context */
2701 talloc_steal(mem_ctx, state->out_mem_ctx);
2703 /* Return result */
2704 *result = state->orig.out.result;
2706 tevent_req_received(req);
2707 return NT_STATUS_OK;
2710 NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
2711 TALLOC_CTX *mem_ctx,
2712 struct policy_handle *domain_handle /* [in] [ref] */,
2713 uint32_t num_names /* [in] [range(0,1000)] */,
2714 struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
2715 struct samr_Ids *rids /* [out] [ref] */,
2716 struct samr_Ids *types /* [out] [ref] */)
2718 struct samr_LookupNames r;
2719 NTSTATUS status;
2721 /* In parameters */
2722 r.in.domain_handle = domain_handle;
2723 r.in.num_names = num_names;
2724 r.in.names = names;
2726 status = cli->dispatch(cli,
2727 mem_ctx,
2728 &ndr_table_samr,
2729 NDR_SAMR_LOOKUPNAMES,
2730 &r);
2732 if (!NT_STATUS_IS_OK(status)) {
2733 return status;
2736 if (NT_STATUS_IS_ERR(status)) {
2737 return status;
2740 /* Return variables */
2741 *rids = *r.out.rids;
2742 *types = *r.out.types;
2744 /* Return result */
2745 return r.out.result;
2748 struct rpccli_samr_LookupRids_state {
2749 struct samr_LookupRids orig;
2750 struct samr_LookupRids tmp;
2751 TALLOC_CTX *out_mem_ctx;
2752 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2755 static void rpccli_samr_LookupRids_done(struct tevent_req *subreq);
2757 struct tevent_req *rpccli_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
2758 struct tevent_context *ev,
2759 struct rpc_pipe_client *cli,
2760 struct policy_handle *_domain_handle /* [in] [ref] */,
2761 uint32_t _num_rids /* [in] [range(0,1000)] */,
2762 uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
2763 struct lsa_Strings *_names /* [out] [ref] */,
2764 struct samr_Ids *_types /* [out] [ref] */)
2766 struct tevent_req *req;
2767 struct rpccli_samr_LookupRids_state *state;
2768 struct tevent_req *subreq;
2770 req = tevent_req_create(mem_ctx, &state,
2771 struct rpccli_samr_LookupRids_state);
2772 if (req == NULL) {
2773 return NULL;
2775 state->out_mem_ctx = NULL;
2776 state->dispatch_recv = cli->dispatch_recv;
2778 /* In parameters */
2779 state->orig.in.domain_handle = _domain_handle;
2780 state->orig.in.num_rids = _num_rids;
2781 state->orig.in.rids = _rids;
2783 /* Out parameters */
2784 state->orig.out.names = _names;
2785 state->orig.out.types = _types;
2787 /* Result */
2788 ZERO_STRUCT(state->orig.out.result);
2790 state->out_mem_ctx = talloc_named_const(state, 0,
2791 "rpccli_samr_LookupRids_out_memory");
2792 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2793 return tevent_req_post(req, ev);
2796 /* make a temporary copy, that we pass to the dispatch function */
2797 state->tmp = state->orig;
2799 subreq = cli->dispatch_send(state, ev, cli,
2800 &ndr_table_samr,
2801 NDR_SAMR_LOOKUPRIDS,
2802 &state->tmp);
2803 if (tevent_req_nomem(subreq, req)) {
2804 return tevent_req_post(req, ev);
2806 tevent_req_set_callback(subreq, rpccli_samr_LookupRids_done, req);
2807 return req;
2810 static void rpccli_samr_LookupRids_done(struct tevent_req *subreq)
2812 struct tevent_req *req = tevent_req_callback_data(
2813 subreq, struct tevent_req);
2814 struct rpccli_samr_LookupRids_state *state = tevent_req_data(
2815 req, struct rpccli_samr_LookupRids_state);
2816 NTSTATUS status;
2817 TALLOC_CTX *mem_ctx;
2819 if (state->out_mem_ctx) {
2820 mem_ctx = state->out_mem_ctx;
2821 } else {
2822 mem_ctx = state;
2825 status = state->dispatch_recv(subreq, mem_ctx);
2826 TALLOC_FREE(subreq);
2827 if (!NT_STATUS_IS_OK(status)) {
2828 tevent_req_nterror(req, status);
2829 return;
2832 /* Copy out parameters */
2833 *state->orig.out.names = *state->tmp.out.names;
2834 *state->orig.out.types = *state->tmp.out.types;
2836 /* Copy result */
2837 state->orig.out.result = state->tmp.out.result;
2839 /* Reset temporary structure */
2840 ZERO_STRUCT(state->tmp);
2842 tevent_req_done(req);
2845 NTSTATUS rpccli_samr_LookupRids_recv(struct tevent_req *req,
2846 TALLOC_CTX *mem_ctx,
2847 NTSTATUS *result)
2849 struct rpccli_samr_LookupRids_state *state = tevent_req_data(
2850 req, struct rpccli_samr_LookupRids_state);
2851 NTSTATUS status;
2853 if (tevent_req_is_nterror(req, &status)) {
2854 tevent_req_received(req);
2855 return status;
2858 /* Steal possbile out parameters to the callers context */
2859 talloc_steal(mem_ctx, state->out_mem_ctx);
2861 /* Return result */
2862 *result = state->orig.out.result;
2864 tevent_req_received(req);
2865 return NT_STATUS_OK;
2868 NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
2869 TALLOC_CTX *mem_ctx,
2870 struct policy_handle *domain_handle /* [in] [ref] */,
2871 uint32_t num_rids /* [in] [range(0,1000)] */,
2872 uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
2873 struct lsa_Strings *names /* [out] [ref] */,
2874 struct samr_Ids *types /* [out] [ref] */)
2876 struct samr_LookupRids r;
2877 NTSTATUS status;
2879 /* In parameters */
2880 r.in.domain_handle = domain_handle;
2881 r.in.num_rids = num_rids;
2882 r.in.rids = rids;
2884 status = cli->dispatch(cli,
2885 mem_ctx,
2886 &ndr_table_samr,
2887 NDR_SAMR_LOOKUPRIDS,
2888 &r);
2890 if (!NT_STATUS_IS_OK(status)) {
2891 return status;
2894 if (NT_STATUS_IS_ERR(status)) {
2895 return status;
2898 /* Return variables */
2899 *names = *r.out.names;
2900 *types = *r.out.types;
2902 /* Return result */
2903 return r.out.result;
2906 struct rpccli_samr_OpenGroup_state {
2907 struct samr_OpenGroup orig;
2908 struct samr_OpenGroup tmp;
2909 TALLOC_CTX *out_mem_ctx;
2910 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2913 static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq);
2915 struct tevent_req *rpccli_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
2916 struct tevent_context *ev,
2917 struct rpc_pipe_client *cli,
2918 struct policy_handle *_domain_handle /* [in] [ref] */,
2919 uint32_t _access_mask /* [in] */,
2920 uint32_t _rid /* [in] */,
2921 struct policy_handle *_group_handle /* [out] [ref] */)
2923 struct tevent_req *req;
2924 struct rpccli_samr_OpenGroup_state *state;
2925 struct tevent_req *subreq;
2927 req = tevent_req_create(mem_ctx, &state,
2928 struct rpccli_samr_OpenGroup_state);
2929 if (req == NULL) {
2930 return NULL;
2932 state->out_mem_ctx = NULL;
2933 state->dispatch_recv = cli->dispatch_recv;
2935 /* In parameters */
2936 state->orig.in.domain_handle = _domain_handle;
2937 state->orig.in.access_mask = _access_mask;
2938 state->orig.in.rid = _rid;
2940 /* Out parameters */
2941 state->orig.out.group_handle = _group_handle;
2943 /* Result */
2944 ZERO_STRUCT(state->orig.out.result);
2946 state->out_mem_ctx = talloc_named_const(state, 0,
2947 "rpccli_samr_OpenGroup_out_memory");
2948 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2949 return tevent_req_post(req, ev);
2952 /* make a temporary copy, that we pass to the dispatch function */
2953 state->tmp = state->orig;
2955 subreq = cli->dispatch_send(state, ev, cli,
2956 &ndr_table_samr,
2957 NDR_SAMR_OPENGROUP,
2958 &state->tmp);
2959 if (tevent_req_nomem(subreq, req)) {
2960 return tevent_req_post(req, ev);
2962 tevent_req_set_callback(subreq, rpccli_samr_OpenGroup_done, req);
2963 return req;
2966 static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq)
2968 struct tevent_req *req = tevent_req_callback_data(
2969 subreq, struct tevent_req);
2970 struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
2971 req, struct rpccli_samr_OpenGroup_state);
2972 NTSTATUS status;
2973 TALLOC_CTX *mem_ctx;
2975 if (state->out_mem_ctx) {
2976 mem_ctx = state->out_mem_ctx;
2977 } else {
2978 mem_ctx = state;
2981 status = state->dispatch_recv(subreq, mem_ctx);
2982 TALLOC_FREE(subreq);
2983 if (!NT_STATUS_IS_OK(status)) {
2984 tevent_req_nterror(req, status);
2985 return;
2988 /* Copy out parameters */
2989 *state->orig.out.group_handle = *state->tmp.out.group_handle;
2991 /* Copy result */
2992 state->orig.out.result = state->tmp.out.result;
2994 /* Reset temporary structure */
2995 ZERO_STRUCT(state->tmp);
2997 tevent_req_done(req);
3000 NTSTATUS rpccli_samr_OpenGroup_recv(struct tevent_req *req,
3001 TALLOC_CTX *mem_ctx,
3002 NTSTATUS *result)
3004 struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
3005 req, struct rpccli_samr_OpenGroup_state);
3006 NTSTATUS status;
3008 if (tevent_req_is_nterror(req, &status)) {
3009 tevent_req_received(req);
3010 return status;
3013 /* Steal possbile out parameters to the callers context */
3014 talloc_steal(mem_ctx, state->out_mem_ctx);
3016 /* Return result */
3017 *result = state->orig.out.result;
3019 tevent_req_received(req);
3020 return NT_STATUS_OK;
3023 NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
3024 TALLOC_CTX *mem_ctx,
3025 struct policy_handle *domain_handle /* [in] [ref] */,
3026 uint32_t access_mask /* [in] */,
3027 uint32_t rid /* [in] */,
3028 struct policy_handle *group_handle /* [out] [ref] */)
3030 struct samr_OpenGroup r;
3031 NTSTATUS status;
3033 /* In parameters */
3034 r.in.domain_handle = domain_handle;
3035 r.in.access_mask = access_mask;
3036 r.in.rid = rid;
3038 status = cli->dispatch(cli,
3039 mem_ctx,
3040 &ndr_table_samr,
3041 NDR_SAMR_OPENGROUP,
3042 &r);
3044 if (!NT_STATUS_IS_OK(status)) {
3045 return status;
3048 if (NT_STATUS_IS_ERR(status)) {
3049 return status;
3052 /* Return variables */
3053 *group_handle = *r.out.group_handle;
3055 /* Return result */
3056 return r.out.result;
3059 struct rpccli_samr_QueryGroupInfo_state {
3060 struct samr_QueryGroupInfo orig;
3061 struct samr_QueryGroupInfo tmp;
3062 TALLOC_CTX *out_mem_ctx;
3063 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3066 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq);
3068 struct tevent_req *rpccli_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
3069 struct tevent_context *ev,
3070 struct rpc_pipe_client *cli,
3071 struct policy_handle *_group_handle /* [in] [ref] */,
3072 enum samr_GroupInfoEnum _level /* [in] */,
3073 union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */)
3075 struct tevent_req *req;
3076 struct rpccli_samr_QueryGroupInfo_state *state;
3077 struct tevent_req *subreq;
3079 req = tevent_req_create(mem_ctx, &state,
3080 struct rpccli_samr_QueryGroupInfo_state);
3081 if (req == NULL) {
3082 return NULL;
3084 state->out_mem_ctx = NULL;
3085 state->dispatch_recv = cli->dispatch_recv;
3087 /* In parameters */
3088 state->orig.in.group_handle = _group_handle;
3089 state->orig.in.level = _level;
3091 /* Out parameters */
3092 state->orig.out.info = _info;
3094 /* Result */
3095 ZERO_STRUCT(state->orig.out.result);
3097 state->out_mem_ctx = talloc_named_const(state, 0,
3098 "rpccli_samr_QueryGroupInfo_out_memory");
3099 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3100 return tevent_req_post(req, ev);
3103 /* make a temporary copy, that we pass to the dispatch function */
3104 state->tmp = state->orig;
3106 subreq = cli->dispatch_send(state, ev, cli,
3107 &ndr_table_samr,
3108 NDR_SAMR_QUERYGROUPINFO,
3109 &state->tmp);
3110 if (tevent_req_nomem(subreq, req)) {
3111 return tevent_req_post(req, ev);
3113 tevent_req_set_callback(subreq, rpccli_samr_QueryGroupInfo_done, req);
3114 return req;
3117 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq)
3119 struct tevent_req *req = tevent_req_callback_data(
3120 subreq, struct tevent_req);
3121 struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
3122 req, struct rpccli_samr_QueryGroupInfo_state);
3123 NTSTATUS status;
3124 TALLOC_CTX *mem_ctx;
3126 if (state->out_mem_ctx) {
3127 mem_ctx = state->out_mem_ctx;
3128 } else {
3129 mem_ctx = state;
3132 status = state->dispatch_recv(subreq, mem_ctx);
3133 TALLOC_FREE(subreq);
3134 if (!NT_STATUS_IS_OK(status)) {
3135 tevent_req_nterror(req, status);
3136 return;
3139 /* Copy out parameters */
3140 *state->orig.out.info = *state->tmp.out.info;
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_samr_QueryGroupInfo_recv(struct tevent_req *req,
3152 TALLOC_CTX *mem_ctx,
3153 NTSTATUS *result)
3155 struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
3156 req, struct rpccli_samr_QueryGroupInfo_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_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
3175 TALLOC_CTX *mem_ctx,
3176 struct policy_handle *group_handle /* [in] [ref] */,
3177 enum samr_GroupInfoEnum level /* [in] */,
3178 union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
3180 struct samr_QueryGroupInfo r;
3181 NTSTATUS status;
3183 /* In parameters */
3184 r.in.group_handle = group_handle;
3185 r.in.level = level;
3187 status = cli->dispatch(cli,
3188 mem_ctx,
3189 &ndr_table_samr,
3190 NDR_SAMR_QUERYGROUPINFO,
3191 &r);
3193 if (!NT_STATUS_IS_OK(status)) {
3194 return status;
3197 if (NT_STATUS_IS_ERR(status)) {
3198 return status;
3201 /* Return variables */
3202 *info = *r.out.info;
3204 /* Return result */
3205 return r.out.result;
3208 struct rpccli_samr_SetGroupInfo_state {
3209 struct samr_SetGroupInfo orig;
3210 struct samr_SetGroupInfo tmp;
3211 TALLOC_CTX *out_mem_ctx;
3212 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3215 static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq);
3217 struct tevent_req *rpccli_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
3218 struct tevent_context *ev,
3219 struct rpc_pipe_client *cli,
3220 struct policy_handle *_group_handle /* [in] [ref] */,
3221 enum samr_GroupInfoEnum _level /* [in] */,
3222 union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */)
3224 struct tevent_req *req;
3225 struct rpccli_samr_SetGroupInfo_state *state;
3226 struct tevent_req *subreq;
3228 req = tevent_req_create(mem_ctx, &state,
3229 struct rpccli_samr_SetGroupInfo_state);
3230 if (req == NULL) {
3231 return NULL;
3233 state->out_mem_ctx = NULL;
3234 state->dispatch_recv = cli->dispatch_recv;
3236 /* In parameters */
3237 state->orig.in.group_handle = _group_handle;
3238 state->orig.in.level = _level;
3239 state->orig.in.info = _info;
3241 /* Out parameters */
3243 /* Result */
3244 ZERO_STRUCT(state->orig.out.result);
3246 /* make a temporary copy, that we pass to the dispatch function */
3247 state->tmp = state->orig;
3249 subreq = cli->dispatch_send(state, ev, cli,
3250 &ndr_table_samr,
3251 NDR_SAMR_SETGROUPINFO,
3252 &state->tmp);
3253 if (tevent_req_nomem(subreq, req)) {
3254 return tevent_req_post(req, ev);
3256 tevent_req_set_callback(subreq, rpccli_samr_SetGroupInfo_done, req);
3257 return req;
3260 static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq)
3262 struct tevent_req *req = tevent_req_callback_data(
3263 subreq, struct tevent_req);
3264 struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
3265 req, struct rpccli_samr_SetGroupInfo_state);
3266 NTSTATUS status;
3267 TALLOC_CTX *mem_ctx;
3269 if (state->out_mem_ctx) {
3270 mem_ctx = state->out_mem_ctx;
3271 } else {
3272 mem_ctx = state;
3275 status = state->dispatch_recv(subreq, mem_ctx);
3276 TALLOC_FREE(subreq);
3277 if (!NT_STATUS_IS_OK(status)) {
3278 tevent_req_nterror(req, status);
3279 return;
3282 /* Copy out parameters */
3284 /* Copy result */
3285 state->orig.out.result = state->tmp.out.result;
3287 /* Reset temporary structure */
3288 ZERO_STRUCT(state->tmp);
3290 tevent_req_done(req);
3293 NTSTATUS rpccli_samr_SetGroupInfo_recv(struct tevent_req *req,
3294 TALLOC_CTX *mem_ctx,
3295 NTSTATUS *result)
3297 struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
3298 req, struct rpccli_samr_SetGroupInfo_state);
3299 NTSTATUS status;
3301 if (tevent_req_is_nterror(req, &status)) {
3302 tevent_req_received(req);
3303 return status;
3306 /* Steal possbile out parameters to the callers context */
3307 talloc_steal(mem_ctx, state->out_mem_ctx);
3309 /* Return result */
3310 *result = state->orig.out.result;
3312 tevent_req_received(req);
3313 return NT_STATUS_OK;
3316 NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
3317 TALLOC_CTX *mem_ctx,
3318 struct policy_handle *group_handle /* [in] [ref] */,
3319 enum samr_GroupInfoEnum level /* [in] */,
3320 union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
3322 struct samr_SetGroupInfo r;
3323 NTSTATUS status;
3325 /* In parameters */
3326 r.in.group_handle = group_handle;
3327 r.in.level = level;
3328 r.in.info = info;
3330 status = cli->dispatch(cli,
3331 mem_ctx,
3332 &ndr_table_samr,
3333 NDR_SAMR_SETGROUPINFO,
3334 &r);
3336 if (!NT_STATUS_IS_OK(status)) {
3337 return status;
3340 if (NT_STATUS_IS_ERR(status)) {
3341 return status;
3344 /* Return variables */
3346 /* Return result */
3347 return r.out.result;
3350 struct rpccli_samr_AddGroupMember_state {
3351 struct samr_AddGroupMember orig;
3352 struct samr_AddGroupMember tmp;
3353 TALLOC_CTX *out_mem_ctx;
3354 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3357 static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq);
3359 struct tevent_req *rpccli_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
3360 struct tevent_context *ev,
3361 struct rpc_pipe_client *cli,
3362 struct policy_handle *_group_handle /* [in] [ref] */,
3363 uint32_t _rid /* [in] */,
3364 uint32_t _flags /* [in] */)
3366 struct tevent_req *req;
3367 struct rpccli_samr_AddGroupMember_state *state;
3368 struct tevent_req *subreq;
3370 req = tevent_req_create(mem_ctx, &state,
3371 struct rpccli_samr_AddGroupMember_state);
3372 if (req == NULL) {
3373 return NULL;
3375 state->out_mem_ctx = NULL;
3376 state->dispatch_recv = cli->dispatch_recv;
3378 /* In parameters */
3379 state->orig.in.group_handle = _group_handle;
3380 state->orig.in.rid = _rid;
3381 state->orig.in.flags = _flags;
3383 /* Out parameters */
3385 /* Result */
3386 ZERO_STRUCT(state->orig.out.result);
3388 /* make a temporary copy, that we pass to the dispatch function */
3389 state->tmp = state->orig;
3391 subreq = cli->dispatch_send(state, ev, cli,
3392 &ndr_table_samr,
3393 NDR_SAMR_ADDGROUPMEMBER,
3394 &state->tmp);
3395 if (tevent_req_nomem(subreq, req)) {
3396 return tevent_req_post(req, ev);
3398 tevent_req_set_callback(subreq, rpccli_samr_AddGroupMember_done, req);
3399 return req;
3402 static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq)
3404 struct tevent_req *req = tevent_req_callback_data(
3405 subreq, struct tevent_req);
3406 struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
3407 req, struct rpccli_samr_AddGroupMember_state);
3408 NTSTATUS status;
3409 TALLOC_CTX *mem_ctx;
3411 if (state->out_mem_ctx) {
3412 mem_ctx = state->out_mem_ctx;
3413 } else {
3414 mem_ctx = state;
3417 status = state->dispatch_recv(subreq, mem_ctx);
3418 TALLOC_FREE(subreq);
3419 if (!NT_STATUS_IS_OK(status)) {
3420 tevent_req_nterror(req, status);
3421 return;
3424 /* Copy out parameters */
3426 /* Copy result */
3427 state->orig.out.result = state->tmp.out.result;
3429 /* Reset temporary structure */
3430 ZERO_STRUCT(state->tmp);
3432 tevent_req_done(req);
3435 NTSTATUS rpccli_samr_AddGroupMember_recv(struct tevent_req *req,
3436 TALLOC_CTX *mem_ctx,
3437 NTSTATUS *result)
3439 struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
3440 req, struct rpccli_samr_AddGroupMember_state);
3441 NTSTATUS status;
3443 if (tevent_req_is_nterror(req, &status)) {
3444 tevent_req_received(req);
3445 return status;
3448 /* Steal possbile out parameters to the callers context */
3449 talloc_steal(mem_ctx, state->out_mem_ctx);
3451 /* Return result */
3452 *result = state->orig.out.result;
3454 tevent_req_received(req);
3455 return NT_STATUS_OK;
3458 NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
3459 TALLOC_CTX *mem_ctx,
3460 struct policy_handle *group_handle /* [in] [ref] */,
3461 uint32_t rid /* [in] */,
3462 uint32_t flags /* [in] */)
3464 struct samr_AddGroupMember r;
3465 NTSTATUS status;
3467 /* In parameters */
3468 r.in.group_handle = group_handle;
3469 r.in.rid = rid;
3470 r.in.flags = flags;
3472 status = cli->dispatch(cli,
3473 mem_ctx,
3474 &ndr_table_samr,
3475 NDR_SAMR_ADDGROUPMEMBER,
3476 &r);
3478 if (!NT_STATUS_IS_OK(status)) {
3479 return status;
3482 if (NT_STATUS_IS_ERR(status)) {
3483 return status;
3486 /* Return variables */
3488 /* Return result */
3489 return r.out.result;
3492 struct rpccli_samr_DeleteDomainGroup_state {
3493 struct samr_DeleteDomainGroup orig;
3494 struct samr_DeleteDomainGroup tmp;
3495 TALLOC_CTX *out_mem_ctx;
3496 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3499 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq);
3501 struct tevent_req *rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
3502 struct tevent_context *ev,
3503 struct rpc_pipe_client *cli,
3504 struct policy_handle *_group_handle /* [in,out] [ref] */)
3506 struct tevent_req *req;
3507 struct rpccli_samr_DeleteDomainGroup_state *state;
3508 struct tevent_req *subreq;
3510 req = tevent_req_create(mem_ctx, &state,
3511 struct rpccli_samr_DeleteDomainGroup_state);
3512 if (req == NULL) {
3513 return NULL;
3515 state->out_mem_ctx = NULL;
3516 state->dispatch_recv = cli->dispatch_recv;
3518 /* In parameters */
3519 state->orig.in.group_handle = _group_handle;
3521 /* Out parameters */
3522 state->orig.out.group_handle = _group_handle;
3524 /* Result */
3525 ZERO_STRUCT(state->orig.out.result);
3527 state->out_mem_ctx = talloc_named_const(state, 0,
3528 "rpccli_samr_DeleteDomainGroup_out_memory");
3529 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3530 return tevent_req_post(req, ev);
3533 /* make a temporary copy, that we pass to the dispatch function */
3534 state->tmp = state->orig;
3536 subreq = cli->dispatch_send(state, ev, cli,
3537 &ndr_table_samr,
3538 NDR_SAMR_DELETEDOMAINGROUP,
3539 &state->tmp);
3540 if (tevent_req_nomem(subreq, req)) {
3541 return tevent_req_post(req, ev);
3543 tevent_req_set_callback(subreq, rpccli_samr_DeleteDomainGroup_done, req);
3544 return req;
3547 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq)
3549 struct tevent_req *req = tevent_req_callback_data(
3550 subreq, struct tevent_req);
3551 struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
3552 req, struct rpccli_samr_DeleteDomainGroup_state);
3553 NTSTATUS status;
3554 TALLOC_CTX *mem_ctx;
3556 if (state->out_mem_ctx) {
3557 mem_ctx = state->out_mem_ctx;
3558 } else {
3559 mem_ctx = state;
3562 status = state->dispatch_recv(subreq, mem_ctx);
3563 TALLOC_FREE(subreq);
3564 if (!NT_STATUS_IS_OK(status)) {
3565 tevent_req_nterror(req, status);
3566 return;
3569 /* Copy out parameters */
3570 *state->orig.out.group_handle = *state->tmp.out.group_handle;
3572 /* Copy result */
3573 state->orig.out.result = state->tmp.out.result;
3575 /* Reset temporary structure */
3576 ZERO_STRUCT(state->tmp);
3578 tevent_req_done(req);
3581 NTSTATUS rpccli_samr_DeleteDomainGroup_recv(struct tevent_req *req,
3582 TALLOC_CTX *mem_ctx,
3583 NTSTATUS *result)
3585 struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
3586 req, struct rpccli_samr_DeleteDomainGroup_state);
3587 NTSTATUS status;
3589 if (tevent_req_is_nterror(req, &status)) {
3590 tevent_req_received(req);
3591 return status;
3594 /* Steal possbile out parameters to the callers context */
3595 talloc_steal(mem_ctx, state->out_mem_ctx);
3597 /* Return result */
3598 *result = state->orig.out.result;
3600 tevent_req_received(req);
3601 return NT_STATUS_OK;
3604 NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
3605 TALLOC_CTX *mem_ctx,
3606 struct policy_handle *group_handle /* [in,out] [ref] */)
3608 struct samr_DeleteDomainGroup r;
3609 NTSTATUS status;
3611 /* In parameters */
3612 r.in.group_handle = group_handle;
3614 status = cli->dispatch(cli,
3615 mem_ctx,
3616 &ndr_table_samr,
3617 NDR_SAMR_DELETEDOMAINGROUP,
3618 &r);
3620 if (!NT_STATUS_IS_OK(status)) {
3621 return status;
3624 if (NT_STATUS_IS_ERR(status)) {
3625 return status;
3628 /* Return variables */
3629 *group_handle = *r.out.group_handle;
3631 /* Return result */
3632 return r.out.result;
3635 struct rpccli_samr_DeleteGroupMember_state {
3636 struct samr_DeleteGroupMember orig;
3637 struct samr_DeleteGroupMember tmp;
3638 TALLOC_CTX *out_mem_ctx;
3639 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3642 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq);
3644 struct tevent_req *rpccli_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
3645 struct tevent_context *ev,
3646 struct rpc_pipe_client *cli,
3647 struct policy_handle *_group_handle /* [in] [ref] */,
3648 uint32_t _rid /* [in] */)
3650 struct tevent_req *req;
3651 struct rpccli_samr_DeleteGroupMember_state *state;
3652 struct tevent_req *subreq;
3654 req = tevent_req_create(mem_ctx, &state,
3655 struct rpccli_samr_DeleteGroupMember_state);
3656 if (req == NULL) {
3657 return NULL;
3659 state->out_mem_ctx = NULL;
3660 state->dispatch_recv = cli->dispatch_recv;
3662 /* In parameters */
3663 state->orig.in.group_handle = _group_handle;
3664 state->orig.in.rid = _rid;
3666 /* Out parameters */
3668 /* Result */
3669 ZERO_STRUCT(state->orig.out.result);
3671 /* make a temporary copy, that we pass to the dispatch function */
3672 state->tmp = state->orig;
3674 subreq = cli->dispatch_send(state, ev, cli,
3675 &ndr_table_samr,
3676 NDR_SAMR_DELETEGROUPMEMBER,
3677 &state->tmp);
3678 if (tevent_req_nomem(subreq, req)) {
3679 return tevent_req_post(req, ev);
3681 tevent_req_set_callback(subreq, rpccli_samr_DeleteGroupMember_done, req);
3682 return req;
3685 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq)
3687 struct tevent_req *req = tevent_req_callback_data(
3688 subreq, struct tevent_req);
3689 struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
3690 req, struct rpccli_samr_DeleteGroupMember_state);
3691 NTSTATUS status;
3692 TALLOC_CTX *mem_ctx;
3694 if (state->out_mem_ctx) {
3695 mem_ctx = state->out_mem_ctx;
3696 } else {
3697 mem_ctx = state;
3700 status = state->dispatch_recv(subreq, mem_ctx);
3701 TALLOC_FREE(subreq);
3702 if (!NT_STATUS_IS_OK(status)) {
3703 tevent_req_nterror(req, status);
3704 return;
3707 /* Copy out parameters */
3709 /* Copy result */
3710 state->orig.out.result = state->tmp.out.result;
3712 /* Reset temporary structure */
3713 ZERO_STRUCT(state->tmp);
3715 tevent_req_done(req);
3718 NTSTATUS rpccli_samr_DeleteGroupMember_recv(struct tevent_req *req,
3719 TALLOC_CTX *mem_ctx,
3720 NTSTATUS *result)
3722 struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
3723 req, struct rpccli_samr_DeleteGroupMember_state);
3724 NTSTATUS status;
3726 if (tevent_req_is_nterror(req, &status)) {
3727 tevent_req_received(req);
3728 return status;
3731 /* Steal possbile out parameters to the callers context */
3732 talloc_steal(mem_ctx, state->out_mem_ctx);
3734 /* Return result */
3735 *result = state->orig.out.result;
3737 tevent_req_received(req);
3738 return NT_STATUS_OK;
3741 NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
3742 TALLOC_CTX *mem_ctx,
3743 struct policy_handle *group_handle /* [in] [ref] */,
3744 uint32_t rid /* [in] */)
3746 struct samr_DeleteGroupMember r;
3747 NTSTATUS status;
3749 /* In parameters */
3750 r.in.group_handle = group_handle;
3751 r.in.rid = rid;
3753 status = cli->dispatch(cli,
3754 mem_ctx,
3755 &ndr_table_samr,
3756 NDR_SAMR_DELETEGROUPMEMBER,
3757 &r);
3759 if (!NT_STATUS_IS_OK(status)) {
3760 return status;
3763 if (NT_STATUS_IS_ERR(status)) {
3764 return status;
3767 /* Return variables */
3769 /* Return result */
3770 return r.out.result;
3773 struct rpccli_samr_QueryGroupMember_state {
3774 struct samr_QueryGroupMember orig;
3775 struct samr_QueryGroupMember tmp;
3776 TALLOC_CTX *out_mem_ctx;
3777 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3780 static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq);
3782 struct tevent_req *rpccli_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
3783 struct tevent_context *ev,
3784 struct rpc_pipe_client *cli,
3785 struct policy_handle *_group_handle /* [in] [ref] */,
3786 struct samr_RidTypeArray **_rids /* [out] [ref] */)
3788 struct tevent_req *req;
3789 struct rpccli_samr_QueryGroupMember_state *state;
3790 struct tevent_req *subreq;
3792 req = tevent_req_create(mem_ctx, &state,
3793 struct rpccli_samr_QueryGroupMember_state);
3794 if (req == NULL) {
3795 return NULL;
3797 state->out_mem_ctx = NULL;
3798 state->dispatch_recv = cli->dispatch_recv;
3800 /* In parameters */
3801 state->orig.in.group_handle = _group_handle;
3803 /* Out parameters */
3804 state->orig.out.rids = _rids;
3806 /* Result */
3807 ZERO_STRUCT(state->orig.out.result);
3809 state->out_mem_ctx = talloc_named_const(state, 0,
3810 "rpccli_samr_QueryGroupMember_out_memory");
3811 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3812 return tevent_req_post(req, ev);
3815 /* make a temporary copy, that we pass to the dispatch function */
3816 state->tmp = state->orig;
3818 subreq = cli->dispatch_send(state, ev, cli,
3819 &ndr_table_samr,
3820 NDR_SAMR_QUERYGROUPMEMBER,
3821 &state->tmp);
3822 if (tevent_req_nomem(subreq, req)) {
3823 return tevent_req_post(req, ev);
3825 tevent_req_set_callback(subreq, rpccli_samr_QueryGroupMember_done, req);
3826 return req;
3829 static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq)
3831 struct tevent_req *req = tevent_req_callback_data(
3832 subreq, struct tevent_req);
3833 struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
3834 req, struct rpccli_samr_QueryGroupMember_state);
3835 NTSTATUS status;
3836 TALLOC_CTX *mem_ctx;
3838 if (state->out_mem_ctx) {
3839 mem_ctx = state->out_mem_ctx;
3840 } else {
3841 mem_ctx = state;
3844 status = state->dispatch_recv(subreq, mem_ctx);
3845 TALLOC_FREE(subreq);
3846 if (!NT_STATUS_IS_OK(status)) {
3847 tevent_req_nterror(req, status);
3848 return;
3851 /* Copy out parameters */
3852 *state->orig.out.rids = *state->tmp.out.rids;
3854 /* Copy result */
3855 state->orig.out.result = state->tmp.out.result;
3857 /* Reset temporary structure */
3858 ZERO_STRUCT(state->tmp);
3860 tevent_req_done(req);
3863 NTSTATUS rpccli_samr_QueryGroupMember_recv(struct tevent_req *req,
3864 TALLOC_CTX *mem_ctx,
3865 NTSTATUS *result)
3867 struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
3868 req, struct rpccli_samr_QueryGroupMember_state);
3869 NTSTATUS status;
3871 if (tevent_req_is_nterror(req, &status)) {
3872 tevent_req_received(req);
3873 return status;
3876 /* Steal possbile out parameters to the callers context */
3877 talloc_steal(mem_ctx, state->out_mem_ctx);
3879 /* Return result */
3880 *result = state->orig.out.result;
3882 tevent_req_received(req);
3883 return NT_STATUS_OK;
3886 NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
3887 TALLOC_CTX *mem_ctx,
3888 struct policy_handle *group_handle /* [in] [ref] */,
3889 struct samr_RidTypeArray **rids /* [out] [ref] */)
3891 struct samr_QueryGroupMember r;
3892 NTSTATUS status;
3894 /* In parameters */
3895 r.in.group_handle = group_handle;
3897 status = cli->dispatch(cli,
3898 mem_ctx,
3899 &ndr_table_samr,
3900 NDR_SAMR_QUERYGROUPMEMBER,
3901 &r);
3903 if (!NT_STATUS_IS_OK(status)) {
3904 return status;
3907 if (NT_STATUS_IS_ERR(status)) {
3908 return status;
3911 /* Return variables */
3912 *rids = *r.out.rids;
3914 /* Return result */
3915 return r.out.result;
3918 struct rpccli_samr_SetMemberAttributesOfGroup_state {
3919 struct samr_SetMemberAttributesOfGroup orig;
3920 struct samr_SetMemberAttributesOfGroup tmp;
3921 TALLOC_CTX *out_mem_ctx;
3922 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3925 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq);
3927 struct tevent_req *rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
3928 struct tevent_context *ev,
3929 struct rpc_pipe_client *cli,
3930 struct policy_handle *_group_handle /* [in] [ref] */,
3931 uint32_t _unknown1 /* [in] */,
3932 uint32_t _unknown2 /* [in] */)
3934 struct tevent_req *req;
3935 struct rpccli_samr_SetMemberAttributesOfGroup_state *state;
3936 struct tevent_req *subreq;
3938 req = tevent_req_create(mem_ctx, &state,
3939 struct rpccli_samr_SetMemberAttributesOfGroup_state);
3940 if (req == NULL) {
3941 return NULL;
3943 state->out_mem_ctx = NULL;
3944 state->dispatch_recv = cli->dispatch_recv;
3946 /* In parameters */
3947 state->orig.in.group_handle = _group_handle;
3948 state->orig.in.unknown1 = _unknown1;
3949 state->orig.in.unknown2 = _unknown2;
3951 /* Out parameters */
3953 /* Result */
3954 ZERO_STRUCT(state->orig.out.result);
3956 /* make a temporary copy, that we pass to the dispatch function */
3957 state->tmp = state->orig;
3959 subreq = cli->dispatch_send(state, ev, cli,
3960 &ndr_table_samr,
3961 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
3962 &state->tmp);
3963 if (tevent_req_nomem(subreq, req)) {
3964 return tevent_req_post(req, ev);
3966 tevent_req_set_callback(subreq, rpccli_samr_SetMemberAttributesOfGroup_done, req);
3967 return req;
3970 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq)
3972 struct tevent_req *req = tevent_req_callback_data(
3973 subreq, struct tevent_req);
3974 struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
3975 req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
3976 NTSTATUS status;
3977 TALLOC_CTX *mem_ctx;
3979 if (state->out_mem_ctx) {
3980 mem_ctx = state->out_mem_ctx;
3981 } else {
3982 mem_ctx = state;
3985 status = state->dispatch_recv(subreq, mem_ctx);
3986 TALLOC_FREE(subreq);
3987 if (!NT_STATUS_IS_OK(status)) {
3988 tevent_req_nterror(req, status);
3989 return;
3992 /* Copy out parameters */
3994 /* Copy result */
3995 state->orig.out.result = state->tmp.out.result;
3997 /* Reset temporary structure */
3998 ZERO_STRUCT(state->tmp);
4000 tevent_req_done(req);
4003 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
4004 TALLOC_CTX *mem_ctx,
4005 NTSTATUS *result)
4007 struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
4008 req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
4009 NTSTATUS status;
4011 if (tevent_req_is_nterror(req, &status)) {
4012 tevent_req_received(req);
4013 return status;
4016 /* Steal possbile out parameters to the callers context */
4017 talloc_steal(mem_ctx, state->out_mem_ctx);
4019 /* Return result */
4020 *result = state->orig.out.result;
4022 tevent_req_received(req);
4023 return NT_STATUS_OK;
4026 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
4027 TALLOC_CTX *mem_ctx,
4028 struct policy_handle *group_handle /* [in] [ref] */,
4029 uint32_t unknown1 /* [in] */,
4030 uint32_t unknown2 /* [in] */)
4032 struct samr_SetMemberAttributesOfGroup r;
4033 NTSTATUS status;
4035 /* In parameters */
4036 r.in.group_handle = group_handle;
4037 r.in.unknown1 = unknown1;
4038 r.in.unknown2 = unknown2;
4040 status = cli->dispatch(cli,
4041 mem_ctx,
4042 &ndr_table_samr,
4043 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
4044 &r);
4046 if (!NT_STATUS_IS_OK(status)) {
4047 return status;
4050 if (NT_STATUS_IS_ERR(status)) {
4051 return status;
4054 /* Return variables */
4056 /* Return result */
4057 return r.out.result;
4060 struct rpccli_samr_OpenAlias_state {
4061 struct samr_OpenAlias orig;
4062 struct samr_OpenAlias tmp;
4063 TALLOC_CTX *out_mem_ctx;
4064 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4067 static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq);
4069 struct tevent_req *rpccli_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
4070 struct tevent_context *ev,
4071 struct rpc_pipe_client *cli,
4072 struct policy_handle *_domain_handle /* [in] [ref] */,
4073 uint32_t _access_mask /* [in] */,
4074 uint32_t _rid /* [in] */,
4075 struct policy_handle *_alias_handle /* [out] [ref] */)
4077 struct tevent_req *req;
4078 struct rpccli_samr_OpenAlias_state *state;
4079 struct tevent_req *subreq;
4081 req = tevent_req_create(mem_ctx, &state,
4082 struct rpccli_samr_OpenAlias_state);
4083 if (req == NULL) {
4084 return NULL;
4086 state->out_mem_ctx = NULL;
4087 state->dispatch_recv = cli->dispatch_recv;
4089 /* In parameters */
4090 state->orig.in.domain_handle = _domain_handle;
4091 state->orig.in.access_mask = _access_mask;
4092 state->orig.in.rid = _rid;
4094 /* Out parameters */
4095 state->orig.out.alias_handle = _alias_handle;
4097 /* Result */
4098 ZERO_STRUCT(state->orig.out.result);
4100 state->out_mem_ctx = talloc_named_const(state, 0,
4101 "rpccli_samr_OpenAlias_out_memory");
4102 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4103 return tevent_req_post(req, ev);
4106 /* make a temporary copy, that we pass to the dispatch function */
4107 state->tmp = state->orig;
4109 subreq = cli->dispatch_send(state, ev, cli,
4110 &ndr_table_samr,
4111 NDR_SAMR_OPENALIAS,
4112 &state->tmp);
4113 if (tevent_req_nomem(subreq, req)) {
4114 return tevent_req_post(req, ev);
4116 tevent_req_set_callback(subreq, rpccli_samr_OpenAlias_done, req);
4117 return req;
4120 static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq)
4122 struct tevent_req *req = tevent_req_callback_data(
4123 subreq, struct tevent_req);
4124 struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
4125 req, struct rpccli_samr_OpenAlias_state);
4126 NTSTATUS status;
4127 TALLOC_CTX *mem_ctx;
4129 if (state->out_mem_ctx) {
4130 mem_ctx = state->out_mem_ctx;
4131 } else {
4132 mem_ctx = state;
4135 status = state->dispatch_recv(subreq, mem_ctx);
4136 TALLOC_FREE(subreq);
4137 if (!NT_STATUS_IS_OK(status)) {
4138 tevent_req_nterror(req, status);
4139 return;
4142 /* Copy out parameters */
4143 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
4145 /* Copy result */
4146 state->orig.out.result = state->tmp.out.result;
4148 /* Reset temporary structure */
4149 ZERO_STRUCT(state->tmp);
4151 tevent_req_done(req);
4154 NTSTATUS rpccli_samr_OpenAlias_recv(struct tevent_req *req,
4155 TALLOC_CTX *mem_ctx,
4156 NTSTATUS *result)
4158 struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
4159 req, struct rpccli_samr_OpenAlias_state);
4160 NTSTATUS status;
4162 if (tevent_req_is_nterror(req, &status)) {
4163 tevent_req_received(req);
4164 return status;
4167 /* Steal possbile out parameters to the callers context */
4168 talloc_steal(mem_ctx, state->out_mem_ctx);
4170 /* Return result */
4171 *result = state->orig.out.result;
4173 tevent_req_received(req);
4174 return NT_STATUS_OK;
4177 NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
4178 TALLOC_CTX *mem_ctx,
4179 struct policy_handle *domain_handle /* [in] [ref] */,
4180 uint32_t access_mask /* [in] */,
4181 uint32_t rid /* [in] */,
4182 struct policy_handle *alias_handle /* [out] [ref] */)
4184 struct samr_OpenAlias r;
4185 NTSTATUS status;
4187 /* In parameters */
4188 r.in.domain_handle = domain_handle;
4189 r.in.access_mask = access_mask;
4190 r.in.rid = rid;
4192 status = cli->dispatch(cli,
4193 mem_ctx,
4194 &ndr_table_samr,
4195 NDR_SAMR_OPENALIAS,
4196 &r);
4198 if (!NT_STATUS_IS_OK(status)) {
4199 return status;
4202 if (NT_STATUS_IS_ERR(status)) {
4203 return status;
4206 /* Return variables */
4207 *alias_handle = *r.out.alias_handle;
4209 /* Return result */
4210 return r.out.result;
4213 struct rpccli_samr_QueryAliasInfo_state {
4214 struct samr_QueryAliasInfo orig;
4215 struct samr_QueryAliasInfo tmp;
4216 TALLOC_CTX *out_mem_ctx;
4217 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4220 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq);
4222 struct tevent_req *rpccli_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
4223 struct tevent_context *ev,
4224 struct rpc_pipe_client *cli,
4225 struct policy_handle *_alias_handle /* [in] [ref] */,
4226 enum samr_AliasInfoEnum _level /* [in] */,
4227 union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */)
4229 struct tevent_req *req;
4230 struct rpccli_samr_QueryAliasInfo_state *state;
4231 struct tevent_req *subreq;
4233 req = tevent_req_create(mem_ctx, &state,
4234 struct rpccli_samr_QueryAliasInfo_state);
4235 if (req == NULL) {
4236 return NULL;
4238 state->out_mem_ctx = NULL;
4239 state->dispatch_recv = cli->dispatch_recv;
4241 /* In parameters */
4242 state->orig.in.alias_handle = _alias_handle;
4243 state->orig.in.level = _level;
4245 /* Out parameters */
4246 state->orig.out.info = _info;
4248 /* Result */
4249 ZERO_STRUCT(state->orig.out.result);
4251 state->out_mem_ctx = talloc_named_const(state, 0,
4252 "rpccli_samr_QueryAliasInfo_out_memory");
4253 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4254 return tevent_req_post(req, ev);
4257 /* make a temporary copy, that we pass to the dispatch function */
4258 state->tmp = state->orig;
4260 subreq = cli->dispatch_send(state, ev, cli,
4261 &ndr_table_samr,
4262 NDR_SAMR_QUERYALIASINFO,
4263 &state->tmp);
4264 if (tevent_req_nomem(subreq, req)) {
4265 return tevent_req_post(req, ev);
4267 tevent_req_set_callback(subreq, rpccli_samr_QueryAliasInfo_done, req);
4268 return req;
4271 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq)
4273 struct tevent_req *req = tevent_req_callback_data(
4274 subreq, struct tevent_req);
4275 struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
4276 req, struct rpccli_samr_QueryAliasInfo_state);
4277 NTSTATUS status;
4278 TALLOC_CTX *mem_ctx;
4280 if (state->out_mem_ctx) {
4281 mem_ctx = state->out_mem_ctx;
4282 } else {
4283 mem_ctx = state;
4286 status = state->dispatch_recv(subreq, mem_ctx);
4287 TALLOC_FREE(subreq);
4288 if (!NT_STATUS_IS_OK(status)) {
4289 tevent_req_nterror(req, status);
4290 return;
4293 /* Copy out parameters */
4294 *state->orig.out.info = *state->tmp.out.info;
4296 /* Copy result */
4297 state->orig.out.result = state->tmp.out.result;
4299 /* Reset temporary structure */
4300 ZERO_STRUCT(state->tmp);
4302 tevent_req_done(req);
4305 NTSTATUS rpccli_samr_QueryAliasInfo_recv(struct tevent_req *req,
4306 TALLOC_CTX *mem_ctx,
4307 NTSTATUS *result)
4309 struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
4310 req, struct rpccli_samr_QueryAliasInfo_state);
4311 NTSTATUS status;
4313 if (tevent_req_is_nterror(req, &status)) {
4314 tevent_req_received(req);
4315 return status;
4318 /* Steal possbile out parameters to the callers context */
4319 talloc_steal(mem_ctx, state->out_mem_ctx);
4321 /* Return result */
4322 *result = state->orig.out.result;
4324 tevent_req_received(req);
4325 return NT_STATUS_OK;
4328 NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
4329 TALLOC_CTX *mem_ctx,
4330 struct policy_handle *alias_handle /* [in] [ref] */,
4331 enum samr_AliasInfoEnum level /* [in] */,
4332 union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
4334 struct samr_QueryAliasInfo r;
4335 NTSTATUS status;
4337 /* In parameters */
4338 r.in.alias_handle = alias_handle;
4339 r.in.level = level;
4341 status = cli->dispatch(cli,
4342 mem_ctx,
4343 &ndr_table_samr,
4344 NDR_SAMR_QUERYALIASINFO,
4345 &r);
4347 if (!NT_STATUS_IS_OK(status)) {
4348 return status;
4351 if (NT_STATUS_IS_ERR(status)) {
4352 return status;
4355 /* Return variables */
4356 *info = *r.out.info;
4358 /* Return result */
4359 return r.out.result;
4362 struct rpccli_samr_SetAliasInfo_state {
4363 struct samr_SetAliasInfo orig;
4364 struct samr_SetAliasInfo tmp;
4365 TALLOC_CTX *out_mem_ctx;
4366 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4369 static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq);
4371 struct tevent_req *rpccli_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
4372 struct tevent_context *ev,
4373 struct rpc_pipe_client *cli,
4374 struct policy_handle *_alias_handle /* [in] [ref] */,
4375 enum samr_AliasInfoEnum _level /* [in] */,
4376 union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */)
4378 struct tevent_req *req;
4379 struct rpccli_samr_SetAliasInfo_state *state;
4380 struct tevent_req *subreq;
4382 req = tevent_req_create(mem_ctx, &state,
4383 struct rpccli_samr_SetAliasInfo_state);
4384 if (req == NULL) {
4385 return NULL;
4387 state->out_mem_ctx = NULL;
4388 state->dispatch_recv = cli->dispatch_recv;
4390 /* In parameters */
4391 state->orig.in.alias_handle = _alias_handle;
4392 state->orig.in.level = _level;
4393 state->orig.in.info = _info;
4395 /* Out parameters */
4397 /* Result */
4398 ZERO_STRUCT(state->orig.out.result);
4400 /* make a temporary copy, that we pass to the dispatch function */
4401 state->tmp = state->orig;
4403 subreq = cli->dispatch_send(state, ev, cli,
4404 &ndr_table_samr,
4405 NDR_SAMR_SETALIASINFO,
4406 &state->tmp);
4407 if (tevent_req_nomem(subreq, req)) {
4408 return tevent_req_post(req, ev);
4410 tevent_req_set_callback(subreq, rpccli_samr_SetAliasInfo_done, req);
4411 return req;
4414 static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq)
4416 struct tevent_req *req = tevent_req_callback_data(
4417 subreq, struct tevent_req);
4418 struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
4419 req, struct rpccli_samr_SetAliasInfo_state);
4420 NTSTATUS status;
4421 TALLOC_CTX *mem_ctx;
4423 if (state->out_mem_ctx) {
4424 mem_ctx = state->out_mem_ctx;
4425 } else {
4426 mem_ctx = state;
4429 status = state->dispatch_recv(subreq, mem_ctx);
4430 TALLOC_FREE(subreq);
4431 if (!NT_STATUS_IS_OK(status)) {
4432 tevent_req_nterror(req, status);
4433 return;
4436 /* Copy out parameters */
4438 /* Copy result */
4439 state->orig.out.result = state->tmp.out.result;
4441 /* Reset temporary structure */
4442 ZERO_STRUCT(state->tmp);
4444 tevent_req_done(req);
4447 NTSTATUS rpccli_samr_SetAliasInfo_recv(struct tevent_req *req,
4448 TALLOC_CTX *mem_ctx,
4449 NTSTATUS *result)
4451 struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
4452 req, struct rpccli_samr_SetAliasInfo_state);
4453 NTSTATUS status;
4455 if (tevent_req_is_nterror(req, &status)) {
4456 tevent_req_received(req);
4457 return status;
4460 /* Steal possbile out parameters to the callers context */
4461 talloc_steal(mem_ctx, state->out_mem_ctx);
4463 /* Return result */
4464 *result = state->orig.out.result;
4466 tevent_req_received(req);
4467 return NT_STATUS_OK;
4470 NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
4471 TALLOC_CTX *mem_ctx,
4472 struct policy_handle *alias_handle /* [in] [ref] */,
4473 enum samr_AliasInfoEnum level /* [in] */,
4474 union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
4476 struct samr_SetAliasInfo r;
4477 NTSTATUS status;
4479 /* In parameters */
4480 r.in.alias_handle = alias_handle;
4481 r.in.level = level;
4482 r.in.info = info;
4484 status = cli->dispatch(cli,
4485 mem_ctx,
4486 &ndr_table_samr,
4487 NDR_SAMR_SETALIASINFO,
4488 &r);
4490 if (!NT_STATUS_IS_OK(status)) {
4491 return status;
4494 if (NT_STATUS_IS_ERR(status)) {
4495 return status;
4498 /* Return variables */
4500 /* Return result */
4501 return r.out.result;
4504 struct rpccli_samr_DeleteDomAlias_state {
4505 struct samr_DeleteDomAlias orig;
4506 struct samr_DeleteDomAlias tmp;
4507 TALLOC_CTX *out_mem_ctx;
4508 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4511 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq);
4513 struct tevent_req *rpccli_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
4514 struct tevent_context *ev,
4515 struct rpc_pipe_client *cli,
4516 struct policy_handle *_alias_handle /* [in,out] [ref] */)
4518 struct tevent_req *req;
4519 struct rpccli_samr_DeleteDomAlias_state *state;
4520 struct tevent_req *subreq;
4522 req = tevent_req_create(mem_ctx, &state,
4523 struct rpccli_samr_DeleteDomAlias_state);
4524 if (req == NULL) {
4525 return NULL;
4527 state->out_mem_ctx = NULL;
4528 state->dispatch_recv = cli->dispatch_recv;
4530 /* In parameters */
4531 state->orig.in.alias_handle = _alias_handle;
4533 /* Out parameters */
4534 state->orig.out.alias_handle = _alias_handle;
4536 /* Result */
4537 ZERO_STRUCT(state->orig.out.result);
4539 state->out_mem_ctx = talloc_named_const(state, 0,
4540 "rpccli_samr_DeleteDomAlias_out_memory");
4541 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4542 return tevent_req_post(req, ev);
4545 /* make a temporary copy, that we pass to the dispatch function */
4546 state->tmp = state->orig;
4548 subreq = cli->dispatch_send(state, ev, cli,
4549 &ndr_table_samr,
4550 NDR_SAMR_DELETEDOMALIAS,
4551 &state->tmp);
4552 if (tevent_req_nomem(subreq, req)) {
4553 return tevent_req_post(req, ev);
4555 tevent_req_set_callback(subreq, rpccli_samr_DeleteDomAlias_done, req);
4556 return req;
4559 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq)
4561 struct tevent_req *req = tevent_req_callback_data(
4562 subreq, struct tevent_req);
4563 struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
4564 req, struct rpccli_samr_DeleteDomAlias_state);
4565 NTSTATUS status;
4566 TALLOC_CTX *mem_ctx;
4568 if (state->out_mem_ctx) {
4569 mem_ctx = state->out_mem_ctx;
4570 } else {
4571 mem_ctx = state;
4574 status = state->dispatch_recv(subreq, mem_ctx);
4575 TALLOC_FREE(subreq);
4576 if (!NT_STATUS_IS_OK(status)) {
4577 tevent_req_nterror(req, status);
4578 return;
4581 /* Copy out parameters */
4582 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
4584 /* Copy result */
4585 state->orig.out.result = state->tmp.out.result;
4587 /* Reset temporary structure */
4588 ZERO_STRUCT(state->tmp);
4590 tevent_req_done(req);
4593 NTSTATUS rpccli_samr_DeleteDomAlias_recv(struct tevent_req *req,
4594 TALLOC_CTX *mem_ctx,
4595 NTSTATUS *result)
4597 struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
4598 req, struct rpccli_samr_DeleteDomAlias_state);
4599 NTSTATUS status;
4601 if (tevent_req_is_nterror(req, &status)) {
4602 tevent_req_received(req);
4603 return status;
4606 /* Steal possbile out parameters to the callers context */
4607 talloc_steal(mem_ctx, state->out_mem_ctx);
4609 /* Return result */
4610 *result = state->orig.out.result;
4612 tevent_req_received(req);
4613 return NT_STATUS_OK;
4616 NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
4617 TALLOC_CTX *mem_ctx,
4618 struct policy_handle *alias_handle /* [in,out] [ref] */)
4620 struct samr_DeleteDomAlias r;
4621 NTSTATUS status;
4623 /* In parameters */
4624 r.in.alias_handle = alias_handle;
4626 status = cli->dispatch(cli,
4627 mem_ctx,
4628 &ndr_table_samr,
4629 NDR_SAMR_DELETEDOMALIAS,
4630 &r);
4632 if (!NT_STATUS_IS_OK(status)) {
4633 return status;
4636 if (NT_STATUS_IS_ERR(status)) {
4637 return status;
4640 /* Return variables */
4641 *alias_handle = *r.out.alias_handle;
4643 /* Return result */
4644 return r.out.result;
4647 struct rpccli_samr_AddAliasMember_state {
4648 struct samr_AddAliasMember orig;
4649 struct samr_AddAliasMember tmp;
4650 TALLOC_CTX *out_mem_ctx;
4651 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4654 static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq);
4656 struct tevent_req *rpccli_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
4657 struct tevent_context *ev,
4658 struct rpc_pipe_client *cli,
4659 struct policy_handle *_alias_handle /* [in] [ref] */,
4660 struct dom_sid2 *_sid /* [in] [ref] */)
4662 struct tevent_req *req;
4663 struct rpccli_samr_AddAliasMember_state *state;
4664 struct tevent_req *subreq;
4666 req = tevent_req_create(mem_ctx, &state,
4667 struct rpccli_samr_AddAliasMember_state);
4668 if (req == NULL) {
4669 return NULL;
4671 state->out_mem_ctx = NULL;
4672 state->dispatch_recv = cli->dispatch_recv;
4674 /* In parameters */
4675 state->orig.in.alias_handle = _alias_handle;
4676 state->orig.in.sid = _sid;
4678 /* Out parameters */
4680 /* Result */
4681 ZERO_STRUCT(state->orig.out.result);
4683 /* make a temporary copy, that we pass to the dispatch function */
4684 state->tmp = state->orig;
4686 subreq = cli->dispatch_send(state, ev, cli,
4687 &ndr_table_samr,
4688 NDR_SAMR_ADDALIASMEMBER,
4689 &state->tmp);
4690 if (tevent_req_nomem(subreq, req)) {
4691 return tevent_req_post(req, ev);
4693 tevent_req_set_callback(subreq, rpccli_samr_AddAliasMember_done, req);
4694 return req;
4697 static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq)
4699 struct tevent_req *req = tevent_req_callback_data(
4700 subreq, struct tevent_req);
4701 struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
4702 req, struct rpccli_samr_AddAliasMember_state);
4703 NTSTATUS status;
4704 TALLOC_CTX *mem_ctx;
4706 if (state->out_mem_ctx) {
4707 mem_ctx = state->out_mem_ctx;
4708 } else {
4709 mem_ctx = state;
4712 status = state->dispatch_recv(subreq, mem_ctx);
4713 TALLOC_FREE(subreq);
4714 if (!NT_STATUS_IS_OK(status)) {
4715 tevent_req_nterror(req, status);
4716 return;
4719 /* Copy out parameters */
4721 /* Copy result */
4722 state->orig.out.result = state->tmp.out.result;
4724 /* Reset temporary structure */
4725 ZERO_STRUCT(state->tmp);
4727 tevent_req_done(req);
4730 NTSTATUS rpccli_samr_AddAliasMember_recv(struct tevent_req *req,
4731 TALLOC_CTX *mem_ctx,
4732 NTSTATUS *result)
4734 struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
4735 req, struct rpccli_samr_AddAliasMember_state);
4736 NTSTATUS status;
4738 if (tevent_req_is_nterror(req, &status)) {
4739 tevent_req_received(req);
4740 return status;
4743 /* Steal possbile out parameters to the callers context */
4744 talloc_steal(mem_ctx, state->out_mem_ctx);
4746 /* Return result */
4747 *result = state->orig.out.result;
4749 tevent_req_received(req);
4750 return NT_STATUS_OK;
4753 NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
4754 TALLOC_CTX *mem_ctx,
4755 struct policy_handle *alias_handle /* [in] [ref] */,
4756 struct dom_sid2 *sid /* [in] [ref] */)
4758 struct samr_AddAliasMember r;
4759 NTSTATUS status;
4761 /* In parameters */
4762 r.in.alias_handle = alias_handle;
4763 r.in.sid = sid;
4765 status = cli->dispatch(cli,
4766 mem_ctx,
4767 &ndr_table_samr,
4768 NDR_SAMR_ADDALIASMEMBER,
4769 &r);
4771 if (!NT_STATUS_IS_OK(status)) {
4772 return status;
4775 if (NT_STATUS_IS_ERR(status)) {
4776 return status;
4779 /* Return variables */
4781 /* Return result */
4782 return r.out.result;
4785 struct rpccli_samr_DeleteAliasMember_state {
4786 struct samr_DeleteAliasMember orig;
4787 struct samr_DeleteAliasMember tmp;
4788 TALLOC_CTX *out_mem_ctx;
4789 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4792 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq);
4794 struct tevent_req *rpccli_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
4795 struct tevent_context *ev,
4796 struct rpc_pipe_client *cli,
4797 struct policy_handle *_alias_handle /* [in] [ref] */,
4798 struct dom_sid2 *_sid /* [in] [ref] */)
4800 struct tevent_req *req;
4801 struct rpccli_samr_DeleteAliasMember_state *state;
4802 struct tevent_req *subreq;
4804 req = tevent_req_create(mem_ctx, &state,
4805 struct rpccli_samr_DeleteAliasMember_state);
4806 if (req == NULL) {
4807 return NULL;
4809 state->out_mem_ctx = NULL;
4810 state->dispatch_recv = cli->dispatch_recv;
4812 /* In parameters */
4813 state->orig.in.alias_handle = _alias_handle;
4814 state->orig.in.sid = _sid;
4816 /* Out parameters */
4818 /* Result */
4819 ZERO_STRUCT(state->orig.out.result);
4821 /* make a temporary copy, that we pass to the dispatch function */
4822 state->tmp = state->orig;
4824 subreq = cli->dispatch_send(state, ev, cli,
4825 &ndr_table_samr,
4826 NDR_SAMR_DELETEALIASMEMBER,
4827 &state->tmp);
4828 if (tevent_req_nomem(subreq, req)) {
4829 return tevent_req_post(req, ev);
4831 tevent_req_set_callback(subreq, rpccli_samr_DeleteAliasMember_done, req);
4832 return req;
4835 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq)
4837 struct tevent_req *req = tevent_req_callback_data(
4838 subreq, struct tevent_req);
4839 struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
4840 req, struct rpccli_samr_DeleteAliasMember_state);
4841 NTSTATUS status;
4842 TALLOC_CTX *mem_ctx;
4844 if (state->out_mem_ctx) {
4845 mem_ctx = state->out_mem_ctx;
4846 } else {
4847 mem_ctx = state;
4850 status = state->dispatch_recv(subreq, mem_ctx);
4851 TALLOC_FREE(subreq);
4852 if (!NT_STATUS_IS_OK(status)) {
4853 tevent_req_nterror(req, status);
4854 return;
4857 /* Copy out parameters */
4859 /* Copy result */
4860 state->orig.out.result = state->tmp.out.result;
4862 /* Reset temporary structure */
4863 ZERO_STRUCT(state->tmp);
4865 tevent_req_done(req);
4868 NTSTATUS rpccli_samr_DeleteAliasMember_recv(struct tevent_req *req,
4869 TALLOC_CTX *mem_ctx,
4870 NTSTATUS *result)
4872 struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
4873 req, struct rpccli_samr_DeleteAliasMember_state);
4874 NTSTATUS status;
4876 if (tevent_req_is_nterror(req, &status)) {
4877 tevent_req_received(req);
4878 return status;
4881 /* Steal possbile out parameters to the callers context */
4882 talloc_steal(mem_ctx, state->out_mem_ctx);
4884 /* Return result */
4885 *result = state->orig.out.result;
4887 tevent_req_received(req);
4888 return NT_STATUS_OK;
4891 NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
4892 TALLOC_CTX *mem_ctx,
4893 struct policy_handle *alias_handle /* [in] [ref] */,
4894 struct dom_sid2 *sid /* [in] [ref] */)
4896 struct samr_DeleteAliasMember r;
4897 NTSTATUS status;
4899 /* In parameters */
4900 r.in.alias_handle = alias_handle;
4901 r.in.sid = sid;
4903 status = cli->dispatch(cli,
4904 mem_ctx,
4905 &ndr_table_samr,
4906 NDR_SAMR_DELETEALIASMEMBER,
4907 &r);
4909 if (!NT_STATUS_IS_OK(status)) {
4910 return status;
4913 if (NT_STATUS_IS_ERR(status)) {
4914 return status;
4917 /* Return variables */
4919 /* Return result */
4920 return r.out.result;
4923 struct rpccli_samr_GetMembersInAlias_state {
4924 struct samr_GetMembersInAlias orig;
4925 struct samr_GetMembersInAlias tmp;
4926 TALLOC_CTX *out_mem_ctx;
4927 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4930 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq);
4932 struct tevent_req *rpccli_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
4933 struct tevent_context *ev,
4934 struct rpc_pipe_client *cli,
4935 struct policy_handle *_alias_handle /* [in] [ref] */,
4936 struct lsa_SidArray *_sids /* [out] [ref] */)
4938 struct tevent_req *req;
4939 struct rpccli_samr_GetMembersInAlias_state *state;
4940 struct tevent_req *subreq;
4942 req = tevent_req_create(mem_ctx, &state,
4943 struct rpccli_samr_GetMembersInAlias_state);
4944 if (req == NULL) {
4945 return NULL;
4947 state->out_mem_ctx = NULL;
4948 state->dispatch_recv = cli->dispatch_recv;
4950 /* In parameters */
4951 state->orig.in.alias_handle = _alias_handle;
4953 /* Out parameters */
4954 state->orig.out.sids = _sids;
4956 /* Result */
4957 ZERO_STRUCT(state->orig.out.result);
4959 state->out_mem_ctx = talloc_named_const(state, 0,
4960 "rpccli_samr_GetMembersInAlias_out_memory");
4961 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4962 return tevent_req_post(req, ev);
4965 /* make a temporary copy, that we pass to the dispatch function */
4966 state->tmp = state->orig;
4968 subreq = cli->dispatch_send(state, ev, cli,
4969 &ndr_table_samr,
4970 NDR_SAMR_GETMEMBERSINALIAS,
4971 &state->tmp);
4972 if (tevent_req_nomem(subreq, req)) {
4973 return tevent_req_post(req, ev);
4975 tevent_req_set_callback(subreq, rpccli_samr_GetMembersInAlias_done, req);
4976 return req;
4979 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq)
4981 struct tevent_req *req = tevent_req_callback_data(
4982 subreq, struct tevent_req);
4983 struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
4984 req, struct rpccli_samr_GetMembersInAlias_state);
4985 NTSTATUS status;
4986 TALLOC_CTX *mem_ctx;
4988 if (state->out_mem_ctx) {
4989 mem_ctx = state->out_mem_ctx;
4990 } else {
4991 mem_ctx = state;
4994 status = state->dispatch_recv(subreq, mem_ctx);
4995 TALLOC_FREE(subreq);
4996 if (!NT_STATUS_IS_OK(status)) {
4997 tevent_req_nterror(req, status);
4998 return;
5001 /* Copy out parameters */
5002 *state->orig.out.sids = *state->tmp.out.sids;
5004 /* Copy result */
5005 state->orig.out.result = state->tmp.out.result;
5007 /* Reset temporary structure */
5008 ZERO_STRUCT(state->tmp);
5010 tevent_req_done(req);
5013 NTSTATUS rpccli_samr_GetMembersInAlias_recv(struct tevent_req *req,
5014 TALLOC_CTX *mem_ctx,
5015 NTSTATUS *result)
5017 struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
5018 req, struct rpccli_samr_GetMembersInAlias_state);
5019 NTSTATUS status;
5021 if (tevent_req_is_nterror(req, &status)) {
5022 tevent_req_received(req);
5023 return status;
5026 /* Steal possbile out parameters to the callers context */
5027 talloc_steal(mem_ctx, state->out_mem_ctx);
5029 /* Return result */
5030 *result = state->orig.out.result;
5032 tevent_req_received(req);
5033 return NT_STATUS_OK;
5036 NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
5037 TALLOC_CTX *mem_ctx,
5038 struct policy_handle *alias_handle /* [in] [ref] */,
5039 struct lsa_SidArray *sids /* [out] [ref] */)
5041 struct samr_GetMembersInAlias r;
5042 NTSTATUS status;
5044 /* In parameters */
5045 r.in.alias_handle = alias_handle;
5047 status = cli->dispatch(cli,
5048 mem_ctx,
5049 &ndr_table_samr,
5050 NDR_SAMR_GETMEMBERSINALIAS,
5051 &r);
5053 if (!NT_STATUS_IS_OK(status)) {
5054 return status;
5057 if (NT_STATUS_IS_ERR(status)) {
5058 return status;
5061 /* Return variables */
5062 *sids = *r.out.sids;
5064 /* Return result */
5065 return r.out.result;
5068 struct rpccli_samr_OpenUser_state {
5069 struct samr_OpenUser orig;
5070 struct samr_OpenUser tmp;
5071 TALLOC_CTX *out_mem_ctx;
5072 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5075 static void rpccli_samr_OpenUser_done(struct tevent_req *subreq);
5077 struct tevent_req *rpccli_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
5078 struct tevent_context *ev,
5079 struct rpc_pipe_client *cli,
5080 struct policy_handle *_domain_handle /* [in] [ref] */,
5081 uint32_t _access_mask /* [in] */,
5082 uint32_t _rid /* [in] */,
5083 struct policy_handle *_user_handle /* [out] [ref] */)
5085 struct tevent_req *req;
5086 struct rpccli_samr_OpenUser_state *state;
5087 struct tevent_req *subreq;
5089 req = tevent_req_create(mem_ctx, &state,
5090 struct rpccli_samr_OpenUser_state);
5091 if (req == NULL) {
5092 return NULL;
5094 state->out_mem_ctx = NULL;
5095 state->dispatch_recv = cli->dispatch_recv;
5097 /* In parameters */
5098 state->orig.in.domain_handle = _domain_handle;
5099 state->orig.in.access_mask = _access_mask;
5100 state->orig.in.rid = _rid;
5102 /* Out parameters */
5103 state->orig.out.user_handle = _user_handle;
5105 /* Result */
5106 ZERO_STRUCT(state->orig.out.result);
5108 state->out_mem_ctx = talloc_named_const(state, 0,
5109 "rpccli_samr_OpenUser_out_memory");
5110 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5111 return tevent_req_post(req, ev);
5114 /* make a temporary copy, that we pass to the dispatch function */
5115 state->tmp = state->orig;
5117 subreq = cli->dispatch_send(state, ev, cli,
5118 &ndr_table_samr,
5119 NDR_SAMR_OPENUSER,
5120 &state->tmp);
5121 if (tevent_req_nomem(subreq, req)) {
5122 return tevent_req_post(req, ev);
5124 tevent_req_set_callback(subreq, rpccli_samr_OpenUser_done, req);
5125 return req;
5128 static void rpccli_samr_OpenUser_done(struct tevent_req *subreq)
5130 struct tevent_req *req = tevent_req_callback_data(
5131 subreq, struct tevent_req);
5132 struct rpccli_samr_OpenUser_state *state = tevent_req_data(
5133 req, struct rpccli_samr_OpenUser_state);
5134 NTSTATUS status;
5135 TALLOC_CTX *mem_ctx;
5137 if (state->out_mem_ctx) {
5138 mem_ctx = state->out_mem_ctx;
5139 } else {
5140 mem_ctx = state;
5143 status = state->dispatch_recv(subreq, mem_ctx);
5144 TALLOC_FREE(subreq);
5145 if (!NT_STATUS_IS_OK(status)) {
5146 tevent_req_nterror(req, status);
5147 return;
5150 /* Copy out parameters */
5151 *state->orig.out.user_handle = *state->tmp.out.user_handle;
5153 /* Copy result */
5154 state->orig.out.result = state->tmp.out.result;
5156 /* Reset temporary structure */
5157 ZERO_STRUCT(state->tmp);
5159 tevent_req_done(req);
5162 NTSTATUS rpccli_samr_OpenUser_recv(struct tevent_req *req,
5163 TALLOC_CTX *mem_ctx,
5164 NTSTATUS *result)
5166 struct rpccli_samr_OpenUser_state *state = tevent_req_data(
5167 req, struct rpccli_samr_OpenUser_state);
5168 NTSTATUS status;
5170 if (tevent_req_is_nterror(req, &status)) {
5171 tevent_req_received(req);
5172 return status;
5175 /* Steal possbile out parameters to the callers context */
5176 talloc_steal(mem_ctx, state->out_mem_ctx);
5178 /* Return result */
5179 *result = state->orig.out.result;
5181 tevent_req_received(req);
5182 return NT_STATUS_OK;
5185 NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
5186 TALLOC_CTX *mem_ctx,
5187 struct policy_handle *domain_handle /* [in] [ref] */,
5188 uint32_t access_mask /* [in] */,
5189 uint32_t rid /* [in] */,
5190 struct policy_handle *user_handle /* [out] [ref] */)
5192 struct samr_OpenUser r;
5193 NTSTATUS status;
5195 /* In parameters */
5196 r.in.domain_handle = domain_handle;
5197 r.in.access_mask = access_mask;
5198 r.in.rid = rid;
5200 status = cli->dispatch(cli,
5201 mem_ctx,
5202 &ndr_table_samr,
5203 NDR_SAMR_OPENUSER,
5204 &r);
5206 if (!NT_STATUS_IS_OK(status)) {
5207 return status;
5210 if (NT_STATUS_IS_ERR(status)) {
5211 return status;
5214 /* Return variables */
5215 *user_handle = *r.out.user_handle;
5217 /* Return result */
5218 return r.out.result;
5221 struct rpccli_samr_DeleteUser_state {
5222 struct samr_DeleteUser orig;
5223 struct samr_DeleteUser tmp;
5224 TALLOC_CTX *out_mem_ctx;
5225 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5228 static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq);
5230 struct tevent_req *rpccli_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
5231 struct tevent_context *ev,
5232 struct rpc_pipe_client *cli,
5233 struct policy_handle *_user_handle /* [in,out] [ref] */)
5235 struct tevent_req *req;
5236 struct rpccli_samr_DeleteUser_state *state;
5237 struct tevent_req *subreq;
5239 req = tevent_req_create(mem_ctx, &state,
5240 struct rpccli_samr_DeleteUser_state);
5241 if (req == NULL) {
5242 return NULL;
5244 state->out_mem_ctx = NULL;
5245 state->dispatch_recv = cli->dispatch_recv;
5247 /* In parameters */
5248 state->orig.in.user_handle = _user_handle;
5250 /* Out parameters */
5251 state->orig.out.user_handle = _user_handle;
5253 /* Result */
5254 ZERO_STRUCT(state->orig.out.result);
5256 state->out_mem_ctx = talloc_named_const(state, 0,
5257 "rpccli_samr_DeleteUser_out_memory");
5258 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5259 return tevent_req_post(req, ev);
5262 /* make a temporary copy, that we pass to the dispatch function */
5263 state->tmp = state->orig;
5265 subreq = cli->dispatch_send(state, ev, cli,
5266 &ndr_table_samr,
5267 NDR_SAMR_DELETEUSER,
5268 &state->tmp);
5269 if (tevent_req_nomem(subreq, req)) {
5270 return tevent_req_post(req, ev);
5272 tevent_req_set_callback(subreq, rpccli_samr_DeleteUser_done, req);
5273 return req;
5276 static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq)
5278 struct tevent_req *req = tevent_req_callback_data(
5279 subreq, struct tevent_req);
5280 struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
5281 req, struct rpccli_samr_DeleteUser_state);
5282 NTSTATUS status;
5283 TALLOC_CTX *mem_ctx;
5285 if (state->out_mem_ctx) {
5286 mem_ctx = state->out_mem_ctx;
5287 } else {
5288 mem_ctx = state;
5291 status = state->dispatch_recv(subreq, mem_ctx);
5292 TALLOC_FREE(subreq);
5293 if (!NT_STATUS_IS_OK(status)) {
5294 tevent_req_nterror(req, status);
5295 return;
5298 /* Copy out parameters */
5299 *state->orig.out.user_handle = *state->tmp.out.user_handle;
5301 /* Copy result */
5302 state->orig.out.result = state->tmp.out.result;
5304 /* Reset temporary structure */
5305 ZERO_STRUCT(state->tmp);
5307 tevent_req_done(req);
5310 NTSTATUS rpccli_samr_DeleteUser_recv(struct tevent_req *req,
5311 TALLOC_CTX *mem_ctx,
5312 NTSTATUS *result)
5314 struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
5315 req, struct rpccli_samr_DeleteUser_state);
5316 NTSTATUS status;
5318 if (tevent_req_is_nterror(req, &status)) {
5319 tevent_req_received(req);
5320 return status;
5323 /* Steal possbile out parameters to the callers context */
5324 talloc_steal(mem_ctx, state->out_mem_ctx);
5326 /* Return result */
5327 *result = state->orig.out.result;
5329 tevent_req_received(req);
5330 return NT_STATUS_OK;
5333 NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
5334 TALLOC_CTX *mem_ctx,
5335 struct policy_handle *user_handle /* [in,out] [ref] */)
5337 struct samr_DeleteUser r;
5338 NTSTATUS status;
5340 /* In parameters */
5341 r.in.user_handle = user_handle;
5343 status = cli->dispatch(cli,
5344 mem_ctx,
5345 &ndr_table_samr,
5346 NDR_SAMR_DELETEUSER,
5347 &r);
5349 if (!NT_STATUS_IS_OK(status)) {
5350 return status;
5353 if (NT_STATUS_IS_ERR(status)) {
5354 return status;
5357 /* Return variables */
5358 *user_handle = *r.out.user_handle;
5360 /* Return result */
5361 return r.out.result;
5364 struct rpccli_samr_QueryUserInfo_state {
5365 struct samr_QueryUserInfo orig;
5366 struct samr_QueryUserInfo tmp;
5367 TALLOC_CTX *out_mem_ctx;
5368 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5371 static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq);
5373 struct tevent_req *rpccli_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
5374 struct tevent_context *ev,
5375 struct rpc_pipe_client *cli,
5376 struct policy_handle *_user_handle /* [in] [ref] */,
5377 enum samr_UserInfoLevel _level /* [in] */,
5378 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
5380 struct tevent_req *req;
5381 struct rpccli_samr_QueryUserInfo_state *state;
5382 struct tevent_req *subreq;
5384 req = tevent_req_create(mem_ctx, &state,
5385 struct rpccli_samr_QueryUserInfo_state);
5386 if (req == NULL) {
5387 return NULL;
5389 state->out_mem_ctx = NULL;
5390 state->dispatch_recv = cli->dispatch_recv;
5392 /* In parameters */
5393 state->orig.in.user_handle = _user_handle;
5394 state->orig.in.level = _level;
5396 /* Out parameters */
5397 state->orig.out.info = _info;
5399 /* Result */
5400 ZERO_STRUCT(state->orig.out.result);
5402 state->out_mem_ctx = talloc_named_const(state, 0,
5403 "rpccli_samr_QueryUserInfo_out_memory");
5404 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5405 return tevent_req_post(req, ev);
5408 /* make a temporary copy, that we pass to the dispatch function */
5409 state->tmp = state->orig;
5411 subreq = cli->dispatch_send(state, ev, cli,
5412 &ndr_table_samr,
5413 NDR_SAMR_QUERYUSERINFO,
5414 &state->tmp);
5415 if (tevent_req_nomem(subreq, req)) {
5416 return tevent_req_post(req, ev);
5418 tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo_done, req);
5419 return req;
5422 static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq)
5424 struct tevent_req *req = tevent_req_callback_data(
5425 subreq, struct tevent_req);
5426 struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
5427 req, struct rpccli_samr_QueryUserInfo_state);
5428 NTSTATUS status;
5429 TALLOC_CTX *mem_ctx;
5431 if (state->out_mem_ctx) {
5432 mem_ctx = state->out_mem_ctx;
5433 } else {
5434 mem_ctx = state;
5437 status = state->dispatch_recv(subreq, mem_ctx);
5438 TALLOC_FREE(subreq);
5439 if (!NT_STATUS_IS_OK(status)) {
5440 tevent_req_nterror(req, status);
5441 return;
5444 /* Copy out parameters */
5445 *state->orig.out.info = *state->tmp.out.info;
5447 /* Copy result */
5448 state->orig.out.result = state->tmp.out.result;
5450 /* Reset temporary structure */
5451 ZERO_STRUCT(state->tmp);
5453 tevent_req_done(req);
5456 NTSTATUS rpccli_samr_QueryUserInfo_recv(struct tevent_req *req,
5457 TALLOC_CTX *mem_ctx,
5458 NTSTATUS *result)
5460 struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
5461 req, struct rpccli_samr_QueryUserInfo_state);
5462 NTSTATUS status;
5464 if (tevent_req_is_nterror(req, &status)) {
5465 tevent_req_received(req);
5466 return status;
5469 /* Steal possbile out parameters to the callers context */
5470 talloc_steal(mem_ctx, state->out_mem_ctx);
5472 /* Return result */
5473 *result = state->orig.out.result;
5475 tevent_req_received(req);
5476 return NT_STATUS_OK;
5479 NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
5480 TALLOC_CTX *mem_ctx,
5481 struct policy_handle *user_handle /* [in] [ref] */,
5482 enum samr_UserInfoLevel level /* [in] */,
5483 union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
5485 struct samr_QueryUserInfo r;
5486 NTSTATUS status;
5488 /* In parameters */
5489 r.in.user_handle = user_handle;
5490 r.in.level = level;
5492 status = cli->dispatch(cli,
5493 mem_ctx,
5494 &ndr_table_samr,
5495 NDR_SAMR_QUERYUSERINFO,
5496 &r);
5498 if (!NT_STATUS_IS_OK(status)) {
5499 return status;
5502 if (NT_STATUS_IS_ERR(status)) {
5503 return status;
5506 /* Return variables */
5507 *info = *r.out.info;
5509 /* Return result */
5510 return r.out.result;
5513 struct rpccli_samr_SetUserInfo_state {
5514 struct samr_SetUserInfo orig;
5515 struct samr_SetUserInfo tmp;
5516 TALLOC_CTX *out_mem_ctx;
5517 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5520 static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq);
5522 struct tevent_req *rpccli_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
5523 struct tevent_context *ev,
5524 struct rpc_pipe_client *cli,
5525 struct policy_handle *_user_handle /* [in] [ref] */,
5526 enum samr_UserInfoLevel _level /* [in] */,
5527 union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
5529 struct tevent_req *req;
5530 struct rpccli_samr_SetUserInfo_state *state;
5531 struct tevent_req *subreq;
5533 req = tevent_req_create(mem_ctx, &state,
5534 struct rpccli_samr_SetUserInfo_state);
5535 if (req == NULL) {
5536 return NULL;
5538 state->out_mem_ctx = NULL;
5539 state->dispatch_recv = cli->dispatch_recv;
5541 /* In parameters */
5542 state->orig.in.user_handle = _user_handle;
5543 state->orig.in.level = _level;
5544 state->orig.in.info = _info;
5546 /* Out parameters */
5548 /* Result */
5549 ZERO_STRUCT(state->orig.out.result);
5551 /* make a temporary copy, that we pass to the dispatch function */
5552 state->tmp = state->orig;
5554 subreq = cli->dispatch_send(state, ev, cli,
5555 &ndr_table_samr,
5556 NDR_SAMR_SETUSERINFO,
5557 &state->tmp);
5558 if (tevent_req_nomem(subreq, req)) {
5559 return tevent_req_post(req, ev);
5561 tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo_done, req);
5562 return req;
5565 static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq)
5567 struct tevent_req *req = tevent_req_callback_data(
5568 subreq, struct tevent_req);
5569 struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
5570 req, struct rpccli_samr_SetUserInfo_state);
5571 NTSTATUS status;
5572 TALLOC_CTX *mem_ctx;
5574 if (state->out_mem_ctx) {
5575 mem_ctx = state->out_mem_ctx;
5576 } else {
5577 mem_ctx = state;
5580 status = state->dispatch_recv(subreq, mem_ctx);
5581 TALLOC_FREE(subreq);
5582 if (!NT_STATUS_IS_OK(status)) {
5583 tevent_req_nterror(req, status);
5584 return;
5587 /* Copy out parameters */
5589 /* Copy result */
5590 state->orig.out.result = state->tmp.out.result;
5592 /* Reset temporary structure */
5593 ZERO_STRUCT(state->tmp);
5595 tevent_req_done(req);
5598 NTSTATUS rpccli_samr_SetUserInfo_recv(struct tevent_req *req,
5599 TALLOC_CTX *mem_ctx,
5600 NTSTATUS *result)
5602 struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
5603 req, struct rpccli_samr_SetUserInfo_state);
5604 NTSTATUS status;
5606 if (tevent_req_is_nterror(req, &status)) {
5607 tevent_req_received(req);
5608 return status;
5611 /* Steal possbile out parameters to the callers context */
5612 talloc_steal(mem_ctx, state->out_mem_ctx);
5614 /* Return result */
5615 *result = state->orig.out.result;
5617 tevent_req_received(req);
5618 return NT_STATUS_OK;
5621 NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
5622 TALLOC_CTX *mem_ctx,
5623 struct policy_handle *user_handle /* [in] [ref] */,
5624 enum samr_UserInfoLevel level /* [in] */,
5625 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
5627 struct samr_SetUserInfo r;
5628 NTSTATUS status;
5630 /* In parameters */
5631 r.in.user_handle = user_handle;
5632 r.in.level = level;
5633 r.in.info = info;
5635 status = cli->dispatch(cli,
5636 mem_ctx,
5637 &ndr_table_samr,
5638 NDR_SAMR_SETUSERINFO,
5639 &r);
5641 if (!NT_STATUS_IS_OK(status)) {
5642 return status;
5645 if (NT_STATUS_IS_ERR(status)) {
5646 return status;
5649 /* Return variables */
5651 /* Return result */
5652 return r.out.result;
5655 struct rpccli_samr_ChangePasswordUser_state {
5656 struct samr_ChangePasswordUser orig;
5657 struct samr_ChangePasswordUser tmp;
5658 TALLOC_CTX *out_mem_ctx;
5659 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5662 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq);
5664 struct tevent_req *rpccli_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
5665 struct tevent_context *ev,
5666 struct rpc_pipe_client *cli,
5667 struct policy_handle *_user_handle /* [in] [ref] */,
5668 uint8_t _lm_present /* [in] */,
5669 struct samr_Password *_old_lm_crypted /* [in] [unique] */,
5670 struct samr_Password *_new_lm_crypted /* [in] [unique] */,
5671 uint8_t _nt_present /* [in] */,
5672 struct samr_Password *_old_nt_crypted /* [in] [unique] */,
5673 struct samr_Password *_new_nt_crypted /* [in] [unique] */,
5674 uint8_t _cross1_present /* [in] */,
5675 struct samr_Password *_nt_cross /* [in] [unique] */,
5676 uint8_t _cross2_present /* [in] */,
5677 struct samr_Password *_lm_cross /* [in] [unique] */)
5679 struct tevent_req *req;
5680 struct rpccli_samr_ChangePasswordUser_state *state;
5681 struct tevent_req *subreq;
5683 req = tevent_req_create(mem_ctx, &state,
5684 struct rpccli_samr_ChangePasswordUser_state);
5685 if (req == NULL) {
5686 return NULL;
5688 state->out_mem_ctx = NULL;
5689 state->dispatch_recv = cli->dispatch_recv;
5691 /* In parameters */
5692 state->orig.in.user_handle = _user_handle;
5693 state->orig.in.lm_present = _lm_present;
5694 state->orig.in.old_lm_crypted = _old_lm_crypted;
5695 state->orig.in.new_lm_crypted = _new_lm_crypted;
5696 state->orig.in.nt_present = _nt_present;
5697 state->orig.in.old_nt_crypted = _old_nt_crypted;
5698 state->orig.in.new_nt_crypted = _new_nt_crypted;
5699 state->orig.in.cross1_present = _cross1_present;
5700 state->orig.in.nt_cross = _nt_cross;
5701 state->orig.in.cross2_present = _cross2_present;
5702 state->orig.in.lm_cross = _lm_cross;
5704 /* Out parameters */
5706 /* Result */
5707 ZERO_STRUCT(state->orig.out.result);
5709 /* make a temporary copy, that we pass to the dispatch function */
5710 state->tmp = state->orig;
5712 subreq = cli->dispatch_send(state, ev, cli,
5713 &ndr_table_samr,
5714 NDR_SAMR_CHANGEPASSWORDUSER,
5715 &state->tmp);
5716 if (tevent_req_nomem(subreq, req)) {
5717 return tevent_req_post(req, ev);
5719 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser_done, req);
5720 return req;
5723 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq)
5725 struct tevent_req *req = tevent_req_callback_data(
5726 subreq, struct tevent_req);
5727 struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
5728 req, struct rpccli_samr_ChangePasswordUser_state);
5729 NTSTATUS status;
5730 TALLOC_CTX *mem_ctx;
5732 if (state->out_mem_ctx) {
5733 mem_ctx = state->out_mem_ctx;
5734 } else {
5735 mem_ctx = state;
5738 status = state->dispatch_recv(subreq, mem_ctx);
5739 TALLOC_FREE(subreq);
5740 if (!NT_STATUS_IS_OK(status)) {
5741 tevent_req_nterror(req, status);
5742 return;
5745 /* Copy out parameters */
5747 /* Copy result */
5748 state->orig.out.result = state->tmp.out.result;
5750 /* Reset temporary structure */
5751 ZERO_STRUCT(state->tmp);
5753 tevent_req_done(req);
5756 NTSTATUS rpccli_samr_ChangePasswordUser_recv(struct tevent_req *req,
5757 TALLOC_CTX *mem_ctx,
5758 NTSTATUS *result)
5760 struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
5761 req, struct rpccli_samr_ChangePasswordUser_state);
5762 NTSTATUS status;
5764 if (tevent_req_is_nterror(req, &status)) {
5765 tevent_req_received(req);
5766 return status;
5769 /* Steal possbile out parameters to the callers context */
5770 talloc_steal(mem_ctx, state->out_mem_ctx);
5772 /* Return result */
5773 *result = state->orig.out.result;
5775 tevent_req_received(req);
5776 return NT_STATUS_OK;
5779 NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
5780 TALLOC_CTX *mem_ctx,
5781 struct policy_handle *user_handle /* [in] [ref] */,
5782 uint8_t lm_present /* [in] */,
5783 struct samr_Password *old_lm_crypted /* [in] [unique] */,
5784 struct samr_Password *new_lm_crypted /* [in] [unique] */,
5785 uint8_t nt_present /* [in] */,
5786 struct samr_Password *old_nt_crypted /* [in] [unique] */,
5787 struct samr_Password *new_nt_crypted /* [in] [unique] */,
5788 uint8_t cross1_present /* [in] */,
5789 struct samr_Password *nt_cross /* [in] [unique] */,
5790 uint8_t cross2_present /* [in] */,
5791 struct samr_Password *lm_cross /* [in] [unique] */)
5793 struct samr_ChangePasswordUser r;
5794 NTSTATUS status;
5796 /* In parameters */
5797 r.in.user_handle = user_handle;
5798 r.in.lm_present = lm_present;
5799 r.in.old_lm_crypted = old_lm_crypted;
5800 r.in.new_lm_crypted = new_lm_crypted;
5801 r.in.nt_present = nt_present;
5802 r.in.old_nt_crypted = old_nt_crypted;
5803 r.in.new_nt_crypted = new_nt_crypted;
5804 r.in.cross1_present = cross1_present;
5805 r.in.nt_cross = nt_cross;
5806 r.in.cross2_present = cross2_present;
5807 r.in.lm_cross = lm_cross;
5809 status = cli->dispatch(cli,
5810 mem_ctx,
5811 &ndr_table_samr,
5812 NDR_SAMR_CHANGEPASSWORDUSER,
5813 &r);
5815 if (!NT_STATUS_IS_OK(status)) {
5816 return status;
5819 if (NT_STATUS_IS_ERR(status)) {
5820 return status;
5823 /* Return variables */
5825 /* Return result */
5826 return r.out.result;
5829 struct rpccli_samr_GetGroupsForUser_state {
5830 struct samr_GetGroupsForUser orig;
5831 struct samr_GetGroupsForUser tmp;
5832 TALLOC_CTX *out_mem_ctx;
5833 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5836 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq);
5838 struct tevent_req *rpccli_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
5839 struct tevent_context *ev,
5840 struct rpc_pipe_client *cli,
5841 struct policy_handle *_user_handle /* [in] [ref] */,
5842 struct samr_RidWithAttributeArray **_rids /* [out] [ref] */)
5844 struct tevent_req *req;
5845 struct rpccli_samr_GetGroupsForUser_state *state;
5846 struct tevent_req *subreq;
5848 req = tevent_req_create(mem_ctx, &state,
5849 struct rpccli_samr_GetGroupsForUser_state);
5850 if (req == NULL) {
5851 return NULL;
5853 state->out_mem_ctx = NULL;
5854 state->dispatch_recv = cli->dispatch_recv;
5856 /* In parameters */
5857 state->orig.in.user_handle = _user_handle;
5859 /* Out parameters */
5860 state->orig.out.rids = _rids;
5862 /* Result */
5863 ZERO_STRUCT(state->orig.out.result);
5865 state->out_mem_ctx = talloc_named_const(state, 0,
5866 "rpccli_samr_GetGroupsForUser_out_memory");
5867 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5868 return tevent_req_post(req, ev);
5871 /* make a temporary copy, that we pass to the dispatch function */
5872 state->tmp = state->orig;
5874 subreq = cli->dispatch_send(state, ev, cli,
5875 &ndr_table_samr,
5876 NDR_SAMR_GETGROUPSFORUSER,
5877 &state->tmp);
5878 if (tevent_req_nomem(subreq, req)) {
5879 return tevent_req_post(req, ev);
5881 tevent_req_set_callback(subreq, rpccli_samr_GetGroupsForUser_done, req);
5882 return req;
5885 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq)
5887 struct tevent_req *req = tevent_req_callback_data(
5888 subreq, struct tevent_req);
5889 struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
5890 req, struct rpccli_samr_GetGroupsForUser_state);
5891 NTSTATUS status;
5892 TALLOC_CTX *mem_ctx;
5894 if (state->out_mem_ctx) {
5895 mem_ctx = state->out_mem_ctx;
5896 } else {
5897 mem_ctx = state;
5900 status = state->dispatch_recv(subreq, mem_ctx);
5901 TALLOC_FREE(subreq);
5902 if (!NT_STATUS_IS_OK(status)) {
5903 tevent_req_nterror(req, status);
5904 return;
5907 /* Copy out parameters */
5908 *state->orig.out.rids = *state->tmp.out.rids;
5910 /* Copy result */
5911 state->orig.out.result = state->tmp.out.result;
5913 /* Reset temporary structure */
5914 ZERO_STRUCT(state->tmp);
5916 tevent_req_done(req);
5919 NTSTATUS rpccli_samr_GetGroupsForUser_recv(struct tevent_req *req,
5920 TALLOC_CTX *mem_ctx,
5921 NTSTATUS *result)
5923 struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
5924 req, struct rpccli_samr_GetGroupsForUser_state);
5925 NTSTATUS status;
5927 if (tevent_req_is_nterror(req, &status)) {
5928 tevent_req_received(req);
5929 return status;
5932 /* Steal possbile out parameters to the callers context */
5933 talloc_steal(mem_ctx, state->out_mem_ctx);
5935 /* Return result */
5936 *result = state->orig.out.result;
5938 tevent_req_received(req);
5939 return NT_STATUS_OK;
5942 NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
5943 TALLOC_CTX *mem_ctx,
5944 struct policy_handle *user_handle /* [in] [ref] */,
5945 struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
5947 struct samr_GetGroupsForUser r;
5948 NTSTATUS status;
5950 /* In parameters */
5951 r.in.user_handle = user_handle;
5953 status = cli->dispatch(cli,
5954 mem_ctx,
5955 &ndr_table_samr,
5956 NDR_SAMR_GETGROUPSFORUSER,
5957 &r);
5959 if (!NT_STATUS_IS_OK(status)) {
5960 return status;
5963 if (NT_STATUS_IS_ERR(status)) {
5964 return status;
5967 /* Return variables */
5968 *rids = *r.out.rids;
5970 /* Return result */
5971 return r.out.result;
5974 struct rpccli_samr_QueryDisplayInfo_state {
5975 struct samr_QueryDisplayInfo orig;
5976 struct samr_QueryDisplayInfo tmp;
5977 TALLOC_CTX *out_mem_ctx;
5978 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5981 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq);
5983 struct tevent_req *rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
5984 struct tevent_context *ev,
5985 struct rpc_pipe_client *cli,
5986 struct policy_handle *_domain_handle /* [in] [ref] */,
5987 uint16_t _level /* [in] */,
5988 uint32_t _start_idx /* [in] */,
5989 uint32_t _max_entries /* [in] */,
5990 uint32_t _buf_size /* [in] */,
5991 uint32_t *_total_size /* [out] [ref] */,
5992 uint32_t *_returned_size /* [out] [ref] */,
5993 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
5995 struct tevent_req *req;
5996 struct rpccli_samr_QueryDisplayInfo_state *state;
5997 struct tevent_req *subreq;
5999 req = tevent_req_create(mem_ctx, &state,
6000 struct rpccli_samr_QueryDisplayInfo_state);
6001 if (req == NULL) {
6002 return NULL;
6004 state->out_mem_ctx = NULL;
6005 state->dispatch_recv = cli->dispatch_recv;
6007 /* In parameters */
6008 state->orig.in.domain_handle = _domain_handle;
6009 state->orig.in.level = _level;
6010 state->orig.in.start_idx = _start_idx;
6011 state->orig.in.max_entries = _max_entries;
6012 state->orig.in.buf_size = _buf_size;
6014 /* Out parameters */
6015 state->orig.out.total_size = _total_size;
6016 state->orig.out.returned_size = _returned_size;
6017 state->orig.out.info = _info;
6019 /* Result */
6020 ZERO_STRUCT(state->orig.out.result);
6022 state->out_mem_ctx = talloc_named_const(state, 0,
6023 "rpccli_samr_QueryDisplayInfo_out_memory");
6024 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6025 return tevent_req_post(req, ev);
6028 /* make a temporary copy, that we pass to the dispatch function */
6029 state->tmp = state->orig;
6031 subreq = cli->dispatch_send(state, ev, cli,
6032 &ndr_table_samr,
6033 NDR_SAMR_QUERYDISPLAYINFO,
6034 &state->tmp);
6035 if (tevent_req_nomem(subreq, req)) {
6036 return tevent_req_post(req, ev);
6038 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo_done, req);
6039 return req;
6042 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq)
6044 struct tevent_req *req = tevent_req_callback_data(
6045 subreq, struct tevent_req);
6046 struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
6047 req, struct rpccli_samr_QueryDisplayInfo_state);
6048 NTSTATUS status;
6049 TALLOC_CTX *mem_ctx;
6051 if (state->out_mem_ctx) {
6052 mem_ctx = state->out_mem_ctx;
6053 } else {
6054 mem_ctx = state;
6057 status = state->dispatch_recv(subreq, mem_ctx);
6058 TALLOC_FREE(subreq);
6059 if (!NT_STATUS_IS_OK(status)) {
6060 tevent_req_nterror(req, status);
6061 return;
6064 /* Copy out parameters */
6065 *state->orig.out.total_size = *state->tmp.out.total_size;
6066 *state->orig.out.returned_size = *state->tmp.out.returned_size;
6067 *state->orig.out.info = *state->tmp.out.info;
6069 /* Copy result */
6070 state->orig.out.result = state->tmp.out.result;
6072 /* Reset temporary structure */
6073 ZERO_STRUCT(state->tmp);
6075 tevent_req_done(req);
6078 NTSTATUS rpccli_samr_QueryDisplayInfo_recv(struct tevent_req *req,
6079 TALLOC_CTX *mem_ctx,
6080 NTSTATUS *result)
6082 struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
6083 req, struct rpccli_samr_QueryDisplayInfo_state);
6084 NTSTATUS status;
6086 if (tevent_req_is_nterror(req, &status)) {
6087 tevent_req_received(req);
6088 return status;
6091 /* Steal possbile out parameters to the callers context */
6092 talloc_steal(mem_ctx, state->out_mem_ctx);
6094 /* Return result */
6095 *result = state->orig.out.result;
6097 tevent_req_received(req);
6098 return NT_STATUS_OK;
6101 NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
6102 TALLOC_CTX *mem_ctx,
6103 struct policy_handle *domain_handle /* [in] [ref] */,
6104 uint16_t level /* [in] */,
6105 uint32_t start_idx /* [in] */,
6106 uint32_t max_entries /* [in] */,
6107 uint32_t buf_size /* [in] */,
6108 uint32_t *total_size /* [out] [ref] */,
6109 uint32_t *returned_size /* [out] [ref] */,
6110 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
6112 struct samr_QueryDisplayInfo r;
6113 NTSTATUS status;
6115 /* In parameters */
6116 r.in.domain_handle = domain_handle;
6117 r.in.level = level;
6118 r.in.start_idx = start_idx;
6119 r.in.max_entries = max_entries;
6120 r.in.buf_size = buf_size;
6122 status = cli->dispatch(cli,
6123 mem_ctx,
6124 &ndr_table_samr,
6125 NDR_SAMR_QUERYDISPLAYINFO,
6126 &r);
6128 if (!NT_STATUS_IS_OK(status)) {
6129 return status;
6132 if (NT_STATUS_IS_ERR(status)) {
6133 return status;
6136 /* Return variables */
6137 *total_size = *r.out.total_size;
6138 *returned_size = *r.out.returned_size;
6139 *info = *r.out.info;
6141 /* Return result */
6142 return r.out.result;
6145 struct rpccli_samr_GetDisplayEnumerationIndex_state {
6146 struct samr_GetDisplayEnumerationIndex orig;
6147 struct samr_GetDisplayEnumerationIndex tmp;
6148 TALLOC_CTX *out_mem_ctx;
6149 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6152 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq);
6154 struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
6155 struct tevent_context *ev,
6156 struct rpc_pipe_client *cli,
6157 struct policy_handle *_domain_handle /* [in] [ref] */,
6158 uint16_t _level /* [in] */,
6159 struct lsa_String *_name /* [in] [ref] */,
6160 uint32_t *_idx /* [out] [ref] */)
6162 struct tevent_req *req;
6163 struct rpccli_samr_GetDisplayEnumerationIndex_state *state;
6164 struct tevent_req *subreq;
6166 req = tevent_req_create(mem_ctx, &state,
6167 struct rpccli_samr_GetDisplayEnumerationIndex_state);
6168 if (req == NULL) {
6169 return NULL;
6171 state->out_mem_ctx = NULL;
6172 state->dispatch_recv = cli->dispatch_recv;
6174 /* In parameters */
6175 state->orig.in.domain_handle = _domain_handle;
6176 state->orig.in.level = _level;
6177 state->orig.in.name = _name;
6179 /* Out parameters */
6180 state->orig.out.idx = _idx;
6182 /* Result */
6183 ZERO_STRUCT(state->orig.out.result);
6185 state->out_mem_ctx = talloc_named_const(state, 0,
6186 "rpccli_samr_GetDisplayEnumerationIndex_out_memory");
6187 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6188 return tevent_req_post(req, ev);
6191 /* make a temporary copy, that we pass to the dispatch function */
6192 state->tmp = state->orig;
6194 subreq = cli->dispatch_send(state, ev, cli,
6195 &ndr_table_samr,
6196 NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
6197 &state->tmp);
6198 if (tevent_req_nomem(subreq, req)) {
6199 return tevent_req_post(req, ev);
6201 tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex_done, req);
6202 return req;
6205 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq)
6207 struct tevent_req *req = tevent_req_callback_data(
6208 subreq, struct tevent_req);
6209 struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
6210 req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
6211 NTSTATUS status;
6212 TALLOC_CTX *mem_ctx;
6214 if (state->out_mem_ctx) {
6215 mem_ctx = state->out_mem_ctx;
6216 } else {
6217 mem_ctx = state;
6220 status = state->dispatch_recv(subreq, mem_ctx);
6221 TALLOC_FREE(subreq);
6222 if (!NT_STATUS_IS_OK(status)) {
6223 tevent_req_nterror(req, status);
6224 return;
6227 /* Copy out parameters */
6228 *state->orig.out.idx = *state->tmp.out.idx;
6230 /* Copy result */
6231 state->orig.out.result = state->tmp.out.result;
6233 /* Reset temporary structure */
6234 ZERO_STRUCT(state->tmp);
6236 tevent_req_done(req);
6239 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
6240 TALLOC_CTX *mem_ctx,
6241 NTSTATUS *result)
6243 struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
6244 req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
6245 NTSTATUS status;
6247 if (tevent_req_is_nterror(req, &status)) {
6248 tevent_req_received(req);
6249 return status;
6252 /* Steal possbile out parameters to the callers context */
6253 talloc_steal(mem_ctx, state->out_mem_ctx);
6255 /* Return result */
6256 *result = state->orig.out.result;
6258 tevent_req_received(req);
6259 return NT_STATUS_OK;
6262 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
6263 TALLOC_CTX *mem_ctx,
6264 struct policy_handle *domain_handle /* [in] [ref] */,
6265 uint16_t level /* [in] */,
6266 struct lsa_String *name /* [in] [ref] */,
6267 uint32_t *idx /* [out] [ref] */)
6269 struct samr_GetDisplayEnumerationIndex r;
6270 NTSTATUS status;
6272 /* In parameters */
6273 r.in.domain_handle = domain_handle;
6274 r.in.level = level;
6275 r.in.name = name;
6277 status = cli->dispatch(cli,
6278 mem_ctx,
6279 &ndr_table_samr,
6280 NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
6281 &r);
6283 if (!NT_STATUS_IS_OK(status)) {
6284 return status;
6287 if (NT_STATUS_IS_ERR(status)) {
6288 return status;
6291 /* Return variables */
6292 *idx = *r.out.idx;
6294 /* Return result */
6295 return r.out.result;
6298 struct rpccli_samr_TestPrivateFunctionsDomain_state {
6299 struct samr_TestPrivateFunctionsDomain orig;
6300 struct samr_TestPrivateFunctionsDomain tmp;
6301 TALLOC_CTX *out_mem_ctx;
6302 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6305 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq);
6307 struct tevent_req *rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
6308 struct tevent_context *ev,
6309 struct rpc_pipe_client *cli,
6310 struct policy_handle *_domain_handle /* [in] [ref] */)
6312 struct tevent_req *req;
6313 struct rpccli_samr_TestPrivateFunctionsDomain_state *state;
6314 struct tevent_req *subreq;
6316 req = tevent_req_create(mem_ctx, &state,
6317 struct rpccli_samr_TestPrivateFunctionsDomain_state);
6318 if (req == NULL) {
6319 return NULL;
6321 state->out_mem_ctx = NULL;
6322 state->dispatch_recv = cli->dispatch_recv;
6324 /* In parameters */
6325 state->orig.in.domain_handle = _domain_handle;
6327 /* Out parameters */
6329 /* Result */
6330 ZERO_STRUCT(state->orig.out.result);
6332 /* make a temporary copy, that we pass to the dispatch function */
6333 state->tmp = state->orig;
6335 subreq = cli->dispatch_send(state, ev, cli,
6336 &ndr_table_samr,
6337 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
6338 &state->tmp);
6339 if (tevent_req_nomem(subreq, req)) {
6340 return tevent_req_post(req, ev);
6342 tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsDomain_done, req);
6343 return req;
6346 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq)
6348 struct tevent_req *req = tevent_req_callback_data(
6349 subreq, struct tevent_req);
6350 struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
6351 req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
6352 NTSTATUS status;
6353 TALLOC_CTX *mem_ctx;
6355 if (state->out_mem_ctx) {
6356 mem_ctx = state->out_mem_ctx;
6357 } else {
6358 mem_ctx = state;
6361 status = state->dispatch_recv(subreq, mem_ctx);
6362 TALLOC_FREE(subreq);
6363 if (!NT_STATUS_IS_OK(status)) {
6364 tevent_req_nterror(req, status);
6365 return;
6368 /* Copy out parameters */
6370 /* Copy result */
6371 state->orig.out.result = state->tmp.out.result;
6373 /* Reset temporary structure */
6374 ZERO_STRUCT(state->tmp);
6376 tevent_req_done(req);
6379 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
6380 TALLOC_CTX *mem_ctx,
6381 NTSTATUS *result)
6383 struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
6384 req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
6385 NTSTATUS status;
6387 if (tevent_req_is_nterror(req, &status)) {
6388 tevent_req_received(req);
6389 return status;
6392 /* Steal possbile out parameters to the callers context */
6393 talloc_steal(mem_ctx, state->out_mem_ctx);
6395 /* Return result */
6396 *result = state->orig.out.result;
6398 tevent_req_received(req);
6399 return NT_STATUS_OK;
6402 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
6403 TALLOC_CTX *mem_ctx,
6404 struct policy_handle *domain_handle /* [in] [ref] */)
6406 struct samr_TestPrivateFunctionsDomain r;
6407 NTSTATUS status;
6409 /* In parameters */
6410 r.in.domain_handle = domain_handle;
6412 status = cli->dispatch(cli,
6413 mem_ctx,
6414 &ndr_table_samr,
6415 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
6416 &r);
6418 if (!NT_STATUS_IS_OK(status)) {
6419 return status;
6422 if (NT_STATUS_IS_ERR(status)) {
6423 return status;
6426 /* Return variables */
6428 /* Return result */
6429 return r.out.result;
6432 struct rpccli_samr_TestPrivateFunctionsUser_state {
6433 struct samr_TestPrivateFunctionsUser orig;
6434 struct samr_TestPrivateFunctionsUser tmp;
6435 TALLOC_CTX *out_mem_ctx;
6436 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6439 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq);
6441 struct tevent_req *rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
6442 struct tevent_context *ev,
6443 struct rpc_pipe_client *cli,
6444 struct policy_handle *_user_handle /* [in] [ref] */)
6446 struct tevent_req *req;
6447 struct rpccli_samr_TestPrivateFunctionsUser_state *state;
6448 struct tevent_req *subreq;
6450 req = tevent_req_create(mem_ctx, &state,
6451 struct rpccli_samr_TestPrivateFunctionsUser_state);
6452 if (req == NULL) {
6453 return NULL;
6455 state->out_mem_ctx = NULL;
6456 state->dispatch_recv = cli->dispatch_recv;
6458 /* In parameters */
6459 state->orig.in.user_handle = _user_handle;
6461 /* Out parameters */
6463 /* Result */
6464 ZERO_STRUCT(state->orig.out.result);
6466 /* make a temporary copy, that we pass to the dispatch function */
6467 state->tmp = state->orig;
6469 subreq = cli->dispatch_send(state, ev, cli,
6470 &ndr_table_samr,
6471 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
6472 &state->tmp);
6473 if (tevent_req_nomem(subreq, req)) {
6474 return tevent_req_post(req, ev);
6476 tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsUser_done, req);
6477 return req;
6480 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq)
6482 struct tevent_req *req = tevent_req_callback_data(
6483 subreq, struct tevent_req);
6484 struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
6485 req, struct rpccli_samr_TestPrivateFunctionsUser_state);
6486 NTSTATUS status;
6487 TALLOC_CTX *mem_ctx;
6489 if (state->out_mem_ctx) {
6490 mem_ctx = state->out_mem_ctx;
6491 } else {
6492 mem_ctx = state;
6495 status = state->dispatch_recv(subreq, mem_ctx);
6496 TALLOC_FREE(subreq);
6497 if (!NT_STATUS_IS_OK(status)) {
6498 tevent_req_nterror(req, status);
6499 return;
6502 /* Copy out parameters */
6504 /* Copy result */
6505 state->orig.out.result = state->tmp.out.result;
6507 /* Reset temporary structure */
6508 ZERO_STRUCT(state->tmp);
6510 tevent_req_done(req);
6513 NTSTATUS rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
6514 TALLOC_CTX *mem_ctx,
6515 NTSTATUS *result)
6517 struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
6518 req, struct rpccli_samr_TestPrivateFunctionsUser_state);
6519 NTSTATUS status;
6521 if (tevent_req_is_nterror(req, &status)) {
6522 tevent_req_received(req);
6523 return status;
6526 /* Steal possbile out parameters to the callers context */
6527 talloc_steal(mem_ctx, state->out_mem_ctx);
6529 /* Return result */
6530 *result = state->orig.out.result;
6532 tevent_req_received(req);
6533 return NT_STATUS_OK;
6536 NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
6537 TALLOC_CTX *mem_ctx,
6538 struct policy_handle *user_handle /* [in] [ref] */)
6540 struct samr_TestPrivateFunctionsUser r;
6541 NTSTATUS status;
6543 /* In parameters */
6544 r.in.user_handle = user_handle;
6546 status = cli->dispatch(cli,
6547 mem_ctx,
6548 &ndr_table_samr,
6549 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
6550 &r);
6552 if (!NT_STATUS_IS_OK(status)) {
6553 return status;
6556 if (NT_STATUS_IS_ERR(status)) {
6557 return status;
6560 /* Return variables */
6562 /* Return result */
6563 return r.out.result;
6566 struct rpccli_samr_GetUserPwInfo_state {
6567 struct samr_GetUserPwInfo orig;
6568 struct samr_GetUserPwInfo tmp;
6569 TALLOC_CTX *out_mem_ctx;
6570 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6573 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq);
6575 struct tevent_req *rpccli_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
6576 struct tevent_context *ev,
6577 struct rpc_pipe_client *cli,
6578 struct policy_handle *_user_handle /* [in] [ref] */,
6579 struct samr_PwInfo *_info /* [out] [ref] */)
6581 struct tevent_req *req;
6582 struct rpccli_samr_GetUserPwInfo_state *state;
6583 struct tevent_req *subreq;
6585 req = tevent_req_create(mem_ctx, &state,
6586 struct rpccli_samr_GetUserPwInfo_state);
6587 if (req == NULL) {
6588 return NULL;
6590 state->out_mem_ctx = NULL;
6591 state->dispatch_recv = cli->dispatch_recv;
6593 /* In parameters */
6594 state->orig.in.user_handle = _user_handle;
6596 /* Out parameters */
6597 state->orig.out.info = _info;
6599 /* Result */
6600 ZERO_STRUCT(state->orig.out.result);
6602 state->out_mem_ctx = talloc_named_const(state, 0,
6603 "rpccli_samr_GetUserPwInfo_out_memory");
6604 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6605 return tevent_req_post(req, ev);
6608 /* make a temporary copy, that we pass to the dispatch function */
6609 state->tmp = state->orig;
6611 subreq = cli->dispatch_send(state, ev, cli,
6612 &ndr_table_samr,
6613 NDR_SAMR_GETUSERPWINFO,
6614 &state->tmp);
6615 if (tevent_req_nomem(subreq, req)) {
6616 return tevent_req_post(req, ev);
6618 tevent_req_set_callback(subreq, rpccli_samr_GetUserPwInfo_done, req);
6619 return req;
6622 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq)
6624 struct tevent_req *req = tevent_req_callback_data(
6625 subreq, struct tevent_req);
6626 struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
6627 req, struct rpccli_samr_GetUserPwInfo_state);
6628 NTSTATUS status;
6629 TALLOC_CTX *mem_ctx;
6631 if (state->out_mem_ctx) {
6632 mem_ctx = state->out_mem_ctx;
6633 } else {
6634 mem_ctx = state;
6637 status = state->dispatch_recv(subreq, mem_ctx);
6638 TALLOC_FREE(subreq);
6639 if (!NT_STATUS_IS_OK(status)) {
6640 tevent_req_nterror(req, status);
6641 return;
6644 /* Copy out parameters */
6645 *state->orig.out.info = *state->tmp.out.info;
6647 /* Copy result */
6648 state->orig.out.result = state->tmp.out.result;
6650 /* Reset temporary structure */
6651 ZERO_STRUCT(state->tmp);
6653 tevent_req_done(req);
6656 NTSTATUS rpccli_samr_GetUserPwInfo_recv(struct tevent_req *req,
6657 TALLOC_CTX *mem_ctx,
6658 NTSTATUS *result)
6660 struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
6661 req, struct rpccli_samr_GetUserPwInfo_state);
6662 NTSTATUS status;
6664 if (tevent_req_is_nterror(req, &status)) {
6665 tevent_req_received(req);
6666 return status;
6669 /* Steal possbile out parameters to the callers context */
6670 talloc_steal(mem_ctx, state->out_mem_ctx);
6672 /* Return result */
6673 *result = state->orig.out.result;
6675 tevent_req_received(req);
6676 return NT_STATUS_OK;
6679 NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
6680 TALLOC_CTX *mem_ctx,
6681 struct policy_handle *user_handle /* [in] [ref] */,
6682 struct samr_PwInfo *info /* [out] [ref] */)
6684 struct samr_GetUserPwInfo r;
6685 NTSTATUS status;
6687 /* In parameters */
6688 r.in.user_handle = user_handle;
6690 status = cli->dispatch(cli,
6691 mem_ctx,
6692 &ndr_table_samr,
6693 NDR_SAMR_GETUSERPWINFO,
6694 &r);
6696 if (!NT_STATUS_IS_OK(status)) {
6697 return status;
6700 if (NT_STATUS_IS_ERR(status)) {
6701 return status;
6704 /* Return variables */
6705 *info = *r.out.info;
6707 /* Return result */
6708 return r.out.result;
6711 struct rpccli_samr_RemoveMemberFromForeignDomain_state {
6712 struct samr_RemoveMemberFromForeignDomain orig;
6713 struct samr_RemoveMemberFromForeignDomain tmp;
6714 TALLOC_CTX *out_mem_ctx;
6715 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6718 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq);
6720 struct tevent_req *rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
6721 struct tevent_context *ev,
6722 struct rpc_pipe_client *cli,
6723 struct policy_handle *_domain_handle /* [in] [ref] */,
6724 struct dom_sid2 *_sid /* [in] [ref] */)
6726 struct tevent_req *req;
6727 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state;
6728 struct tevent_req *subreq;
6730 req = tevent_req_create(mem_ctx, &state,
6731 struct rpccli_samr_RemoveMemberFromForeignDomain_state);
6732 if (req == NULL) {
6733 return NULL;
6735 state->out_mem_ctx = NULL;
6736 state->dispatch_recv = cli->dispatch_recv;
6738 /* In parameters */
6739 state->orig.in.domain_handle = _domain_handle;
6740 state->orig.in.sid = _sid;
6742 /* Out parameters */
6744 /* Result */
6745 ZERO_STRUCT(state->orig.out.result);
6747 /* make a temporary copy, that we pass to the dispatch function */
6748 state->tmp = state->orig;
6750 subreq = cli->dispatch_send(state, ev, cli,
6751 &ndr_table_samr,
6752 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
6753 &state->tmp);
6754 if (tevent_req_nomem(subreq, req)) {
6755 return tevent_req_post(req, ev);
6757 tevent_req_set_callback(subreq, rpccli_samr_RemoveMemberFromForeignDomain_done, req);
6758 return req;
6761 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq)
6763 struct tevent_req *req = tevent_req_callback_data(
6764 subreq, struct tevent_req);
6765 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
6766 req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
6767 NTSTATUS status;
6768 TALLOC_CTX *mem_ctx;
6770 if (state->out_mem_ctx) {
6771 mem_ctx = state->out_mem_ctx;
6772 } else {
6773 mem_ctx = state;
6776 status = state->dispatch_recv(subreq, mem_ctx);
6777 TALLOC_FREE(subreq);
6778 if (!NT_STATUS_IS_OK(status)) {
6779 tevent_req_nterror(req, status);
6780 return;
6783 /* Copy out parameters */
6785 /* Copy result */
6786 state->orig.out.result = state->tmp.out.result;
6788 /* Reset temporary structure */
6789 ZERO_STRUCT(state->tmp);
6791 tevent_req_done(req);
6794 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
6795 TALLOC_CTX *mem_ctx,
6796 NTSTATUS *result)
6798 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
6799 req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
6800 NTSTATUS status;
6802 if (tevent_req_is_nterror(req, &status)) {
6803 tevent_req_received(req);
6804 return status;
6807 /* Steal possbile out parameters to the callers context */
6808 talloc_steal(mem_ctx, state->out_mem_ctx);
6810 /* Return result */
6811 *result = state->orig.out.result;
6813 tevent_req_received(req);
6814 return NT_STATUS_OK;
6817 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
6818 TALLOC_CTX *mem_ctx,
6819 struct policy_handle *domain_handle /* [in] [ref] */,
6820 struct dom_sid2 *sid /* [in] [ref] */)
6822 struct samr_RemoveMemberFromForeignDomain r;
6823 NTSTATUS status;
6825 /* In parameters */
6826 r.in.domain_handle = domain_handle;
6827 r.in.sid = sid;
6829 status = cli->dispatch(cli,
6830 mem_ctx,
6831 &ndr_table_samr,
6832 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
6833 &r);
6835 if (!NT_STATUS_IS_OK(status)) {
6836 return status;
6839 if (NT_STATUS_IS_ERR(status)) {
6840 return status;
6843 /* Return variables */
6845 /* Return result */
6846 return r.out.result;
6849 struct rpccli_samr_QueryDomainInfo2_state {
6850 struct samr_QueryDomainInfo2 orig;
6851 struct samr_QueryDomainInfo2 tmp;
6852 TALLOC_CTX *out_mem_ctx;
6853 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6856 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq);
6858 struct tevent_req *rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
6859 struct tevent_context *ev,
6860 struct rpc_pipe_client *cli,
6861 struct policy_handle *_domain_handle /* [in] [ref] */,
6862 enum samr_DomainInfoClass _level /* [in] */,
6863 union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
6865 struct tevent_req *req;
6866 struct rpccli_samr_QueryDomainInfo2_state *state;
6867 struct tevent_req *subreq;
6869 req = tevent_req_create(mem_ctx, &state,
6870 struct rpccli_samr_QueryDomainInfo2_state);
6871 if (req == NULL) {
6872 return NULL;
6874 state->out_mem_ctx = NULL;
6875 state->dispatch_recv = cli->dispatch_recv;
6877 /* In parameters */
6878 state->orig.in.domain_handle = _domain_handle;
6879 state->orig.in.level = _level;
6881 /* Out parameters */
6882 state->orig.out.info = _info;
6884 /* Result */
6885 ZERO_STRUCT(state->orig.out.result);
6887 state->out_mem_ctx = talloc_named_const(state, 0,
6888 "rpccli_samr_QueryDomainInfo2_out_memory");
6889 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6890 return tevent_req_post(req, ev);
6893 /* make a temporary copy, that we pass to the dispatch function */
6894 state->tmp = state->orig;
6896 subreq = cli->dispatch_send(state, ev, cli,
6897 &ndr_table_samr,
6898 NDR_SAMR_QUERYDOMAININFO2,
6899 &state->tmp);
6900 if (tevent_req_nomem(subreq, req)) {
6901 return tevent_req_post(req, ev);
6903 tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo2_done, req);
6904 return req;
6907 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq)
6909 struct tevent_req *req = tevent_req_callback_data(
6910 subreq, struct tevent_req);
6911 struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
6912 req, struct rpccli_samr_QueryDomainInfo2_state);
6913 NTSTATUS status;
6914 TALLOC_CTX *mem_ctx;
6916 if (state->out_mem_ctx) {
6917 mem_ctx = state->out_mem_ctx;
6918 } else {
6919 mem_ctx = state;
6922 status = state->dispatch_recv(subreq, mem_ctx);
6923 TALLOC_FREE(subreq);
6924 if (!NT_STATUS_IS_OK(status)) {
6925 tevent_req_nterror(req, status);
6926 return;
6929 /* Copy out parameters */
6930 *state->orig.out.info = *state->tmp.out.info;
6932 /* Copy result */
6933 state->orig.out.result = state->tmp.out.result;
6935 /* Reset temporary structure */
6936 ZERO_STRUCT(state->tmp);
6938 tevent_req_done(req);
6941 NTSTATUS rpccli_samr_QueryDomainInfo2_recv(struct tevent_req *req,
6942 TALLOC_CTX *mem_ctx,
6943 NTSTATUS *result)
6945 struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
6946 req, struct rpccli_samr_QueryDomainInfo2_state);
6947 NTSTATUS status;
6949 if (tevent_req_is_nterror(req, &status)) {
6950 tevent_req_received(req);
6951 return status;
6954 /* Steal possbile out parameters to the callers context */
6955 talloc_steal(mem_ctx, state->out_mem_ctx);
6957 /* Return result */
6958 *result = state->orig.out.result;
6960 tevent_req_received(req);
6961 return NT_STATUS_OK;
6964 NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
6965 TALLOC_CTX *mem_ctx,
6966 struct policy_handle *domain_handle /* [in] [ref] */,
6967 enum samr_DomainInfoClass level /* [in] */,
6968 union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
6970 struct samr_QueryDomainInfo2 r;
6971 NTSTATUS status;
6973 /* In parameters */
6974 r.in.domain_handle = domain_handle;
6975 r.in.level = level;
6977 status = cli->dispatch(cli,
6978 mem_ctx,
6979 &ndr_table_samr,
6980 NDR_SAMR_QUERYDOMAININFO2,
6981 &r);
6983 if (!NT_STATUS_IS_OK(status)) {
6984 return status;
6987 if (NT_STATUS_IS_ERR(status)) {
6988 return status;
6991 /* Return variables */
6992 *info = *r.out.info;
6994 /* Return result */
6995 return r.out.result;
6998 struct rpccli_samr_QueryUserInfo2_state {
6999 struct samr_QueryUserInfo2 orig;
7000 struct samr_QueryUserInfo2 tmp;
7001 TALLOC_CTX *out_mem_ctx;
7002 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7005 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq);
7007 struct tevent_req *rpccli_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
7008 struct tevent_context *ev,
7009 struct rpc_pipe_client *cli,
7010 struct policy_handle *_user_handle /* [in] [ref] */,
7011 enum samr_UserInfoLevel _level /* [in] */,
7012 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
7014 struct tevent_req *req;
7015 struct rpccli_samr_QueryUserInfo2_state *state;
7016 struct tevent_req *subreq;
7018 req = tevent_req_create(mem_ctx, &state,
7019 struct rpccli_samr_QueryUserInfo2_state);
7020 if (req == NULL) {
7021 return NULL;
7023 state->out_mem_ctx = NULL;
7024 state->dispatch_recv = cli->dispatch_recv;
7026 /* In parameters */
7027 state->orig.in.user_handle = _user_handle;
7028 state->orig.in.level = _level;
7030 /* Out parameters */
7031 state->orig.out.info = _info;
7033 /* Result */
7034 ZERO_STRUCT(state->orig.out.result);
7036 state->out_mem_ctx = talloc_named_const(state, 0,
7037 "rpccli_samr_QueryUserInfo2_out_memory");
7038 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7039 return tevent_req_post(req, ev);
7042 /* make a temporary copy, that we pass to the dispatch function */
7043 state->tmp = state->orig;
7045 subreq = cli->dispatch_send(state, ev, cli,
7046 &ndr_table_samr,
7047 NDR_SAMR_QUERYUSERINFO2,
7048 &state->tmp);
7049 if (tevent_req_nomem(subreq, req)) {
7050 return tevent_req_post(req, ev);
7052 tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo2_done, req);
7053 return req;
7056 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq)
7058 struct tevent_req *req = tevent_req_callback_data(
7059 subreq, struct tevent_req);
7060 struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
7061 req, struct rpccli_samr_QueryUserInfo2_state);
7062 NTSTATUS status;
7063 TALLOC_CTX *mem_ctx;
7065 if (state->out_mem_ctx) {
7066 mem_ctx = state->out_mem_ctx;
7067 } else {
7068 mem_ctx = state;
7071 status = state->dispatch_recv(subreq, mem_ctx);
7072 TALLOC_FREE(subreq);
7073 if (!NT_STATUS_IS_OK(status)) {
7074 tevent_req_nterror(req, status);
7075 return;
7078 /* Copy out parameters */
7079 *state->orig.out.info = *state->tmp.out.info;
7081 /* Copy result */
7082 state->orig.out.result = state->tmp.out.result;
7084 /* Reset temporary structure */
7085 ZERO_STRUCT(state->tmp);
7087 tevent_req_done(req);
7090 NTSTATUS rpccli_samr_QueryUserInfo2_recv(struct tevent_req *req,
7091 TALLOC_CTX *mem_ctx,
7092 NTSTATUS *result)
7094 struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
7095 req, struct rpccli_samr_QueryUserInfo2_state);
7096 NTSTATUS status;
7098 if (tevent_req_is_nterror(req, &status)) {
7099 tevent_req_received(req);
7100 return status;
7103 /* Steal possbile out parameters to the callers context */
7104 talloc_steal(mem_ctx, state->out_mem_ctx);
7106 /* Return result */
7107 *result = state->orig.out.result;
7109 tevent_req_received(req);
7110 return NT_STATUS_OK;
7113 NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
7114 TALLOC_CTX *mem_ctx,
7115 struct policy_handle *user_handle /* [in] [ref] */,
7116 enum samr_UserInfoLevel level /* [in] */,
7117 union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
7119 struct samr_QueryUserInfo2 r;
7120 NTSTATUS status;
7122 /* In parameters */
7123 r.in.user_handle = user_handle;
7124 r.in.level = level;
7126 status = cli->dispatch(cli,
7127 mem_ctx,
7128 &ndr_table_samr,
7129 NDR_SAMR_QUERYUSERINFO2,
7130 &r);
7132 if (!NT_STATUS_IS_OK(status)) {
7133 return status;
7136 if (NT_STATUS_IS_ERR(status)) {
7137 return status;
7140 /* Return variables */
7141 *info = *r.out.info;
7143 /* Return result */
7144 return r.out.result;
7147 struct rpccli_samr_QueryDisplayInfo2_state {
7148 struct samr_QueryDisplayInfo2 orig;
7149 struct samr_QueryDisplayInfo2 tmp;
7150 TALLOC_CTX *out_mem_ctx;
7151 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7154 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq);
7156 struct tevent_req *rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX *mem_ctx,
7157 struct tevent_context *ev,
7158 struct rpc_pipe_client *cli,
7159 struct policy_handle *_domain_handle /* [in] [ref] */,
7160 uint16_t _level /* [in] */,
7161 uint32_t _start_idx /* [in] */,
7162 uint32_t _max_entries /* [in] */,
7163 uint32_t _buf_size /* [in] */,
7164 uint32_t *_total_size /* [out] [ref] */,
7165 uint32_t *_returned_size /* [out] [ref] */,
7166 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
7168 struct tevent_req *req;
7169 struct rpccli_samr_QueryDisplayInfo2_state *state;
7170 struct tevent_req *subreq;
7172 req = tevent_req_create(mem_ctx, &state,
7173 struct rpccli_samr_QueryDisplayInfo2_state);
7174 if (req == NULL) {
7175 return NULL;
7177 state->out_mem_ctx = NULL;
7178 state->dispatch_recv = cli->dispatch_recv;
7180 /* In parameters */
7181 state->orig.in.domain_handle = _domain_handle;
7182 state->orig.in.level = _level;
7183 state->orig.in.start_idx = _start_idx;
7184 state->orig.in.max_entries = _max_entries;
7185 state->orig.in.buf_size = _buf_size;
7187 /* Out parameters */
7188 state->orig.out.total_size = _total_size;
7189 state->orig.out.returned_size = _returned_size;
7190 state->orig.out.info = _info;
7192 /* Result */
7193 ZERO_STRUCT(state->orig.out.result);
7195 state->out_mem_ctx = talloc_named_const(state, 0,
7196 "rpccli_samr_QueryDisplayInfo2_out_memory");
7197 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7198 return tevent_req_post(req, ev);
7201 /* make a temporary copy, that we pass to the dispatch function */
7202 state->tmp = state->orig;
7204 subreq = cli->dispatch_send(state, ev, cli,
7205 &ndr_table_samr,
7206 NDR_SAMR_QUERYDISPLAYINFO2,
7207 &state->tmp);
7208 if (tevent_req_nomem(subreq, req)) {
7209 return tevent_req_post(req, ev);
7211 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo2_done, req);
7212 return req;
7215 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq)
7217 struct tevent_req *req = tevent_req_callback_data(
7218 subreq, struct tevent_req);
7219 struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
7220 req, struct rpccli_samr_QueryDisplayInfo2_state);
7221 NTSTATUS status;
7222 TALLOC_CTX *mem_ctx;
7224 if (state->out_mem_ctx) {
7225 mem_ctx = state->out_mem_ctx;
7226 } else {
7227 mem_ctx = state;
7230 status = state->dispatch_recv(subreq, mem_ctx);
7231 TALLOC_FREE(subreq);
7232 if (!NT_STATUS_IS_OK(status)) {
7233 tevent_req_nterror(req, status);
7234 return;
7237 /* Copy out parameters */
7238 *state->orig.out.total_size = *state->tmp.out.total_size;
7239 *state->orig.out.returned_size = *state->tmp.out.returned_size;
7240 *state->orig.out.info = *state->tmp.out.info;
7242 /* Copy result */
7243 state->orig.out.result = state->tmp.out.result;
7245 /* Reset temporary structure */
7246 ZERO_STRUCT(state->tmp);
7248 tevent_req_done(req);
7251 NTSTATUS rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req *req,
7252 TALLOC_CTX *mem_ctx,
7253 NTSTATUS *result)
7255 struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
7256 req, struct rpccli_samr_QueryDisplayInfo2_state);
7257 NTSTATUS status;
7259 if (tevent_req_is_nterror(req, &status)) {
7260 tevent_req_received(req);
7261 return status;
7264 /* Steal possbile out parameters to the callers context */
7265 talloc_steal(mem_ctx, state->out_mem_ctx);
7267 /* Return result */
7268 *result = state->orig.out.result;
7270 tevent_req_received(req);
7271 return NT_STATUS_OK;
7274 NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
7275 TALLOC_CTX *mem_ctx,
7276 struct policy_handle *domain_handle /* [in] [ref] */,
7277 uint16_t level /* [in] */,
7278 uint32_t start_idx /* [in] */,
7279 uint32_t max_entries /* [in] */,
7280 uint32_t buf_size /* [in] */,
7281 uint32_t *total_size /* [out] [ref] */,
7282 uint32_t *returned_size /* [out] [ref] */,
7283 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
7285 struct samr_QueryDisplayInfo2 r;
7286 NTSTATUS status;
7288 /* In parameters */
7289 r.in.domain_handle = domain_handle;
7290 r.in.level = level;
7291 r.in.start_idx = start_idx;
7292 r.in.max_entries = max_entries;
7293 r.in.buf_size = buf_size;
7295 status = cli->dispatch(cli,
7296 mem_ctx,
7297 &ndr_table_samr,
7298 NDR_SAMR_QUERYDISPLAYINFO2,
7299 &r);
7301 if (!NT_STATUS_IS_OK(status)) {
7302 return status;
7305 if (NT_STATUS_IS_ERR(status)) {
7306 return status;
7309 /* Return variables */
7310 *total_size = *r.out.total_size;
7311 *returned_size = *r.out.returned_size;
7312 *info = *r.out.info;
7314 /* Return result */
7315 return r.out.result;
7318 struct rpccli_samr_GetDisplayEnumerationIndex2_state {
7319 struct samr_GetDisplayEnumerationIndex2 orig;
7320 struct samr_GetDisplayEnumerationIndex2 tmp;
7321 TALLOC_CTX *out_mem_ctx;
7322 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7325 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq);
7327 struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX *mem_ctx,
7328 struct tevent_context *ev,
7329 struct rpc_pipe_client *cli,
7330 struct policy_handle *_domain_handle /* [in] [ref] */,
7331 uint16_t _level /* [in] */,
7332 struct lsa_String *_name /* [in] [ref] */,
7333 uint32_t *_idx /* [out] [ref] */)
7335 struct tevent_req *req;
7336 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state;
7337 struct tevent_req *subreq;
7339 req = tevent_req_create(mem_ctx, &state,
7340 struct rpccli_samr_GetDisplayEnumerationIndex2_state);
7341 if (req == NULL) {
7342 return NULL;
7344 state->out_mem_ctx = NULL;
7345 state->dispatch_recv = cli->dispatch_recv;
7347 /* In parameters */
7348 state->orig.in.domain_handle = _domain_handle;
7349 state->orig.in.level = _level;
7350 state->orig.in.name = _name;
7352 /* Out parameters */
7353 state->orig.out.idx = _idx;
7355 /* Result */
7356 ZERO_STRUCT(state->orig.out.result);
7358 state->out_mem_ctx = talloc_named_const(state, 0,
7359 "rpccli_samr_GetDisplayEnumerationIndex2_out_memory");
7360 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7361 return tevent_req_post(req, ev);
7364 /* make a temporary copy, that we pass to the dispatch function */
7365 state->tmp = state->orig;
7367 subreq = cli->dispatch_send(state, ev, cli,
7368 &ndr_table_samr,
7369 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
7370 &state->tmp);
7371 if (tevent_req_nomem(subreq, req)) {
7372 return tevent_req_post(req, ev);
7374 tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex2_done, req);
7375 return req;
7378 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq)
7380 struct tevent_req *req = tevent_req_callback_data(
7381 subreq, struct tevent_req);
7382 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
7383 req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
7384 NTSTATUS status;
7385 TALLOC_CTX *mem_ctx;
7387 if (state->out_mem_ctx) {
7388 mem_ctx = state->out_mem_ctx;
7389 } else {
7390 mem_ctx = state;
7393 status = state->dispatch_recv(subreq, mem_ctx);
7394 TALLOC_FREE(subreq);
7395 if (!NT_STATUS_IS_OK(status)) {
7396 tevent_req_nterror(req, status);
7397 return;
7400 /* Copy out parameters */
7401 *state->orig.out.idx = *state->tmp.out.idx;
7403 /* Copy result */
7404 state->orig.out.result = state->tmp.out.result;
7406 /* Reset temporary structure */
7407 ZERO_STRUCT(state->tmp);
7409 tevent_req_done(req);
7412 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req *req,
7413 TALLOC_CTX *mem_ctx,
7414 NTSTATUS *result)
7416 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
7417 req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
7418 NTSTATUS status;
7420 if (tevent_req_is_nterror(req, &status)) {
7421 tevent_req_received(req);
7422 return status;
7425 /* Steal possbile out parameters to the callers context */
7426 talloc_steal(mem_ctx, state->out_mem_ctx);
7428 /* Return result */
7429 *result = state->orig.out.result;
7431 tevent_req_received(req);
7432 return NT_STATUS_OK;
7435 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
7436 TALLOC_CTX *mem_ctx,
7437 struct policy_handle *domain_handle /* [in] [ref] */,
7438 uint16_t level /* [in] */,
7439 struct lsa_String *name /* [in] [ref] */,
7440 uint32_t *idx /* [out] [ref] */)
7442 struct samr_GetDisplayEnumerationIndex2 r;
7443 NTSTATUS status;
7445 /* In parameters */
7446 r.in.domain_handle = domain_handle;
7447 r.in.level = level;
7448 r.in.name = name;
7450 status = cli->dispatch(cli,
7451 mem_ctx,
7452 &ndr_table_samr,
7453 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
7454 &r);
7456 if (!NT_STATUS_IS_OK(status)) {
7457 return status;
7460 if (NT_STATUS_IS_ERR(status)) {
7461 return status;
7464 /* Return variables */
7465 *idx = *r.out.idx;
7467 /* Return result */
7468 return r.out.result;
7471 struct rpccli_samr_CreateUser2_state {
7472 struct samr_CreateUser2 orig;
7473 struct samr_CreateUser2 tmp;
7474 TALLOC_CTX *out_mem_ctx;
7475 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7478 static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq);
7480 struct tevent_req *rpccli_samr_CreateUser2_send(TALLOC_CTX *mem_ctx,
7481 struct tevent_context *ev,
7482 struct rpc_pipe_client *cli,
7483 struct policy_handle *_domain_handle /* [in] [ref] */,
7484 struct lsa_String *_account_name /* [in] [ref] */,
7485 uint32_t _acct_flags /* [in] */,
7486 uint32_t _access_mask /* [in] */,
7487 struct policy_handle *_user_handle /* [out] [ref] */,
7488 uint32_t *_access_granted /* [out] [ref] */,
7489 uint32_t *_rid /* [out] [ref] */)
7491 struct tevent_req *req;
7492 struct rpccli_samr_CreateUser2_state *state;
7493 struct tevent_req *subreq;
7495 req = tevent_req_create(mem_ctx, &state,
7496 struct rpccli_samr_CreateUser2_state);
7497 if (req == NULL) {
7498 return NULL;
7500 state->out_mem_ctx = NULL;
7501 state->dispatch_recv = cli->dispatch_recv;
7503 /* In parameters */
7504 state->orig.in.domain_handle = _domain_handle;
7505 state->orig.in.account_name = _account_name;
7506 state->orig.in.acct_flags = _acct_flags;
7507 state->orig.in.access_mask = _access_mask;
7509 /* Out parameters */
7510 state->orig.out.user_handle = _user_handle;
7511 state->orig.out.access_granted = _access_granted;
7512 state->orig.out.rid = _rid;
7514 /* Result */
7515 ZERO_STRUCT(state->orig.out.result);
7517 state->out_mem_ctx = talloc_named_const(state, 0,
7518 "rpccli_samr_CreateUser2_out_memory");
7519 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7520 return tevent_req_post(req, ev);
7523 /* make a temporary copy, that we pass to the dispatch function */
7524 state->tmp = state->orig;
7526 subreq = cli->dispatch_send(state, ev, cli,
7527 &ndr_table_samr,
7528 NDR_SAMR_CREATEUSER2,
7529 &state->tmp);
7530 if (tevent_req_nomem(subreq, req)) {
7531 return tevent_req_post(req, ev);
7533 tevent_req_set_callback(subreq, rpccli_samr_CreateUser2_done, req);
7534 return req;
7537 static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq)
7539 struct tevent_req *req = tevent_req_callback_data(
7540 subreq, struct tevent_req);
7541 struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
7542 req, struct rpccli_samr_CreateUser2_state);
7543 NTSTATUS status;
7544 TALLOC_CTX *mem_ctx;
7546 if (state->out_mem_ctx) {
7547 mem_ctx = state->out_mem_ctx;
7548 } else {
7549 mem_ctx = state;
7552 status = state->dispatch_recv(subreq, mem_ctx);
7553 TALLOC_FREE(subreq);
7554 if (!NT_STATUS_IS_OK(status)) {
7555 tevent_req_nterror(req, status);
7556 return;
7559 /* Copy out parameters */
7560 *state->orig.out.user_handle = *state->tmp.out.user_handle;
7561 *state->orig.out.access_granted = *state->tmp.out.access_granted;
7562 *state->orig.out.rid = *state->tmp.out.rid;
7564 /* Copy result */
7565 state->orig.out.result = state->tmp.out.result;
7567 /* Reset temporary structure */
7568 ZERO_STRUCT(state->tmp);
7570 tevent_req_done(req);
7573 NTSTATUS rpccli_samr_CreateUser2_recv(struct tevent_req *req,
7574 TALLOC_CTX *mem_ctx,
7575 NTSTATUS *result)
7577 struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
7578 req, struct rpccli_samr_CreateUser2_state);
7579 NTSTATUS status;
7581 if (tevent_req_is_nterror(req, &status)) {
7582 tevent_req_received(req);
7583 return status;
7586 /* Steal possbile out parameters to the callers context */
7587 talloc_steal(mem_ctx, state->out_mem_ctx);
7589 /* Return result */
7590 *result = state->orig.out.result;
7592 tevent_req_received(req);
7593 return NT_STATUS_OK;
7596 NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
7597 TALLOC_CTX *mem_ctx,
7598 struct policy_handle *domain_handle /* [in] [ref] */,
7599 struct lsa_String *account_name /* [in] [ref] */,
7600 uint32_t acct_flags /* [in] */,
7601 uint32_t access_mask /* [in] */,
7602 struct policy_handle *user_handle /* [out] [ref] */,
7603 uint32_t *access_granted /* [out] [ref] */,
7604 uint32_t *rid /* [out] [ref] */)
7606 struct samr_CreateUser2 r;
7607 NTSTATUS status;
7609 /* In parameters */
7610 r.in.domain_handle = domain_handle;
7611 r.in.account_name = account_name;
7612 r.in.acct_flags = acct_flags;
7613 r.in.access_mask = access_mask;
7615 status = cli->dispatch(cli,
7616 mem_ctx,
7617 &ndr_table_samr,
7618 NDR_SAMR_CREATEUSER2,
7619 &r);
7621 if (!NT_STATUS_IS_OK(status)) {
7622 return status;
7625 if (NT_STATUS_IS_ERR(status)) {
7626 return status;
7629 /* Return variables */
7630 *user_handle = *r.out.user_handle;
7631 *access_granted = *r.out.access_granted;
7632 *rid = *r.out.rid;
7634 /* Return result */
7635 return r.out.result;
7638 struct rpccli_samr_QueryDisplayInfo3_state {
7639 struct samr_QueryDisplayInfo3 orig;
7640 struct samr_QueryDisplayInfo3 tmp;
7641 TALLOC_CTX *out_mem_ctx;
7642 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7645 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq);
7647 struct tevent_req *rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX *mem_ctx,
7648 struct tevent_context *ev,
7649 struct rpc_pipe_client *cli,
7650 struct policy_handle *_domain_handle /* [in] [ref] */,
7651 uint16_t _level /* [in] */,
7652 uint32_t _start_idx /* [in] */,
7653 uint32_t _max_entries /* [in] */,
7654 uint32_t _buf_size /* [in] */,
7655 uint32_t *_total_size /* [out] [ref] */,
7656 uint32_t *_returned_size /* [out] [ref] */,
7657 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
7659 struct tevent_req *req;
7660 struct rpccli_samr_QueryDisplayInfo3_state *state;
7661 struct tevent_req *subreq;
7663 req = tevent_req_create(mem_ctx, &state,
7664 struct rpccli_samr_QueryDisplayInfo3_state);
7665 if (req == NULL) {
7666 return NULL;
7668 state->out_mem_ctx = NULL;
7669 state->dispatch_recv = cli->dispatch_recv;
7671 /* In parameters */
7672 state->orig.in.domain_handle = _domain_handle;
7673 state->orig.in.level = _level;
7674 state->orig.in.start_idx = _start_idx;
7675 state->orig.in.max_entries = _max_entries;
7676 state->orig.in.buf_size = _buf_size;
7678 /* Out parameters */
7679 state->orig.out.total_size = _total_size;
7680 state->orig.out.returned_size = _returned_size;
7681 state->orig.out.info = _info;
7683 /* Result */
7684 ZERO_STRUCT(state->orig.out.result);
7686 state->out_mem_ctx = talloc_named_const(state, 0,
7687 "rpccli_samr_QueryDisplayInfo3_out_memory");
7688 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7689 return tevent_req_post(req, ev);
7692 /* make a temporary copy, that we pass to the dispatch function */
7693 state->tmp = state->orig;
7695 subreq = cli->dispatch_send(state, ev, cli,
7696 &ndr_table_samr,
7697 NDR_SAMR_QUERYDISPLAYINFO3,
7698 &state->tmp);
7699 if (tevent_req_nomem(subreq, req)) {
7700 return tevent_req_post(req, ev);
7702 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo3_done, req);
7703 return req;
7706 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq)
7708 struct tevent_req *req = tevent_req_callback_data(
7709 subreq, struct tevent_req);
7710 struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
7711 req, struct rpccli_samr_QueryDisplayInfo3_state);
7712 NTSTATUS status;
7713 TALLOC_CTX *mem_ctx;
7715 if (state->out_mem_ctx) {
7716 mem_ctx = state->out_mem_ctx;
7717 } else {
7718 mem_ctx = state;
7721 status = state->dispatch_recv(subreq, mem_ctx);
7722 TALLOC_FREE(subreq);
7723 if (!NT_STATUS_IS_OK(status)) {
7724 tevent_req_nterror(req, status);
7725 return;
7728 /* Copy out parameters */
7729 *state->orig.out.total_size = *state->tmp.out.total_size;
7730 *state->orig.out.returned_size = *state->tmp.out.returned_size;
7731 *state->orig.out.info = *state->tmp.out.info;
7733 /* Copy result */
7734 state->orig.out.result = state->tmp.out.result;
7736 /* Reset temporary structure */
7737 ZERO_STRUCT(state->tmp);
7739 tevent_req_done(req);
7742 NTSTATUS rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req *req,
7743 TALLOC_CTX *mem_ctx,
7744 NTSTATUS *result)
7746 struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
7747 req, struct rpccli_samr_QueryDisplayInfo3_state);
7748 NTSTATUS status;
7750 if (tevent_req_is_nterror(req, &status)) {
7751 tevent_req_received(req);
7752 return status;
7755 /* Steal possbile out parameters to the callers context */
7756 talloc_steal(mem_ctx, state->out_mem_ctx);
7758 /* Return result */
7759 *result = state->orig.out.result;
7761 tevent_req_received(req);
7762 return NT_STATUS_OK;
7765 NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
7766 TALLOC_CTX *mem_ctx,
7767 struct policy_handle *domain_handle /* [in] [ref] */,
7768 uint16_t level /* [in] */,
7769 uint32_t start_idx /* [in] */,
7770 uint32_t max_entries /* [in] */,
7771 uint32_t buf_size /* [in] */,
7772 uint32_t *total_size /* [out] [ref] */,
7773 uint32_t *returned_size /* [out] [ref] */,
7774 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
7776 struct samr_QueryDisplayInfo3 r;
7777 NTSTATUS status;
7779 /* In parameters */
7780 r.in.domain_handle = domain_handle;
7781 r.in.level = level;
7782 r.in.start_idx = start_idx;
7783 r.in.max_entries = max_entries;
7784 r.in.buf_size = buf_size;
7786 status = cli->dispatch(cli,
7787 mem_ctx,
7788 &ndr_table_samr,
7789 NDR_SAMR_QUERYDISPLAYINFO3,
7790 &r);
7792 if (!NT_STATUS_IS_OK(status)) {
7793 return status;
7796 if (NT_STATUS_IS_ERR(status)) {
7797 return status;
7800 /* Return variables */
7801 *total_size = *r.out.total_size;
7802 *returned_size = *r.out.returned_size;
7803 *info = *r.out.info;
7805 /* Return result */
7806 return r.out.result;
7809 struct rpccli_samr_AddMultipleMembersToAlias_state {
7810 struct samr_AddMultipleMembersToAlias orig;
7811 struct samr_AddMultipleMembersToAlias tmp;
7812 TALLOC_CTX *out_mem_ctx;
7813 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7816 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq);
7818 struct tevent_req *rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX *mem_ctx,
7819 struct tevent_context *ev,
7820 struct rpc_pipe_client *cli,
7821 struct policy_handle *_alias_handle /* [in] [ref] */,
7822 struct lsa_SidArray *_sids /* [in] [ref] */)
7824 struct tevent_req *req;
7825 struct rpccli_samr_AddMultipleMembersToAlias_state *state;
7826 struct tevent_req *subreq;
7828 req = tevent_req_create(mem_ctx, &state,
7829 struct rpccli_samr_AddMultipleMembersToAlias_state);
7830 if (req == NULL) {
7831 return NULL;
7833 state->out_mem_ctx = NULL;
7834 state->dispatch_recv = cli->dispatch_recv;
7836 /* In parameters */
7837 state->orig.in.alias_handle = _alias_handle;
7838 state->orig.in.sids = _sids;
7840 /* Out parameters */
7842 /* Result */
7843 ZERO_STRUCT(state->orig.out.result);
7845 /* make a temporary copy, that we pass to the dispatch function */
7846 state->tmp = state->orig;
7848 subreq = cli->dispatch_send(state, ev, cli,
7849 &ndr_table_samr,
7850 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
7851 &state->tmp);
7852 if (tevent_req_nomem(subreq, req)) {
7853 return tevent_req_post(req, ev);
7855 tevent_req_set_callback(subreq, rpccli_samr_AddMultipleMembersToAlias_done, req);
7856 return req;
7859 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq)
7861 struct tevent_req *req = tevent_req_callback_data(
7862 subreq, struct tevent_req);
7863 struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
7864 req, struct rpccli_samr_AddMultipleMembersToAlias_state);
7865 NTSTATUS status;
7866 TALLOC_CTX *mem_ctx;
7868 if (state->out_mem_ctx) {
7869 mem_ctx = state->out_mem_ctx;
7870 } else {
7871 mem_ctx = state;
7874 status = state->dispatch_recv(subreq, mem_ctx);
7875 TALLOC_FREE(subreq);
7876 if (!NT_STATUS_IS_OK(status)) {
7877 tevent_req_nterror(req, status);
7878 return;
7881 /* Copy out parameters */
7883 /* Copy result */
7884 state->orig.out.result = state->tmp.out.result;
7886 /* Reset temporary structure */
7887 ZERO_STRUCT(state->tmp);
7889 tevent_req_done(req);
7892 NTSTATUS rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req *req,
7893 TALLOC_CTX *mem_ctx,
7894 NTSTATUS *result)
7896 struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
7897 req, struct rpccli_samr_AddMultipleMembersToAlias_state);
7898 NTSTATUS status;
7900 if (tevent_req_is_nterror(req, &status)) {
7901 tevent_req_received(req);
7902 return status;
7905 /* Steal possbile out parameters to the callers context */
7906 talloc_steal(mem_ctx, state->out_mem_ctx);
7908 /* Return result */
7909 *result = state->orig.out.result;
7911 tevent_req_received(req);
7912 return NT_STATUS_OK;
7915 NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
7916 TALLOC_CTX *mem_ctx,
7917 struct policy_handle *alias_handle /* [in] [ref] */,
7918 struct lsa_SidArray *sids /* [in] [ref] */)
7920 struct samr_AddMultipleMembersToAlias r;
7921 NTSTATUS status;
7923 /* In parameters */
7924 r.in.alias_handle = alias_handle;
7925 r.in.sids = sids;
7927 status = cli->dispatch(cli,
7928 mem_ctx,
7929 &ndr_table_samr,
7930 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
7931 &r);
7933 if (!NT_STATUS_IS_OK(status)) {
7934 return status;
7937 if (NT_STATUS_IS_ERR(status)) {
7938 return status;
7941 /* Return variables */
7943 /* Return result */
7944 return r.out.result;
7947 struct rpccli_samr_RemoveMultipleMembersFromAlias_state {
7948 struct samr_RemoveMultipleMembersFromAlias orig;
7949 struct samr_RemoveMultipleMembersFromAlias tmp;
7950 TALLOC_CTX *out_mem_ctx;
7951 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7954 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq);
7956 struct tevent_req *rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX *mem_ctx,
7957 struct tevent_context *ev,
7958 struct rpc_pipe_client *cli,
7959 struct policy_handle *_alias_handle /* [in] [ref] */,
7960 struct lsa_SidArray *_sids /* [in] [ref] */)
7962 struct tevent_req *req;
7963 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state;
7964 struct tevent_req *subreq;
7966 req = tevent_req_create(mem_ctx, &state,
7967 struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
7968 if (req == NULL) {
7969 return NULL;
7971 state->out_mem_ctx = NULL;
7972 state->dispatch_recv = cli->dispatch_recv;
7974 /* In parameters */
7975 state->orig.in.alias_handle = _alias_handle;
7976 state->orig.in.sids = _sids;
7978 /* Out parameters */
7980 /* Result */
7981 ZERO_STRUCT(state->orig.out.result);
7983 /* make a temporary copy, that we pass to the dispatch function */
7984 state->tmp = state->orig;
7986 subreq = cli->dispatch_send(state, ev, cli,
7987 &ndr_table_samr,
7988 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
7989 &state->tmp);
7990 if (tevent_req_nomem(subreq, req)) {
7991 return tevent_req_post(req, ev);
7993 tevent_req_set_callback(subreq, rpccli_samr_RemoveMultipleMembersFromAlias_done, req);
7994 return req;
7997 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq)
7999 struct tevent_req *req = tevent_req_callback_data(
8000 subreq, struct tevent_req);
8001 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
8002 req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
8003 NTSTATUS status;
8004 TALLOC_CTX *mem_ctx;
8006 if (state->out_mem_ctx) {
8007 mem_ctx = state->out_mem_ctx;
8008 } else {
8009 mem_ctx = state;
8012 status = state->dispatch_recv(subreq, mem_ctx);
8013 TALLOC_FREE(subreq);
8014 if (!NT_STATUS_IS_OK(status)) {
8015 tevent_req_nterror(req, status);
8016 return;
8019 /* Copy out parameters */
8021 /* Copy result */
8022 state->orig.out.result = state->tmp.out.result;
8024 /* Reset temporary structure */
8025 ZERO_STRUCT(state->tmp);
8027 tevent_req_done(req);
8030 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req *req,
8031 TALLOC_CTX *mem_ctx,
8032 NTSTATUS *result)
8034 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
8035 req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
8036 NTSTATUS status;
8038 if (tevent_req_is_nterror(req, &status)) {
8039 tevent_req_received(req);
8040 return status;
8043 /* Steal possbile out parameters to the callers context */
8044 talloc_steal(mem_ctx, state->out_mem_ctx);
8046 /* Return result */
8047 *result = state->orig.out.result;
8049 tevent_req_received(req);
8050 return NT_STATUS_OK;
8053 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
8054 TALLOC_CTX *mem_ctx,
8055 struct policy_handle *alias_handle /* [in] [ref] */,
8056 struct lsa_SidArray *sids /* [in] [ref] */)
8058 struct samr_RemoveMultipleMembersFromAlias r;
8059 NTSTATUS status;
8061 /* In parameters */
8062 r.in.alias_handle = alias_handle;
8063 r.in.sids = sids;
8065 status = cli->dispatch(cli,
8066 mem_ctx,
8067 &ndr_table_samr,
8068 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
8069 &r);
8071 if (!NT_STATUS_IS_OK(status)) {
8072 return status;
8075 if (NT_STATUS_IS_ERR(status)) {
8076 return status;
8079 /* Return variables */
8081 /* Return result */
8082 return r.out.result;
8085 struct rpccli_samr_OemChangePasswordUser2_state {
8086 struct samr_OemChangePasswordUser2 orig;
8087 struct samr_OemChangePasswordUser2 tmp;
8088 TALLOC_CTX *out_mem_ctx;
8089 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8092 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq);
8094 struct tevent_req *rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
8095 struct tevent_context *ev,
8096 struct rpc_pipe_client *cli,
8097 struct lsa_AsciiString *_server /* [in] [unique] */,
8098 struct lsa_AsciiString *_account /* [in] [ref] */,
8099 struct samr_CryptPassword *_password /* [in] [unique] */,
8100 struct samr_Password *_hash /* [in] [unique] */)
8102 struct tevent_req *req;
8103 struct rpccli_samr_OemChangePasswordUser2_state *state;
8104 struct tevent_req *subreq;
8106 req = tevent_req_create(mem_ctx, &state,
8107 struct rpccli_samr_OemChangePasswordUser2_state);
8108 if (req == NULL) {
8109 return NULL;
8111 state->out_mem_ctx = NULL;
8112 state->dispatch_recv = cli->dispatch_recv;
8114 /* In parameters */
8115 state->orig.in.server = _server;
8116 state->orig.in.account = _account;
8117 state->orig.in.password = _password;
8118 state->orig.in.hash = _hash;
8120 /* Out parameters */
8122 /* Result */
8123 ZERO_STRUCT(state->orig.out.result);
8125 /* make a temporary copy, that we pass to the dispatch function */
8126 state->tmp = state->orig;
8128 subreq = cli->dispatch_send(state, ev, cli,
8129 &ndr_table_samr,
8130 NDR_SAMR_OEMCHANGEPASSWORDUSER2,
8131 &state->tmp);
8132 if (tevent_req_nomem(subreq, req)) {
8133 return tevent_req_post(req, ev);
8135 tevent_req_set_callback(subreq, rpccli_samr_OemChangePasswordUser2_done, req);
8136 return req;
8139 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq)
8141 struct tevent_req *req = tevent_req_callback_data(
8142 subreq, struct tevent_req);
8143 struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
8144 req, struct rpccli_samr_OemChangePasswordUser2_state);
8145 NTSTATUS status;
8146 TALLOC_CTX *mem_ctx;
8148 if (state->out_mem_ctx) {
8149 mem_ctx = state->out_mem_ctx;
8150 } else {
8151 mem_ctx = state;
8154 status = state->dispatch_recv(subreq, mem_ctx);
8155 TALLOC_FREE(subreq);
8156 if (!NT_STATUS_IS_OK(status)) {
8157 tevent_req_nterror(req, status);
8158 return;
8161 /* Copy out parameters */
8163 /* Copy result */
8164 state->orig.out.result = state->tmp.out.result;
8166 /* Reset temporary structure */
8167 ZERO_STRUCT(state->tmp);
8169 tevent_req_done(req);
8172 NTSTATUS rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req *req,
8173 TALLOC_CTX *mem_ctx,
8174 NTSTATUS *result)
8176 struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
8177 req, struct rpccli_samr_OemChangePasswordUser2_state);
8178 NTSTATUS status;
8180 if (tevent_req_is_nterror(req, &status)) {
8181 tevent_req_received(req);
8182 return status;
8185 /* Steal possbile out parameters to the callers context */
8186 talloc_steal(mem_ctx, state->out_mem_ctx);
8188 /* Return result */
8189 *result = state->orig.out.result;
8191 tevent_req_received(req);
8192 return NT_STATUS_OK;
8195 NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
8196 TALLOC_CTX *mem_ctx,
8197 struct lsa_AsciiString *server /* [in] [unique] */,
8198 struct lsa_AsciiString *account /* [in] [ref] */,
8199 struct samr_CryptPassword *password /* [in] [unique] */,
8200 struct samr_Password *hash /* [in] [unique] */)
8202 struct samr_OemChangePasswordUser2 r;
8203 NTSTATUS status;
8205 /* In parameters */
8206 r.in.server = server;
8207 r.in.account = account;
8208 r.in.password = password;
8209 r.in.hash = hash;
8211 status = cli->dispatch(cli,
8212 mem_ctx,
8213 &ndr_table_samr,
8214 NDR_SAMR_OEMCHANGEPASSWORDUSER2,
8215 &r);
8217 if (!NT_STATUS_IS_OK(status)) {
8218 return status;
8221 if (NT_STATUS_IS_ERR(status)) {
8222 return status;
8225 /* Return variables */
8227 /* Return result */
8228 return r.out.result;
8231 struct rpccli_samr_ChangePasswordUser2_state {
8232 struct samr_ChangePasswordUser2 orig;
8233 struct samr_ChangePasswordUser2 tmp;
8234 TALLOC_CTX *out_mem_ctx;
8235 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8238 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq);
8240 struct tevent_req *rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
8241 struct tevent_context *ev,
8242 struct rpc_pipe_client *cli,
8243 struct lsa_String *_server /* [in] [unique] */,
8244 struct lsa_String *_account /* [in] [ref] */,
8245 struct samr_CryptPassword *_nt_password /* [in] [unique] */,
8246 struct samr_Password *_nt_verifier /* [in] [unique] */,
8247 uint8_t _lm_change /* [in] */,
8248 struct samr_CryptPassword *_lm_password /* [in] [unique] */,
8249 struct samr_Password *_lm_verifier /* [in] [unique] */)
8251 struct tevent_req *req;
8252 struct rpccli_samr_ChangePasswordUser2_state *state;
8253 struct tevent_req *subreq;
8255 req = tevent_req_create(mem_ctx, &state,
8256 struct rpccli_samr_ChangePasswordUser2_state);
8257 if (req == NULL) {
8258 return NULL;
8260 state->out_mem_ctx = NULL;
8261 state->dispatch_recv = cli->dispatch_recv;
8263 /* In parameters */
8264 state->orig.in.server = _server;
8265 state->orig.in.account = _account;
8266 state->orig.in.nt_password = _nt_password;
8267 state->orig.in.nt_verifier = _nt_verifier;
8268 state->orig.in.lm_change = _lm_change;
8269 state->orig.in.lm_password = _lm_password;
8270 state->orig.in.lm_verifier = _lm_verifier;
8272 /* Out parameters */
8274 /* Result */
8275 ZERO_STRUCT(state->orig.out.result);
8277 /* make a temporary copy, that we pass to the dispatch function */
8278 state->tmp = state->orig;
8280 subreq = cli->dispatch_send(state, ev, cli,
8281 &ndr_table_samr,
8282 NDR_SAMR_CHANGEPASSWORDUSER2,
8283 &state->tmp);
8284 if (tevent_req_nomem(subreq, req)) {
8285 return tevent_req_post(req, ev);
8287 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser2_done, req);
8288 return req;
8291 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq)
8293 struct tevent_req *req = tevent_req_callback_data(
8294 subreq, struct tevent_req);
8295 struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
8296 req, struct rpccli_samr_ChangePasswordUser2_state);
8297 NTSTATUS status;
8298 TALLOC_CTX *mem_ctx;
8300 if (state->out_mem_ctx) {
8301 mem_ctx = state->out_mem_ctx;
8302 } else {
8303 mem_ctx = state;
8306 status = state->dispatch_recv(subreq, mem_ctx);
8307 TALLOC_FREE(subreq);
8308 if (!NT_STATUS_IS_OK(status)) {
8309 tevent_req_nterror(req, status);
8310 return;
8313 /* Copy out parameters */
8315 /* Copy result */
8316 state->orig.out.result = state->tmp.out.result;
8318 /* Reset temporary structure */
8319 ZERO_STRUCT(state->tmp);
8321 tevent_req_done(req);
8324 NTSTATUS rpccli_samr_ChangePasswordUser2_recv(struct tevent_req *req,
8325 TALLOC_CTX *mem_ctx,
8326 NTSTATUS *result)
8328 struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
8329 req, struct rpccli_samr_ChangePasswordUser2_state);
8330 NTSTATUS status;
8332 if (tevent_req_is_nterror(req, &status)) {
8333 tevent_req_received(req);
8334 return status;
8337 /* Steal possbile out parameters to the callers context */
8338 talloc_steal(mem_ctx, state->out_mem_ctx);
8340 /* Return result */
8341 *result = state->orig.out.result;
8343 tevent_req_received(req);
8344 return NT_STATUS_OK;
8347 NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
8348 TALLOC_CTX *mem_ctx,
8349 struct lsa_String *server /* [in] [unique] */,
8350 struct lsa_String *account /* [in] [ref] */,
8351 struct samr_CryptPassword *nt_password /* [in] [unique] */,
8352 struct samr_Password *nt_verifier /* [in] [unique] */,
8353 uint8_t lm_change /* [in] */,
8354 struct samr_CryptPassword *lm_password /* [in] [unique] */,
8355 struct samr_Password *lm_verifier /* [in] [unique] */)
8357 struct samr_ChangePasswordUser2 r;
8358 NTSTATUS status;
8360 /* In parameters */
8361 r.in.server = server;
8362 r.in.account = account;
8363 r.in.nt_password = nt_password;
8364 r.in.nt_verifier = nt_verifier;
8365 r.in.lm_change = lm_change;
8366 r.in.lm_password = lm_password;
8367 r.in.lm_verifier = lm_verifier;
8369 status = cli->dispatch(cli,
8370 mem_ctx,
8371 &ndr_table_samr,
8372 NDR_SAMR_CHANGEPASSWORDUSER2,
8373 &r);
8375 if (!NT_STATUS_IS_OK(status)) {
8376 return status;
8379 if (NT_STATUS_IS_ERR(status)) {
8380 return status;
8383 /* Return variables */
8385 /* Return result */
8386 return r.out.result;
8389 struct rpccli_samr_GetDomPwInfo_state {
8390 struct samr_GetDomPwInfo orig;
8391 struct samr_GetDomPwInfo tmp;
8392 TALLOC_CTX *out_mem_ctx;
8393 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8396 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq);
8398 struct tevent_req *rpccli_samr_GetDomPwInfo_send(TALLOC_CTX *mem_ctx,
8399 struct tevent_context *ev,
8400 struct rpc_pipe_client *cli,
8401 struct lsa_String *_domain_name /* [in] [unique] */,
8402 struct samr_PwInfo *_info /* [out] [ref] */)
8404 struct tevent_req *req;
8405 struct rpccli_samr_GetDomPwInfo_state *state;
8406 struct tevent_req *subreq;
8408 req = tevent_req_create(mem_ctx, &state,
8409 struct rpccli_samr_GetDomPwInfo_state);
8410 if (req == NULL) {
8411 return NULL;
8413 state->out_mem_ctx = NULL;
8414 state->dispatch_recv = cli->dispatch_recv;
8416 /* In parameters */
8417 state->orig.in.domain_name = _domain_name;
8419 /* Out parameters */
8420 state->orig.out.info = _info;
8422 /* Result */
8423 ZERO_STRUCT(state->orig.out.result);
8425 state->out_mem_ctx = talloc_named_const(state, 0,
8426 "rpccli_samr_GetDomPwInfo_out_memory");
8427 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8428 return tevent_req_post(req, ev);
8431 /* make a temporary copy, that we pass to the dispatch function */
8432 state->tmp = state->orig;
8434 subreq = cli->dispatch_send(state, ev, cli,
8435 &ndr_table_samr,
8436 NDR_SAMR_GETDOMPWINFO,
8437 &state->tmp);
8438 if (tevent_req_nomem(subreq, req)) {
8439 return tevent_req_post(req, ev);
8441 tevent_req_set_callback(subreq, rpccli_samr_GetDomPwInfo_done, req);
8442 return req;
8445 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq)
8447 struct tevent_req *req = tevent_req_callback_data(
8448 subreq, struct tevent_req);
8449 struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
8450 req, struct rpccli_samr_GetDomPwInfo_state);
8451 NTSTATUS status;
8452 TALLOC_CTX *mem_ctx;
8454 if (state->out_mem_ctx) {
8455 mem_ctx = state->out_mem_ctx;
8456 } else {
8457 mem_ctx = state;
8460 status = state->dispatch_recv(subreq, mem_ctx);
8461 TALLOC_FREE(subreq);
8462 if (!NT_STATUS_IS_OK(status)) {
8463 tevent_req_nterror(req, status);
8464 return;
8467 /* Copy out parameters */
8468 *state->orig.out.info = *state->tmp.out.info;
8470 /* Copy result */
8471 state->orig.out.result = state->tmp.out.result;
8473 /* Reset temporary structure */
8474 ZERO_STRUCT(state->tmp);
8476 tevent_req_done(req);
8479 NTSTATUS rpccli_samr_GetDomPwInfo_recv(struct tevent_req *req,
8480 TALLOC_CTX *mem_ctx,
8481 NTSTATUS *result)
8483 struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
8484 req, struct rpccli_samr_GetDomPwInfo_state);
8485 NTSTATUS status;
8487 if (tevent_req_is_nterror(req, &status)) {
8488 tevent_req_received(req);
8489 return status;
8492 /* Steal possbile out parameters to the callers context */
8493 talloc_steal(mem_ctx, state->out_mem_ctx);
8495 /* Return result */
8496 *result = state->orig.out.result;
8498 tevent_req_received(req);
8499 return NT_STATUS_OK;
8502 NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
8503 TALLOC_CTX *mem_ctx,
8504 struct lsa_String *domain_name /* [in] [unique] */,
8505 struct samr_PwInfo *info /* [out] [ref] */)
8507 struct samr_GetDomPwInfo r;
8508 NTSTATUS status;
8510 /* In parameters */
8511 r.in.domain_name = domain_name;
8513 status = cli->dispatch(cli,
8514 mem_ctx,
8515 &ndr_table_samr,
8516 NDR_SAMR_GETDOMPWINFO,
8517 &r);
8519 if (!NT_STATUS_IS_OK(status)) {
8520 return status;
8523 if (NT_STATUS_IS_ERR(status)) {
8524 return status;
8527 /* Return variables */
8528 *info = *r.out.info;
8530 /* Return result */
8531 return r.out.result;
8534 struct rpccli_samr_Connect2_state {
8535 struct samr_Connect2 orig;
8536 struct samr_Connect2 tmp;
8537 TALLOC_CTX *out_mem_ctx;
8538 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8541 static void rpccli_samr_Connect2_done(struct tevent_req *subreq);
8543 struct tevent_req *rpccli_samr_Connect2_send(TALLOC_CTX *mem_ctx,
8544 struct tevent_context *ev,
8545 struct rpc_pipe_client *cli,
8546 const char *_system_name /* [in] [unique,charset(UTF16)] */,
8547 uint32_t _access_mask /* [in] */,
8548 struct policy_handle *_connect_handle /* [out] [ref] */)
8550 struct tevent_req *req;
8551 struct rpccli_samr_Connect2_state *state;
8552 struct tevent_req *subreq;
8554 req = tevent_req_create(mem_ctx, &state,
8555 struct rpccli_samr_Connect2_state);
8556 if (req == NULL) {
8557 return NULL;
8559 state->out_mem_ctx = NULL;
8560 state->dispatch_recv = cli->dispatch_recv;
8562 /* In parameters */
8563 state->orig.in.system_name = _system_name;
8564 state->orig.in.access_mask = _access_mask;
8566 /* Out parameters */
8567 state->orig.out.connect_handle = _connect_handle;
8569 /* Result */
8570 ZERO_STRUCT(state->orig.out.result);
8572 state->out_mem_ctx = talloc_named_const(state, 0,
8573 "rpccli_samr_Connect2_out_memory");
8574 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8575 return tevent_req_post(req, ev);
8578 /* make a temporary copy, that we pass to the dispatch function */
8579 state->tmp = state->orig;
8581 subreq = cli->dispatch_send(state, ev, cli,
8582 &ndr_table_samr,
8583 NDR_SAMR_CONNECT2,
8584 &state->tmp);
8585 if (tevent_req_nomem(subreq, req)) {
8586 return tevent_req_post(req, ev);
8588 tevent_req_set_callback(subreq, rpccli_samr_Connect2_done, req);
8589 return req;
8592 static void rpccli_samr_Connect2_done(struct tevent_req *subreq)
8594 struct tevent_req *req = tevent_req_callback_data(
8595 subreq, struct tevent_req);
8596 struct rpccli_samr_Connect2_state *state = tevent_req_data(
8597 req, struct rpccli_samr_Connect2_state);
8598 NTSTATUS status;
8599 TALLOC_CTX *mem_ctx;
8601 if (state->out_mem_ctx) {
8602 mem_ctx = state->out_mem_ctx;
8603 } else {
8604 mem_ctx = state;
8607 status = state->dispatch_recv(subreq, mem_ctx);
8608 TALLOC_FREE(subreq);
8609 if (!NT_STATUS_IS_OK(status)) {
8610 tevent_req_nterror(req, status);
8611 return;
8614 /* Copy out parameters */
8615 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
8617 /* Copy result */
8618 state->orig.out.result = state->tmp.out.result;
8620 /* Reset temporary structure */
8621 ZERO_STRUCT(state->tmp);
8623 tevent_req_done(req);
8626 NTSTATUS rpccli_samr_Connect2_recv(struct tevent_req *req,
8627 TALLOC_CTX *mem_ctx,
8628 NTSTATUS *result)
8630 struct rpccli_samr_Connect2_state *state = tevent_req_data(
8631 req, struct rpccli_samr_Connect2_state);
8632 NTSTATUS status;
8634 if (tevent_req_is_nterror(req, &status)) {
8635 tevent_req_received(req);
8636 return status;
8639 /* Steal possbile out parameters to the callers context */
8640 talloc_steal(mem_ctx, state->out_mem_ctx);
8642 /* Return result */
8643 *result = state->orig.out.result;
8645 tevent_req_received(req);
8646 return NT_STATUS_OK;
8649 NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
8650 TALLOC_CTX *mem_ctx,
8651 const char *system_name /* [in] [unique,charset(UTF16)] */,
8652 uint32_t access_mask /* [in] */,
8653 struct policy_handle *connect_handle /* [out] [ref] */)
8655 struct samr_Connect2 r;
8656 NTSTATUS status;
8658 /* In parameters */
8659 r.in.system_name = system_name;
8660 r.in.access_mask = access_mask;
8662 status = cli->dispatch(cli,
8663 mem_ctx,
8664 &ndr_table_samr,
8665 NDR_SAMR_CONNECT2,
8666 &r);
8668 if (!NT_STATUS_IS_OK(status)) {
8669 return status;
8672 if (NT_STATUS_IS_ERR(status)) {
8673 return status;
8676 /* Return variables */
8677 *connect_handle = *r.out.connect_handle;
8679 /* Return result */
8680 return r.out.result;
8683 struct rpccli_samr_SetUserInfo2_state {
8684 struct samr_SetUserInfo2 orig;
8685 struct samr_SetUserInfo2 tmp;
8686 TALLOC_CTX *out_mem_ctx;
8687 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8690 static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq);
8692 struct tevent_req *rpccli_samr_SetUserInfo2_send(TALLOC_CTX *mem_ctx,
8693 struct tevent_context *ev,
8694 struct rpc_pipe_client *cli,
8695 struct policy_handle *_user_handle /* [in] [ref] */,
8696 enum samr_UserInfoLevel _level /* [in] */,
8697 union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
8699 struct tevent_req *req;
8700 struct rpccli_samr_SetUserInfo2_state *state;
8701 struct tevent_req *subreq;
8703 req = tevent_req_create(mem_ctx, &state,
8704 struct rpccli_samr_SetUserInfo2_state);
8705 if (req == NULL) {
8706 return NULL;
8708 state->out_mem_ctx = NULL;
8709 state->dispatch_recv = cli->dispatch_recv;
8711 /* In parameters */
8712 state->orig.in.user_handle = _user_handle;
8713 state->orig.in.level = _level;
8714 state->orig.in.info = _info;
8716 /* Out parameters */
8718 /* Result */
8719 ZERO_STRUCT(state->orig.out.result);
8721 /* make a temporary copy, that we pass to the dispatch function */
8722 state->tmp = state->orig;
8724 subreq = cli->dispatch_send(state, ev, cli,
8725 &ndr_table_samr,
8726 NDR_SAMR_SETUSERINFO2,
8727 &state->tmp);
8728 if (tevent_req_nomem(subreq, req)) {
8729 return tevent_req_post(req, ev);
8731 tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo2_done, req);
8732 return req;
8735 static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq)
8737 struct tevent_req *req = tevent_req_callback_data(
8738 subreq, struct tevent_req);
8739 struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
8740 req, struct rpccli_samr_SetUserInfo2_state);
8741 NTSTATUS status;
8742 TALLOC_CTX *mem_ctx;
8744 if (state->out_mem_ctx) {
8745 mem_ctx = state->out_mem_ctx;
8746 } else {
8747 mem_ctx = state;
8750 status = state->dispatch_recv(subreq, mem_ctx);
8751 TALLOC_FREE(subreq);
8752 if (!NT_STATUS_IS_OK(status)) {
8753 tevent_req_nterror(req, status);
8754 return;
8757 /* Copy out parameters */
8759 /* Copy result */
8760 state->orig.out.result = state->tmp.out.result;
8762 /* Reset temporary structure */
8763 ZERO_STRUCT(state->tmp);
8765 tevent_req_done(req);
8768 NTSTATUS rpccli_samr_SetUserInfo2_recv(struct tevent_req *req,
8769 TALLOC_CTX *mem_ctx,
8770 NTSTATUS *result)
8772 struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
8773 req, struct rpccli_samr_SetUserInfo2_state);
8774 NTSTATUS status;
8776 if (tevent_req_is_nterror(req, &status)) {
8777 tevent_req_received(req);
8778 return status;
8781 /* Steal possbile out parameters to the callers context */
8782 talloc_steal(mem_ctx, state->out_mem_ctx);
8784 /* Return result */
8785 *result = state->orig.out.result;
8787 tevent_req_received(req);
8788 return NT_STATUS_OK;
8791 NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
8792 TALLOC_CTX *mem_ctx,
8793 struct policy_handle *user_handle /* [in] [ref] */,
8794 enum samr_UserInfoLevel level /* [in] */,
8795 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
8797 struct samr_SetUserInfo2 r;
8798 NTSTATUS status;
8800 /* In parameters */
8801 r.in.user_handle = user_handle;
8802 r.in.level = level;
8803 r.in.info = info;
8805 status = cli->dispatch(cli,
8806 mem_ctx,
8807 &ndr_table_samr,
8808 NDR_SAMR_SETUSERINFO2,
8809 &r);
8811 if (!NT_STATUS_IS_OK(status)) {
8812 return status;
8815 if (NT_STATUS_IS_ERR(status)) {
8816 return status;
8819 /* Return variables */
8821 /* Return result */
8822 return r.out.result;
8825 struct rpccli_samr_SetBootKeyInformation_state {
8826 struct samr_SetBootKeyInformation orig;
8827 struct samr_SetBootKeyInformation tmp;
8828 TALLOC_CTX *out_mem_ctx;
8829 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8832 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq);
8834 struct tevent_req *rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
8835 struct tevent_context *ev,
8836 struct rpc_pipe_client *cli,
8837 struct policy_handle *_connect_handle /* [in] [ref] */,
8838 uint32_t _unknown1 /* [in] */,
8839 uint32_t _unknown2 /* [in] */,
8840 uint32_t _unknown3 /* [in] */)
8842 struct tevent_req *req;
8843 struct rpccli_samr_SetBootKeyInformation_state *state;
8844 struct tevent_req *subreq;
8846 req = tevent_req_create(mem_ctx, &state,
8847 struct rpccli_samr_SetBootKeyInformation_state);
8848 if (req == NULL) {
8849 return NULL;
8851 state->out_mem_ctx = NULL;
8852 state->dispatch_recv = cli->dispatch_recv;
8854 /* In parameters */
8855 state->orig.in.connect_handle = _connect_handle;
8856 state->orig.in.unknown1 = _unknown1;
8857 state->orig.in.unknown2 = _unknown2;
8858 state->orig.in.unknown3 = _unknown3;
8860 /* Out parameters */
8862 /* Result */
8863 ZERO_STRUCT(state->orig.out.result);
8865 /* make a temporary copy, that we pass to the dispatch function */
8866 state->tmp = state->orig;
8868 subreq = cli->dispatch_send(state, ev, cli,
8869 &ndr_table_samr,
8870 NDR_SAMR_SETBOOTKEYINFORMATION,
8871 &state->tmp);
8872 if (tevent_req_nomem(subreq, req)) {
8873 return tevent_req_post(req, ev);
8875 tevent_req_set_callback(subreq, rpccli_samr_SetBootKeyInformation_done, req);
8876 return req;
8879 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq)
8881 struct tevent_req *req = tevent_req_callback_data(
8882 subreq, struct tevent_req);
8883 struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
8884 req, struct rpccli_samr_SetBootKeyInformation_state);
8885 NTSTATUS status;
8886 TALLOC_CTX *mem_ctx;
8888 if (state->out_mem_ctx) {
8889 mem_ctx = state->out_mem_ctx;
8890 } else {
8891 mem_ctx = state;
8894 status = state->dispatch_recv(subreq, mem_ctx);
8895 TALLOC_FREE(subreq);
8896 if (!NT_STATUS_IS_OK(status)) {
8897 tevent_req_nterror(req, status);
8898 return;
8901 /* Copy out parameters */
8903 /* Copy result */
8904 state->orig.out.result = state->tmp.out.result;
8906 /* Reset temporary structure */
8907 ZERO_STRUCT(state->tmp);
8909 tevent_req_done(req);
8912 NTSTATUS rpccli_samr_SetBootKeyInformation_recv(struct tevent_req *req,
8913 TALLOC_CTX *mem_ctx,
8914 NTSTATUS *result)
8916 struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
8917 req, struct rpccli_samr_SetBootKeyInformation_state);
8918 NTSTATUS status;
8920 if (tevent_req_is_nterror(req, &status)) {
8921 tevent_req_received(req);
8922 return status;
8925 /* Steal possbile out parameters to the callers context */
8926 talloc_steal(mem_ctx, state->out_mem_ctx);
8928 /* Return result */
8929 *result = state->orig.out.result;
8931 tevent_req_received(req);
8932 return NT_STATUS_OK;
8935 NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
8936 TALLOC_CTX *mem_ctx,
8937 struct policy_handle *connect_handle /* [in] [ref] */,
8938 uint32_t unknown1 /* [in] */,
8939 uint32_t unknown2 /* [in] */,
8940 uint32_t unknown3 /* [in] */)
8942 struct samr_SetBootKeyInformation r;
8943 NTSTATUS status;
8945 /* In parameters */
8946 r.in.connect_handle = connect_handle;
8947 r.in.unknown1 = unknown1;
8948 r.in.unknown2 = unknown2;
8949 r.in.unknown3 = unknown3;
8951 status = cli->dispatch(cli,
8952 mem_ctx,
8953 &ndr_table_samr,
8954 NDR_SAMR_SETBOOTKEYINFORMATION,
8955 &r);
8957 if (!NT_STATUS_IS_OK(status)) {
8958 return status;
8961 if (NT_STATUS_IS_ERR(status)) {
8962 return status;
8965 /* Return variables */
8967 /* Return result */
8968 return r.out.result;
8971 struct rpccli_samr_GetBootKeyInformation_state {
8972 struct samr_GetBootKeyInformation orig;
8973 struct samr_GetBootKeyInformation tmp;
8974 TALLOC_CTX *out_mem_ctx;
8975 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8978 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq);
8980 struct tevent_req *rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
8981 struct tevent_context *ev,
8982 struct rpc_pipe_client *cli,
8983 struct policy_handle *_domain_handle /* [in] [ref] */,
8984 uint32_t *_unknown /* [out] [ref] */)
8986 struct tevent_req *req;
8987 struct rpccli_samr_GetBootKeyInformation_state *state;
8988 struct tevent_req *subreq;
8990 req = tevent_req_create(mem_ctx, &state,
8991 struct rpccli_samr_GetBootKeyInformation_state);
8992 if (req == NULL) {
8993 return NULL;
8995 state->out_mem_ctx = NULL;
8996 state->dispatch_recv = cli->dispatch_recv;
8998 /* In parameters */
8999 state->orig.in.domain_handle = _domain_handle;
9001 /* Out parameters */
9002 state->orig.out.unknown = _unknown;
9004 /* Result */
9005 ZERO_STRUCT(state->orig.out.result);
9007 state->out_mem_ctx = talloc_named_const(state, 0,
9008 "rpccli_samr_GetBootKeyInformation_out_memory");
9009 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9010 return tevent_req_post(req, ev);
9013 /* make a temporary copy, that we pass to the dispatch function */
9014 state->tmp = state->orig;
9016 subreq = cli->dispatch_send(state, ev, cli,
9017 &ndr_table_samr,
9018 NDR_SAMR_GETBOOTKEYINFORMATION,
9019 &state->tmp);
9020 if (tevent_req_nomem(subreq, req)) {
9021 return tevent_req_post(req, ev);
9023 tevent_req_set_callback(subreq, rpccli_samr_GetBootKeyInformation_done, req);
9024 return req;
9027 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq)
9029 struct tevent_req *req = tevent_req_callback_data(
9030 subreq, struct tevent_req);
9031 struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
9032 req, struct rpccli_samr_GetBootKeyInformation_state);
9033 NTSTATUS status;
9034 TALLOC_CTX *mem_ctx;
9036 if (state->out_mem_ctx) {
9037 mem_ctx = state->out_mem_ctx;
9038 } else {
9039 mem_ctx = state;
9042 status = state->dispatch_recv(subreq, mem_ctx);
9043 TALLOC_FREE(subreq);
9044 if (!NT_STATUS_IS_OK(status)) {
9045 tevent_req_nterror(req, status);
9046 return;
9049 /* Copy out parameters */
9050 *state->orig.out.unknown = *state->tmp.out.unknown;
9052 /* Copy result */
9053 state->orig.out.result = state->tmp.out.result;
9055 /* Reset temporary structure */
9056 ZERO_STRUCT(state->tmp);
9058 tevent_req_done(req);
9061 NTSTATUS rpccli_samr_GetBootKeyInformation_recv(struct tevent_req *req,
9062 TALLOC_CTX *mem_ctx,
9063 NTSTATUS *result)
9065 struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
9066 req, struct rpccli_samr_GetBootKeyInformation_state);
9067 NTSTATUS status;
9069 if (tevent_req_is_nterror(req, &status)) {
9070 tevent_req_received(req);
9071 return status;
9074 /* Steal possbile out parameters to the callers context */
9075 talloc_steal(mem_ctx, state->out_mem_ctx);
9077 /* Return result */
9078 *result = state->orig.out.result;
9080 tevent_req_received(req);
9081 return NT_STATUS_OK;
9084 NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
9085 TALLOC_CTX *mem_ctx,
9086 struct policy_handle *domain_handle /* [in] [ref] */,
9087 uint32_t *unknown /* [out] [ref] */)
9089 struct samr_GetBootKeyInformation r;
9090 NTSTATUS status;
9092 /* In parameters */
9093 r.in.domain_handle = domain_handle;
9095 status = cli->dispatch(cli,
9096 mem_ctx,
9097 &ndr_table_samr,
9098 NDR_SAMR_GETBOOTKEYINFORMATION,
9099 &r);
9101 if (!NT_STATUS_IS_OK(status)) {
9102 return status;
9105 if (NT_STATUS_IS_ERR(status)) {
9106 return status;
9109 /* Return variables */
9110 *unknown = *r.out.unknown;
9112 /* Return result */
9113 return r.out.result;
9116 struct rpccli_samr_Connect3_state {
9117 struct samr_Connect3 orig;
9118 struct samr_Connect3 tmp;
9119 TALLOC_CTX *out_mem_ctx;
9120 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9123 static void rpccli_samr_Connect3_done(struct tevent_req *subreq);
9125 struct tevent_req *rpccli_samr_Connect3_send(TALLOC_CTX *mem_ctx,
9126 struct tevent_context *ev,
9127 struct rpc_pipe_client *cli,
9128 const char *_system_name /* [in] [unique,charset(UTF16)] */,
9129 uint32_t _unknown /* [in] */,
9130 uint32_t _access_mask /* [in] */,
9131 struct policy_handle *_connect_handle /* [out] [ref] */)
9133 struct tevent_req *req;
9134 struct rpccli_samr_Connect3_state *state;
9135 struct tevent_req *subreq;
9137 req = tevent_req_create(mem_ctx, &state,
9138 struct rpccli_samr_Connect3_state);
9139 if (req == NULL) {
9140 return NULL;
9142 state->out_mem_ctx = NULL;
9143 state->dispatch_recv = cli->dispatch_recv;
9145 /* In parameters */
9146 state->orig.in.system_name = _system_name;
9147 state->orig.in.unknown = _unknown;
9148 state->orig.in.access_mask = _access_mask;
9150 /* Out parameters */
9151 state->orig.out.connect_handle = _connect_handle;
9153 /* Result */
9154 ZERO_STRUCT(state->orig.out.result);
9156 state->out_mem_ctx = talloc_named_const(state, 0,
9157 "rpccli_samr_Connect3_out_memory");
9158 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9159 return tevent_req_post(req, ev);
9162 /* make a temporary copy, that we pass to the dispatch function */
9163 state->tmp = state->orig;
9165 subreq = cli->dispatch_send(state, ev, cli,
9166 &ndr_table_samr,
9167 NDR_SAMR_CONNECT3,
9168 &state->tmp);
9169 if (tevent_req_nomem(subreq, req)) {
9170 return tevent_req_post(req, ev);
9172 tevent_req_set_callback(subreq, rpccli_samr_Connect3_done, req);
9173 return req;
9176 static void rpccli_samr_Connect3_done(struct tevent_req *subreq)
9178 struct tevent_req *req = tevent_req_callback_data(
9179 subreq, struct tevent_req);
9180 struct rpccli_samr_Connect3_state *state = tevent_req_data(
9181 req, struct rpccli_samr_Connect3_state);
9182 NTSTATUS status;
9183 TALLOC_CTX *mem_ctx;
9185 if (state->out_mem_ctx) {
9186 mem_ctx = state->out_mem_ctx;
9187 } else {
9188 mem_ctx = state;
9191 status = state->dispatch_recv(subreq, mem_ctx);
9192 TALLOC_FREE(subreq);
9193 if (!NT_STATUS_IS_OK(status)) {
9194 tevent_req_nterror(req, status);
9195 return;
9198 /* Copy out parameters */
9199 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
9201 /* Copy result */
9202 state->orig.out.result = state->tmp.out.result;
9204 /* Reset temporary structure */
9205 ZERO_STRUCT(state->tmp);
9207 tevent_req_done(req);
9210 NTSTATUS rpccli_samr_Connect3_recv(struct tevent_req *req,
9211 TALLOC_CTX *mem_ctx,
9212 NTSTATUS *result)
9214 struct rpccli_samr_Connect3_state *state = tevent_req_data(
9215 req, struct rpccli_samr_Connect3_state);
9216 NTSTATUS status;
9218 if (tevent_req_is_nterror(req, &status)) {
9219 tevent_req_received(req);
9220 return status;
9223 /* Steal possbile out parameters to the callers context */
9224 talloc_steal(mem_ctx, state->out_mem_ctx);
9226 /* Return result */
9227 *result = state->orig.out.result;
9229 tevent_req_received(req);
9230 return NT_STATUS_OK;
9233 NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
9234 TALLOC_CTX *mem_ctx,
9235 const char *system_name /* [in] [unique,charset(UTF16)] */,
9236 uint32_t unknown /* [in] */,
9237 uint32_t access_mask /* [in] */,
9238 struct policy_handle *connect_handle /* [out] [ref] */)
9240 struct samr_Connect3 r;
9241 NTSTATUS status;
9243 /* In parameters */
9244 r.in.system_name = system_name;
9245 r.in.unknown = unknown;
9246 r.in.access_mask = access_mask;
9248 status = cli->dispatch(cli,
9249 mem_ctx,
9250 &ndr_table_samr,
9251 NDR_SAMR_CONNECT3,
9252 &r);
9254 if (!NT_STATUS_IS_OK(status)) {
9255 return status;
9258 if (NT_STATUS_IS_ERR(status)) {
9259 return status;
9262 /* Return variables */
9263 *connect_handle = *r.out.connect_handle;
9265 /* Return result */
9266 return r.out.result;
9269 struct rpccli_samr_Connect4_state {
9270 struct samr_Connect4 orig;
9271 struct samr_Connect4 tmp;
9272 TALLOC_CTX *out_mem_ctx;
9273 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9276 static void rpccli_samr_Connect4_done(struct tevent_req *subreq);
9278 struct tevent_req *rpccli_samr_Connect4_send(TALLOC_CTX *mem_ctx,
9279 struct tevent_context *ev,
9280 struct rpc_pipe_client *cli,
9281 const char *_system_name /* [in] [unique,charset(UTF16)] */,
9282 enum samr_ConnectVersion _client_version /* [in] */,
9283 uint32_t _access_mask /* [in] */,
9284 struct policy_handle *_connect_handle /* [out] [ref] */)
9286 struct tevent_req *req;
9287 struct rpccli_samr_Connect4_state *state;
9288 struct tevent_req *subreq;
9290 req = tevent_req_create(mem_ctx, &state,
9291 struct rpccli_samr_Connect4_state);
9292 if (req == NULL) {
9293 return NULL;
9295 state->out_mem_ctx = NULL;
9296 state->dispatch_recv = cli->dispatch_recv;
9298 /* In parameters */
9299 state->orig.in.system_name = _system_name;
9300 state->orig.in.client_version = _client_version;
9301 state->orig.in.access_mask = _access_mask;
9303 /* Out parameters */
9304 state->orig.out.connect_handle = _connect_handle;
9306 /* Result */
9307 ZERO_STRUCT(state->orig.out.result);
9309 state->out_mem_ctx = talloc_named_const(state, 0,
9310 "rpccli_samr_Connect4_out_memory");
9311 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9312 return tevent_req_post(req, ev);
9315 /* make a temporary copy, that we pass to the dispatch function */
9316 state->tmp = state->orig;
9318 subreq = cli->dispatch_send(state, ev, cli,
9319 &ndr_table_samr,
9320 NDR_SAMR_CONNECT4,
9321 &state->tmp);
9322 if (tevent_req_nomem(subreq, req)) {
9323 return tevent_req_post(req, ev);
9325 tevent_req_set_callback(subreq, rpccli_samr_Connect4_done, req);
9326 return req;
9329 static void rpccli_samr_Connect4_done(struct tevent_req *subreq)
9331 struct tevent_req *req = tevent_req_callback_data(
9332 subreq, struct tevent_req);
9333 struct rpccli_samr_Connect4_state *state = tevent_req_data(
9334 req, struct rpccli_samr_Connect4_state);
9335 NTSTATUS status;
9336 TALLOC_CTX *mem_ctx;
9338 if (state->out_mem_ctx) {
9339 mem_ctx = state->out_mem_ctx;
9340 } else {
9341 mem_ctx = state;
9344 status = state->dispatch_recv(subreq, mem_ctx);
9345 TALLOC_FREE(subreq);
9346 if (!NT_STATUS_IS_OK(status)) {
9347 tevent_req_nterror(req, status);
9348 return;
9351 /* Copy out parameters */
9352 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
9354 /* Copy result */
9355 state->orig.out.result = state->tmp.out.result;
9357 /* Reset temporary structure */
9358 ZERO_STRUCT(state->tmp);
9360 tevent_req_done(req);
9363 NTSTATUS rpccli_samr_Connect4_recv(struct tevent_req *req,
9364 TALLOC_CTX *mem_ctx,
9365 NTSTATUS *result)
9367 struct rpccli_samr_Connect4_state *state = tevent_req_data(
9368 req, struct rpccli_samr_Connect4_state);
9369 NTSTATUS status;
9371 if (tevent_req_is_nterror(req, &status)) {
9372 tevent_req_received(req);
9373 return status;
9376 /* Steal possbile out parameters to the callers context */
9377 talloc_steal(mem_ctx, state->out_mem_ctx);
9379 /* Return result */
9380 *result = state->orig.out.result;
9382 tevent_req_received(req);
9383 return NT_STATUS_OK;
9386 NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
9387 TALLOC_CTX *mem_ctx,
9388 const char *system_name /* [in] [unique,charset(UTF16)] */,
9389 enum samr_ConnectVersion client_version /* [in] */,
9390 uint32_t access_mask /* [in] */,
9391 struct policy_handle *connect_handle /* [out] [ref] */)
9393 struct samr_Connect4 r;
9394 NTSTATUS status;
9396 /* In parameters */
9397 r.in.system_name = system_name;
9398 r.in.client_version = client_version;
9399 r.in.access_mask = access_mask;
9401 status = cli->dispatch(cli,
9402 mem_ctx,
9403 &ndr_table_samr,
9404 NDR_SAMR_CONNECT4,
9405 &r);
9407 if (!NT_STATUS_IS_OK(status)) {
9408 return status;
9411 if (NT_STATUS_IS_ERR(status)) {
9412 return status;
9415 /* Return variables */
9416 *connect_handle = *r.out.connect_handle;
9418 /* Return result */
9419 return r.out.result;
9422 struct rpccli_samr_ChangePasswordUser3_state {
9423 struct samr_ChangePasswordUser3 orig;
9424 struct samr_ChangePasswordUser3 tmp;
9425 TALLOC_CTX *out_mem_ctx;
9426 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9429 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq);
9431 struct tevent_req *rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX *mem_ctx,
9432 struct tevent_context *ev,
9433 struct rpc_pipe_client *cli,
9434 struct lsa_String *_server /* [in] [unique] */,
9435 struct lsa_String *_account /* [in] [ref] */,
9436 struct samr_CryptPassword *_nt_password /* [in] [unique] */,
9437 struct samr_Password *_nt_verifier /* [in] [unique] */,
9438 uint8_t _lm_change /* [in] */,
9439 struct samr_CryptPassword *_lm_password /* [in] [unique] */,
9440 struct samr_Password *_lm_verifier /* [in] [unique] */,
9441 struct samr_CryptPassword *_password3 /* [in] [unique] */,
9442 struct samr_DomInfo1 **_dominfo /* [out] [ref] */,
9443 struct samr_ChangeReject **_reject /* [out] [ref] */)
9445 struct tevent_req *req;
9446 struct rpccli_samr_ChangePasswordUser3_state *state;
9447 struct tevent_req *subreq;
9449 req = tevent_req_create(mem_ctx, &state,
9450 struct rpccli_samr_ChangePasswordUser3_state);
9451 if (req == NULL) {
9452 return NULL;
9454 state->out_mem_ctx = NULL;
9455 state->dispatch_recv = cli->dispatch_recv;
9457 /* In parameters */
9458 state->orig.in.server = _server;
9459 state->orig.in.account = _account;
9460 state->orig.in.nt_password = _nt_password;
9461 state->orig.in.nt_verifier = _nt_verifier;
9462 state->orig.in.lm_change = _lm_change;
9463 state->orig.in.lm_password = _lm_password;
9464 state->orig.in.lm_verifier = _lm_verifier;
9465 state->orig.in.password3 = _password3;
9467 /* Out parameters */
9468 state->orig.out.dominfo = _dominfo;
9469 state->orig.out.reject = _reject;
9471 /* Result */
9472 ZERO_STRUCT(state->orig.out.result);
9474 state->out_mem_ctx = talloc_named_const(state, 0,
9475 "rpccli_samr_ChangePasswordUser3_out_memory");
9476 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9477 return tevent_req_post(req, ev);
9480 /* make a temporary copy, that we pass to the dispatch function */
9481 state->tmp = state->orig;
9483 subreq = cli->dispatch_send(state, ev, cli,
9484 &ndr_table_samr,
9485 NDR_SAMR_CHANGEPASSWORDUSER3,
9486 &state->tmp);
9487 if (tevent_req_nomem(subreq, req)) {
9488 return tevent_req_post(req, ev);
9490 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser3_done, req);
9491 return req;
9494 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq)
9496 struct tevent_req *req = tevent_req_callback_data(
9497 subreq, struct tevent_req);
9498 struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
9499 req, struct rpccli_samr_ChangePasswordUser3_state);
9500 NTSTATUS status;
9501 TALLOC_CTX *mem_ctx;
9503 if (state->out_mem_ctx) {
9504 mem_ctx = state->out_mem_ctx;
9505 } else {
9506 mem_ctx = state;
9509 status = state->dispatch_recv(subreq, mem_ctx);
9510 TALLOC_FREE(subreq);
9511 if (!NT_STATUS_IS_OK(status)) {
9512 tevent_req_nterror(req, status);
9513 return;
9516 /* Copy out parameters */
9517 *state->orig.out.dominfo = *state->tmp.out.dominfo;
9518 *state->orig.out.reject = *state->tmp.out.reject;
9520 /* Copy result */
9521 state->orig.out.result = state->tmp.out.result;
9523 /* Reset temporary structure */
9524 ZERO_STRUCT(state->tmp);
9526 tevent_req_done(req);
9529 NTSTATUS rpccli_samr_ChangePasswordUser3_recv(struct tevent_req *req,
9530 TALLOC_CTX *mem_ctx,
9531 NTSTATUS *result)
9533 struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
9534 req, struct rpccli_samr_ChangePasswordUser3_state);
9535 NTSTATUS status;
9537 if (tevent_req_is_nterror(req, &status)) {
9538 tevent_req_received(req);
9539 return status;
9542 /* Steal possbile out parameters to the callers context */
9543 talloc_steal(mem_ctx, state->out_mem_ctx);
9545 /* Return result */
9546 *result = state->orig.out.result;
9548 tevent_req_received(req);
9549 return NT_STATUS_OK;
9552 NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
9553 TALLOC_CTX *mem_ctx,
9554 struct lsa_String *server /* [in] [unique] */,
9555 struct lsa_String *account /* [in] [ref] */,
9556 struct samr_CryptPassword *nt_password /* [in] [unique] */,
9557 struct samr_Password *nt_verifier /* [in] [unique] */,
9558 uint8_t lm_change /* [in] */,
9559 struct samr_CryptPassword *lm_password /* [in] [unique] */,
9560 struct samr_Password *lm_verifier /* [in] [unique] */,
9561 struct samr_CryptPassword *password3 /* [in] [unique] */,
9562 struct samr_DomInfo1 **dominfo /* [out] [ref] */,
9563 struct samr_ChangeReject **reject /* [out] [ref] */)
9565 struct samr_ChangePasswordUser3 r;
9566 NTSTATUS status;
9568 /* In parameters */
9569 r.in.server = server;
9570 r.in.account = account;
9571 r.in.nt_password = nt_password;
9572 r.in.nt_verifier = nt_verifier;
9573 r.in.lm_change = lm_change;
9574 r.in.lm_password = lm_password;
9575 r.in.lm_verifier = lm_verifier;
9576 r.in.password3 = password3;
9578 status = cli->dispatch(cli,
9579 mem_ctx,
9580 &ndr_table_samr,
9581 NDR_SAMR_CHANGEPASSWORDUSER3,
9582 &r);
9584 if (!NT_STATUS_IS_OK(status)) {
9585 return status;
9588 if (NT_STATUS_IS_ERR(status)) {
9589 return status;
9592 /* Return variables */
9593 *dominfo = *r.out.dominfo;
9594 *reject = *r.out.reject;
9596 /* Return result */
9597 return r.out.result;
9600 struct rpccli_samr_Connect5_state {
9601 struct samr_Connect5 orig;
9602 struct samr_Connect5 tmp;
9603 TALLOC_CTX *out_mem_ctx;
9604 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9607 static void rpccli_samr_Connect5_done(struct tevent_req *subreq);
9609 struct tevent_req *rpccli_samr_Connect5_send(TALLOC_CTX *mem_ctx,
9610 struct tevent_context *ev,
9611 struct rpc_pipe_client *cli,
9612 const char *_system_name /* [in] [unique,charset(UTF16)] */,
9613 uint32_t _access_mask /* [in] */,
9614 uint32_t _level_in /* [in] */,
9615 union samr_ConnectInfo *_info_in /* [in] [ref,switch_is(level_in)] */,
9616 uint32_t *_level_out /* [out] [ref] */,
9617 union samr_ConnectInfo *_info_out /* [out] [ref,switch_is(*level_out)] */,
9618 struct policy_handle *_connect_handle /* [out] [ref] */)
9620 struct tevent_req *req;
9621 struct rpccli_samr_Connect5_state *state;
9622 struct tevent_req *subreq;
9624 req = tevent_req_create(mem_ctx, &state,
9625 struct rpccli_samr_Connect5_state);
9626 if (req == NULL) {
9627 return NULL;
9629 state->out_mem_ctx = NULL;
9630 state->dispatch_recv = cli->dispatch_recv;
9632 /* In parameters */
9633 state->orig.in.system_name = _system_name;
9634 state->orig.in.access_mask = _access_mask;
9635 state->orig.in.level_in = _level_in;
9636 state->orig.in.info_in = _info_in;
9638 /* Out parameters */
9639 state->orig.out.level_out = _level_out;
9640 state->orig.out.info_out = _info_out;
9641 state->orig.out.connect_handle = _connect_handle;
9643 /* Result */
9644 ZERO_STRUCT(state->orig.out.result);
9646 state->out_mem_ctx = talloc_named_const(state, 0,
9647 "rpccli_samr_Connect5_out_memory");
9648 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9649 return tevent_req_post(req, ev);
9652 /* make a temporary copy, that we pass to the dispatch function */
9653 state->tmp = state->orig;
9655 subreq = cli->dispatch_send(state, ev, cli,
9656 &ndr_table_samr,
9657 NDR_SAMR_CONNECT5,
9658 &state->tmp);
9659 if (tevent_req_nomem(subreq, req)) {
9660 return tevent_req_post(req, ev);
9662 tevent_req_set_callback(subreq, rpccli_samr_Connect5_done, req);
9663 return req;
9666 static void rpccli_samr_Connect5_done(struct tevent_req *subreq)
9668 struct tevent_req *req = tevent_req_callback_data(
9669 subreq, struct tevent_req);
9670 struct rpccli_samr_Connect5_state *state = tevent_req_data(
9671 req, struct rpccli_samr_Connect5_state);
9672 NTSTATUS status;
9673 TALLOC_CTX *mem_ctx;
9675 if (state->out_mem_ctx) {
9676 mem_ctx = state->out_mem_ctx;
9677 } else {
9678 mem_ctx = state;
9681 status = state->dispatch_recv(subreq, mem_ctx);
9682 TALLOC_FREE(subreq);
9683 if (!NT_STATUS_IS_OK(status)) {
9684 tevent_req_nterror(req, status);
9685 return;
9688 /* Copy out parameters */
9689 *state->orig.out.level_out = *state->tmp.out.level_out;
9690 *state->orig.out.info_out = *state->tmp.out.info_out;
9691 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
9693 /* Copy result */
9694 state->orig.out.result = state->tmp.out.result;
9696 /* Reset temporary structure */
9697 ZERO_STRUCT(state->tmp);
9699 tevent_req_done(req);
9702 NTSTATUS rpccli_samr_Connect5_recv(struct tevent_req *req,
9703 TALLOC_CTX *mem_ctx,
9704 NTSTATUS *result)
9706 struct rpccli_samr_Connect5_state *state = tevent_req_data(
9707 req, struct rpccli_samr_Connect5_state);
9708 NTSTATUS status;
9710 if (tevent_req_is_nterror(req, &status)) {
9711 tevent_req_received(req);
9712 return status;
9715 /* Steal possbile out parameters to the callers context */
9716 talloc_steal(mem_ctx, state->out_mem_ctx);
9718 /* Return result */
9719 *result = state->orig.out.result;
9721 tevent_req_received(req);
9722 return NT_STATUS_OK;
9725 NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
9726 TALLOC_CTX *mem_ctx,
9727 const char *system_name /* [in] [unique,charset(UTF16)] */,
9728 uint32_t access_mask /* [in] */,
9729 uint32_t level_in /* [in] */,
9730 union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */,
9731 uint32_t *level_out /* [out] [ref] */,
9732 union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */,
9733 struct policy_handle *connect_handle /* [out] [ref] */)
9735 struct samr_Connect5 r;
9736 NTSTATUS status;
9738 /* In parameters */
9739 r.in.system_name = system_name;
9740 r.in.access_mask = access_mask;
9741 r.in.level_in = level_in;
9742 r.in.info_in = info_in;
9744 status = cli->dispatch(cli,
9745 mem_ctx,
9746 &ndr_table_samr,
9747 NDR_SAMR_CONNECT5,
9748 &r);
9750 if (!NT_STATUS_IS_OK(status)) {
9751 return status;
9754 if (NT_STATUS_IS_ERR(status)) {
9755 return status;
9758 /* Return variables */
9759 *level_out = *r.out.level_out;
9760 *info_out = *r.out.info_out;
9761 *connect_handle = *r.out.connect_handle;
9763 /* Return result */
9764 return r.out.result;
9767 struct rpccli_samr_RidToSid_state {
9768 struct samr_RidToSid orig;
9769 struct samr_RidToSid tmp;
9770 TALLOC_CTX *out_mem_ctx;
9771 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9774 static void rpccli_samr_RidToSid_done(struct tevent_req *subreq);
9776 struct tevent_req *rpccli_samr_RidToSid_send(TALLOC_CTX *mem_ctx,
9777 struct tevent_context *ev,
9778 struct rpc_pipe_client *cli,
9779 struct policy_handle *_domain_handle /* [in] [ref] */,
9780 uint32_t _rid /* [in] */,
9781 struct dom_sid2 **_sid /* [out] [ref] */)
9783 struct tevent_req *req;
9784 struct rpccli_samr_RidToSid_state *state;
9785 struct tevent_req *subreq;
9787 req = tevent_req_create(mem_ctx, &state,
9788 struct rpccli_samr_RidToSid_state);
9789 if (req == NULL) {
9790 return NULL;
9792 state->out_mem_ctx = NULL;
9793 state->dispatch_recv = cli->dispatch_recv;
9795 /* In parameters */
9796 state->orig.in.domain_handle = _domain_handle;
9797 state->orig.in.rid = _rid;
9799 /* Out parameters */
9800 state->orig.out.sid = _sid;
9802 /* Result */
9803 ZERO_STRUCT(state->orig.out.result);
9805 state->out_mem_ctx = talloc_named_const(state, 0,
9806 "rpccli_samr_RidToSid_out_memory");
9807 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9808 return tevent_req_post(req, ev);
9811 /* make a temporary copy, that we pass to the dispatch function */
9812 state->tmp = state->orig;
9814 subreq = cli->dispatch_send(state, ev, cli,
9815 &ndr_table_samr,
9816 NDR_SAMR_RIDTOSID,
9817 &state->tmp);
9818 if (tevent_req_nomem(subreq, req)) {
9819 return tevent_req_post(req, ev);
9821 tevent_req_set_callback(subreq, rpccli_samr_RidToSid_done, req);
9822 return req;
9825 static void rpccli_samr_RidToSid_done(struct tevent_req *subreq)
9827 struct tevent_req *req = tevent_req_callback_data(
9828 subreq, struct tevent_req);
9829 struct rpccli_samr_RidToSid_state *state = tevent_req_data(
9830 req, struct rpccli_samr_RidToSid_state);
9831 NTSTATUS status;
9832 TALLOC_CTX *mem_ctx;
9834 if (state->out_mem_ctx) {
9835 mem_ctx = state->out_mem_ctx;
9836 } else {
9837 mem_ctx = state;
9840 status = state->dispatch_recv(subreq, mem_ctx);
9841 TALLOC_FREE(subreq);
9842 if (!NT_STATUS_IS_OK(status)) {
9843 tevent_req_nterror(req, status);
9844 return;
9847 /* Copy out parameters */
9848 *state->orig.out.sid = *state->tmp.out.sid;
9850 /* Copy result */
9851 state->orig.out.result = state->tmp.out.result;
9853 /* Reset temporary structure */
9854 ZERO_STRUCT(state->tmp);
9856 tevent_req_done(req);
9859 NTSTATUS rpccli_samr_RidToSid_recv(struct tevent_req *req,
9860 TALLOC_CTX *mem_ctx,
9861 NTSTATUS *result)
9863 struct rpccli_samr_RidToSid_state *state = tevent_req_data(
9864 req, struct rpccli_samr_RidToSid_state);
9865 NTSTATUS status;
9867 if (tevent_req_is_nterror(req, &status)) {
9868 tevent_req_received(req);
9869 return status;
9872 /* Steal possbile out parameters to the callers context */
9873 talloc_steal(mem_ctx, state->out_mem_ctx);
9875 /* Return result */
9876 *result = state->orig.out.result;
9878 tevent_req_received(req);
9879 return NT_STATUS_OK;
9882 NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
9883 TALLOC_CTX *mem_ctx,
9884 struct policy_handle *domain_handle /* [in] [ref] */,
9885 uint32_t rid /* [in] */,
9886 struct dom_sid2 **sid /* [out] [ref] */)
9888 struct samr_RidToSid r;
9889 NTSTATUS status;
9891 /* In parameters */
9892 r.in.domain_handle = domain_handle;
9893 r.in.rid = rid;
9895 status = cli->dispatch(cli,
9896 mem_ctx,
9897 &ndr_table_samr,
9898 NDR_SAMR_RIDTOSID,
9899 &r);
9901 if (!NT_STATUS_IS_OK(status)) {
9902 return status;
9905 if (NT_STATUS_IS_ERR(status)) {
9906 return status;
9909 /* Return variables */
9910 *sid = *r.out.sid;
9912 /* Return result */
9913 return r.out.result;
9916 struct rpccli_samr_SetDsrmPassword_state {
9917 struct samr_SetDsrmPassword orig;
9918 struct samr_SetDsrmPassword tmp;
9919 TALLOC_CTX *out_mem_ctx;
9920 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9923 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq);
9925 struct tevent_req *rpccli_samr_SetDsrmPassword_send(TALLOC_CTX *mem_ctx,
9926 struct tevent_context *ev,
9927 struct rpc_pipe_client *cli,
9928 struct lsa_String *_name /* [in] [unique] */,
9929 uint32_t _unknown /* [in] */,
9930 struct samr_Password *_hash /* [in] [unique] */)
9932 struct tevent_req *req;
9933 struct rpccli_samr_SetDsrmPassword_state *state;
9934 struct tevent_req *subreq;
9936 req = tevent_req_create(mem_ctx, &state,
9937 struct rpccli_samr_SetDsrmPassword_state);
9938 if (req == NULL) {
9939 return NULL;
9941 state->out_mem_ctx = NULL;
9942 state->dispatch_recv = cli->dispatch_recv;
9944 /* In parameters */
9945 state->orig.in.name = _name;
9946 state->orig.in.unknown = _unknown;
9947 state->orig.in.hash = _hash;
9949 /* Out parameters */
9951 /* Result */
9952 ZERO_STRUCT(state->orig.out.result);
9954 /* make a temporary copy, that we pass to the dispatch function */
9955 state->tmp = state->orig;
9957 subreq = cli->dispatch_send(state, ev, cli,
9958 &ndr_table_samr,
9959 NDR_SAMR_SETDSRMPASSWORD,
9960 &state->tmp);
9961 if (tevent_req_nomem(subreq, req)) {
9962 return tevent_req_post(req, ev);
9964 tevent_req_set_callback(subreq, rpccli_samr_SetDsrmPassword_done, req);
9965 return req;
9968 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq)
9970 struct tevent_req *req = tevent_req_callback_data(
9971 subreq, struct tevent_req);
9972 struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
9973 req, struct rpccli_samr_SetDsrmPassword_state);
9974 NTSTATUS status;
9975 TALLOC_CTX *mem_ctx;
9977 if (state->out_mem_ctx) {
9978 mem_ctx = state->out_mem_ctx;
9979 } else {
9980 mem_ctx = state;
9983 status = state->dispatch_recv(subreq, mem_ctx);
9984 TALLOC_FREE(subreq);
9985 if (!NT_STATUS_IS_OK(status)) {
9986 tevent_req_nterror(req, status);
9987 return;
9990 /* Copy out parameters */
9992 /* Copy result */
9993 state->orig.out.result = state->tmp.out.result;
9995 /* Reset temporary structure */
9996 ZERO_STRUCT(state->tmp);
9998 tevent_req_done(req);
10001 NTSTATUS rpccli_samr_SetDsrmPassword_recv(struct tevent_req *req,
10002 TALLOC_CTX *mem_ctx,
10003 NTSTATUS *result)
10005 struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
10006 req, struct rpccli_samr_SetDsrmPassword_state);
10007 NTSTATUS status;
10009 if (tevent_req_is_nterror(req, &status)) {
10010 tevent_req_received(req);
10011 return status;
10014 /* Steal possbile out parameters to the callers context */
10015 talloc_steal(mem_ctx, state->out_mem_ctx);
10017 /* Return result */
10018 *result = state->orig.out.result;
10020 tevent_req_received(req);
10021 return NT_STATUS_OK;
10024 NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
10025 TALLOC_CTX *mem_ctx,
10026 struct lsa_String *name /* [in] [unique] */,
10027 uint32_t unknown /* [in] */,
10028 struct samr_Password *hash /* [in] [unique] */)
10030 struct samr_SetDsrmPassword r;
10031 NTSTATUS status;
10033 /* In parameters */
10034 r.in.name = name;
10035 r.in.unknown = unknown;
10036 r.in.hash = hash;
10038 status = cli->dispatch(cli,
10039 mem_ctx,
10040 &ndr_table_samr,
10041 NDR_SAMR_SETDSRMPASSWORD,
10042 &r);
10044 if (!NT_STATUS_IS_OK(status)) {
10045 return status;
10048 if (NT_STATUS_IS_ERR(status)) {
10049 return status;
10052 /* Return variables */
10054 /* Return result */
10055 return r.out.result;
10058 struct rpccli_samr_ValidatePassword_state {
10059 struct samr_ValidatePassword orig;
10060 struct samr_ValidatePassword tmp;
10061 TALLOC_CTX *out_mem_ctx;
10062 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10065 static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq);
10067 struct tevent_req *rpccli_samr_ValidatePassword_send(TALLOC_CTX *mem_ctx,
10068 struct tevent_context *ev,
10069 struct rpc_pipe_client *cli,
10070 enum samr_ValidatePasswordLevel _level /* [in] */,
10071 union samr_ValidatePasswordReq *_req /* [in] [ref,switch_is(level)] */,
10072 union samr_ValidatePasswordRep **_rep /* [out] [ref,switch_is(level)] */)
10074 struct tevent_req *req;
10075 struct rpccli_samr_ValidatePassword_state *state;
10076 struct tevent_req *subreq;
10078 req = tevent_req_create(mem_ctx, &state,
10079 struct rpccli_samr_ValidatePassword_state);
10080 if (req == NULL) {
10081 return NULL;
10083 state->out_mem_ctx = NULL;
10084 state->dispatch_recv = cli->dispatch_recv;
10086 /* In parameters */
10087 state->orig.in.level = _level;
10088 state->orig.in.req = _req;
10090 /* Out parameters */
10091 state->orig.out.rep = _rep;
10093 /* Result */
10094 ZERO_STRUCT(state->orig.out.result);
10096 state->out_mem_ctx = talloc_named_const(state, 0,
10097 "rpccli_samr_ValidatePassword_out_memory");
10098 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10099 return tevent_req_post(req, ev);
10102 /* make a temporary copy, that we pass to the dispatch function */
10103 state->tmp = state->orig;
10105 subreq = cli->dispatch_send(state, ev, cli,
10106 &ndr_table_samr,
10107 NDR_SAMR_VALIDATEPASSWORD,
10108 &state->tmp);
10109 if (tevent_req_nomem(subreq, req)) {
10110 return tevent_req_post(req, ev);
10112 tevent_req_set_callback(subreq, rpccli_samr_ValidatePassword_done, req);
10113 return req;
10116 static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq)
10118 struct tevent_req *req = tevent_req_callback_data(
10119 subreq, struct tevent_req);
10120 struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
10121 req, struct rpccli_samr_ValidatePassword_state);
10122 NTSTATUS status;
10123 TALLOC_CTX *mem_ctx;
10125 if (state->out_mem_ctx) {
10126 mem_ctx = state->out_mem_ctx;
10127 } else {
10128 mem_ctx = state;
10131 status = state->dispatch_recv(subreq, mem_ctx);
10132 TALLOC_FREE(subreq);
10133 if (!NT_STATUS_IS_OK(status)) {
10134 tevent_req_nterror(req, status);
10135 return;
10138 /* Copy out parameters */
10139 *state->orig.out.rep = *state->tmp.out.rep;
10141 /* Copy result */
10142 state->orig.out.result = state->tmp.out.result;
10144 /* Reset temporary structure */
10145 ZERO_STRUCT(state->tmp);
10147 tevent_req_done(req);
10150 NTSTATUS rpccli_samr_ValidatePassword_recv(struct tevent_req *req,
10151 TALLOC_CTX *mem_ctx,
10152 NTSTATUS *result)
10154 struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
10155 req, struct rpccli_samr_ValidatePassword_state);
10156 NTSTATUS status;
10158 if (tevent_req_is_nterror(req, &status)) {
10159 tevent_req_received(req);
10160 return status;
10163 /* Steal possbile out parameters to the callers context */
10164 talloc_steal(mem_ctx, state->out_mem_ctx);
10166 /* Return result */
10167 *result = state->orig.out.result;
10169 tevent_req_received(req);
10170 return NT_STATUS_OK;
10173 NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli,
10174 TALLOC_CTX *mem_ctx,
10175 enum samr_ValidatePasswordLevel level /* [in] */,
10176 union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */,
10177 union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */)
10179 struct samr_ValidatePassword r;
10180 NTSTATUS status;
10182 /* In parameters */
10183 r.in.level = level;
10184 r.in.req = req;
10186 status = cli->dispatch(cli,
10187 mem_ctx,
10188 &ndr_table_samr,
10189 NDR_SAMR_VALIDATEPASSWORD,
10190 &r);
10192 if (!NT_STATUS_IS_OK(status)) {
10193 return status;
10196 if (NT_STATUS_IS_ERR(status)) {
10197 return status;
10200 /* Return variables */
10201 *rep = *r.out.rep;
10203 /* Return result */
10204 return r.out.result;