idl: recompile our IDL
[Samba/aatanasov.git] / librpc / gen_ndr / cli_samr.c
blob27119e53cc32c7bc79794869badf5637375c3f6e
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 if (DEBUGLEVEL >= 10) {
48 NDR_PRINT_IN_DEBUG(samr_Connect, &state->orig);
51 state->out_mem_ctx = talloc_named_const(state, 0,
52 "rpccli_samr_Connect_out_memory");
53 if (tevent_req_nomem(state->out_mem_ctx, req)) {
54 return tevent_req_post(req, ev);
57 /* make a temporary copy, that we pass to the dispatch function */
58 state->tmp = state->orig;
60 subreq = cli->dispatch_send(state, ev, cli,
61 &ndr_table_samr,
62 NDR_SAMR_CONNECT,
63 &state->tmp);
64 if (tevent_req_nomem(subreq, req)) {
65 return tevent_req_post(req, ev);
67 tevent_req_set_callback(subreq, rpccli_samr_Connect_done, req);
68 return req;
71 static void rpccli_samr_Connect_done(struct tevent_req *subreq)
73 struct tevent_req *req = tevent_req_callback_data(
74 subreq, struct tevent_req);
75 struct rpccli_samr_Connect_state *state = tevent_req_data(
76 req, struct rpccli_samr_Connect_state);
77 NTSTATUS status;
78 TALLOC_CTX *mem_ctx;
80 if (state->out_mem_ctx) {
81 mem_ctx = state->out_mem_ctx;
82 } else {
83 mem_ctx = state;
86 status = state->dispatch_recv(subreq, mem_ctx);
87 TALLOC_FREE(subreq);
88 if (!NT_STATUS_IS_OK(status)) {
89 tevent_req_nterror(req, status);
90 return;
93 /* Copy out parameters */
94 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
96 /* Copy result */
97 state->orig.out.result = state->tmp.out.result;
99 /* Reset temporary structure */
100 ZERO_STRUCT(state->tmp);
102 if (DEBUGLEVEL >= 10) {
103 NDR_PRINT_OUT_DEBUG(samr_Connect, &state->orig);
106 tevent_req_done(req);
109 NTSTATUS rpccli_samr_Connect_recv(struct tevent_req *req,
110 TALLOC_CTX *mem_ctx,
111 NTSTATUS *result)
113 struct rpccli_samr_Connect_state *state = tevent_req_data(
114 req, struct rpccli_samr_Connect_state);
115 NTSTATUS status;
117 if (tevent_req_is_nterror(req, &status)) {
118 tevent_req_received(req);
119 return status;
122 /* Steal possbile out parameters to the callers context */
123 talloc_steal(mem_ctx, state->out_mem_ctx);
125 /* Return result */
126 *result = state->orig.out.result;
128 tevent_req_received(req);
129 return NT_STATUS_OK;
132 NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
133 TALLOC_CTX *mem_ctx,
134 uint16_t *system_name /* [in] [unique] */,
135 uint32_t access_mask /* [in] */,
136 struct policy_handle *connect_handle /* [out] [ref] */)
138 struct samr_Connect r;
139 NTSTATUS status;
141 /* In parameters */
142 r.in.system_name = system_name;
143 r.in.access_mask = access_mask;
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_IN_DEBUG(samr_Connect, &r);
149 status = cli->dispatch(cli,
150 mem_ctx,
151 &ndr_table_samr,
152 NDR_SAMR_CONNECT,
153 &r);
155 if (!NT_STATUS_IS_OK(status)) {
156 return status;
159 if (DEBUGLEVEL >= 10) {
160 NDR_PRINT_OUT_DEBUG(samr_Connect, &r);
163 if (NT_STATUS_IS_ERR(status)) {
164 return status;
167 /* Return variables */
168 *connect_handle = *r.out.connect_handle;
170 /* Return result */
171 return r.out.result;
174 struct rpccli_samr_Close_state {
175 struct samr_Close orig;
176 struct samr_Close tmp;
177 TALLOC_CTX *out_mem_ctx;
178 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
181 static void rpccli_samr_Close_done(struct tevent_req *subreq);
183 struct tevent_req *rpccli_samr_Close_send(TALLOC_CTX *mem_ctx,
184 struct tevent_context *ev,
185 struct rpc_pipe_client *cli,
186 struct policy_handle *_handle /* [in,out] [ref] */)
188 struct tevent_req *req;
189 struct rpccli_samr_Close_state *state;
190 struct tevent_req *subreq;
192 req = tevent_req_create(mem_ctx, &state,
193 struct rpccli_samr_Close_state);
194 if (req == NULL) {
195 return NULL;
197 state->out_mem_ctx = NULL;
198 state->dispatch_recv = cli->dispatch_recv;
200 /* In parameters */
201 state->orig.in.handle = _handle;
203 /* Out parameters */
204 state->orig.out.handle = _handle;
206 /* Result */
207 ZERO_STRUCT(state->orig.out.result);
209 if (DEBUGLEVEL >= 10) {
210 NDR_PRINT_IN_DEBUG(samr_Close, &state->orig);
213 state->out_mem_ctx = talloc_named_const(state, 0,
214 "rpccli_samr_Close_out_memory");
215 if (tevent_req_nomem(state->out_mem_ctx, req)) {
216 return tevent_req_post(req, ev);
219 /* make a temporary copy, that we pass to the dispatch function */
220 state->tmp = state->orig;
222 subreq = cli->dispatch_send(state, ev, cli,
223 &ndr_table_samr,
224 NDR_SAMR_CLOSE,
225 &state->tmp);
226 if (tevent_req_nomem(subreq, req)) {
227 return tevent_req_post(req, ev);
229 tevent_req_set_callback(subreq, rpccli_samr_Close_done, req);
230 return req;
233 static void rpccli_samr_Close_done(struct tevent_req *subreq)
235 struct tevent_req *req = tevent_req_callback_data(
236 subreq, struct tevent_req);
237 struct rpccli_samr_Close_state *state = tevent_req_data(
238 req, struct rpccli_samr_Close_state);
239 NTSTATUS status;
240 TALLOC_CTX *mem_ctx;
242 if (state->out_mem_ctx) {
243 mem_ctx = state->out_mem_ctx;
244 } else {
245 mem_ctx = state;
248 status = state->dispatch_recv(subreq, mem_ctx);
249 TALLOC_FREE(subreq);
250 if (!NT_STATUS_IS_OK(status)) {
251 tevent_req_nterror(req, status);
252 return;
255 /* Copy out parameters */
256 *state->orig.out.handle = *state->tmp.out.handle;
258 /* Copy result */
259 state->orig.out.result = state->tmp.out.result;
261 /* Reset temporary structure */
262 ZERO_STRUCT(state->tmp);
264 if (DEBUGLEVEL >= 10) {
265 NDR_PRINT_OUT_DEBUG(samr_Close, &state->orig);
268 tevent_req_done(req);
271 NTSTATUS rpccli_samr_Close_recv(struct tevent_req *req,
272 TALLOC_CTX *mem_ctx,
273 NTSTATUS *result)
275 struct rpccli_samr_Close_state *state = tevent_req_data(
276 req, struct rpccli_samr_Close_state);
277 NTSTATUS status;
279 if (tevent_req_is_nterror(req, &status)) {
280 tevent_req_received(req);
281 return status;
284 /* Steal possbile out parameters to the callers context */
285 talloc_steal(mem_ctx, state->out_mem_ctx);
287 /* Return result */
288 *result = state->orig.out.result;
290 tevent_req_received(req);
291 return NT_STATUS_OK;
294 NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
295 TALLOC_CTX *mem_ctx,
296 struct policy_handle *handle /* [in,out] [ref] */)
298 struct samr_Close r;
299 NTSTATUS status;
301 /* In parameters */
302 r.in.handle = handle;
304 if (DEBUGLEVEL >= 10) {
305 NDR_PRINT_IN_DEBUG(samr_Close, &r);
308 status = cli->dispatch(cli,
309 mem_ctx,
310 &ndr_table_samr,
311 NDR_SAMR_CLOSE,
312 &r);
314 if (!NT_STATUS_IS_OK(status)) {
315 return status;
318 if (DEBUGLEVEL >= 10) {
319 NDR_PRINT_OUT_DEBUG(samr_Close, &r);
322 if (NT_STATUS_IS_ERR(status)) {
323 return status;
326 /* Return variables */
327 *handle = *r.out.handle;
329 /* Return result */
330 return r.out.result;
333 struct rpccli_samr_SetSecurity_state {
334 struct samr_SetSecurity orig;
335 struct samr_SetSecurity tmp;
336 TALLOC_CTX *out_mem_ctx;
337 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
340 static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq);
342 struct tevent_req *rpccli_samr_SetSecurity_send(TALLOC_CTX *mem_ctx,
343 struct tevent_context *ev,
344 struct rpc_pipe_client *cli,
345 struct policy_handle *_handle /* [in] [ref] */,
346 uint32_t _sec_info /* [in] */,
347 struct sec_desc_buf *_sdbuf /* [in] [ref] */)
349 struct tevent_req *req;
350 struct rpccli_samr_SetSecurity_state *state;
351 struct tevent_req *subreq;
353 req = tevent_req_create(mem_ctx, &state,
354 struct rpccli_samr_SetSecurity_state);
355 if (req == NULL) {
356 return NULL;
358 state->out_mem_ctx = NULL;
359 state->dispatch_recv = cli->dispatch_recv;
361 /* In parameters */
362 state->orig.in.handle = _handle;
363 state->orig.in.sec_info = _sec_info;
364 state->orig.in.sdbuf = _sdbuf;
366 /* Out parameters */
368 /* Result */
369 ZERO_STRUCT(state->orig.out.result);
371 if (DEBUGLEVEL >= 10) {
372 NDR_PRINT_IN_DEBUG(samr_SetSecurity, &state->orig);
375 /* make a temporary copy, that we pass to the dispatch function */
376 state->tmp = state->orig;
378 subreq = cli->dispatch_send(state, ev, cli,
379 &ndr_table_samr,
380 NDR_SAMR_SETSECURITY,
381 &state->tmp);
382 if (tevent_req_nomem(subreq, req)) {
383 return tevent_req_post(req, ev);
385 tevent_req_set_callback(subreq, rpccli_samr_SetSecurity_done, req);
386 return req;
389 static void rpccli_samr_SetSecurity_done(struct tevent_req *subreq)
391 struct tevent_req *req = tevent_req_callback_data(
392 subreq, struct tevent_req);
393 struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
394 req, struct rpccli_samr_SetSecurity_state);
395 NTSTATUS status;
396 TALLOC_CTX *mem_ctx;
398 if (state->out_mem_ctx) {
399 mem_ctx = state->out_mem_ctx;
400 } else {
401 mem_ctx = state;
404 status = state->dispatch_recv(subreq, mem_ctx);
405 TALLOC_FREE(subreq);
406 if (!NT_STATUS_IS_OK(status)) {
407 tevent_req_nterror(req, status);
408 return;
411 /* Copy out parameters */
413 /* Copy result */
414 state->orig.out.result = state->tmp.out.result;
416 /* Reset temporary structure */
417 ZERO_STRUCT(state->tmp);
419 if (DEBUGLEVEL >= 10) {
420 NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &state->orig);
423 tevent_req_done(req);
426 NTSTATUS rpccli_samr_SetSecurity_recv(struct tevent_req *req,
427 TALLOC_CTX *mem_ctx,
428 NTSTATUS *result)
430 struct rpccli_samr_SetSecurity_state *state = tevent_req_data(
431 req, struct rpccli_samr_SetSecurity_state);
432 NTSTATUS status;
434 if (tevent_req_is_nterror(req, &status)) {
435 tevent_req_received(req);
436 return status;
439 /* Steal possbile out parameters to the callers context */
440 talloc_steal(mem_ctx, state->out_mem_ctx);
442 /* Return result */
443 *result = state->orig.out.result;
445 tevent_req_received(req);
446 return NT_STATUS_OK;
449 NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
450 TALLOC_CTX *mem_ctx,
451 struct policy_handle *handle /* [in] [ref] */,
452 uint32_t sec_info /* [in] */,
453 struct sec_desc_buf *sdbuf /* [in] [ref] */)
455 struct samr_SetSecurity r;
456 NTSTATUS status;
458 /* In parameters */
459 r.in.handle = handle;
460 r.in.sec_info = sec_info;
461 r.in.sdbuf = sdbuf;
463 if (DEBUGLEVEL >= 10) {
464 NDR_PRINT_IN_DEBUG(samr_SetSecurity, &r);
467 status = cli->dispatch(cli,
468 mem_ctx,
469 &ndr_table_samr,
470 NDR_SAMR_SETSECURITY,
471 &r);
473 if (!NT_STATUS_IS_OK(status)) {
474 return status;
477 if (DEBUGLEVEL >= 10) {
478 NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &r);
481 if (NT_STATUS_IS_ERR(status)) {
482 return status;
485 /* Return variables */
487 /* Return result */
488 return r.out.result;
491 struct rpccli_samr_QuerySecurity_state {
492 struct samr_QuerySecurity orig;
493 struct samr_QuerySecurity tmp;
494 TALLOC_CTX *out_mem_ctx;
495 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
498 static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq);
500 struct tevent_req *rpccli_samr_QuerySecurity_send(TALLOC_CTX *mem_ctx,
501 struct tevent_context *ev,
502 struct rpc_pipe_client *cli,
503 struct policy_handle *_handle /* [in] [ref] */,
504 uint32_t _sec_info /* [in] */,
505 struct sec_desc_buf **_sdbuf /* [out] [ref] */)
507 struct tevent_req *req;
508 struct rpccli_samr_QuerySecurity_state *state;
509 struct tevent_req *subreq;
511 req = tevent_req_create(mem_ctx, &state,
512 struct rpccli_samr_QuerySecurity_state);
513 if (req == NULL) {
514 return NULL;
516 state->out_mem_ctx = NULL;
517 state->dispatch_recv = cli->dispatch_recv;
519 /* In parameters */
520 state->orig.in.handle = _handle;
521 state->orig.in.sec_info = _sec_info;
523 /* Out parameters */
524 state->orig.out.sdbuf = _sdbuf;
526 /* Result */
527 ZERO_STRUCT(state->orig.out.result);
529 if (DEBUGLEVEL >= 10) {
530 NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &state->orig);
533 state->out_mem_ctx = talloc_named_const(state, 0,
534 "rpccli_samr_QuerySecurity_out_memory");
535 if (tevent_req_nomem(state->out_mem_ctx, req)) {
536 return tevent_req_post(req, ev);
539 /* make a temporary copy, that we pass to the dispatch function */
540 state->tmp = state->orig;
542 subreq = cli->dispatch_send(state, ev, cli,
543 &ndr_table_samr,
544 NDR_SAMR_QUERYSECURITY,
545 &state->tmp);
546 if (tevent_req_nomem(subreq, req)) {
547 return tevent_req_post(req, ev);
549 tevent_req_set_callback(subreq, rpccli_samr_QuerySecurity_done, req);
550 return req;
553 static void rpccli_samr_QuerySecurity_done(struct tevent_req *subreq)
555 struct tevent_req *req = tevent_req_callback_data(
556 subreq, struct tevent_req);
557 struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
558 req, struct rpccli_samr_QuerySecurity_state);
559 NTSTATUS status;
560 TALLOC_CTX *mem_ctx;
562 if (state->out_mem_ctx) {
563 mem_ctx = state->out_mem_ctx;
564 } else {
565 mem_ctx = state;
568 status = state->dispatch_recv(subreq, mem_ctx);
569 TALLOC_FREE(subreq);
570 if (!NT_STATUS_IS_OK(status)) {
571 tevent_req_nterror(req, status);
572 return;
575 /* Copy out parameters */
576 *state->orig.out.sdbuf = *state->tmp.out.sdbuf;
578 /* Copy result */
579 state->orig.out.result = state->tmp.out.result;
581 /* Reset temporary structure */
582 ZERO_STRUCT(state->tmp);
584 if (DEBUGLEVEL >= 10) {
585 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &state->orig);
588 tevent_req_done(req);
591 NTSTATUS rpccli_samr_QuerySecurity_recv(struct tevent_req *req,
592 TALLOC_CTX *mem_ctx,
593 NTSTATUS *result)
595 struct rpccli_samr_QuerySecurity_state *state = tevent_req_data(
596 req, struct rpccli_samr_QuerySecurity_state);
597 NTSTATUS status;
599 if (tevent_req_is_nterror(req, &status)) {
600 tevent_req_received(req);
601 return status;
604 /* Steal possbile out parameters to the callers context */
605 talloc_steal(mem_ctx, state->out_mem_ctx);
607 /* Return result */
608 *result = state->orig.out.result;
610 tevent_req_received(req);
611 return NT_STATUS_OK;
614 NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
615 TALLOC_CTX *mem_ctx,
616 struct policy_handle *handle /* [in] [ref] */,
617 uint32_t sec_info /* [in] */,
618 struct sec_desc_buf **sdbuf /* [out] [ref] */)
620 struct samr_QuerySecurity r;
621 NTSTATUS status;
623 /* In parameters */
624 r.in.handle = handle;
625 r.in.sec_info = sec_info;
627 if (DEBUGLEVEL >= 10) {
628 NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &r);
631 status = cli->dispatch(cli,
632 mem_ctx,
633 &ndr_table_samr,
634 NDR_SAMR_QUERYSECURITY,
635 &r);
637 if (!NT_STATUS_IS_OK(status)) {
638 return status;
641 if (DEBUGLEVEL >= 10) {
642 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &r);
645 if (NT_STATUS_IS_ERR(status)) {
646 return status;
649 /* Return variables */
650 *sdbuf = *r.out.sdbuf;
652 /* Return result */
653 return r.out.result;
656 struct rpccli_samr_Shutdown_state {
657 struct samr_Shutdown orig;
658 struct samr_Shutdown tmp;
659 TALLOC_CTX *out_mem_ctx;
660 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
663 static void rpccli_samr_Shutdown_done(struct tevent_req *subreq);
665 struct tevent_req *rpccli_samr_Shutdown_send(TALLOC_CTX *mem_ctx,
666 struct tevent_context *ev,
667 struct rpc_pipe_client *cli,
668 struct policy_handle *_connect_handle /* [in] [ref] */)
670 struct tevent_req *req;
671 struct rpccli_samr_Shutdown_state *state;
672 struct tevent_req *subreq;
674 req = tevent_req_create(mem_ctx, &state,
675 struct rpccli_samr_Shutdown_state);
676 if (req == NULL) {
677 return NULL;
679 state->out_mem_ctx = NULL;
680 state->dispatch_recv = cli->dispatch_recv;
682 /* In parameters */
683 state->orig.in.connect_handle = _connect_handle;
685 /* Out parameters */
687 /* Result */
688 ZERO_STRUCT(state->orig.out.result);
690 if (DEBUGLEVEL >= 10) {
691 NDR_PRINT_IN_DEBUG(samr_Shutdown, &state->orig);
694 /* make a temporary copy, that we pass to the dispatch function */
695 state->tmp = state->orig;
697 subreq = cli->dispatch_send(state, ev, cli,
698 &ndr_table_samr,
699 NDR_SAMR_SHUTDOWN,
700 &state->tmp);
701 if (tevent_req_nomem(subreq, req)) {
702 return tevent_req_post(req, ev);
704 tevent_req_set_callback(subreq, rpccli_samr_Shutdown_done, req);
705 return req;
708 static void rpccli_samr_Shutdown_done(struct tevent_req *subreq)
710 struct tevent_req *req = tevent_req_callback_data(
711 subreq, struct tevent_req);
712 struct rpccli_samr_Shutdown_state *state = tevent_req_data(
713 req, struct rpccli_samr_Shutdown_state);
714 NTSTATUS status;
715 TALLOC_CTX *mem_ctx;
717 if (state->out_mem_ctx) {
718 mem_ctx = state->out_mem_ctx;
719 } else {
720 mem_ctx = state;
723 status = state->dispatch_recv(subreq, mem_ctx);
724 TALLOC_FREE(subreq);
725 if (!NT_STATUS_IS_OK(status)) {
726 tevent_req_nterror(req, status);
727 return;
730 /* Copy out parameters */
732 /* Copy result */
733 state->orig.out.result = state->tmp.out.result;
735 /* Reset temporary structure */
736 ZERO_STRUCT(state->tmp);
738 if (DEBUGLEVEL >= 10) {
739 NDR_PRINT_OUT_DEBUG(samr_Shutdown, &state->orig);
742 tevent_req_done(req);
745 NTSTATUS rpccli_samr_Shutdown_recv(struct tevent_req *req,
746 TALLOC_CTX *mem_ctx,
747 NTSTATUS *result)
749 struct rpccli_samr_Shutdown_state *state = tevent_req_data(
750 req, struct rpccli_samr_Shutdown_state);
751 NTSTATUS status;
753 if (tevent_req_is_nterror(req, &status)) {
754 tevent_req_received(req);
755 return status;
758 /* Steal possbile out parameters to the callers context */
759 talloc_steal(mem_ctx, state->out_mem_ctx);
761 /* Return result */
762 *result = state->orig.out.result;
764 tevent_req_received(req);
765 return NT_STATUS_OK;
768 NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
769 TALLOC_CTX *mem_ctx,
770 struct policy_handle *connect_handle /* [in] [ref] */)
772 struct samr_Shutdown r;
773 NTSTATUS status;
775 /* In parameters */
776 r.in.connect_handle = connect_handle;
778 if (DEBUGLEVEL >= 10) {
779 NDR_PRINT_IN_DEBUG(samr_Shutdown, &r);
782 status = cli->dispatch(cli,
783 mem_ctx,
784 &ndr_table_samr,
785 NDR_SAMR_SHUTDOWN,
786 &r);
788 if (!NT_STATUS_IS_OK(status)) {
789 return status;
792 if (DEBUGLEVEL >= 10) {
793 NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r);
796 if (NT_STATUS_IS_ERR(status)) {
797 return status;
800 /* Return variables */
802 /* Return result */
803 return r.out.result;
806 struct rpccli_samr_LookupDomain_state {
807 struct samr_LookupDomain orig;
808 struct samr_LookupDomain tmp;
809 TALLOC_CTX *out_mem_ctx;
810 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
813 static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq);
815 struct tevent_req *rpccli_samr_LookupDomain_send(TALLOC_CTX *mem_ctx,
816 struct tevent_context *ev,
817 struct rpc_pipe_client *cli,
818 struct policy_handle *_connect_handle /* [in] [ref] */,
819 struct lsa_String *_domain_name /* [in] [ref] */,
820 struct dom_sid2 **_sid /* [out] [ref] */)
822 struct tevent_req *req;
823 struct rpccli_samr_LookupDomain_state *state;
824 struct tevent_req *subreq;
826 req = tevent_req_create(mem_ctx, &state,
827 struct rpccli_samr_LookupDomain_state);
828 if (req == NULL) {
829 return NULL;
831 state->out_mem_ctx = NULL;
832 state->dispatch_recv = cli->dispatch_recv;
834 /* In parameters */
835 state->orig.in.connect_handle = _connect_handle;
836 state->orig.in.domain_name = _domain_name;
838 /* Out parameters */
839 state->orig.out.sid = _sid;
841 /* Result */
842 ZERO_STRUCT(state->orig.out.result);
844 if (DEBUGLEVEL >= 10) {
845 NDR_PRINT_IN_DEBUG(samr_LookupDomain, &state->orig);
848 state->out_mem_ctx = talloc_named_const(state, 0,
849 "rpccli_samr_LookupDomain_out_memory");
850 if (tevent_req_nomem(state->out_mem_ctx, req)) {
851 return tevent_req_post(req, ev);
854 /* make a temporary copy, that we pass to the dispatch function */
855 state->tmp = state->orig;
857 subreq = cli->dispatch_send(state, ev, cli,
858 &ndr_table_samr,
859 NDR_SAMR_LOOKUPDOMAIN,
860 &state->tmp);
861 if (tevent_req_nomem(subreq, req)) {
862 return tevent_req_post(req, ev);
864 tevent_req_set_callback(subreq, rpccli_samr_LookupDomain_done, req);
865 return req;
868 static void rpccli_samr_LookupDomain_done(struct tevent_req *subreq)
870 struct tevent_req *req = tevent_req_callback_data(
871 subreq, struct tevent_req);
872 struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
873 req, struct rpccli_samr_LookupDomain_state);
874 NTSTATUS status;
875 TALLOC_CTX *mem_ctx;
877 if (state->out_mem_ctx) {
878 mem_ctx = state->out_mem_ctx;
879 } else {
880 mem_ctx = state;
883 status = state->dispatch_recv(subreq, mem_ctx);
884 TALLOC_FREE(subreq);
885 if (!NT_STATUS_IS_OK(status)) {
886 tevent_req_nterror(req, status);
887 return;
890 /* Copy out parameters */
891 *state->orig.out.sid = *state->tmp.out.sid;
893 /* Copy result */
894 state->orig.out.result = state->tmp.out.result;
896 /* Reset temporary structure */
897 ZERO_STRUCT(state->tmp);
899 if (DEBUGLEVEL >= 10) {
900 NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &state->orig);
903 tevent_req_done(req);
906 NTSTATUS rpccli_samr_LookupDomain_recv(struct tevent_req *req,
907 TALLOC_CTX *mem_ctx,
908 NTSTATUS *result)
910 struct rpccli_samr_LookupDomain_state *state = tevent_req_data(
911 req, struct rpccli_samr_LookupDomain_state);
912 NTSTATUS status;
914 if (tevent_req_is_nterror(req, &status)) {
915 tevent_req_received(req);
916 return status;
919 /* Steal possbile out parameters to the callers context */
920 talloc_steal(mem_ctx, state->out_mem_ctx);
922 /* Return result */
923 *result = state->orig.out.result;
925 tevent_req_received(req);
926 return NT_STATUS_OK;
929 NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
930 TALLOC_CTX *mem_ctx,
931 struct policy_handle *connect_handle /* [in] [ref] */,
932 struct lsa_String *domain_name /* [in] [ref] */,
933 struct dom_sid2 **sid /* [out] [ref] */)
935 struct samr_LookupDomain r;
936 NTSTATUS status;
938 /* In parameters */
939 r.in.connect_handle = connect_handle;
940 r.in.domain_name = domain_name;
942 if (DEBUGLEVEL >= 10) {
943 NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r);
946 status = cli->dispatch(cli,
947 mem_ctx,
948 &ndr_table_samr,
949 NDR_SAMR_LOOKUPDOMAIN,
950 &r);
952 if (!NT_STATUS_IS_OK(status)) {
953 return status;
956 if (DEBUGLEVEL >= 10) {
957 NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r);
960 if (NT_STATUS_IS_ERR(status)) {
961 return status;
964 /* Return variables */
965 *sid = *r.out.sid;
967 /* Return result */
968 return r.out.result;
971 struct rpccli_samr_EnumDomains_state {
972 struct samr_EnumDomains orig;
973 struct samr_EnumDomains tmp;
974 TALLOC_CTX *out_mem_ctx;
975 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
978 static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq);
980 struct tevent_req *rpccli_samr_EnumDomains_send(TALLOC_CTX *mem_ctx,
981 struct tevent_context *ev,
982 struct rpc_pipe_client *cli,
983 struct policy_handle *_connect_handle /* [in] [ref] */,
984 uint32_t *_resume_handle /* [in,out] [ref] */,
985 struct samr_SamArray **_sam /* [out] [ref] */,
986 uint32_t _buf_size /* [in] */,
987 uint32_t *_num_entries /* [out] [ref] */)
989 struct tevent_req *req;
990 struct rpccli_samr_EnumDomains_state *state;
991 struct tevent_req *subreq;
993 req = tevent_req_create(mem_ctx, &state,
994 struct rpccli_samr_EnumDomains_state);
995 if (req == NULL) {
996 return NULL;
998 state->out_mem_ctx = NULL;
999 state->dispatch_recv = cli->dispatch_recv;
1001 /* In parameters */
1002 state->orig.in.connect_handle = _connect_handle;
1003 state->orig.in.resume_handle = _resume_handle;
1004 state->orig.in.buf_size = _buf_size;
1006 /* Out parameters */
1007 state->orig.out.resume_handle = _resume_handle;
1008 state->orig.out.sam = _sam;
1009 state->orig.out.num_entries = _num_entries;
1011 /* Result */
1012 ZERO_STRUCT(state->orig.out.result);
1014 if (DEBUGLEVEL >= 10) {
1015 NDR_PRINT_IN_DEBUG(samr_EnumDomains, &state->orig);
1018 state->out_mem_ctx = talloc_named_const(state, 0,
1019 "rpccli_samr_EnumDomains_out_memory");
1020 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1021 return tevent_req_post(req, ev);
1024 /* make a temporary copy, that we pass to the dispatch function */
1025 state->tmp = state->orig;
1027 subreq = cli->dispatch_send(state, ev, cli,
1028 &ndr_table_samr,
1029 NDR_SAMR_ENUMDOMAINS,
1030 &state->tmp);
1031 if (tevent_req_nomem(subreq, req)) {
1032 return tevent_req_post(req, ev);
1034 tevent_req_set_callback(subreq, rpccli_samr_EnumDomains_done, req);
1035 return req;
1038 static void rpccli_samr_EnumDomains_done(struct tevent_req *subreq)
1040 struct tevent_req *req = tevent_req_callback_data(
1041 subreq, struct tevent_req);
1042 struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
1043 req, struct rpccli_samr_EnumDomains_state);
1044 NTSTATUS status;
1045 TALLOC_CTX *mem_ctx;
1047 if (state->out_mem_ctx) {
1048 mem_ctx = state->out_mem_ctx;
1049 } else {
1050 mem_ctx = state;
1053 status = state->dispatch_recv(subreq, mem_ctx);
1054 TALLOC_FREE(subreq);
1055 if (!NT_STATUS_IS_OK(status)) {
1056 tevent_req_nterror(req, status);
1057 return;
1060 /* Copy out parameters */
1061 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
1062 *state->orig.out.sam = *state->tmp.out.sam;
1063 *state->orig.out.num_entries = *state->tmp.out.num_entries;
1065 /* Copy result */
1066 state->orig.out.result = state->tmp.out.result;
1068 /* Reset temporary structure */
1069 ZERO_STRUCT(state->tmp);
1071 if (DEBUGLEVEL >= 10) {
1072 NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &state->orig);
1075 tevent_req_done(req);
1078 NTSTATUS rpccli_samr_EnumDomains_recv(struct tevent_req *req,
1079 TALLOC_CTX *mem_ctx,
1080 NTSTATUS *result)
1082 struct rpccli_samr_EnumDomains_state *state = tevent_req_data(
1083 req, struct rpccli_samr_EnumDomains_state);
1084 NTSTATUS status;
1086 if (tevent_req_is_nterror(req, &status)) {
1087 tevent_req_received(req);
1088 return status;
1091 /* Steal possbile out parameters to the callers context */
1092 talloc_steal(mem_ctx, state->out_mem_ctx);
1094 /* Return result */
1095 *result = state->orig.out.result;
1097 tevent_req_received(req);
1098 return NT_STATUS_OK;
1101 NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
1102 TALLOC_CTX *mem_ctx,
1103 struct policy_handle *connect_handle /* [in] [ref] */,
1104 uint32_t *resume_handle /* [in,out] [ref] */,
1105 struct samr_SamArray **sam /* [out] [ref] */,
1106 uint32_t buf_size /* [in] */,
1107 uint32_t *num_entries /* [out] [ref] */)
1109 struct samr_EnumDomains r;
1110 NTSTATUS status;
1112 /* In parameters */
1113 r.in.connect_handle = connect_handle;
1114 r.in.resume_handle = resume_handle;
1115 r.in.buf_size = buf_size;
1117 if (DEBUGLEVEL >= 10) {
1118 NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r);
1121 status = cli->dispatch(cli,
1122 mem_ctx,
1123 &ndr_table_samr,
1124 NDR_SAMR_ENUMDOMAINS,
1125 &r);
1127 if (!NT_STATUS_IS_OK(status)) {
1128 return status;
1131 if (DEBUGLEVEL >= 10) {
1132 NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r);
1135 if (NT_STATUS_IS_ERR(status)) {
1136 return status;
1139 /* Return variables */
1140 *resume_handle = *r.out.resume_handle;
1141 *sam = *r.out.sam;
1142 *num_entries = *r.out.num_entries;
1144 /* Return result */
1145 return r.out.result;
1148 struct rpccli_samr_OpenDomain_state {
1149 struct samr_OpenDomain orig;
1150 struct samr_OpenDomain tmp;
1151 TALLOC_CTX *out_mem_ctx;
1152 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1155 static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq);
1157 struct tevent_req *rpccli_samr_OpenDomain_send(TALLOC_CTX *mem_ctx,
1158 struct tevent_context *ev,
1159 struct rpc_pipe_client *cli,
1160 struct policy_handle *_connect_handle /* [in] [ref] */,
1161 uint32_t _access_mask /* [in] */,
1162 struct dom_sid2 *_sid /* [in] [ref] */,
1163 struct policy_handle *_domain_handle /* [out] [ref] */)
1165 struct tevent_req *req;
1166 struct rpccli_samr_OpenDomain_state *state;
1167 struct tevent_req *subreq;
1169 req = tevent_req_create(mem_ctx, &state,
1170 struct rpccli_samr_OpenDomain_state);
1171 if (req == NULL) {
1172 return NULL;
1174 state->out_mem_ctx = NULL;
1175 state->dispatch_recv = cli->dispatch_recv;
1177 /* In parameters */
1178 state->orig.in.connect_handle = _connect_handle;
1179 state->orig.in.access_mask = _access_mask;
1180 state->orig.in.sid = _sid;
1182 /* Out parameters */
1183 state->orig.out.domain_handle = _domain_handle;
1185 /* Result */
1186 ZERO_STRUCT(state->orig.out.result);
1188 if (DEBUGLEVEL >= 10) {
1189 NDR_PRINT_IN_DEBUG(samr_OpenDomain, &state->orig);
1192 state->out_mem_ctx = talloc_named_const(state, 0,
1193 "rpccli_samr_OpenDomain_out_memory");
1194 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1195 return tevent_req_post(req, ev);
1198 /* make a temporary copy, that we pass to the dispatch function */
1199 state->tmp = state->orig;
1201 subreq = cli->dispatch_send(state, ev, cli,
1202 &ndr_table_samr,
1203 NDR_SAMR_OPENDOMAIN,
1204 &state->tmp);
1205 if (tevent_req_nomem(subreq, req)) {
1206 return tevent_req_post(req, ev);
1208 tevent_req_set_callback(subreq, rpccli_samr_OpenDomain_done, req);
1209 return req;
1212 static void rpccli_samr_OpenDomain_done(struct tevent_req *subreq)
1214 struct tevent_req *req = tevent_req_callback_data(
1215 subreq, struct tevent_req);
1216 struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
1217 req, struct rpccli_samr_OpenDomain_state);
1218 NTSTATUS status;
1219 TALLOC_CTX *mem_ctx;
1221 if (state->out_mem_ctx) {
1222 mem_ctx = state->out_mem_ctx;
1223 } else {
1224 mem_ctx = state;
1227 status = state->dispatch_recv(subreq, mem_ctx);
1228 TALLOC_FREE(subreq);
1229 if (!NT_STATUS_IS_OK(status)) {
1230 tevent_req_nterror(req, status);
1231 return;
1234 /* Copy out parameters */
1235 *state->orig.out.domain_handle = *state->tmp.out.domain_handle;
1237 /* Copy result */
1238 state->orig.out.result = state->tmp.out.result;
1240 /* Reset temporary structure */
1241 ZERO_STRUCT(state->tmp);
1243 if (DEBUGLEVEL >= 10) {
1244 NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &state->orig);
1247 tevent_req_done(req);
1250 NTSTATUS rpccli_samr_OpenDomain_recv(struct tevent_req *req,
1251 TALLOC_CTX *mem_ctx,
1252 NTSTATUS *result)
1254 struct rpccli_samr_OpenDomain_state *state = tevent_req_data(
1255 req, struct rpccli_samr_OpenDomain_state);
1256 NTSTATUS status;
1258 if (tevent_req_is_nterror(req, &status)) {
1259 tevent_req_received(req);
1260 return status;
1263 /* Steal possbile out parameters to the callers context */
1264 talloc_steal(mem_ctx, state->out_mem_ctx);
1266 /* Return result */
1267 *result = state->orig.out.result;
1269 tevent_req_received(req);
1270 return NT_STATUS_OK;
1273 NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
1274 TALLOC_CTX *mem_ctx,
1275 struct policy_handle *connect_handle /* [in] [ref] */,
1276 uint32_t access_mask /* [in] */,
1277 struct dom_sid2 *sid /* [in] [ref] */,
1278 struct policy_handle *domain_handle /* [out] [ref] */)
1280 struct samr_OpenDomain r;
1281 NTSTATUS status;
1283 /* In parameters */
1284 r.in.connect_handle = connect_handle;
1285 r.in.access_mask = access_mask;
1286 r.in.sid = sid;
1288 if (DEBUGLEVEL >= 10) {
1289 NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r);
1292 status = cli->dispatch(cli,
1293 mem_ctx,
1294 &ndr_table_samr,
1295 NDR_SAMR_OPENDOMAIN,
1296 &r);
1298 if (!NT_STATUS_IS_OK(status)) {
1299 return status;
1302 if (DEBUGLEVEL >= 10) {
1303 NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r);
1306 if (NT_STATUS_IS_ERR(status)) {
1307 return status;
1310 /* Return variables */
1311 *domain_handle = *r.out.domain_handle;
1313 /* Return result */
1314 return r.out.result;
1317 struct rpccli_samr_QueryDomainInfo_state {
1318 struct samr_QueryDomainInfo orig;
1319 struct samr_QueryDomainInfo tmp;
1320 TALLOC_CTX *out_mem_ctx;
1321 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1324 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq);
1326 struct tevent_req *rpccli_samr_QueryDomainInfo_send(TALLOC_CTX *mem_ctx,
1327 struct tevent_context *ev,
1328 struct rpc_pipe_client *cli,
1329 struct policy_handle *_domain_handle /* [in] [ref] */,
1330 enum samr_DomainInfoClass _level /* [in] */,
1331 union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
1333 struct tevent_req *req;
1334 struct rpccli_samr_QueryDomainInfo_state *state;
1335 struct tevent_req *subreq;
1337 req = tevent_req_create(mem_ctx, &state,
1338 struct rpccli_samr_QueryDomainInfo_state);
1339 if (req == NULL) {
1340 return NULL;
1342 state->out_mem_ctx = NULL;
1343 state->dispatch_recv = cli->dispatch_recv;
1345 /* In parameters */
1346 state->orig.in.domain_handle = _domain_handle;
1347 state->orig.in.level = _level;
1349 /* Out parameters */
1350 state->orig.out.info = _info;
1352 /* Result */
1353 ZERO_STRUCT(state->orig.out.result);
1355 if (DEBUGLEVEL >= 10) {
1356 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &state->orig);
1359 state->out_mem_ctx = talloc_named_const(state, 0,
1360 "rpccli_samr_QueryDomainInfo_out_memory");
1361 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1362 return tevent_req_post(req, ev);
1365 /* make a temporary copy, that we pass to the dispatch function */
1366 state->tmp = state->orig;
1368 subreq = cli->dispatch_send(state, ev, cli,
1369 &ndr_table_samr,
1370 NDR_SAMR_QUERYDOMAININFO,
1371 &state->tmp);
1372 if (tevent_req_nomem(subreq, req)) {
1373 return tevent_req_post(req, ev);
1375 tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo_done, req);
1376 return req;
1379 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req *subreq)
1381 struct tevent_req *req = tevent_req_callback_data(
1382 subreq, struct tevent_req);
1383 struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
1384 req, struct rpccli_samr_QueryDomainInfo_state);
1385 NTSTATUS status;
1386 TALLOC_CTX *mem_ctx;
1388 if (state->out_mem_ctx) {
1389 mem_ctx = state->out_mem_ctx;
1390 } else {
1391 mem_ctx = state;
1394 status = state->dispatch_recv(subreq, mem_ctx);
1395 TALLOC_FREE(subreq);
1396 if (!NT_STATUS_IS_OK(status)) {
1397 tevent_req_nterror(req, status);
1398 return;
1401 /* Copy out parameters */
1402 *state->orig.out.info = *state->tmp.out.info;
1404 /* Copy result */
1405 state->orig.out.result = state->tmp.out.result;
1407 /* Reset temporary structure */
1408 ZERO_STRUCT(state->tmp);
1410 if (DEBUGLEVEL >= 10) {
1411 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &state->orig);
1414 tevent_req_done(req);
1417 NTSTATUS rpccli_samr_QueryDomainInfo_recv(struct tevent_req *req,
1418 TALLOC_CTX *mem_ctx,
1419 NTSTATUS *result)
1421 struct rpccli_samr_QueryDomainInfo_state *state = tevent_req_data(
1422 req, struct rpccli_samr_QueryDomainInfo_state);
1423 NTSTATUS status;
1425 if (tevent_req_is_nterror(req, &status)) {
1426 tevent_req_received(req);
1427 return status;
1430 /* Steal possbile out parameters to the callers context */
1431 talloc_steal(mem_ctx, state->out_mem_ctx);
1433 /* Return result */
1434 *result = state->orig.out.result;
1436 tevent_req_received(req);
1437 return NT_STATUS_OK;
1440 NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
1441 TALLOC_CTX *mem_ctx,
1442 struct policy_handle *domain_handle /* [in] [ref] */,
1443 enum samr_DomainInfoClass level /* [in] */,
1444 union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
1446 struct samr_QueryDomainInfo r;
1447 NTSTATUS status;
1449 /* In parameters */
1450 r.in.domain_handle = domain_handle;
1451 r.in.level = level;
1453 if (DEBUGLEVEL >= 10) {
1454 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r);
1457 status = cli->dispatch(cli,
1458 mem_ctx,
1459 &ndr_table_samr,
1460 NDR_SAMR_QUERYDOMAININFO,
1461 &r);
1463 if (!NT_STATUS_IS_OK(status)) {
1464 return status;
1467 if (DEBUGLEVEL >= 10) {
1468 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r);
1471 if (NT_STATUS_IS_ERR(status)) {
1472 return status;
1475 /* Return variables */
1476 *info = *r.out.info;
1478 /* Return result */
1479 return r.out.result;
1482 struct rpccli_samr_SetDomainInfo_state {
1483 struct samr_SetDomainInfo orig;
1484 struct samr_SetDomainInfo tmp;
1485 TALLOC_CTX *out_mem_ctx;
1486 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1489 static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq);
1491 struct tevent_req *rpccli_samr_SetDomainInfo_send(TALLOC_CTX *mem_ctx,
1492 struct tevent_context *ev,
1493 struct rpc_pipe_client *cli,
1494 struct policy_handle *_domain_handle /* [in] [ref] */,
1495 enum samr_DomainInfoClass _level /* [in] */,
1496 union samr_DomainInfo *_info /* [in] [ref,switch_is(level)] */)
1498 struct tevent_req *req;
1499 struct rpccli_samr_SetDomainInfo_state *state;
1500 struct tevent_req *subreq;
1502 req = tevent_req_create(mem_ctx, &state,
1503 struct rpccli_samr_SetDomainInfo_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.level = _level;
1513 state->orig.in.info = _info;
1515 /* Out parameters */
1517 /* Result */
1518 ZERO_STRUCT(state->orig.out.result);
1520 if (DEBUGLEVEL >= 10) {
1521 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &state->orig);
1524 /* make a temporary copy, that we pass to the dispatch function */
1525 state->tmp = state->orig;
1527 subreq = cli->dispatch_send(state, ev, cli,
1528 &ndr_table_samr,
1529 NDR_SAMR_SETDOMAININFO,
1530 &state->tmp);
1531 if (tevent_req_nomem(subreq, req)) {
1532 return tevent_req_post(req, ev);
1534 tevent_req_set_callback(subreq, rpccli_samr_SetDomainInfo_done, req);
1535 return req;
1538 static void rpccli_samr_SetDomainInfo_done(struct tevent_req *subreq)
1540 struct tevent_req *req = tevent_req_callback_data(
1541 subreq, struct tevent_req);
1542 struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
1543 req, struct rpccli_samr_SetDomainInfo_state);
1544 NTSTATUS status;
1545 TALLOC_CTX *mem_ctx;
1547 if (state->out_mem_ctx) {
1548 mem_ctx = state->out_mem_ctx;
1549 } else {
1550 mem_ctx = state;
1553 status = state->dispatch_recv(subreq, mem_ctx);
1554 TALLOC_FREE(subreq);
1555 if (!NT_STATUS_IS_OK(status)) {
1556 tevent_req_nterror(req, status);
1557 return;
1560 /* Copy out parameters */
1562 /* Copy result */
1563 state->orig.out.result = state->tmp.out.result;
1565 /* Reset temporary structure */
1566 ZERO_STRUCT(state->tmp);
1568 if (DEBUGLEVEL >= 10) {
1569 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &state->orig);
1572 tevent_req_done(req);
1575 NTSTATUS rpccli_samr_SetDomainInfo_recv(struct tevent_req *req,
1576 TALLOC_CTX *mem_ctx,
1577 NTSTATUS *result)
1579 struct rpccli_samr_SetDomainInfo_state *state = tevent_req_data(
1580 req, struct rpccli_samr_SetDomainInfo_state);
1581 NTSTATUS status;
1583 if (tevent_req_is_nterror(req, &status)) {
1584 tevent_req_received(req);
1585 return status;
1588 /* Steal possbile out parameters to the callers context */
1589 talloc_steal(mem_ctx, state->out_mem_ctx);
1591 /* Return result */
1592 *result = state->orig.out.result;
1594 tevent_req_received(req);
1595 return NT_STATUS_OK;
1598 NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
1599 TALLOC_CTX *mem_ctx,
1600 struct policy_handle *domain_handle /* [in] [ref] */,
1601 enum samr_DomainInfoClass level /* [in] */,
1602 union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
1604 struct samr_SetDomainInfo r;
1605 NTSTATUS status;
1607 /* In parameters */
1608 r.in.domain_handle = domain_handle;
1609 r.in.level = level;
1610 r.in.info = info;
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r);
1616 status = cli->dispatch(cli,
1617 mem_ctx,
1618 &ndr_table_samr,
1619 NDR_SAMR_SETDOMAININFO,
1620 &r);
1622 if (!NT_STATUS_IS_OK(status)) {
1623 return status;
1626 if (DEBUGLEVEL >= 10) {
1627 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r);
1630 if (NT_STATUS_IS_ERR(status)) {
1631 return status;
1634 /* Return variables */
1636 /* Return result */
1637 return r.out.result;
1640 struct rpccli_samr_CreateDomainGroup_state {
1641 struct samr_CreateDomainGroup orig;
1642 struct samr_CreateDomainGroup tmp;
1643 TALLOC_CTX *out_mem_ctx;
1644 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1647 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq);
1649 struct tevent_req *rpccli_samr_CreateDomainGroup_send(TALLOC_CTX *mem_ctx,
1650 struct tevent_context *ev,
1651 struct rpc_pipe_client *cli,
1652 struct policy_handle *_domain_handle /* [in] [ref] */,
1653 struct lsa_String *_name /* [in] [ref] */,
1654 uint32_t _access_mask /* [in] */,
1655 struct policy_handle *_group_handle /* [out] [ref] */,
1656 uint32_t *_rid /* [out] [ref] */)
1658 struct tevent_req *req;
1659 struct rpccli_samr_CreateDomainGroup_state *state;
1660 struct tevent_req *subreq;
1662 req = tevent_req_create(mem_ctx, &state,
1663 struct rpccli_samr_CreateDomainGroup_state);
1664 if (req == NULL) {
1665 return NULL;
1667 state->out_mem_ctx = NULL;
1668 state->dispatch_recv = cli->dispatch_recv;
1670 /* In parameters */
1671 state->orig.in.domain_handle = _domain_handle;
1672 state->orig.in.name = _name;
1673 state->orig.in.access_mask = _access_mask;
1675 /* Out parameters */
1676 state->orig.out.group_handle = _group_handle;
1677 state->orig.out.rid = _rid;
1679 /* Result */
1680 ZERO_STRUCT(state->orig.out.result);
1682 if (DEBUGLEVEL >= 10) {
1683 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &state->orig);
1686 state->out_mem_ctx = talloc_named_const(state, 0,
1687 "rpccli_samr_CreateDomainGroup_out_memory");
1688 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1689 return tevent_req_post(req, ev);
1692 /* make a temporary copy, that we pass to the dispatch function */
1693 state->tmp = state->orig;
1695 subreq = cli->dispatch_send(state, ev, cli,
1696 &ndr_table_samr,
1697 NDR_SAMR_CREATEDOMAINGROUP,
1698 &state->tmp);
1699 if (tevent_req_nomem(subreq, req)) {
1700 return tevent_req_post(req, ev);
1702 tevent_req_set_callback(subreq, rpccli_samr_CreateDomainGroup_done, req);
1703 return req;
1706 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req *subreq)
1708 struct tevent_req *req = tevent_req_callback_data(
1709 subreq, struct tevent_req);
1710 struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
1711 req, struct rpccli_samr_CreateDomainGroup_state);
1712 NTSTATUS status;
1713 TALLOC_CTX *mem_ctx;
1715 if (state->out_mem_ctx) {
1716 mem_ctx = state->out_mem_ctx;
1717 } else {
1718 mem_ctx = state;
1721 status = state->dispatch_recv(subreq, mem_ctx);
1722 TALLOC_FREE(subreq);
1723 if (!NT_STATUS_IS_OK(status)) {
1724 tevent_req_nterror(req, status);
1725 return;
1728 /* Copy out parameters */
1729 *state->orig.out.group_handle = *state->tmp.out.group_handle;
1730 *state->orig.out.rid = *state->tmp.out.rid;
1732 /* Copy result */
1733 state->orig.out.result = state->tmp.out.result;
1735 /* Reset temporary structure */
1736 ZERO_STRUCT(state->tmp);
1738 if (DEBUGLEVEL >= 10) {
1739 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &state->orig);
1742 tevent_req_done(req);
1745 NTSTATUS rpccli_samr_CreateDomainGroup_recv(struct tevent_req *req,
1746 TALLOC_CTX *mem_ctx,
1747 NTSTATUS *result)
1749 struct rpccli_samr_CreateDomainGroup_state *state = tevent_req_data(
1750 req, struct rpccli_samr_CreateDomainGroup_state);
1751 NTSTATUS status;
1753 if (tevent_req_is_nterror(req, &status)) {
1754 tevent_req_received(req);
1755 return status;
1758 /* Steal possbile out parameters to the callers context */
1759 talloc_steal(mem_ctx, state->out_mem_ctx);
1761 /* Return result */
1762 *result = state->orig.out.result;
1764 tevent_req_received(req);
1765 return NT_STATUS_OK;
1768 NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
1769 TALLOC_CTX *mem_ctx,
1770 struct policy_handle *domain_handle /* [in] [ref] */,
1771 struct lsa_String *name /* [in] [ref] */,
1772 uint32_t access_mask /* [in] */,
1773 struct policy_handle *group_handle /* [out] [ref] */,
1774 uint32_t *rid /* [out] [ref] */)
1776 struct samr_CreateDomainGroup r;
1777 NTSTATUS status;
1779 /* In parameters */
1780 r.in.domain_handle = domain_handle;
1781 r.in.name = name;
1782 r.in.access_mask = access_mask;
1784 if (DEBUGLEVEL >= 10) {
1785 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r);
1788 status = cli->dispatch(cli,
1789 mem_ctx,
1790 &ndr_table_samr,
1791 NDR_SAMR_CREATEDOMAINGROUP,
1792 &r);
1794 if (!NT_STATUS_IS_OK(status)) {
1795 return status;
1798 if (DEBUGLEVEL >= 10) {
1799 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r);
1802 if (NT_STATUS_IS_ERR(status)) {
1803 return status;
1806 /* Return variables */
1807 *group_handle = *r.out.group_handle;
1808 *rid = *r.out.rid;
1810 /* Return result */
1811 return r.out.result;
1814 struct rpccli_samr_EnumDomainGroups_state {
1815 struct samr_EnumDomainGroups orig;
1816 struct samr_EnumDomainGroups tmp;
1817 TALLOC_CTX *out_mem_ctx;
1818 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1821 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq);
1823 struct tevent_req *rpccli_samr_EnumDomainGroups_send(TALLOC_CTX *mem_ctx,
1824 struct tevent_context *ev,
1825 struct rpc_pipe_client *cli,
1826 struct policy_handle *_domain_handle /* [in] [ref] */,
1827 uint32_t *_resume_handle /* [in,out] [ref] */,
1828 struct samr_SamArray **_sam /* [out] [ref] */,
1829 uint32_t _max_size /* [in] */,
1830 uint32_t *_num_entries /* [out] [ref] */)
1832 struct tevent_req *req;
1833 struct rpccli_samr_EnumDomainGroups_state *state;
1834 struct tevent_req *subreq;
1836 req = tevent_req_create(mem_ctx, &state,
1837 struct rpccli_samr_EnumDomainGroups_state);
1838 if (req == NULL) {
1839 return NULL;
1841 state->out_mem_ctx = NULL;
1842 state->dispatch_recv = cli->dispatch_recv;
1844 /* In parameters */
1845 state->orig.in.domain_handle = _domain_handle;
1846 state->orig.in.resume_handle = _resume_handle;
1847 state->orig.in.max_size = _max_size;
1849 /* Out parameters */
1850 state->orig.out.resume_handle = _resume_handle;
1851 state->orig.out.sam = _sam;
1852 state->orig.out.num_entries = _num_entries;
1854 /* Result */
1855 ZERO_STRUCT(state->orig.out.result);
1857 if (DEBUGLEVEL >= 10) {
1858 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &state->orig);
1861 state->out_mem_ctx = talloc_named_const(state, 0,
1862 "rpccli_samr_EnumDomainGroups_out_memory");
1863 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1864 return tevent_req_post(req, ev);
1867 /* make a temporary copy, that we pass to the dispatch function */
1868 state->tmp = state->orig;
1870 subreq = cli->dispatch_send(state, ev, cli,
1871 &ndr_table_samr,
1872 NDR_SAMR_ENUMDOMAINGROUPS,
1873 &state->tmp);
1874 if (tevent_req_nomem(subreq, req)) {
1875 return tevent_req_post(req, ev);
1877 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainGroups_done, req);
1878 return req;
1881 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req *subreq)
1883 struct tevent_req *req = tevent_req_callback_data(
1884 subreq, struct tevent_req);
1885 struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
1886 req, struct rpccli_samr_EnumDomainGroups_state);
1887 NTSTATUS status;
1888 TALLOC_CTX *mem_ctx;
1890 if (state->out_mem_ctx) {
1891 mem_ctx = state->out_mem_ctx;
1892 } else {
1893 mem_ctx = state;
1896 status = state->dispatch_recv(subreq, mem_ctx);
1897 TALLOC_FREE(subreq);
1898 if (!NT_STATUS_IS_OK(status)) {
1899 tevent_req_nterror(req, status);
1900 return;
1903 /* Copy out parameters */
1904 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
1905 *state->orig.out.sam = *state->tmp.out.sam;
1906 *state->orig.out.num_entries = *state->tmp.out.num_entries;
1908 /* Copy result */
1909 state->orig.out.result = state->tmp.out.result;
1911 /* Reset temporary structure */
1912 ZERO_STRUCT(state->tmp);
1914 if (DEBUGLEVEL >= 10) {
1915 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &state->orig);
1918 tevent_req_done(req);
1921 NTSTATUS rpccli_samr_EnumDomainGroups_recv(struct tevent_req *req,
1922 TALLOC_CTX *mem_ctx,
1923 NTSTATUS *result)
1925 struct rpccli_samr_EnumDomainGroups_state *state = tevent_req_data(
1926 req, struct rpccli_samr_EnumDomainGroups_state);
1927 NTSTATUS status;
1929 if (tevent_req_is_nterror(req, &status)) {
1930 tevent_req_received(req);
1931 return status;
1934 /* Steal possbile out parameters to the callers context */
1935 talloc_steal(mem_ctx, state->out_mem_ctx);
1937 /* Return result */
1938 *result = state->orig.out.result;
1940 tevent_req_received(req);
1941 return NT_STATUS_OK;
1944 NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
1945 TALLOC_CTX *mem_ctx,
1946 struct policy_handle *domain_handle /* [in] [ref] */,
1947 uint32_t *resume_handle /* [in,out] [ref] */,
1948 struct samr_SamArray **sam /* [out] [ref] */,
1949 uint32_t max_size /* [in] */,
1950 uint32_t *num_entries /* [out] [ref] */)
1952 struct samr_EnumDomainGroups r;
1953 NTSTATUS status;
1955 /* In parameters */
1956 r.in.domain_handle = domain_handle;
1957 r.in.resume_handle = resume_handle;
1958 r.in.max_size = max_size;
1960 if (DEBUGLEVEL >= 10) {
1961 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r);
1964 status = cli->dispatch(cli,
1965 mem_ctx,
1966 &ndr_table_samr,
1967 NDR_SAMR_ENUMDOMAINGROUPS,
1968 &r);
1970 if (!NT_STATUS_IS_OK(status)) {
1971 return status;
1974 if (DEBUGLEVEL >= 10) {
1975 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r);
1978 if (NT_STATUS_IS_ERR(status)) {
1979 return status;
1982 /* Return variables */
1983 *resume_handle = *r.out.resume_handle;
1984 *sam = *r.out.sam;
1985 *num_entries = *r.out.num_entries;
1987 /* Return result */
1988 return r.out.result;
1991 struct rpccli_samr_CreateUser_state {
1992 struct samr_CreateUser orig;
1993 struct samr_CreateUser tmp;
1994 TALLOC_CTX *out_mem_ctx;
1995 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1998 static void rpccli_samr_CreateUser_done(struct tevent_req *subreq);
2000 struct tevent_req *rpccli_samr_CreateUser_send(TALLOC_CTX *mem_ctx,
2001 struct tevent_context *ev,
2002 struct rpc_pipe_client *cli,
2003 struct policy_handle *_domain_handle /* [in] [ref] */,
2004 struct lsa_String *_account_name /* [in] [ref] */,
2005 uint32_t _access_mask /* [in] */,
2006 struct policy_handle *_user_handle /* [out] [ref] */,
2007 uint32_t *_rid /* [out] [ref] */)
2009 struct tevent_req *req;
2010 struct rpccli_samr_CreateUser_state *state;
2011 struct tevent_req *subreq;
2013 req = tevent_req_create(mem_ctx, &state,
2014 struct rpccli_samr_CreateUser_state);
2015 if (req == NULL) {
2016 return NULL;
2018 state->out_mem_ctx = NULL;
2019 state->dispatch_recv = cli->dispatch_recv;
2021 /* In parameters */
2022 state->orig.in.domain_handle = _domain_handle;
2023 state->orig.in.account_name = _account_name;
2024 state->orig.in.access_mask = _access_mask;
2026 /* Out parameters */
2027 state->orig.out.user_handle = _user_handle;
2028 state->orig.out.rid = _rid;
2030 /* Result */
2031 ZERO_STRUCT(state->orig.out.result);
2033 if (DEBUGLEVEL >= 10) {
2034 NDR_PRINT_IN_DEBUG(samr_CreateUser, &state->orig);
2037 state->out_mem_ctx = talloc_named_const(state, 0,
2038 "rpccli_samr_CreateUser_out_memory");
2039 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2040 return tevent_req_post(req, ev);
2043 /* make a temporary copy, that we pass to the dispatch function */
2044 state->tmp = state->orig;
2046 subreq = cli->dispatch_send(state, ev, cli,
2047 &ndr_table_samr,
2048 NDR_SAMR_CREATEUSER,
2049 &state->tmp);
2050 if (tevent_req_nomem(subreq, req)) {
2051 return tevent_req_post(req, ev);
2053 tevent_req_set_callback(subreq, rpccli_samr_CreateUser_done, req);
2054 return req;
2057 static void rpccli_samr_CreateUser_done(struct tevent_req *subreq)
2059 struct tevent_req *req = tevent_req_callback_data(
2060 subreq, struct tevent_req);
2061 struct rpccli_samr_CreateUser_state *state = tevent_req_data(
2062 req, struct rpccli_samr_CreateUser_state);
2063 NTSTATUS status;
2064 TALLOC_CTX *mem_ctx;
2066 if (state->out_mem_ctx) {
2067 mem_ctx = state->out_mem_ctx;
2068 } else {
2069 mem_ctx = state;
2072 status = state->dispatch_recv(subreq, mem_ctx);
2073 TALLOC_FREE(subreq);
2074 if (!NT_STATUS_IS_OK(status)) {
2075 tevent_req_nterror(req, status);
2076 return;
2079 /* Copy out parameters */
2080 *state->orig.out.user_handle = *state->tmp.out.user_handle;
2081 *state->orig.out.rid = *state->tmp.out.rid;
2083 /* Copy result */
2084 state->orig.out.result = state->tmp.out.result;
2086 /* Reset temporary structure */
2087 ZERO_STRUCT(state->tmp);
2089 if (DEBUGLEVEL >= 10) {
2090 NDR_PRINT_OUT_DEBUG(samr_CreateUser, &state->orig);
2093 tevent_req_done(req);
2096 NTSTATUS rpccli_samr_CreateUser_recv(struct tevent_req *req,
2097 TALLOC_CTX *mem_ctx,
2098 NTSTATUS *result)
2100 struct rpccli_samr_CreateUser_state *state = tevent_req_data(
2101 req, struct rpccli_samr_CreateUser_state);
2102 NTSTATUS status;
2104 if (tevent_req_is_nterror(req, &status)) {
2105 tevent_req_received(req);
2106 return status;
2109 /* Steal possbile out parameters to the callers context */
2110 talloc_steal(mem_ctx, state->out_mem_ctx);
2112 /* Return result */
2113 *result = state->orig.out.result;
2115 tevent_req_received(req);
2116 return NT_STATUS_OK;
2119 NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
2120 TALLOC_CTX *mem_ctx,
2121 struct policy_handle *domain_handle /* [in] [ref] */,
2122 struct lsa_String *account_name /* [in] [ref] */,
2123 uint32_t access_mask /* [in] */,
2124 struct policy_handle *user_handle /* [out] [ref] */,
2125 uint32_t *rid /* [out] [ref] */)
2127 struct samr_CreateUser r;
2128 NTSTATUS status;
2130 /* In parameters */
2131 r.in.domain_handle = domain_handle;
2132 r.in.account_name = account_name;
2133 r.in.access_mask = access_mask;
2135 if (DEBUGLEVEL >= 10) {
2136 NDR_PRINT_IN_DEBUG(samr_CreateUser, &r);
2139 status = cli->dispatch(cli,
2140 mem_ctx,
2141 &ndr_table_samr,
2142 NDR_SAMR_CREATEUSER,
2143 &r);
2145 if (!NT_STATUS_IS_OK(status)) {
2146 return status;
2149 if (DEBUGLEVEL >= 10) {
2150 NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r);
2153 if (NT_STATUS_IS_ERR(status)) {
2154 return status;
2157 /* Return variables */
2158 *user_handle = *r.out.user_handle;
2159 *rid = *r.out.rid;
2161 /* Return result */
2162 return r.out.result;
2165 struct rpccli_samr_EnumDomainUsers_state {
2166 struct samr_EnumDomainUsers orig;
2167 struct samr_EnumDomainUsers tmp;
2168 TALLOC_CTX *out_mem_ctx;
2169 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2172 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq);
2174 struct tevent_req *rpccli_samr_EnumDomainUsers_send(TALLOC_CTX *mem_ctx,
2175 struct tevent_context *ev,
2176 struct rpc_pipe_client *cli,
2177 struct policy_handle *_domain_handle /* [in] [ref] */,
2178 uint32_t *_resume_handle /* [in,out] [ref] */,
2179 uint32_t _acct_flags /* [in] */,
2180 struct samr_SamArray **_sam /* [out] [ref] */,
2181 uint32_t _max_size /* [in] */,
2182 uint32_t *_num_entries /* [out] [ref] */)
2184 struct tevent_req *req;
2185 struct rpccli_samr_EnumDomainUsers_state *state;
2186 struct tevent_req *subreq;
2188 req = tevent_req_create(mem_ctx, &state,
2189 struct rpccli_samr_EnumDomainUsers_state);
2190 if (req == NULL) {
2191 return NULL;
2193 state->out_mem_ctx = NULL;
2194 state->dispatch_recv = cli->dispatch_recv;
2196 /* In parameters */
2197 state->orig.in.domain_handle = _domain_handle;
2198 state->orig.in.resume_handle = _resume_handle;
2199 state->orig.in.acct_flags = _acct_flags;
2200 state->orig.in.max_size = _max_size;
2202 /* Out parameters */
2203 state->orig.out.resume_handle = _resume_handle;
2204 state->orig.out.sam = _sam;
2205 state->orig.out.num_entries = _num_entries;
2207 /* Result */
2208 ZERO_STRUCT(state->orig.out.result);
2210 if (DEBUGLEVEL >= 10) {
2211 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &state->orig);
2214 state->out_mem_ctx = talloc_named_const(state, 0,
2215 "rpccli_samr_EnumDomainUsers_out_memory");
2216 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2217 return tevent_req_post(req, ev);
2220 /* make a temporary copy, that we pass to the dispatch function */
2221 state->tmp = state->orig;
2223 subreq = cli->dispatch_send(state, ev, cli,
2224 &ndr_table_samr,
2225 NDR_SAMR_ENUMDOMAINUSERS,
2226 &state->tmp);
2227 if (tevent_req_nomem(subreq, req)) {
2228 return tevent_req_post(req, ev);
2230 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainUsers_done, req);
2231 return req;
2234 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req *subreq)
2236 struct tevent_req *req = tevent_req_callback_data(
2237 subreq, struct tevent_req);
2238 struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
2239 req, struct rpccli_samr_EnumDomainUsers_state);
2240 NTSTATUS status;
2241 TALLOC_CTX *mem_ctx;
2243 if (state->out_mem_ctx) {
2244 mem_ctx = state->out_mem_ctx;
2245 } else {
2246 mem_ctx = state;
2249 status = state->dispatch_recv(subreq, mem_ctx);
2250 TALLOC_FREE(subreq);
2251 if (!NT_STATUS_IS_OK(status)) {
2252 tevent_req_nterror(req, status);
2253 return;
2256 /* Copy out parameters */
2257 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2258 *state->orig.out.sam = *state->tmp.out.sam;
2259 *state->orig.out.num_entries = *state->tmp.out.num_entries;
2261 /* Copy result */
2262 state->orig.out.result = state->tmp.out.result;
2264 /* Reset temporary structure */
2265 ZERO_STRUCT(state->tmp);
2267 if (DEBUGLEVEL >= 10) {
2268 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &state->orig);
2271 tevent_req_done(req);
2274 NTSTATUS rpccli_samr_EnumDomainUsers_recv(struct tevent_req *req,
2275 TALLOC_CTX *mem_ctx,
2276 NTSTATUS *result)
2278 struct rpccli_samr_EnumDomainUsers_state *state = tevent_req_data(
2279 req, struct rpccli_samr_EnumDomainUsers_state);
2280 NTSTATUS status;
2282 if (tevent_req_is_nterror(req, &status)) {
2283 tevent_req_received(req);
2284 return status;
2287 /* Steal possbile out parameters to the callers context */
2288 talloc_steal(mem_ctx, state->out_mem_ctx);
2290 /* Return result */
2291 *result = state->orig.out.result;
2293 tevent_req_received(req);
2294 return NT_STATUS_OK;
2297 NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
2298 TALLOC_CTX *mem_ctx,
2299 struct policy_handle *domain_handle /* [in] [ref] */,
2300 uint32_t *resume_handle /* [in,out] [ref] */,
2301 uint32_t acct_flags /* [in] */,
2302 struct samr_SamArray **sam /* [out] [ref] */,
2303 uint32_t max_size /* [in] */,
2304 uint32_t *num_entries /* [out] [ref] */)
2306 struct samr_EnumDomainUsers r;
2307 NTSTATUS status;
2309 /* In parameters */
2310 r.in.domain_handle = domain_handle;
2311 r.in.resume_handle = resume_handle;
2312 r.in.acct_flags = acct_flags;
2313 r.in.max_size = max_size;
2315 if (DEBUGLEVEL >= 10) {
2316 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r);
2319 status = cli->dispatch(cli,
2320 mem_ctx,
2321 &ndr_table_samr,
2322 NDR_SAMR_ENUMDOMAINUSERS,
2323 &r);
2325 if (!NT_STATUS_IS_OK(status)) {
2326 return status;
2329 if (DEBUGLEVEL >= 10) {
2330 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r);
2333 if (NT_STATUS_IS_ERR(status)) {
2334 return status;
2337 /* Return variables */
2338 *resume_handle = *r.out.resume_handle;
2339 *sam = *r.out.sam;
2340 *num_entries = *r.out.num_entries;
2342 /* Return result */
2343 return r.out.result;
2346 struct rpccli_samr_CreateDomAlias_state {
2347 struct samr_CreateDomAlias orig;
2348 struct samr_CreateDomAlias tmp;
2349 TALLOC_CTX *out_mem_ctx;
2350 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2353 static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq);
2355 struct tevent_req *rpccli_samr_CreateDomAlias_send(TALLOC_CTX *mem_ctx,
2356 struct tevent_context *ev,
2357 struct rpc_pipe_client *cli,
2358 struct policy_handle *_domain_handle /* [in] [ref] */,
2359 struct lsa_String *_alias_name /* [in] [ref] */,
2360 uint32_t _access_mask /* [in] */,
2361 struct policy_handle *_alias_handle /* [out] [ref] */,
2362 uint32_t *_rid /* [out] [ref] */)
2364 struct tevent_req *req;
2365 struct rpccli_samr_CreateDomAlias_state *state;
2366 struct tevent_req *subreq;
2368 req = tevent_req_create(mem_ctx, &state,
2369 struct rpccli_samr_CreateDomAlias_state);
2370 if (req == NULL) {
2371 return NULL;
2373 state->out_mem_ctx = NULL;
2374 state->dispatch_recv = cli->dispatch_recv;
2376 /* In parameters */
2377 state->orig.in.domain_handle = _domain_handle;
2378 state->orig.in.alias_name = _alias_name;
2379 state->orig.in.access_mask = _access_mask;
2381 /* Out parameters */
2382 state->orig.out.alias_handle = _alias_handle;
2383 state->orig.out.rid = _rid;
2385 /* Result */
2386 ZERO_STRUCT(state->orig.out.result);
2388 if (DEBUGLEVEL >= 10) {
2389 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &state->orig);
2392 state->out_mem_ctx = talloc_named_const(state, 0,
2393 "rpccli_samr_CreateDomAlias_out_memory");
2394 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2395 return tevent_req_post(req, ev);
2398 /* make a temporary copy, that we pass to the dispatch function */
2399 state->tmp = state->orig;
2401 subreq = cli->dispatch_send(state, ev, cli,
2402 &ndr_table_samr,
2403 NDR_SAMR_CREATEDOMALIAS,
2404 &state->tmp);
2405 if (tevent_req_nomem(subreq, req)) {
2406 return tevent_req_post(req, ev);
2408 tevent_req_set_callback(subreq, rpccli_samr_CreateDomAlias_done, req);
2409 return req;
2412 static void rpccli_samr_CreateDomAlias_done(struct tevent_req *subreq)
2414 struct tevent_req *req = tevent_req_callback_data(
2415 subreq, struct tevent_req);
2416 struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
2417 req, struct rpccli_samr_CreateDomAlias_state);
2418 NTSTATUS status;
2419 TALLOC_CTX *mem_ctx;
2421 if (state->out_mem_ctx) {
2422 mem_ctx = state->out_mem_ctx;
2423 } else {
2424 mem_ctx = state;
2427 status = state->dispatch_recv(subreq, mem_ctx);
2428 TALLOC_FREE(subreq);
2429 if (!NT_STATUS_IS_OK(status)) {
2430 tevent_req_nterror(req, status);
2431 return;
2434 /* Copy out parameters */
2435 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
2436 *state->orig.out.rid = *state->tmp.out.rid;
2438 /* Copy result */
2439 state->orig.out.result = state->tmp.out.result;
2441 /* Reset temporary structure */
2442 ZERO_STRUCT(state->tmp);
2444 if (DEBUGLEVEL >= 10) {
2445 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &state->orig);
2448 tevent_req_done(req);
2451 NTSTATUS rpccli_samr_CreateDomAlias_recv(struct tevent_req *req,
2452 TALLOC_CTX *mem_ctx,
2453 NTSTATUS *result)
2455 struct rpccli_samr_CreateDomAlias_state *state = tevent_req_data(
2456 req, struct rpccli_samr_CreateDomAlias_state);
2457 NTSTATUS status;
2459 if (tevent_req_is_nterror(req, &status)) {
2460 tevent_req_received(req);
2461 return status;
2464 /* Steal possbile out parameters to the callers context */
2465 talloc_steal(mem_ctx, state->out_mem_ctx);
2467 /* Return result */
2468 *result = state->orig.out.result;
2470 tevent_req_received(req);
2471 return NT_STATUS_OK;
2474 NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
2475 TALLOC_CTX *mem_ctx,
2476 struct policy_handle *domain_handle /* [in] [ref] */,
2477 struct lsa_String *alias_name /* [in] [ref] */,
2478 uint32_t access_mask /* [in] */,
2479 struct policy_handle *alias_handle /* [out] [ref] */,
2480 uint32_t *rid /* [out] [ref] */)
2482 struct samr_CreateDomAlias r;
2483 NTSTATUS status;
2485 /* In parameters */
2486 r.in.domain_handle = domain_handle;
2487 r.in.alias_name = alias_name;
2488 r.in.access_mask = access_mask;
2490 if (DEBUGLEVEL >= 10) {
2491 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r);
2494 status = cli->dispatch(cli,
2495 mem_ctx,
2496 &ndr_table_samr,
2497 NDR_SAMR_CREATEDOMALIAS,
2498 &r);
2500 if (!NT_STATUS_IS_OK(status)) {
2501 return status;
2504 if (DEBUGLEVEL >= 10) {
2505 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r);
2508 if (NT_STATUS_IS_ERR(status)) {
2509 return status;
2512 /* Return variables */
2513 *alias_handle = *r.out.alias_handle;
2514 *rid = *r.out.rid;
2516 /* Return result */
2517 return r.out.result;
2520 struct rpccli_samr_EnumDomainAliases_state {
2521 struct samr_EnumDomainAliases orig;
2522 struct samr_EnumDomainAliases tmp;
2523 TALLOC_CTX *out_mem_ctx;
2524 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2527 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq);
2529 struct tevent_req *rpccli_samr_EnumDomainAliases_send(TALLOC_CTX *mem_ctx,
2530 struct tevent_context *ev,
2531 struct rpc_pipe_client *cli,
2532 struct policy_handle *_domain_handle /* [in] [ref] */,
2533 uint32_t *_resume_handle /* [in,out] [ref] */,
2534 struct samr_SamArray **_sam /* [out] [ref] */,
2535 uint32_t _max_size /* [in] */,
2536 uint32_t *_num_entries /* [out] [ref] */)
2538 struct tevent_req *req;
2539 struct rpccli_samr_EnumDomainAliases_state *state;
2540 struct tevent_req *subreq;
2542 req = tevent_req_create(mem_ctx, &state,
2543 struct rpccli_samr_EnumDomainAliases_state);
2544 if (req == NULL) {
2545 return NULL;
2547 state->out_mem_ctx = NULL;
2548 state->dispatch_recv = cli->dispatch_recv;
2550 /* In parameters */
2551 state->orig.in.domain_handle = _domain_handle;
2552 state->orig.in.resume_handle = _resume_handle;
2553 state->orig.in.max_size = _max_size;
2555 /* Out parameters */
2556 state->orig.out.resume_handle = _resume_handle;
2557 state->orig.out.sam = _sam;
2558 state->orig.out.num_entries = _num_entries;
2560 /* Result */
2561 ZERO_STRUCT(state->orig.out.result);
2563 if (DEBUGLEVEL >= 10) {
2564 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &state->orig);
2567 state->out_mem_ctx = talloc_named_const(state, 0,
2568 "rpccli_samr_EnumDomainAliases_out_memory");
2569 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2570 return tevent_req_post(req, ev);
2573 /* make a temporary copy, that we pass to the dispatch function */
2574 state->tmp = state->orig;
2576 subreq = cli->dispatch_send(state, ev, cli,
2577 &ndr_table_samr,
2578 NDR_SAMR_ENUMDOMAINALIASES,
2579 &state->tmp);
2580 if (tevent_req_nomem(subreq, req)) {
2581 return tevent_req_post(req, ev);
2583 tevent_req_set_callback(subreq, rpccli_samr_EnumDomainAliases_done, req);
2584 return req;
2587 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req *subreq)
2589 struct tevent_req *req = tevent_req_callback_data(
2590 subreq, struct tevent_req);
2591 struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
2592 req, struct rpccli_samr_EnumDomainAliases_state);
2593 NTSTATUS status;
2594 TALLOC_CTX *mem_ctx;
2596 if (state->out_mem_ctx) {
2597 mem_ctx = state->out_mem_ctx;
2598 } else {
2599 mem_ctx = state;
2602 status = state->dispatch_recv(subreq, mem_ctx);
2603 TALLOC_FREE(subreq);
2604 if (!NT_STATUS_IS_OK(status)) {
2605 tevent_req_nterror(req, status);
2606 return;
2609 /* Copy out parameters */
2610 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2611 *state->orig.out.sam = *state->tmp.out.sam;
2612 *state->orig.out.num_entries = *state->tmp.out.num_entries;
2614 /* Copy result */
2615 state->orig.out.result = state->tmp.out.result;
2617 /* Reset temporary structure */
2618 ZERO_STRUCT(state->tmp);
2620 if (DEBUGLEVEL >= 10) {
2621 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &state->orig);
2624 tevent_req_done(req);
2627 NTSTATUS rpccli_samr_EnumDomainAliases_recv(struct tevent_req *req,
2628 TALLOC_CTX *mem_ctx,
2629 NTSTATUS *result)
2631 struct rpccli_samr_EnumDomainAliases_state *state = tevent_req_data(
2632 req, struct rpccli_samr_EnumDomainAliases_state);
2633 NTSTATUS status;
2635 if (tevent_req_is_nterror(req, &status)) {
2636 tevent_req_received(req);
2637 return status;
2640 /* Steal possbile out parameters to the callers context */
2641 talloc_steal(mem_ctx, state->out_mem_ctx);
2643 /* Return result */
2644 *result = state->orig.out.result;
2646 tevent_req_received(req);
2647 return NT_STATUS_OK;
2650 NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
2651 TALLOC_CTX *mem_ctx,
2652 struct policy_handle *domain_handle /* [in] [ref] */,
2653 uint32_t *resume_handle /* [in,out] [ref] */,
2654 struct samr_SamArray **sam /* [out] [ref] */,
2655 uint32_t max_size /* [in] */,
2656 uint32_t *num_entries /* [out] [ref] */)
2658 struct samr_EnumDomainAliases r;
2659 NTSTATUS status;
2661 /* In parameters */
2662 r.in.domain_handle = domain_handle;
2663 r.in.resume_handle = resume_handle;
2664 r.in.max_size = max_size;
2666 if (DEBUGLEVEL >= 10) {
2667 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r);
2670 status = cli->dispatch(cli,
2671 mem_ctx,
2672 &ndr_table_samr,
2673 NDR_SAMR_ENUMDOMAINALIASES,
2674 &r);
2676 if (!NT_STATUS_IS_OK(status)) {
2677 return status;
2680 if (DEBUGLEVEL >= 10) {
2681 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r);
2684 if (NT_STATUS_IS_ERR(status)) {
2685 return status;
2688 /* Return variables */
2689 *resume_handle = *r.out.resume_handle;
2690 *sam = *r.out.sam;
2691 *num_entries = *r.out.num_entries;
2693 /* Return result */
2694 return r.out.result;
2697 struct rpccli_samr_GetAliasMembership_state {
2698 struct samr_GetAliasMembership orig;
2699 struct samr_GetAliasMembership tmp;
2700 TALLOC_CTX *out_mem_ctx;
2701 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2704 static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq);
2706 struct tevent_req *rpccli_samr_GetAliasMembership_send(TALLOC_CTX *mem_ctx,
2707 struct tevent_context *ev,
2708 struct rpc_pipe_client *cli,
2709 struct policy_handle *_domain_handle /* [in] [ref] */,
2710 struct lsa_SidArray *_sids /* [in] [ref] */,
2711 struct samr_Ids *_rids /* [out] [ref] */)
2713 struct tevent_req *req;
2714 struct rpccli_samr_GetAliasMembership_state *state;
2715 struct tevent_req *subreq;
2717 req = tevent_req_create(mem_ctx, &state,
2718 struct rpccli_samr_GetAliasMembership_state);
2719 if (req == NULL) {
2720 return NULL;
2722 state->out_mem_ctx = NULL;
2723 state->dispatch_recv = cli->dispatch_recv;
2725 /* In parameters */
2726 state->orig.in.domain_handle = _domain_handle;
2727 state->orig.in.sids = _sids;
2729 /* Out parameters */
2730 state->orig.out.rids = _rids;
2732 /* Result */
2733 ZERO_STRUCT(state->orig.out.result);
2735 if (DEBUGLEVEL >= 10) {
2736 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &state->orig);
2739 state->out_mem_ctx = talloc_named_const(state, 0,
2740 "rpccli_samr_GetAliasMembership_out_memory");
2741 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2742 return tevent_req_post(req, ev);
2745 /* make a temporary copy, that we pass to the dispatch function */
2746 state->tmp = state->orig;
2748 subreq = cli->dispatch_send(state, ev, cli,
2749 &ndr_table_samr,
2750 NDR_SAMR_GETALIASMEMBERSHIP,
2751 &state->tmp);
2752 if (tevent_req_nomem(subreq, req)) {
2753 return tevent_req_post(req, ev);
2755 tevent_req_set_callback(subreq, rpccli_samr_GetAliasMembership_done, req);
2756 return req;
2759 static void rpccli_samr_GetAliasMembership_done(struct tevent_req *subreq)
2761 struct tevent_req *req = tevent_req_callback_data(
2762 subreq, struct tevent_req);
2763 struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
2764 req, struct rpccli_samr_GetAliasMembership_state);
2765 NTSTATUS status;
2766 TALLOC_CTX *mem_ctx;
2768 if (state->out_mem_ctx) {
2769 mem_ctx = state->out_mem_ctx;
2770 } else {
2771 mem_ctx = state;
2774 status = state->dispatch_recv(subreq, mem_ctx);
2775 TALLOC_FREE(subreq);
2776 if (!NT_STATUS_IS_OK(status)) {
2777 tevent_req_nterror(req, status);
2778 return;
2781 /* Copy out parameters */
2782 *state->orig.out.rids = *state->tmp.out.rids;
2784 /* Copy result */
2785 state->orig.out.result = state->tmp.out.result;
2787 /* Reset temporary structure */
2788 ZERO_STRUCT(state->tmp);
2790 if (DEBUGLEVEL >= 10) {
2791 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &state->orig);
2794 tevent_req_done(req);
2797 NTSTATUS rpccli_samr_GetAliasMembership_recv(struct tevent_req *req,
2798 TALLOC_CTX *mem_ctx,
2799 NTSTATUS *result)
2801 struct rpccli_samr_GetAliasMembership_state *state = tevent_req_data(
2802 req, struct rpccli_samr_GetAliasMembership_state);
2803 NTSTATUS status;
2805 if (tevent_req_is_nterror(req, &status)) {
2806 tevent_req_received(req);
2807 return status;
2810 /* Steal possbile out parameters to the callers context */
2811 talloc_steal(mem_ctx, state->out_mem_ctx);
2813 /* Return result */
2814 *result = state->orig.out.result;
2816 tevent_req_received(req);
2817 return NT_STATUS_OK;
2820 NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
2821 TALLOC_CTX *mem_ctx,
2822 struct policy_handle *domain_handle /* [in] [ref] */,
2823 struct lsa_SidArray *sids /* [in] [ref] */,
2824 struct samr_Ids *rids /* [out] [ref] */)
2826 struct samr_GetAliasMembership r;
2827 NTSTATUS status;
2829 /* In parameters */
2830 r.in.domain_handle = domain_handle;
2831 r.in.sids = sids;
2833 if (DEBUGLEVEL >= 10) {
2834 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r);
2837 status = cli->dispatch(cli,
2838 mem_ctx,
2839 &ndr_table_samr,
2840 NDR_SAMR_GETALIASMEMBERSHIP,
2841 &r);
2843 if (!NT_STATUS_IS_OK(status)) {
2844 return status;
2847 if (DEBUGLEVEL >= 10) {
2848 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r);
2851 if (NT_STATUS_IS_ERR(status)) {
2852 return status;
2855 /* Return variables */
2856 *rids = *r.out.rids;
2858 /* Return result */
2859 return r.out.result;
2862 struct rpccli_samr_LookupNames_state {
2863 struct samr_LookupNames orig;
2864 struct samr_LookupNames tmp;
2865 TALLOC_CTX *out_mem_ctx;
2866 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2869 static void rpccli_samr_LookupNames_done(struct tevent_req *subreq);
2871 struct tevent_req *rpccli_samr_LookupNames_send(TALLOC_CTX *mem_ctx,
2872 struct tevent_context *ev,
2873 struct rpc_pipe_client *cli,
2874 struct policy_handle *_domain_handle /* [in] [ref] */,
2875 uint32_t _num_names /* [in] [range(0,1000)] */,
2876 struct lsa_String *_names /* [in] [length_is(num_names),size_is(1000)] */,
2877 struct samr_Ids *_rids /* [out] [ref] */,
2878 struct samr_Ids *_types /* [out] [ref] */)
2880 struct tevent_req *req;
2881 struct rpccli_samr_LookupNames_state *state;
2882 struct tevent_req *subreq;
2884 req = tevent_req_create(mem_ctx, &state,
2885 struct rpccli_samr_LookupNames_state);
2886 if (req == NULL) {
2887 return NULL;
2889 state->out_mem_ctx = NULL;
2890 state->dispatch_recv = cli->dispatch_recv;
2892 /* In parameters */
2893 state->orig.in.domain_handle = _domain_handle;
2894 state->orig.in.num_names = _num_names;
2895 state->orig.in.names = _names;
2897 /* Out parameters */
2898 state->orig.out.rids = _rids;
2899 state->orig.out.types = _types;
2901 /* Result */
2902 ZERO_STRUCT(state->orig.out.result);
2904 if (DEBUGLEVEL >= 10) {
2905 NDR_PRINT_IN_DEBUG(samr_LookupNames, &state->orig);
2908 state->out_mem_ctx = talloc_named_const(state, 0,
2909 "rpccli_samr_LookupNames_out_memory");
2910 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2911 return tevent_req_post(req, ev);
2914 /* make a temporary copy, that we pass to the dispatch function */
2915 state->tmp = state->orig;
2917 subreq = cli->dispatch_send(state, ev, cli,
2918 &ndr_table_samr,
2919 NDR_SAMR_LOOKUPNAMES,
2920 &state->tmp);
2921 if (tevent_req_nomem(subreq, req)) {
2922 return tevent_req_post(req, ev);
2924 tevent_req_set_callback(subreq, rpccli_samr_LookupNames_done, req);
2925 return req;
2928 static void rpccli_samr_LookupNames_done(struct tevent_req *subreq)
2930 struct tevent_req *req = tevent_req_callback_data(
2931 subreq, struct tevent_req);
2932 struct rpccli_samr_LookupNames_state *state = tevent_req_data(
2933 req, struct rpccli_samr_LookupNames_state);
2934 NTSTATUS status;
2935 TALLOC_CTX *mem_ctx;
2937 if (state->out_mem_ctx) {
2938 mem_ctx = state->out_mem_ctx;
2939 } else {
2940 mem_ctx = state;
2943 status = state->dispatch_recv(subreq, mem_ctx);
2944 TALLOC_FREE(subreq);
2945 if (!NT_STATUS_IS_OK(status)) {
2946 tevent_req_nterror(req, status);
2947 return;
2950 /* Copy out parameters */
2951 *state->orig.out.rids = *state->tmp.out.rids;
2952 *state->orig.out.types = *state->tmp.out.types;
2954 /* Copy result */
2955 state->orig.out.result = state->tmp.out.result;
2957 /* Reset temporary structure */
2958 ZERO_STRUCT(state->tmp);
2960 if (DEBUGLEVEL >= 10) {
2961 NDR_PRINT_OUT_DEBUG(samr_LookupNames, &state->orig);
2964 tevent_req_done(req);
2967 NTSTATUS rpccli_samr_LookupNames_recv(struct tevent_req *req,
2968 TALLOC_CTX *mem_ctx,
2969 NTSTATUS *result)
2971 struct rpccli_samr_LookupNames_state *state = tevent_req_data(
2972 req, struct rpccli_samr_LookupNames_state);
2973 NTSTATUS status;
2975 if (tevent_req_is_nterror(req, &status)) {
2976 tevent_req_received(req);
2977 return status;
2980 /* Steal possbile out parameters to the callers context */
2981 talloc_steal(mem_ctx, state->out_mem_ctx);
2983 /* Return result */
2984 *result = state->orig.out.result;
2986 tevent_req_received(req);
2987 return NT_STATUS_OK;
2990 NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
2991 TALLOC_CTX *mem_ctx,
2992 struct policy_handle *domain_handle /* [in] [ref] */,
2993 uint32_t num_names /* [in] [range(0,1000)] */,
2994 struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
2995 struct samr_Ids *rids /* [out] [ref] */,
2996 struct samr_Ids *types /* [out] [ref] */)
2998 struct samr_LookupNames r;
2999 NTSTATUS status;
3001 /* In parameters */
3002 r.in.domain_handle = domain_handle;
3003 r.in.num_names = num_names;
3004 r.in.names = names;
3006 if (DEBUGLEVEL >= 10) {
3007 NDR_PRINT_IN_DEBUG(samr_LookupNames, &r);
3010 status = cli->dispatch(cli,
3011 mem_ctx,
3012 &ndr_table_samr,
3013 NDR_SAMR_LOOKUPNAMES,
3014 &r);
3016 if (!NT_STATUS_IS_OK(status)) {
3017 return status;
3020 if (DEBUGLEVEL >= 10) {
3021 NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r);
3024 if (NT_STATUS_IS_ERR(status)) {
3025 return status;
3028 /* Return variables */
3029 *rids = *r.out.rids;
3030 *types = *r.out.types;
3032 /* Return result */
3033 return r.out.result;
3036 struct rpccli_samr_LookupRids_state {
3037 struct samr_LookupRids orig;
3038 struct samr_LookupRids tmp;
3039 TALLOC_CTX *out_mem_ctx;
3040 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3043 static void rpccli_samr_LookupRids_done(struct tevent_req *subreq);
3045 struct tevent_req *rpccli_samr_LookupRids_send(TALLOC_CTX *mem_ctx,
3046 struct tevent_context *ev,
3047 struct rpc_pipe_client *cli,
3048 struct policy_handle *_domain_handle /* [in] [ref] */,
3049 uint32_t _num_rids /* [in] [range(0,1000)] */,
3050 uint32_t *_rids /* [in] [length_is(num_rids),size_is(1000)] */,
3051 struct lsa_Strings *_names /* [out] [ref] */,
3052 struct samr_Ids *_types /* [out] [ref] */)
3054 struct tevent_req *req;
3055 struct rpccli_samr_LookupRids_state *state;
3056 struct tevent_req *subreq;
3058 req = tevent_req_create(mem_ctx, &state,
3059 struct rpccli_samr_LookupRids_state);
3060 if (req == NULL) {
3061 return NULL;
3063 state->out_mem_ctx = NULL;
3064 state->dispatch_recv = cli->dispatch_recv;
3066 /* In parameters */
3067 state->orig.in.domain_handle = _domain_handle;
3068 state->orig.in.num_rids = _num_rids;
3069 state->orig.in.rids = _rids;
3071 /* Out parameters */
3072 state->orig.out.names = _names;
3073 state->orig.out.types = _types;
3075 /* Result */
3076 ZERO_STRUCT(state->orig.out.result);
3078 if (DEBUGLEVEL >= 10) {
3079 NDR_PRINT_IN_DEBUG(samr_LookupRids, &state->orig);
3082 state->out_mem_ctx = talloc_named_const(state, 0,
3083 "rpccli_samr_LookupRids_out_memory");
3084 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3085 return tevent_req_post(req, ev);
3088 /* make a temporary copy, that we pass to the dispatch function */
3089 state->tmp = state->orig;
3091 subreq = cli->dispatch_send(state, ev, cli,
3092 &ndr_table_samr,
3093 NDR_SAMR_LOOKUPRIDS,
3094 &state->tmp);
3095 if (tevent_req_nomem(subreq, req)) {
3096 return tevent_req_post(req, ev);
3098 tevent_req_set_callback(subreq, rpccli_samr_LookupRids_done, req);
3099 return req;
3102 static void rpccli_samr_LookupRids_done(struct tevent_req *subreq)
3104 struct tevent_req *req = tevent_req_callback_data(
3105 subreq, struct tevent_req);
3106 struct rpccli_samr_LookupRids_state *state = tevent_req_data(
3107 req, struct rpccli_samr_LookupRids_state);
3108 NTSTATUS status;
3109 TALLOC_CTX *mem_ctx;
3111 if (state->out_mem_ctx) {
3112 mem_ctx = state->out_mem_ctx;
3113 } else {
3114 mem_ctx = state;
3117 status = state->dispatch_recv(subreq, mem_ctx);
3118 TALLOC_FREE(subreq);
3119 if (!NT_STATUS_IS_OK(status)) {
3120 tevent_req_nterror(req, status);
3121 return;
3124 /* Copy out parameters */
3125 *state->orig.out.names = *state->tmp.out.names;
3126 *state->orig.out.types = *state->tmp.out.types;
3128 /* Copy result */
3129 state->orig.out.result = state->tmp.out.result;
3131 /* Reset temporary structure */
3132 ZERO_STRUCT(state->tmp);
3134 if (DEBUGLEVEL >= 10) {
3135 NDR_PRINT_OUT_DEBUG(samr_LookupRids, &state->orig);
3138 tevent_req_done(req);
3141 NTSTATUS rpccli_samr_LookupRids_recv(struct tevent_req *req,
3142 TALLOC_CTX *mem_ctx,
3143 NTSTATUS *result)
3145 struct rpccli_samr_LookupRids_state *state = tevent_req_data(
3146 req, struct rpccli_samr_LookupRids_state);
3147 NTSTATUS status;
3149 if (tevent_req_is_nterror(req, &status)) {
3150 tevent_req_received(req);
3151 return status;
3154 /* Steal possbile out parameters to the callers context */
3155 talloc_steal(mem_ctx, state->out_mem_ctx);
3157 /* Return result */
3158 *result = state->orig.out.result;
3160 tevent_req_received(req);
3161 return NT_STATUS_OK;
3164 NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
3165 TALLOC_CTX *mem_ctx,
3166 struct policy_handle *domain_handle /* [in] [ref] */,
3167 uint32_t num_rids /* [in] [range(0,1000)] */,
3168 uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
3169 struct lsa_Strings *names /* [out] [ref] */,
3170 struct samr_Ids *types /* [out] [ref] */)
3172 struct samr_LookupRids r;
3173 NTSTATUS status;
3175 /* In parameters */
3176 r.in.domain_handle = domain_handle;
3177 r.in.num_rids = num_rids;
3178 r.in.rids = rids;
3180 if (DEBUGLEVEL >= 10) {
3181 NDR_PRINT_IN_DEBUG(samr_LookupRids, &r);
3184 status = cli->dispatch(cli,
3185 mem_ctx,
3186 &ndr_table_samr,
3187 NDR_SAMR_LOOKUPRIDS,
3188 &r);
3190 if (!NT_STATUS_IS_OK(status)) {
3191 return status;
3194 if (DEBUGLEVEL >= 10) {
3195 NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r);
3198 if (NT_STATUS_IS_ERR(status)) {
3199 return status;
3202 /* Return variables */
3203 *names = *r.out.names;
3204 *types = *r.out.types;
3206 /* Return result */
3207 return r.out.result;
3210 struct rpccli_samr_OpenGroup_state {
3211 struct samr_OpenGroup orig;
3212 struct samr_OpenGroup tmp;
3213 TALLOC_CTX *out_mem_ctx;
3214 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3217 static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq);
3219 struct tevent_req *rpccli_samr_OpenGroup_send(TALLOC_CTX *mem_ctx,
3220 struct tevent_context *ev,
3221 struct rpc_pipe_client *cli,
3222 struct policy_handle *_domain_handle /* [in] [ref] */,
3223 uint32_t _access_mask /* [in] */,
3224 uint32_t _rid /* [in] */,
3225 struct policy_handle *_group_handle /* [out] [ref] */)
3227 struct tevent_req *req;
3228 struct rpccli_samr_OpenGroup_state *state;
3229 struct tevent_req *subreq;
3231 req = tevent_req_create(mem_ctx, &state,
3232 struct rpccli_samr_OpenGroup_state);
3233 if (req == NULL) {
3234 return NULL;
3236 state->out_mem_ctx = NULL;
3237 state->dispatch_recv = cli->dispatch_recv;
3239 /* In parameters */
3240 state->orig.in.domain_handle = _domain_handle;
3241 state->orig.in.access_mask = _access_mask;
3242 state->orig.in.rid = _rid;
3244 /* Out parameters */
3245 state->orig.out.group_handle = _group_handle;
3247 /* Result */
3248 ZERO_STRUCT(state->orig.out.result);
3250 if (DEBUGLEVEL >= 10) {
3251 NDR_PRINT_IN_DEBUG(samr_OpenGroup, &state->orig);
3254 state->out_mem_ctx = talloc_named_const(state, 0,
3255 "rpccli_samr_OpenGroup_out_memory");
3256 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3257 return tevent_req_post(req, ev);
3260 /* make a temporary copy, that we pass to the dispatch function */
3261 state->tmp = state->orig;
3263 subreq = cli->dispatch_send(state, ev, cli,
3264 &ndr_table_samr,
3265 NDR_SAMR_OPENGROUP,
3266 &state->tmp);
3267 if (tevent_req_nomem(subreq, req)) {
3268 return tevent_req_post(req, ev);
3270 tevent_req_set_callback(subreq, rpccli_samr_OpenGroup_done, req);
3271 return req;
3274 static void rpccli_samr_OpenGroup_done(struct tevent_req *subreq)
3276 struct tevent_req *req = tevent_req_callback_data(
3277 subreq, struct tevent_req);
3278 struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
3279 req, struct rpccli_samr_OpenGroup_state);
3280 NTSTATUS status;
3281 TALLOC_CTX *mem_ctx;
3283 if (state->out_mem_ctx) {
3284 mem_ctx = state->out_mem_ctx;
3285 } else {
3286 mem_ctx = state;
3289 status = state->dispatch_recv(subreq, mem_ctx);
3290 TALLOC_FREE(subreq);
3291 if (!NT_STATUS_IS_OK(status)) {
3292 tevent_req_nterror(req, status);
3293 return;
3296 /* Copy out parameters */
3297 *state->orig.out.group_handle = *state->tmp.out.group_handle;
3299 /* Copy result */
3300 state->orig.out.result = state->tmp.out.result;
3302 /* Reset temporary structure */
3303 ZERO_STRUCT(state->tmp);
3305 if (DEBUGLEVEL >= 10) {
3306 NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &state->orig);
3309 tevent_req_done(req);
3312 NTSTATUS rpccli_samr_OpenGroup_recv(struct tevent_req *req,
3313 TALLOC_CTX *mem_ctx,
3314 NTSTATUS *result)
3316 struct rpccli_samr_OpenGroup_state *state = tevent_req_data(
3317 req, struct rpccli_samr_OpenGroup_state);
3318 NTSTATUS status;
3320 if (tevent_req_is_nterror(req, &status)) {
3321 tevent_req_received(req);
3322 return status;
3325 /* Steal possbile out parameters to the callers context */
3326 talloc_steal(mem_ctx, state->out_mem_ctx);
3328 /* Return result */
3329 *result = state->orig.out.result;
3331 tevent_req_received(req);
3332 return NT_STATUS_OK;
3335 NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
3336 TALLOC_CTX *mem_ctx,
3337 struct policy_handle *domain_handle /* [in] [ref] */,
3338 uint32_t access_mask /* [in] */,
3339 uint32_t rid /* [in] */,
3340 struct policy_handle *group_handle /* [out] [ref] */)
3342 struct samr_OpenGroup r;
3343 NTSTATUS status;
3345 /* In parameters */
3346 r.in.domain_handle = domain_handle;
3347 r.in.access_mask = access_mask;
3348 r.in.rid = rid;
3350 if (DEBUGLEVEL >= 10) {
3351 NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r);
3354 status = cli->dispatch(cli,
3355 mem_ctx,
3356 &ndr_table_samr,
3357 NDR_SAMR_OPENGROUP,
3358 &r);
3360 if (!NT_STATUS_IS_OK(status)) {
3361 return status;
3364 if (DEBUGLEVEL >= 10) {
3365 NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r);
3368 if (NT_STATUS_IS_ERR(status)) {
3369 return status;
3372 /* Return variables */
3373 *group_handle = *r.out.group_handle;
3375 /* Return result */
3376 return r.out.result;
3379 struct rpccli_samr_QueryGroupInfo_state {
3380 struct samr_QueryGroupInfo orig;
3381 struct samr_QueryGroupInfo tmp;
3382 TALLOC_CTX *out_mem_ctx;
3383 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3386 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq);
3388 struct tevent_req *rpccli_samr_QueryGroupInfo_send(TALLOC_CTX *mem_ctx,
3389 struct tevent_context *ev,
3390 struct rpc_pipe_client *cli,
3391 struct policy_handle *_group_handle /* [in] [ref] */,
3392 enum samr_GroupInfoEnum _level /* [in] */,
3393 union samr_GroupInfo **_info /* [out] [ref,switch_is(level)] */)
3395 struct tevent_req *req;
3396 struct rpccli_samr_QueryGroupInfo_state *state;
3397 struct tevent_req *subreq;
3399 req = tevent_req_create(mem_ctx, &state,
3400 struct rpccli_samr_QueryGroupInfo_state);
3401 if (req == NULL) {
3402 return NULL;
3404 state->out_mem_ctx = NULL;
3405 state->dispatch_recv = cli->dispatch_recv;
3407 /* In parameters */
3408 state->orig.in.group_handle = _group_handle;
3409 state->orig.in.level = _level;
3411 /* Out parameters */
3412 state->orig.out.info = _info;
3414 /* Result */
3415 ZERO_STRUCT(state->orig.out.result);
3417 if (DEBUGLEVEL >= 10) {
3418 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &state->orig);
3421 state->out_mem_ctx = talloc_named_const(state, 0,
3422 "rpccli_samr_QueryGroupInfo_out_memory");
3423 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3424 return tevent_req_post(req, ev);
3427 /* make a temporary copy, that we pass to the dispatch function */
3428 state->tmp = state->orig;
3430 subreq = cli->dispatch_send(state, ev, cli,
3431 &ndr_table_samr,
3432 NDR_SAMR_QUERYGROUPINFO,
3433 &state->tmp);
3434 if (tevent_req_nomem(subreq, req)) {
3435 return tevent_req_post(req, ev);
3437 tevent_req_set_callback(subreq, rpccli_samr_QueryGroupInfo_done, req);
3438 return req;
3441 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req *subreq)
3443 struct tevent_req *req = tevent_req_callback_data(
3444 subreq, struct tevent_req);
3445 struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
3446 req, struct rpccli_samr_QueryGroupInfo_state);
3447 NTSTATUS status;
3448 TALLOC_CTX *mem_ctx;
3450 if (state->out_mem_ctx) {
3451 mem_ctx = state->out_mem_ctx;
3452 } else {
3453 mem_ctx = state;
3456 status = state->dispatch_recv(subreq, mem_ctx);
3457 TALLOC_FREE(subreq);
3458 if (!NT_STATUS_IS_OK(status)) {
3459 tevent_req_nterror(req, status);
3460 return;
3463 /* Copy out parameters */
3464 *state->orig.out.info = *state->tmp.out.info;
3466 /* Copy result */
3467 state->orig.out.result = state->tmp.out.result;
3469 /* Reset temporary structure */
3470 ZERO_STRUCT(state->tmp);
3472 if (DEBUGLEVEL >= 10) {
3473 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &state->orig);
3476 tevent_req_done(req);
3479 NTSTATUS rpccli_samr_QueryGroupInfo_recv(struct tevent_req *req,
3480 TALLOC_CTX *mem_ctx,
3481 NTSTATUS *result)
3483 struct rpccli_samr_QueryGroupInfo_state *state = tevent_req_data(
3484 req, struct rpccli_samr_QueryGroupInfo_state);
3485 NTSTATUS status;
3487 if (tevent_req_is_nterror(req, &status)) {
3488 tevent_req_received(req);
3489 return status;
3492 /* Steal possbile out parameters to the callers context */
3493 talloc_steal(mem_ctx, state->out_mem_ctx);
3495 /* Return result */
3496 *result = state->orig.out.result;
3498 tevent_req_received(req);
3499 return NT_STATUS_OK;
3502 NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
3503 TALLOC_CTX *mem_ctx,
3504 struct policy_handle *group_handle /* [in] [ref] */,
3505 enum samr_GroupInfoEnum level /* [in] */,
3506 union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
3508 struct samr_QueryGroupInfo r;
3509 NTSTATUS status;
3511 /* In parameters */
3512 r.in.group_handle = group_handle;
3513 r.in.level = level;
3515 if (DEBUGLEVEL >= 10) {
3516 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r);
3519 status = cli->dispatch(cli,
3520 mem_ctx,
3521 &ndr_table_samr,
3522 NDR_SAMR_QUERYGROUPINFO,
3523 &r);
3525 if (!NT_STATUS_IS_OK(status)) {
3526 return status;
3529 if (DEBUGLEVEL >= 10) {
3530 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r);
3533 if (NT_STATUS_IS_ERR(status)) {
3534 return status;
3537 /* Return variables */
3538 *info = *r.out.info;
3540 /* Return result */
3541 return r.out.result;
3544 struct rpccli_samr_SetGroupInfo_state {
3545 struct samr_SetGroupInfo orig;
3546 struct samr_SetGroupInfo tmp;
3547 TALLOC_CTX *out_mem_ctx;
3548 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3551 static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq);
3553 struct tevent_req *rpccli_samr_SetGroupInfo_send(TALLOC_CTX *mem_ctx,
3554 struct tevent_context *ev,
3555 struct rpc_pipe_client *cli,
3556 struct policy_handle *_group_handle /* [in] [ref] */,
3557 enum samr_GroupInfoEnum _level /* [in] */,
3558 union samr_GroupInfo *_info /* [in] [ref,switch_is(level)] */)
3560 struct tevent_req *req;
3561 struct rpccli_samr_SetGroupInfo_state *state;
3562 struct tevent_req *subreq;
3564 req = tevent_req_create(mem_ctx, &state,
3565 struct rpccli_samr_SetGroupInfo_state);
3566 if (req == NULL) {
3567 return NULL;
3569 state->out_mem_ctx = NULL;
3570 state->dispatch_recv = cli->dispatch_recv;
3572 /* In parameters */
3573 state->orig.in.group_handle = _group_handle;
3574 state->orig.in.level = _level;
3575 state->orig.in.info = _info;
3577 /* Out parameters */
3579 /* Result */
3580 ZERO_STRUCT(state->orig.out.result);
3582 if (DEBUGLEVEL >= 10) {
3583 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &state->orig);
3586 /* make a temporary copy, that we pass to the dispatch function */
3587 state->tmp = state->orig;
3589 subreq = cli->dispatch_send(state, ev, cli,
3590 &ndr_table_samr,
3591 NDR_SAMR_SETGROUPINFO,
3592 &state->tmp);
3593 if (tevent_req_nomem(subreq, req)) {
3594 return tevent_req_post(req, ev);
3596 tevent_req_set_callback(subreq, rpccli_samr_SetGroupInfo_done, req);
3597 return req;
3600 static void rpccli_samr_SetGroupInfo_done(struct tevent_req *subreq)
3602 struct tevent_req *req = tevent_req_callback_data(
3603 subreq, struct tevent_req);
3604 struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
3605 req, struct rpccli_samr_SetGroupInfo_state);
3606 NTSTATUS status;
3607 TALLOC_CTX *mem_ctx;
3609 if (state->out_mem_ctx) {
3610 mem_ctx = state->out_mem_ctx;
3611 } else {
3612 mem_ctx = state;
3615 status = state->dispatch_recv(subreq, mem_ctx);
3616 TALLOC_FREE(subreq);
3617 if (!NT_STATUS_IS_OK(status)) {
3618 tevent_req_nterror(req, status);
3619 return;
3622 /* Copy out parameters */
3624 /* Copy result */
3625 state->orig.out.result = state->tmp.out.result;
3627 /* Reset temporary structure */
3628 ZERO_STRUCT(state->tmp);
3630 if (DEBUGLEVEL >= 10) {
3631 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &state->orig);
3634 tevent_req_done(req);
3637 NTSTATUS rpccli_samr_SetGroupInfo_recv(struct tevent_req *req,
3638 TALLOC_CTX *mem_ctx,
3639 NTSTATUS *result)
3641 struct rpccli_samr_SetGroupInfo_state *state = tevent_req_data(
3642 req, struct rpccli_samr_SetGroupInfo_state);
3643 NTSTATUS status;
3645 if (tevent_req_is_nterror(req, &status)) {
3646 tevent_req_received(req);
3647 return status;
3650 /* Steal possbile out parameters to the callers context */
3651 talloc_steal(mem_ctx, state->out_mem_ctx);
3653 /* Return result */
3654 *result = state->orig.out.result;
3656 tevent_req_received(req);
3657 return NT_STATUS_OK;
3660 NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
3661 TALLOC_CTX *mem_ctx,
3662 struct policy_handle *group_handle /* [in] [ref] */,
3663 enum samr_GroupInfoEnum level /* [in] */,
3664 union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
3666 struct samr_SetGroupInfo r;
3667 NTSTATUS status;
3669 /* In parameters */
3670 r.in.group_handle = group_handle;
3671 r.in.level = level;
3672 r.in.info = info;
3674 if (DEBUGLEVEL >= 10) {
3675 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r);
3678 status = cli->dispatch(cli,
3679 mem_ctx,
3680 &ndr_table_samr,
3681 NDR_SAMR_SETGROUPINFO,
3682 &r);
3684 if (!NT_STATUS_IS_OK(status)) {
3685 return status;
3688 if (DEBUGLEVEL >= 10) {
3689 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r);
3692 if (NT_STATUS_IS_ERR(status)) {
3693 return status;
3696 /* Return variables */
3698 /* Return result */
3699 return r.out.result;
3702 struct rpccli_samr_AddGroupMember_state {
3703 struct samr_AddGroupMember orig;
3704 struct samr_AddGroupMember tmp;
3705 TALLOC_CTX *out_mem_ctx;
3706 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3709 static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq);
3711 struct tevent_req *rpccli_samr_AddGroupMember_send(TALLOC_CTX *mem_ctx,
3712 struct tevent_context *ev,
3713 struct rpc_pipe_client *cli,
3714 struct policy_handle *_group_handle /* [in] [ref] */,
3715 uint32_t _rid /* [in] */,
3716 uint32_t _flags /* [in] */)
3718 struct tevent_req *req;
3719 struct rpccli_samr_AddGroupMember_state *state;
3720 struct tevent_req *subreq;
3722 req = tevent_req_create(mem_ctx, &state,
3723 struct rpccli_samr_AddGroupMember_state);
3724 if (req == NULL) {
3725 return NULL;
3727 state->out_mem_ctx = NULL;
3728 state->dispatch_recv = cli->dispatch_recv;
3730 /* In parameters */
3731 state->orig.in.group_handle = _group_handle;
3732 state->orig.in.rid = _rid;
3733 state->orig.in.flags = _flags;
3735 /* Out parameters */
3737 /* Result */
3738 ZERO_STRUCT(state->orig.out.result);
3740 if (DEBUGLEVEL >= 10) {
3741 NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &state->orig);
3744 /* make a temporary copy, that we pass to the dispatch function */
3745 state->tmp = state->orig;
3747 subreq = cli->dispatch_send(state, ev, cli,
3748 &ndr_table_samr,
3749 NDR_SAMR_ADDGROUPMEMBER,
3750 &state->tmp);
3751 if (tevent_req_nomem(subreq, req)) {
3752 return tevent_req_post(req, ev);
3754 tevent_req_set_callback(subreq, rpccli_samr_AddGroupMember_done, req);
3755 return req;
3758 static void rpccli_samr_AddGroupMember_done(struct tevent_req *subreq)
3760 struct tevent_req *req = tevent_req_callback_data(
3761 subreq, struct tevent_req);
3762 struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
3763 req, struct rpccli_samr_AddGroupMember_state);
3764 NTSTATUS status;
3765 TALLOC_CTX *mem_ctx;
3767 if (state->out_mem_ctx) {
3768 mem_ctx = state->out_mem_ctx;
3769 } else {
3770 mem_ctx = state;
3773 status = state->dispatch_recv(subreq, mem_ctx);
3774 TALLOC_FREE(subreq);
3775 if (!NT_STATUS_IS_OK(status)) {
3776 tevent_req_nterror(req, status);
3777 return;
3780 /* Copy out parameters */
3782 /* Copy result */
3783 state->orig.out.result = state->tmp.out.result;
3785 /* Reset temporary structure */
3786 ZERO_STRUCT(state->tmp);
3788 if (DEBUGLEVEL >= 10) {
3789 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &state->orig);
3792 tevent_req_done(req);
3795 NTSTATUS rpccli_samr_AddGroupMember_recv(struct tevent_req *req,
3796 TALLOC_CTX *mem_ctx,
3797 NTSTATUS *result)
3799 struct rpccli_samr_AddGroupMember_state *state = tevent_req_data(
3800 req, struct rpccli_samr_AddGroupMember_state);
3801 NTSTATUS status;
3803 if (tevent_req_is_nterror(req, &status)) {
3804 tevent_req_received(req);
3805 return status;
3808 /* Steal possbile out parameters to the callers context */
3809 talloc_steal(mem_ctx, state->out_mem_ctx);
3811 /* Return result */
3812 *result = state->orig.out.result;
3814 tevent_req_received(req);
3815 return NT_STATUS_OK;
3818 NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
3819 TALLOC_CTX *mem_ctx,
3820 struct policy_handle *group_handle /* [in] [ref] */,
3821 uint32_t rid /* [in] */,
3822 uint32_t flags /* [in] */)
3824 struct samr_AddGroupMember r;
3825 NTSTATUS status;
3827 /* In parameters */
3828 r.in.group_handle = group_handle;
3829 r.in.rid = rid;
3830 r.in.flags = flags;
3832 if (DEBUGLEVEL >= 10) {
3833 NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r);
3836 status = cli->dispatch(cli,
3837 mem_ctx,
3838 &ndr_table_samr,
3839 NDR_SAMR_ADDGROUPMEMBER,
3840 &r);
3842 if (!NT_STATUS_IS_OK(status)) {
3843 return status;
3846 if (DEBUGLEVEL >= 10) {
3847 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r);
3850 if (NT_STATUS_IS_ERR(status)) {
3851 return status;
3854 /* Return variables */
3856 /* Return result */
3857 return r.out.result;
3860 struct rpccli_samr_DeleteDomainGroup_state {
3861 struct samr_DeleteDomainGroup orig;
3862 struct samr_DeleteDomainGroup tmp;
3863 TALLOC_CTX *out_mem_ctx;
3864 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3867 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq);
3869 struct tevent_req *rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX *mem_ctx,
3870 struct tevent_context *ev,
3871 struct rpc_pipe_client *cli,
3872 struct policy_handle *_group_handle /* [in,out] [ref] */)
3874 struct tevent_req *req;
3875 struct rpccli_samr_DeleteDomainGroup_state *state;
3876 struct tevent_req *subreq;
3878 req = tevent_req_create(mem_ctx, &state,
3879 struct rpccli_samr_DeleteDomainGroup_state);
3880 if (req == NULL) {
3881 return NULL;
3883 state->out_mem_ctx = NULL;
3884 state->dispatch_recv = cli->dispatch_recv;
3886 /* In parameters */
3887 state->orig.in.group_handle = _group_handle;
3889 /* Out parameters */
3890 state->orig.out.group_handle = _group_handle;
3892 /* Result */
3893 ZERO_STRUCT(state->orig.out.result);
3895 if (DEBUGLEVEL >= 10) {
3896 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &state->orig);
3899 state->out_mem_ctx = talloc_named_const(state, 0,
3900 "rpccli_samr_DeleteDomainGroup_out_memory");
3901 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3902 return tevent_req_post(req, ev);
3905 /* make a temporary copy, that we pass to the dispatch function */
3906 state->tmp = state->orig;
3908 subreq = cli->dispatch_send(state, ev, cli,
3909 &ndr_table_samr,
3910 NDR_SAMR_DELETEDOMAINGROUP,
3911 &state->tmp);
3912 if (tevent_req_nomem(subreq, req)) {
3913 return tevent_req_post(req, ev);
3915 tevent_req_set_callback(subreq, rpccli_samr_DeleteDomainGroup_done, req);
3916 return req;
3919 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req *subreq)
3921 struct tevent_req *req = tevent_req_callback_data(
3922 subreq, struct tevent_req);
3923 struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
3924 req, struct rpccli_samr_DeleteDomainGroup_state);
3925 NTSTATUS status;
3926 TALLOC_CTX *mem_ctx;
3928 if (state->out_mem_ctx) {
3929 mem_ctx = state->out_mem_ctx;
3930 } else {
3931 mem_ctx = state;
3934 status = state->dispatch_recv(subreq, mem_ctx);
3935 TALLOC_FREE(subreq);
3936 if (!NT_STATUS_IS_OK(status)) {
3937 tevent_req_nterror(req, status);
3938 return;
3941 /* Copy out parameters */
3942 *state->orig.out.group_handle = *state->tmp.out.group_handle;
3944 /* Copy result */
3945 state->orig.out.result = state->tmp.out.result;
3947 /* Reset temporary structure */
3948 ZERO_STRUCT(state->tmp);
3950 if (DEBUGLEVEL >= 10) {
3951 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &state->orig);
3954 tevent_req_done(req);
3957 NTSTATUS rpccli_samr_DeleteDomainGroup_recv(struct tevent_req *req,
3958 TALLOC_CTX *mem_ctx,
3959 NTSTATUS *result)
3961 struct rpccli_samr_DeleteDomainGroup_state *state = tevent_req_data(
3962 req, struct rpccli_samr_DeleteDomainGroup_state);
3963 NTSTATUS status;
3965 if (tevent_req_is_nterror(req, &status)) {
3966 tevent_req_received(req);
3967 return status;
3970 /* Steal possbile out parameters to the callers context */
3971 talloc_steal(mem_ctx, state->out_mem_ctx);
3973 /* Return result */
3974 *result = state->orig.out.result;
3976 tevent_req_received(req);
3977 return NT_STATUS_OK;
3980 NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
3981 TALLOC_CTX *mem_ctx,
3982 struct policy_handle *group_handle /* [in,out] [ref] */)
3984 struct samr_DeleteDomainGroup r;
3985 NTSTATUS status;
3987 /* In parameters */
3988 r.in.group_handle = group_handle;
3990 if (DEBUGLEVEL >= 10) {
3991 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r);
3994 status = cli->dispatch(cli,
3995 mem_ctx,
3996 &ndr_table_samr,
3997 NDR_SAMR_DELETEDOMAINGROUP,
3998 &r);
4000 if (!NT_STATUS_IS_OK(status)) {
4001 return status;
4004 if (DEBUGLEVEL >= 10) {
4005 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r);
4008 if (NT_STATUS_IS_ERR(status)) {
4009 return status;
4012 /* Return variables */
4013 *group_handle = *r.out.group_handle;
4015 /* Return result */
4016 return r.out.result;
4019 struct rpccli_samr_DeleteGroupMember_state {
4020 struct samr_DeleteGroupMember orig;
4021 struct samr_DeleteGroupMember tmp;
4022 TALLOC_CTX *out_mem_ctx;
4023 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4026 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq);
4028 struct tevent_req *rpccli_samr_DeleteGroupMember_send(TALLOC_CTX *mem_ctx,
4029 struct tevent_context *ev,
4030 struct rpc_pipe_client *cli,
4031 struct policy_handle *_group_handle /* [in] [ref] */,
4032 uint32_t _rid /* [in] */)
4034 struct tevent_req *req;
4035 struct rpccli_samr_DeleteGroupMember_state *state;
4036 struct tevent_req *subreq;
4038 req = tevent_req_create(mem_ctx, &state,
4039 struct rpccli_samr_DeleteGroupMember_state);
4040 if (req == NULL) {
4041 return NULL;
4043 state->out_mem_ctx = NULL;
4044 state->dispatch_recv = cli->dispatch_recv;
4046 /* In parameters */
4047 state->orig.in.group_handle = _group_handle;
4048 state->orig.in.rid = _rid;
4050 /* Out parameters */
4052 /* Result */
4053 ZERO_STRUCT(state->orig.out.result);
4055 if (DEBUGLEVEL >= 10) {
4056 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &state->orig);
4059 /* make a temporary copy, that we pass to the dispatch function */
4060 state->tmp = state->orig;
4062 subreq = cli->dispatch_send(state, ev, cli,
4063 &ndr_table_samr,
4064 NDR_SAMR_DELETEGROUPMEMBER,
4065 &state->tmp);
4066 if (tevent_req_nomem(subreq, req)) {
4067 return tevent_req_post(req, ev);
4069 tevent_req_set_callback(subreq, rpccli_samr_DeleteGroupMember_done, req);
4070 return req;
4073 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req *subreq)
4075 struct tevent_req *req = tevent_req_callback_data(
4076 subreq, struct tevent_req);
4077 struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
4078 req, struct rpccli_samr_DeleteGroupMember_state);
4079 NTSTATUS status;
4080 TALLOC_CTX *mem_ctx;
4082 if (state->out_mem_ctx) {
4083 mem_ctx = state->out_mem_ctx;
4084 } else {
4085 mem_ctx = state;
4088 status = state->dispatch_recv(subreq, mem_ctx);
4089 TALLOC_FREE(subreq);
4090 if (!NT_STATUS_IS_OK(status)) {
4091 tevent_req_nterror(req, status);
4092 return;
4095 /* Copy out parameters */
4097 /* Copy result */
4098 state->orig.out.result = state->tmp.out.result;
4100 /* Reset temporary structure */
4101 ZERO_STRUCT(state->tmp);
4103 if (DEBUGLEVEL >= 10) {
4104 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &state->orig);
4107 tevent_req_done(req);
4110 NTSTATUS rpccli_samr_DeleteGroupMember_recv(struct tevent_req *req,
4111 TALLOC_CTX *mem_ctx,
4112 NTSTATUS *result)
4114 struct rpccli_samr_DeleteGroupMember_state *state = tevent_req_data(
4115 req, struct rpccli_samr_DeleteGroupMember_state);
4116 NTSTATUS status;
4118 if (tevent_req_is_nterror(req, &status)) {
4119 tevent_req_received(req);
4120 return status;
4123 /* Steal possbile out parameters to the callers context */
4124 talloc_steal(mem_ctx, state->out_mem_ctx);
4126 /* Return result */
4127 *result = state->orig.out.result;
4129 tevent_req_received(req);
4130 return NT_STATUS_OK;
4133 NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
4134 TALLOC_CTX *mem_ctx,
4135 struct policy_handle *group_handle /* [in] [ref] */,
4136 uint32_t rid /* [in] */)
4138 struct samr_DeleteGroupMember r;
4139 NTSTATUS status;
4141 /* In parameters */
4142 r.in.group_handle = group_handle;
4143 r.in.rid = rid;
4145 if (DEBUGLEVEL >= 10) {
4146 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r);
4149 status = cli->dispatch(cli,
4150 mem_ctx,
4151 &ndr_table_samr,
4152 NDR_SAMR_DELETEGROUPMEMBER,
4153 &r);
4155 if (!NT_STATUS_IS_OK(status)) {
4156 return status;
4159 if (DEBUGLEVEL >= 10) {
4160 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r);
4163 if (NT_STATUS_IS_ERR(status)) {
4164 return status;
4167 /* Return variables */
4169 /* Return result */
4170 return r.out.result;
4173 struct rpccli_samr_QueryGroupMember_state {
4174 struct samr_QueryGroupMember orig;
4175 struct samr_QueryGroupMember tmp;
4176 TALLOC_CTX *out_mem_ctx;
4177 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4180 static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq);
4182 struct tevent_req *rpccli_samr_QueryGroupMember_send(TALLOC_CTX *mem_ctx,
4183 struct tevent_context *ev,
4184 struct rpc_pipe_client *cli,
4185 struct policy_handle *_group_handle /* [in] [ref] */,
4186 struct samr_RidTypeArray **_rids /* [out] [ref] */)
4188 struct tevent_req *req;
4189 struct rpccli_samr_QueryGroupMember_state *state;
4190 struct tevent_req *subreq;
4192 req = tevent_req_create(mem_ctx, &state,
4193 struct rpccli_samr_QueryGroupMember_state);
4194 if (req == NULL) {
4195 return NULL;
4197 state->out_mem_ctx = NULL;
4198 state->dispatch_recv = cli->dispatch_recv;
4200 /* In parameters */
4201 state->orig.in.group_handle = _group_handle;
4203 /* Out parameters */
4204 state->orig.out.rids = _rids;
4206 /* Result */
4207 ZERO_STRUCT(state->orig.out.result);
4209 if (DEBUGLEVEL >= 10) {
4210 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &state->orig);
4213 state->out_mem_ctx = talloc_named_const(state, 0,
4214 "rpccli_samr_QueryGroupMember_out_memory");
4215 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4216 return tevent_req_post(req, ev);
4219 /* make a temporary copy, that we pass to the dispatch function */
4220 state->tmp = state->orig;
4222 subreq = cli->dispatch_send(state, ev, cli,
4223 &ndr_table_samr,
4224 NDR_SAMR_QUERYGROUPMEMBER,
4225 &state->tmp);
4226 if (tevent_req_nomem(subreq, req)) {
4227 return tevent_req_post(req, ev);
4229 tevent_req_set_callback(subreq, rpccli_samr_QueryGroupMember_done, req);
4230 return req;
4233 static void rpccli_samr_QueryGroupMember_done(struct tevent_req *subreq)
4235 struct tevent_req *req = tevent_req_callback_data(
4236 subreq, struct tevent_req);
4237 struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
4238 req, struct rpccli_samr_QueryGroupMember_state);
4239 NTSTATUS status;
4240 TALLOC_CTX *mem_ctx;
4242 if (state->out_mem_ctx) {
4243 mem_ctx = state->out_mem_ctx;
4244 } else {
4245 mem_ctx = state;
4248 status = state->dispatch_recv(subreq, mem_ctx);
4249 TALLOC_FREE(subreq);
4250 if (!NT_STATUS_IS_OK(status)) {
4251 tevent_req_nterror(req, status);
4252 return;
4255 /* Copy out parameters */
4256 *state->orig.out.rids = *state->tmp.out.rids;
4258 /* Copy result */
4259 state->orig.out.result = state->tmp.out.result;
4261 /* Reset temporary structure */
4262 ZERO_STRUCT(state->tmp);
4264 if (DEBUGLEVEL >= 10) {
4265 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &state->orig);
4268 tevent_req_done(req);
4271 NTSTATUS rpccli_samr_QueryGroupMember_recv(struct tevent_req *req,
4272 TALLOC_CTX *mem_ctx,
4273 NTSTATUS *result)
4275 struct rpccli_samr_QueryGroupMember_state *state = tevent_req_data(
4276 req, struct rpccli_samr_QueryGroupMember_state);
4277 NTSTATUS status;
4279 if (tevent_req_is_nterror(req, &status)) {
4280 tevent_req_received(req);
4281 return status;
4284 /* Steal possbile out parameters to the callers context */
4285 talloc_steal(mem_ctx, state->out_mem_ctx);
4287 /* Return result */
4288 *result = state->orig.out.result;
4290 tevent_req_received(req);
4291 return NT_STATUS_OK;
4294 NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
4295 TALLOC_CTX *mem_ctx,
4296 struct policy_handle *group_handle /* [in] [ref] */,
4297 struct samr_RidTypeArray **rids /* [out] [ref] */)
4299 struct samr_QueryGroupMember r;
4300 NTSTATUS status;
4302 /* In parameters */
4303 r.in.group_handle = group_handle;
4305 if (DEBUGLEVEL >= 10) {
4306 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r);
4309 status = cli->dispatch(cli,
4310 mem_ctx,
4311 &ndr_table_samr,
4312 NDR_SAMR_QUERYGROUPMEMBER,
4313 &r);
4315 if (!NT_STATUS_IS_OK(status)) {
4316 return status;
4319 if (DEBUGLEVEL >= 10) {
4320 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r);
4323 if (NT_STATUS_IS_ERR(status)) {
4324 return status;
4327 /* Return variables */
4328 *rids = *r.out.rids;
4330 /* Return result */
4331 return r.out.result;
4334 struct rpccli_samr_SetMemberAttributesOfGroup_state {
4335 struct samr_SetMemberAttributesOfGroup orig;
4336 struct samr_SetMemberAttributesOfGroup tmp;
4337 TALLOC_CTX *out_mem_ctx;
4338 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4341 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq);
4343 struct tevent_req *rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX *mem_ctx,
4344 struct tevent_context *ev,
4345 struct rpc_pipe_client *cli,
4346 struct policy_handle *_group_handle /* [in] [ref] */,
4347 uint32_t _unknown1 /* [in] */,
4348 uint32_t _unknown2 /* [in] */)
4350 struct tevent_req *req;
4351 struct rpccli_samr_SetMemberAttributesOfGroup_state *state;
4352 struct tevent_req *subreq;
4354 req = tevent_req_create(mem_ctx, &state,
4355 struct rpccli_samr_SetMemberAttributesOfGroup_state);
4356 if (req == NULL) {
4357 return NULL;
4359 state->out_mem_ctx = NULL;
4360 state->dispatch_recv = cli->dispatch_recv;
4362 /* In parameters */
4363 state->orig.in.group_handle = _group_handle;
4364 state->orig.in.unknown1 = _unknown1;
4365 state->orig.in.unknown2 = _unknown2;
4367 /* Out parameters */
4369 /* Result */
4370 ZERO_STRUCT(state->orig.out.result);
4372 if (DEBUGLEVEL >= 10) {
4373 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &state->orig);
4376 /* make a temporary copy, that we pass to the dispatch function */
4377 state->tmp = state->orig;
4379 subreq = cli->dispatch_send(state, ev, cli,
4380 &ndr_table_samr,
4381 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
4382 &state->tmp);
4383 if (tevent_req_nomem(subreq, req)) {
4384 return tevent_req_post(req, ev);
4386 tevent_req_set_callback(subreq, rpccli_samr_SetMemberAttributesOfGroup_done, req);
4387 return req;
4390 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req *subreq)
4392 struct tevent_req *req = tevent_req_callback_data(
4393 subreq, struct tevent_req);
4394 struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
4395 req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
4396 NTSTATUS status;
4397 TALLOC_CTX *mem_ctx;
4399 if (state->out_mem_ctx) {
4400 mem_ctx = state->out_mem_ctx;
4401 } else {
4402 mem_ctx = state;
4405 status = state->dispatch_recv(subreq, mem_ctx);
4406 TALLOC_FREE(subreq);
4407 if (!NT_STATUS_IS_OK(status)) {
4408 tevent_req_nterror(req, status);
4409 return;
4412 /* Copy out parameters */
4414 /* Copy result */
4415 state->orig.out.result = state->tmp.out.result;
4417 /* Reset temporary structure */
4418 ZERO_STRUCT(state->tmp);
4420 if (DEBUGLEVEL >= 10) {
4421 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &state->orig);
4424 tevent_req_done(req);
4427 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req *req,
4428 TALLOC_CTX *mem_ctx,
4429 NTSTATUS *result)
4431 struct rpccli_samr_SetMemberAttributesOfGroup_state *state = tevent_req_data(
4432 req, struct rpccli_samr_SetMemberAttributesOfGroup_state);
4433 NTSTATUS status;
4435 if (tevent_req_is_nterror(req, &status)) {
4436 tevent_req_received(req);
4437 return status;
4440 /* Steal possbile out parameters to the callers context */
4441 talloc_steal(mem_ctx, state->out_mem_ctx);
4443 /* Return result */
4444 *result = state->orig.out.result;
4446 tevent_req_received(req);
4447 return NT_STATUS_OK;
4450 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
4451 TALLOC_CTX *mem_ctx,
4452 struct policy_handle *group_handle /* [in] [ref] */,
4453 uint32_t unknown1 /* [in] */,
4454 uint32_t unknown2 /* [in] */)
4456 struct samr_SetMemberAttributesOfGroup r;
4457 NTSTATUS status;
4459 /* In parameters */
4460 r.in.group_handle = group_handle;
4461 r.in.unknown1 = unknown1;
4462 r.in.unknown2 = unknown2;
4464 if (DEBUGLEVEL >= 10) {
4465 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r);
4468 status = cli->dispatch(cli,
4469 mem_ctx,
4470 &ndr_table_samr,
4471 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
4472 &r);
4474 if (!NT_STATUS_IS_OK(status)) {
4475 return status;
4478 if (DEBUGLEVEL >= 10) {
4479 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r);
4482 if (NT_STATUS_IS_ERR(status)) {
4483 return status;
4486 /* Return variables */
4488 /* Return result */
4489 return r.out.result;
4492 struct rpccli_samr_OpenAlias_state {
4493 struct samr_OpenAlias orig;
4494 struct samr_OpenAlias tmp;
4495 TALLOC_CTX *out_mem_ctx;
4496 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4499 static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq);
4501 struct tevent_req *rpccli_samr_OpenAlias_send(TALLOC_CTX *mem_ctx,
4502 struct tevent_context *ev,
4503 struct rpc_pipe_client *cli,
4504 struct policy_handle *_domain_handle /* [in] [ref] */,
4505 uint32_t _access_mask /* [in] */,
4506 uint32_t _rid /* [in] */,
4507 struct policy_handle *_alias_handle /* [out] [ref] */)
4509 struct tevent_req *req;
4510 struct rpccli_samr_OpenAlias_state *state;
4511 struct tevent_req *subreq;
4513 req = tevent_req_create(mem_ctx, &state,
4514 struct rpccli_samr_OpenAlias_state);
4515 if (req == NULL) {
4516 return NULL;
4518 state->out_mem_ctx = NULL;
4519 state->dispatch_recv = cli->dispatch_recv;
4521 /* In parameters */
4522 state->orig.in.domain_handle = _domain_handle;
4523 state->orig.in.access_mask = _access_mask;
4524 state->orig.in.rid = _rid;
4526 /* Out parameters */
4527 state->orig.out.alias_handle = _alias_handle;
4529 /* Result */
4530 ZERO_STRUCT(state->orig.out.result);
4532 if (DEBUGLEVEL >= 10) {
4533 NDR_PRINT_IN_DEBUG(samr_OpenAlias, &state->orig);
4536 state->out_mem_ctx = talloc_named_const(state, 0,
4537 "rpccli_samr_OpenAlias_out_memory");
4538 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4539 return tevent_req_post(req, ev);
4542 /* make a temporary copy, that we pass to the dispatch function */
4543 state->tmp = state->orig;
4545 subreq = cli->dispatch_send(state, ev, cli,
4546 &ndr_table_samr,
4547 NDR_SAMR_OPENALIAS,
4548 &state->tmp);
4549 if (tevent_req_nomem(subreq, req)) {
4550 return tevent_req_post(req, ev);
4552 tevent_req_set_callback(subreq, rpccli_samr_OpenAlias_done, req);
4553 return req;
4556 static void rpccli_samr_OpenAlias_done(struct tevent_req *subreq)
4558 struct tevent_req *req = tevent_req_callback_data(
4559 subreq, struct tevent_req);
4560 struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
4561 req, struct rpccli_samr_OpenAlias_state);
4562 NTSTATUS status;
4563 TALLOC_CTX *mem_ctx;
4565 if (state->out_mem_ctx) {
4566 mem_ctx = state->out_mem_ctx;
4567 } else {
4568 mem_ctx = state;
4571 status = state->dispatch_recv(subreq, mem_ctx);
4572 TALLOC_FREE(subreq);
4573 if (!NT_STATUS_IS_OK(status)) {
4574 tevent_req_nterror(req, status);
4575 return;
4578 /* Copy out parameters */
4579 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
4581 /* Copy result */
4582 state->orig.out.result = state->tmp.out.result;
4584 /* Reset temporary structure */
4585 ZERO_STRUCT(state->tmp);
4587 if (DEBUGLEVEL >= 10) {
4588 NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &state->orig);
4591 tevent_req_done(req);
4594 NTSTATUS rpccli_samr_OpenAlias_recv(struct tevent_req *req,
4595 TALLOC_CTX *mem_ctx,
4596 NTSTATUS *result)
4598 struct rpccli_samr_OpenAlias_state *state = tevent_req_data(
4599 req, struct rpccli_samr_OpenAlias_state);
4600 NTSTATUS status;
4602 if (tevent_req_is_nterror(req, &status)) {
4603 tevent_req_received(req);
4604 return status;
4607 /* Steal possbile out parameters to the callers context */
4608 talloc_steal(mem_ctx, state->out_mem_ctx);
4610 /* Return result */
4611 *result = state->orig.out.result;
4613 tevent_req_received(req);
4614 return NT_STATUS_OK;
4617 NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
4618 TALLOC_CTX *mem_ctx,
4619 struct policy_handle *domain_handle /* [in] [ref] */,
4620 uint32_t access_mask /* [in] */,
4621 uint32_t rid /* [in] */,
4622 struct policy_handle *alias_handle /* [out] [ref] */)
4624 struct samr_OpenAlias r;
4625 NTSTATUS status;
4627 /* In parameters */
4628 r.in.domain_handle = domain_handle;
4629 r.in.access_mask = access_mask;
4630 r.in.rid = rid;
4632 if (DEBUGLEVEL >= 10) {
4633 NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r);
4636 status = cli->dispatch(cli,
4637 mem_ctx,
4638 &ndr_table_samr,
4639 NDR_SAMR_OPENALIAS,
4640 &r);
4642 if (!NT_STATUS_IS_OK(status)) {
4643 return status;
4646 if (DEBUGLEVEL >= 10) {
4647 NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r);
4650 if (NT_STATUS_IS_ERR(status)) {
4651 return status;
4654 /* Return variables */
4655 *alias_handle = *r.out.alias_handle;
4657 /* Return result */
4658 return r.out.result;
4661 struct rpccli_samr_QueryAliasInfo_state {
4662 struct samr_QueryAliasInfo orig;
4663 struct samr_QueryAliasInfo tmp;
4664 TALLOC_CTX *out_mem_ctx;
4665 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4668 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq);
4670 struct tevent_req *rpccli_samr_QueryAliasInfo_send(TALLOC_CTX *mem_ctx,
4671 struct tevent_context *ev,
4672 struct rpc_pipe_client *cli,
4673 struct policy_handle *_alias_handle /* [in] [ref] */,
4674 enum samr_AliasInfoEnum _level /* [in] */,
4675 union samr_AliasInfo **_info /* [out] [ref,switch_is(level)] */)
4677 struct tevent_req *req;
4678 struct rpccli_samr_QueryAliasInfo_state *state;
4679 struct tevent_req *subreq;
4681 req = tevent_req_create(mem_ctx, &state,
4682 struct rpccli_samr_QueryAliasInfo_state);
4683 if (req == NULL) {
4684 return NULL;
4686 state->out_mem_ctx = NULL;
4687 state->dispatch_recv = cli->dispatch_recv;
4689 /* In parameters */
4690 state->orig.in.alias_handle = _alias_handle;
4691 state->orig.in.level = _level;
4693 /* Out parameters */
4694 state->orig.out.info = _info;
4696 /* Result */
4697 ZERO_STRUCT(state->orig.out.result);
4699 if (DEBUGLEVEL >= 10) {
4700 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &state->orig);
4703 state->out_mem_ctx = talloc_named_const(state, 0,
4704 "rpccli_samr_QueryAliasInfo_out_memory");
4705 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4706 return tevent_req_post(req, ev);
4709 /* make a temporary copy, that we pass to the dispatch function */
4710 state->tmp = state->orig;
4712 subreq = cli->dispatch_send(state, ev, cli,
4713 &ndr_table_samr,
4714 NDR_SAMR_QUERYALIASINFO,
4715 &state->tmp);
4716 if (tevent_req_nomem(subreq, req)) {
4717 return tevent_req_post(req, ev);
4719 tevent_req_set_callback(subreq, rpccli_samr_QueryAliasInfo_done, req);
4720 return req;
4723 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req *subreq)
4725 struct tevent_req *req = tevent_req_callback_data(
4726 subreq, struct tevent_req);
4727 struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
4728 req, struct rpccli_samr_QueryAliasInfo_state);
4729 NTSTATUS status;
4730 TALLOC_CTX *mem_ctx;
4732 if (state->out_mem_ctx) {
4733 mem_ctx = state->out_mem_ctx;
4734 } else {
4735 mem_ctx = state;
4738 status = state->dispatch_recv(subreq, mem_ctx);
4739 TALLOC_FREE(subreq);
4740 if (!NT_STATUS_IS_OK(status)) {
4741 tevent_req_nterror(req, status);
4742 return;
4745 /* Copy out parameters */
4746 *state->orig.out.info = *state->tmp.out.info;
4748 /* Copy result */
4749 state->orig.out.result = state->tmp.out.result;
4751 /* Reset temporary structure */
4752 ZERO_STRUCT(state->tmp);
4754 if (DEBUGLEVEL >= 10) {
4755 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &state->orig);
4758 tevent_req_done(req);
4761 NTSTATUS rpccli_samr_QueryAliasInfo_recv(struct tevent_req *req,
4762 TALLOC_CTX *mem_ctx,
4763 NTSTATUS *result)
4765 struct rpccli_samr_QueryAliasInfo_state *state = tevent_req_data(
4766 req, struct rpccli_samr_QueryAliasInfo_state);
4767 NTSTATUS status;
4769 if (tevent_req_is_nterror(req, &status)) {
4770 tevent_req_received(req);
4771 return status;
4774 /* Steal possbile out parameters to the callers context */
4775 talloc_steal(mem_ctx, state->out_mem_ctx);
4777 /* Return result */
4778 *result = state->orig.out.result;
4780 tevent_req_received(req);
4781 return NT_STATUS_OK;
4784 NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
4785 TALLOC_CTX *mem_ctx,
4786 struct policy_handle *alias_handle /* [in] [ref] */,
4787 enum samr_AliasInfoEnum level /* [in] */,
4788 union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
4790 struct samr_QueryAliasInfo r;
4791 NTSTATUS status;
4793 /* In parameters */
4794 r.in.alias_handle = alias_handle;
4795 r.in.level = level;
4797 if (DEBUGLEVEL >= 10) {
4798 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r);
4801 status = cli->dispatch(cli,
4802 mem_ctx,
4803 &ndr_table_samr,
4804 NDR_SAMR_QUERYALIASINFO,
4805 &r);
4807 if (!NT_STATUS_IS_OK(status)) {
4808 return status;
4811 if (DEBUGLEVEL >= 10) {
4812 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r);
4815 if (NT_STATUS_IS_ERR(status)) {
4816 return status;
4819 /* Return variables */
4820 *info = *r.out.info;
4822 /* Return result */
4823 return r.out.result;
4826 struct rpccli_samr_SetAliasInfo_state {
4827 struct samr_SetAliasInfo orig;
4828 struct samr_SetAliasInfo tmp;
4829 TALLOC_CTX *out_mem_ctx;
4830 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4833 static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq);
4835 struct tevent_req *rpccli_samr_SetAliasInfo_send(TALLOC_CTX *mem_ctx,
4836 struct tevent_context *ev,
4837 struct rpc_pipe_client *cli,
4838 struct policy_handle *_alias_handle /* [in] [ref] */,
4839 enum samr_AliasInfoEnum _level /* [in] */,
4840 union samr_AliasInfo *_info /* [in] [ref,switch_is(level)] */)
4842 struct tevent_req *req;
4843 struct rpccli_samr_SetAliasInfo_state *state;
4844 struct tevent_req *subreq;
4846 req = tevent_req_create(mem_ctx, &state,
4847 struct rpccli_samr_SetAliasInfo_state);
4848 if (req == NULL) {
4849 return NULL;
4851 state->out_mem_ctx = NULL;
4852 state->dispatch_recv = cli->dispatch_recv;
4854 /* In parameters */
4855 state->orig.in.alias_handle = _alias_handle;
4856 state->orig.in.level = _level;
4857 state->orig.in.info = _info;
4859 /* Out parameters */
4861 /* Result */
4862 ZERO_STRUCT(state->orig.out.result);
4864 if (DEBUGLEVEL >= 10) {
4865 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &state->orig);
4868 /* make a temporary copy, that we pass to the dispatch function */
4869 state->tmp = state->orig;
4871 subreq = cli->dispatch_send(state, ev, cli,
4872 &ndr_table_samr,
4873 NDR_SAMR_SETALIASINFO,
4874 &state->tmp);
4875 if (tevent_req_nomem(subreq, req)) {
4876 return tevent_req_post(req, ev);
4878 tevent_req_set_callback(subreq, rpccli_samr_SetAliasInfo_done, req);
4879 return req;
4882 static void rpccli_samr_SetAliasInfo_done(struct tevent_req *subreq)
4884 struct tevent_req *req = tevent_req_callback_data(
4885 subreq, struct tevent_req);
4886 struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
4887 req, struct rpccli_samr_SetAliasInfo_state);
4888 NTSTATUS status;
4889 TALLOC_CTX *mem_ctx;
4891 if (state->out_mem_ctx) {
4892 mem_ctx = state->out_mem_ctx;
4893 } else {
4894 mem_ctx = state;
4897 status = state->dispatch_recv(subreq, mem_ctx);
4898 TALLOC_FREE(subreq);
4899 if (!NT_STATUS_IS_OK(status)) {
4900 tevent_req_nterror(req, status);
4901 return;
4904 /* Copy out parameters */
4906 /* Copy result */
4907 state->orig.out.result = state->tmp.out.result;
4909 /* Reset temporary structure */
4910 ZERO_STRUCT(state->tmp);
4912 if (DEBUGLEVEL >= 10) {
4913 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &state->orig);
4916 tevent_req_done(req);
4919 NTSTATUS rpccli_samr_SetAliasInfo_recv(struct tevent_req *req,
4920 TALLOC_CTX *mem_ctx,
4921 NTSTATUS *result)
4923 struct rpccli_samr_SetAliasInfo_state *state = tevent_req_data(
4924 req, struct rpccli_samr_SetAliasInfo_state);
4925 NTSTATUS status;
4927 if (tevent_req_is_nterror(req, &status)) {
4928 tevent_req_received(req);
4929 return status;
4932 /* Steal possbile out parameters to the callers context */
4933 talloc_steal(mem_ctx, state->out_mem_ctx);
4935 /* Return result */
4936 *result = state->orig.out.result;
4938 tevent_req_received(req);
4939 return NT_STATUS_OK;
4942 NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
4943 TALLOC_CTX *mem_ctx,
4944 struct policy_handle *alias_handle /* [in] [ref] */,
4945 enum samr_AliasInfoEnum level /* [in] */,
4946 union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
4948 struct samr_SetAliasInfo r;
4949 NTSTATUS status;
4951 /* In parameters */
4952 r.in.alias_handle = alias_handle;
4953 r.in.level = level;
4954 r.in.info = info;
4956 if (DEBUGLEVEL >= 10) {
4957 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r);
4960 status = cli->dispatch(cli,
4961 mem_ctx,
4962 &ndr_table_samr,
4963 NDR_SAMR_SETALIASINFO,
4964 &r);
4966 if (!NT_STATUS_IS_OK(status)) {
4967 return status;
4970 if (DEBUGLEVEL >= 10) {
4971 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r);
4974 if (NT_STATUS_IS_ERR(status)) {
4975 return status;
4978 /* Return variables */
4980 /* Return result */
4981 return r.out.result;
4984 struct rpccli_samr_DeleteDomAlias_state {
4985 struct samr_DeleteDomAlias orig;
4986 struct samr_DeleteDomAlias tmp;
4987 TALLOC_CTX *out_mem_ctx;
4988 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4991 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq);
4993 struct tevent_req *rpccli_samr_DeleteDomAlias_send(TALLOC_CTX *mem_ctx,
4994 struct tevent_context *ev,
4995 struct rpc_pipe_client *cli,
4996 struct policy_handle *_alias_handle /* [in,out] [ref] */)
4998 struct tevent_req *req;
4999 struct rpccli_samr_DeleteDomAlias_state *state;
5000 struct tevent_req *subreq;
5002 req = tevent_req_create(mem_ctx, &state,
5003 struct rpccli_samr_DeleteDomAlias_state);
5004 if (req == NULL) {
5005 return NULL;
5007 state->out_mem_ctx = NULL;
5008 state->dispatch_recv = cli->dispatch_recv;
5010 /* In parameters */
5011 state->orig.in.alias_handle = _alias_handle;
5013 /* Out parameters */
5014 state->orig.out.alias_handle = _alias_handle;
5016 /* Result */
5017 ZERO_STRUCT(state->orig.out.result);
5019 if (DEBUGLEVEL >= 10) {
5020 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &state->orig);
5023 state->out_mem_ctx = talloc_named_const(state, 0,
5024 "rpccli_samr_DeleteDomAlias_out_memory");
5025 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5026 return tevent_req_post(req, ev);
5029 /* make a temporary copy, that we pass to the dispatch function */
5030 state->tmp = state->orig;
5032 subreq = cli->dispatch_send(state, ev, cli,
5033 &ndr_table_samr,
5034 NDR_SAMR_DELETEDOMALIAS,
5035 &state->tmp);
5036 if (tevent_req_nomem(subreq, req)) {
5037 return tevent_req_post(req, ev);
5039 tevent_req_set_callback(subreq, rpccli_samr_DeleteDomAlias_done, req);
5040 return req;
5043 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req *subreq)
5045 struct tevent_req *req = tevent_req_callback_data(
5046 subreq, struct tevent_req);
5047 struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
5048 req, struct rpccli_samr_DeleteDomAlias_state);
5049 NTSTATUS status;
5050 TALLOC_CTX *mem_ctx;
5052 if (state->out_mem_ctx) {
5053 mem_ctx = state->out_mem_ctx;
5054 } else {
5055 mem_ctx = state;
5058 status = state->dispatch_recv(subreq, mem_ctx);
5059 TALLOC_FREE(subreq);
5060 if (!NT_STATUS_IS_OK(status)) {
5061 tevent_req_nterror(req, status);
5062 return;
5065 /* Copy out parameters */
5066 *state->orig.out.alias_handle = *state->tmp.out.alias_handle;
5068 /* Copy result */
5069 state->orig.out.result = state->tmp.out.result;
5071 /* Reset temporary structure */
5072 ZERO_STRUCT(state->tmp);
5074 if (DEBUGLEVEL >= 10) {
5075 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &state->orig);
5078 tevent_req_done(req);
5081 NTSTATUS rpccli_samr_DeleteDomAlias_recv(struct tevent_req *req,
5082 TALLOC_CTX *mem_ctx,
5083 NTSTATUS *result)
5085 struct rpccli_samr_DeleteDomAlias_state *state = tevent_req_data(
5086 req, struct rpccli_samr_DeleteDomAlias_state);
5087 NTSTATUS status;
5089 if (tevent_req_is_nterror(req, &status)) {
5090 tevent_req_received(req);
5091 return status;
5094 /* Steal possbile out parameters to the callers context */
5095 talloc_steal(mem_ctx, state->out_mem_ctx);
5097 /* Return result */
5098 *result = state->orig.out.result;
5100 tevent_req_received(req);
5101 return NT_STATUS_OK;
5104 NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
5105 TALLOC_CTX *mem_ctx,
5106 struct policy_handle *alias_handle /* [in,out] [ref] */)
5108 struct samr_DeleteDomAlias r;
5109 NTSTATUS status;
5111 /* In parameters */
5112 r.in.alias_handle = alias_handle;
5114 if (DEBUGLEVEL >= 10) {
5115 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r);
5118 status = cli->dispatch(cli,
5119 mem_ctx,
5120 &ndr_table_samr,
5121 NDR_SAMR_DELETEDOMALIAS,
5122 &r);
5124 if (!NT_STATUS_IS_OK(status)) {
5125 return status;
5128 if (DEBUGLEVEL >= 10) {
5129 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r);
5132 if (NT_STATUS_IS_ERR(status)) {
5133 return status;
5136 /* Return variables */
5137 *alias_handle = *r.out.alias_handle;
5139 /* Return result */
5140 return r.out.result;
5143 struct rpccli_samr_AddAliasMember_state {
5144 struct samr_AddAliasMember orig;
5145 struct samr_AddAliasMember tmp;
5146 TALLOC_CTX *out_mem_ctx;
5147 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5150 static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq);
5152 struct tevent_req *rpccli_samr_AddAliasMember_send(TALLOC_CTX *mem_ctx,
5153 struct tevent_context *ev,
5154 struct rpc_pipe_client *cli,
5155 struct policy_handle *_alias_handle /* [in] [ref] */,
5156 struct dom_sid2 *_sid /* [in] [ref] */)
5158 struct tevent_req *req;
5159 struct rpccli_samr_AddAliasMember_state *state;
5160 struct tevent_req *subreq;
5162 req = tevent_req_create(mem_ctx, &state,
5163 struct rpccli_samr_AddAliasMember_state);
5164 if (req == NULL) {
5165 return NULL;
5167 state->out_mem_ctx = NULL;
5168 state->dispatch_recv = cli->dispatch_recv;
5170 /* In parameters */
5171 state->orig.in.alias_handle = _alias_handle;
5172 state->orig.in.sid = _sid;
5174 /* Out parameters */
5176 /* Result */
5177 ZERO_STRUCT(state->orig.out.result);
5179 if (DEBUGLEVEL >= 10) {
5180 NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &state->orig);
5183 /* make a temporary copy, that we pass to the dispatch function */
5184 state->tmp = state->orig;
5186 subreq = cli->dispatch_send(state, ev, cli,
5187 &ndr_table_samr,
5188 NDR_SAMR_ADDALIASMEMBER,
5189 &state->tmp);
5190 if (tevent_req_nomem(subreq, req)) {
5191 return tevent_req_post(req, ev);
5193 tevent_req_set_callback(subreq, rpccli_samr_AddAliasMember_done, req);
5194 return req;
5197 static void rpccli_samr_AddAliasMember_done(struct tevent_req *subreq)
5199 struct tevent_req *req = tevent_req_callback_data(
5200 subreq, struct tevent_req);
5201 struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
5202 req, struct rpccli_samr_AddAliasMember_state);
5203 NTSTATUS status;
5204 TALLOC_CTX *mem_ctx;
5206 if (state->out_mem_ctx) {
5207 mem_ctx = state->out_mem_ctx;
5208 } else {
5209 mem_ctx = state;
5212 status = state->dispatch_recv(subreq, mem_ctx);
5213 TALLOC_FREE(subreq);
5214 if (!NT_STATUS_IS_OK(status)) {
5215 tevent_req_nterror(req, status);
5216 return;
5219 /* Copy out parameters */
5221 /* Copy result */
5222 state->orig.out.result = state->tmp.out.result;
5224 /* Reset temporary structure */
5225 ZERO_STRUCT(state->tmp);
5227 if (DEBUGLEVEL >= 10) {
5228 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &state->orig);
5231 tevent_req_done(req);
5234 NTSTATUS rpccli_samr_AddAliasMember_recv(struct tevent_req *req,
5235 TALLOC_CTX *mem_ctx,
5236 NTSTATUS *result)
5238 struct rpccli_samr_AddAliasMember_state *state = tevent_req_data(
5239 req, struct rpccli_samr_AddAliasMember_state);
5240 NTSTATUS status;
5242 if (tevent_req_is_nterror(req, &status)) {
5243 tevent_req_received(req);
5244 return status;
5247 /* Steal possbile out parameters to the callers context */
5248 talloc_steal(mem_ctx, state->out_mem_ctx);
5250 /* Return result */
5251 *result = state->orig.out.result;
5253 tevent_req_received(req);
5254 return NT_STATUS_OK;
5257 NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
5258 TALLOC_CTX *mem_ctx,
5259 struct policy_handle *alias_handle /* [in] [ref] */,
5260 struct dom_sid2 *sid /* [in] [ref] */)
5262 struct samr_AddAliasMember r;
5263 NTSTATUS status;
5265 /* In parameters */
5266 r.in.alias_handle = alias_handle;
5267 r.in.sid = sid;
5269 if (DEBUGLEVEL >= 10) {
5270 NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r);
5273 status = cli->dispatch(cli,
5274 mem_ctx,
5275 &ndr_table_samr,
5276 NDR_SAMR_ADDALIASMEMBER,
5277 &r);
5279 if (!NT_STATUS_IS_OK(status)) {
5280 return status;
5283 if (DEBUGLEVEL >= 10) {
5284 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r);
5287 if (NT_STATUS_IS_ERR(status)) {
5288 return status;
5291 /* Return variables */
5293 /* Return result */
5294 return r.out.result;
5297 struct rpccli_samr_DeleteAliasMember_state {
5298 struct samr_DeleteAliasMember orig;
5299 struct samr_DeleteAliasMember tmp;
5300 TALLOC_CTX *out_mem_ctx;
5301 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5304 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq);
5306 struct tevent_req *rpccli_samr_DeleteAliasMember_send(TALLOC_CTX *mem_ctx,
5307 struct tevent_context *ev,
5308 struct rpc_pipe_client *cli,
5309 struct policy_handle *_alias_handle /* [in] [ref] */,
5310 struct dom_sid2 *_sid /* [in] [ref] */)
5312 struct tevent_req *req;
5313 struct rpccli_samr_DeleteAliasMember_state *state;
5314 struct tevent_req *subreq;
5316 req = tevent_req_create(mem_ctx, &state,
5317 struct rpccli_samr_DeleteAliasMember_state);
5318 if (req == NULL) {
5319 return NULL;
5321 state->out_mem_ctx = NULL;
5322 state->dispatch_recv = cli->dispatch_recv;
5324 /* In parameters */
5325 state->orig.in.alias_handle = _alias_handle;
5326 state->orig.in.sid = _sid;
5328 /* Out parameters */
5330 /* Result */
5331 ZERO_STRUCT(state->orig.out.result);
5333 if (DEBUGLEVEL >= 10) {
5334 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &state->orig);
5337 /* make a temporary copy, that we pass to the dispatch function */
5338 state->tmp = state->orig;
5340 subreq = cli->dispatch_send(state, ev, cli,
5341 &ndr_table_samr,
5342 NDR_SAMR_DELETEALIASMEMBER,
5343 &state->tmp);
5344 if (tevent_req_nomem(subreq, req)) {
5345 return tevent_req_post(req, ev);
5347 tevent_req_set_callback(subreq, rpccli_samr_DeleteAliasMember_done, req);
5348 return req;
5351 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req *subreq)
5353 struct tevent_req *req = tevent_req_callback_data(
5354 subreq, struct tevent_req);
5355 struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
5356 req, struct rpccli_samr_DeleteAliasMember_state);
5357 NTSTATUS status;
5358 TALLOC_CTX *mem_ctx;
5360 if (state->out_mem_ctx) {
5361 mem_ctx = state->out_mem_ctx;
5362 } else {
5363 mem_ctx = state;
5366 status = state->dispatch_recv(subreq, mem_ctx);
5367 TALLOC_FREE(subreq);
5368 if (!NT_STATUS_IS_OK(status)) {
5369 tevent_req_nterror(req, status);
5370 return;
5373 /* Copy out parameters */
5375 /* Copy result */
5376 state->orig.out.result = state->tmp.out.result;
5378 /* Reset temporary structure */
5379 ZERO_STRUCT(state->tmp);
5381 if (DEBUGLEVEL >= 10) {
5382 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &state->orig);
5385 tevent_req_done(req);
5388 NTSTATUS rpccli_samr_DeleteAliasMember_recv(struct tevent_req *req,
5389 TALLOC_CTX *mem_ctx,
5390 NTSTATUS *result)
5392 struct rpccli_samr_DeleteAliasMember_state *state = tevent_req_data(
5393 req, struct rpccli_samr_DeleteAliasMember_state);
5394 NTSTATUS status;
5396 if (tevent_req_is_nterror(req, &status)) {
5397 tevent_req_received(req);
5398 return status;
5401 /* Steal possbile out parameters to the callers context */
5402 talloc_steal(mem_ctx, state->out_mem_ctx);
5404 /* Return result */
5405 *result = state->orig.out.result;
5407 tevent_req_received(req);
5408 return NT_STATUS_OK;
5411 NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
5412 TALLOC_CTX *mem_ctx,
5413 struct policy_handle *alias_handle /* [in] [ref] */,
5414 struct dom_sid2 *sid /* [in] [ref] */)
5416 struct samr_DeleteAliasMember r;
5417 NTSTATUS status;
5419 /* In parameters */
5420 r.in.alias_handle = alias_handle;
5421 r.in.sid = sid;
5423 if (DEBUGLEVEL >= 10) {
5424 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r);
5427 status = cli->dispatch(cli,
5428 mem_ctx,
5429 &ndr_table_samr,
5430 NDR_SAMR_DELETEALIASMEMBER,
5431 &r);
5433 if (!NT_STATUS_IS_OK(status)) {
5434 return status;
5437 if (DEBUGLEVEL >= 10) {
5438 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r);
5441 if (NT_STATUS_IS_ERR(status)) {
5442 return status;
5445 /* Return variables */
5447 /* Return result */
5448 return r.out.result;
5451 struct rpccli_samr_GetMembersInAlias_state {
5452 struct samr_GetMembersInAlias orig;
5453 struct samr_GetMembersInAlias tmp;
5454 TALLOC_CTX *out_mem_ctx;
5455 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5458 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq);
5460 struct tevent_req *rpccli_samr_GetMembersInAlias_send(TALLOC_CTX *mem_ctx,
5461 struct tevent_context *ev,
5462 struct rpc_pipe_client *cli,
5463 struct policy_handle *_alias_handle /* [in] [ref] */,
5464 struct lsa_SidArray *_sids /* [out] [ref] */)
5466 struct tevent_req *req;
5467 struct rpccli_samr_GetMembersInAlias_state *state;
5468 struct tevent_req *subreq;
5470 req = tevent_req_create(mem_ctx, &state,
5471 struct rpccli_samr_GetMembersInAlias_state);
5472 if (req == NULL) {
5473 return NULL;
5475 state->out_mem_ctx = NULL;
5476 state->dispatch_recv = cli->dispatch_recv;
5478 /* In parameters */
5479 state->orig.in.alias_handle = _alias_handle;
5481 /* Out parameters */
5482 state->orig.out.sids = _sids;
5484 /* Result */
5485 ZERO_STRUCT(state->orig.out.result);
5487 if (DEBUGLEVEL >= 10) {
5488 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &state->orig);
5491 state->out_mem_ctx = talloc_named_const(state, 0,
5492 "rpccli_samr_GetMembersInAlias_out_memory");
5493 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5494 return tevent_req_post(req, ev);
5497 /* make a temporary copy, that we pass to the dispatch function */
5498 state->tmp = state->orig;
5500 subreq = cli->dispatch_send(state, ev, cli,
5501 &ndr_table_samr,
5502 NDR_SAMR_GETMEMBERSINALIAS,
5503 &state->tmp);
5504 if (tevent_req_nomem(subreq, req)) {
5505 return tevent_req_post(req, ev);
5507 tevent_req_set_callback(subreq, rpccli_samr_GetMembersInAlias_done, req);
5508 return req;
5511 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req *subreq)
5513 struct tevent_req *req = tevent_req_callback_data(
5514 subreq, struct tevent_req);
5515 struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
5516 req, struct rpccli_samr_GetMembersInAlias_state);
5517 NTSTATUS status;
5518 TALLOC_CTX *mem_ctx;
5520 if (state->out_mem_ctx) {
5521 mem_ctx = state->out_mem_ctx;
5522 } else {
5523 mem_ctx = state;
5526 status = state->dispatch_recv(subreq, mem_ctx);
5527 TALLOC_FREE(subreq);
5528 if (!NT_STATUS_IS_OK(status)) {
5529 tevent_req_nterror(req, status);
5530 return;
5533 /* Copy out parameters */
5534 *state->orig.out.sids = *state->tmp.out.sids;
5536 /* Copy result */
5537 state->orig.out.result = state->tmp.out.result;
5539 /* Reset temporary structure */
5540 ZERO_STRUCT(state->tmp);
5542 if (DEBUGLEVEL >= 10) {
5543 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &state->orig);
5546 tevent_req_done(req);
5549 NTSTATUS rpccli_samr_GetMembersInAlias_recv(struct tevent_req *req,
5550 TALLOC_CTX *mem_ctx,
5551 NTSTATUS *result)
5553 struct rpccli_samr_GetMembersInAlias_state *state = tevent_req_data(
5554 req, struct rpccli_samr_GetMembersInAlias_state);
5555 NTSTATUS status;
5557 if (tevent_req_is_nterror(req, &status)) {
5558 tevent_req_received(req);
5559 return status;
5562 /* Steal possbile out parameters to the callers context */
5563 talloc_steal(mem_ctx, state->out_mem_ctx);
5565 /* Return result */
5566 *result = state->orig.out.result;
5568 tevent_req_received(req);
5569 return NT_STATUS_OK;
5572 NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
5573 TALLOC_CTX *mem_ctx,
5574 struct policy_handle *alias_handle /* [in] [ref] */,
5575 struct lsa_SidArray *sids /* [out] [ref] */)
5577 struct samr_GetMembersInAlias r;
5578 NTSTATUS status;
5580 /* In parameters */
5581 r.in.alias_handle = alias_handle;
5583 if (DEBUGLEVEL >= 10) {
5584 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r);
5587 status = cli->dispatch(cli,
5588 mem_ctx,
5589 &ndr_table_samr,
5590 NDR_SAMR_GETMEMBERSINALIAS,
5591 &r);
5593 if (!NT_STATUS_IS_OK(status)) {
5594 return status;
5597 if (DEBUGLEVEL >= 10) {
5598 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r);
5601 if (NT_STATUS_IS_ERR(status)) {
5602 return status;
5605 /* Return variables */
5606 *sids = *r.out.sids;
5608 /* Return result */
5609 return r.out.result;
5612 struct rpccli_samr_OpenUser_state {
5613 struct samr_OpenUser orig;
5614 struct samr_OpenUser tmp;
5615 TALLOC_CTX *out_mem_ctx;
5616 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5619 static void rpccli_samr_OpenUser_done(struct tevent_req *subreq);
5621 struct tevent_req *rpccli_samr_OpenUser_send(TALLOC_CTX *mem_ctx,
5622 struct tevent_context *ev,
5623 struct rpc_pipe_client *cli,
5624 struct policy_handle *_domain_handle /* [in] [ref] */,
5625 uint32_t _access_mask /* [in] */,
5626 uint32_t _rid /* [in] */,
5627 struct policy_handle *_user_handle /* [out] [ref] */)
5629 struct tevent_req *req;
5630 struct rpccli_samr_OpenUser_state *state;
5631 struct tevent_req *subreq;
5633 req = tevent_req_create(mem_ctx, &state,
5634 struct rpccli_samr_OpenUser_state);
5635 if (req == NULL) {
5636 return NULL;
5638 state->out_mem_ctx = NULL;
5639 state->dispatch_recv = cli->dispatch_recv;
5641 /* In parameters */
5642 state->orig.in.domain_handle = _domain_handle;
5643 state->orig.in.access_mask = _access_mask;
5644 state->orig.in.rid = _rid;
5646 /* Out parameters */
5647 state->orig.out.user_handle = _user_handle;
5649 /* Result */
5650 ZERO_STRUCT(state->orig.out.result);
5652 if (DEBUGLEVEL >= 10) {
5653 NDR_PRINT_IN_DEBUG(samr_OpenUser, &state->orig);
5656 state->out_mem_ctx = talloc_named_const(state, 0,
5657 "rpccli_samr_OpenUser_out_memory");
5658 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5659 return tevent_req_post(req, ev);
5662 /* make a temporary copy, that we pass to the dispatch function */
5663 state->tmp = state->orig;
5665 subreq = cli->dispatch_send(state, ev, cli,
5666 &ndr_table_samr,
5667 NDR_SAMR_OPENUSER,
5668 &state->tmp);
5669 if (tevent_req_nomem(subreq, req)) {
5670 return tevent_req_post(req, ev);
5672 tevent_req_set_callback(subreq, rpccli_samr_OpenUser_done, req);
5673 return req;
5676 static void rpccli_samr_OpenUser_done(struct tevent_req *subreq)
5678 struct tevent_req *req = tevent_req_callback_data(
5679 subreq, struct tevent_req);
5680 struct rpccli_samr_OpenUser_state *state = tevent_req_data(
5681 req, struct rpccli_samr_OpenUser_state);
5682 NTSTATUS status;
5683 TALLOC_CTX *mem_ctx;
5685 if (state->out_mem_ctx) {
5686 mem_ctx = state->out_mem_ctx;
5687 } else {
5688 mem_ctx = state;
5691 status = state->dispatch_recv(subreq, mem_ctx);
5692 TALLOC_FREE(subreq);
5693 if (!NT_STATUS_IS_OK(status)) {
5694 tevent_req_nterror(req, status);
5695 return;
5698 /* Copy out parameters */
5699 *state->orig.out.user_handle = *state->tmp.out.user_handle;
5701 /* Copy result */
5702 state->orig.out.result = state->tmp.out.result;
5704 /* Reset temporary structure */
5705 ZERO_STRUCT(state->tmp);
5707 if (DEBUGLEVEL >= 10) {
5708 NDR_PRINT_OUT_DEBUG(samr_OpenUser, &state->orig);
5711 tevent_req_done(req);
5714 NTSTATUS rpccli_samr_OpenUser_recv(struct tevent_req *req,
5715 TALLOC_CTX *mem_ctx,
5716 NTSTATUS *result)
5718 struct rpccli_samr_OpenUser_state *state = tevent_req_data(
5719 req, struct rpccli_samr_OpenUser_state);
5720 NTSTATUS status;
5722 if (tevent_req_is_nterror(req, &status)) {
5723 tevent_req_received(req);
5724 return status;
5727 /* Steal possbile out parameters to the callers context */
5728 talloc_steal(mem_ctx, state->out_mem_ctx);
5730 /* Return result */
5731 *result = state->orig.out.result;
5733 tevent_req_received(req);
5734 return NT_STATUS_OK;
5737 NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
5738 TALLOC_CTX *mem_ctx,
5739 struct policy_handle *domain_handle /* [in] [ref] */,
5740 uint32_t access_mask /* [in] */,
5741 uint32_t rid /* [in] */,
5742 struct policy_handle *user_handle /* [out] [ref] */)
5744 struct samr_OpenUser r;
5745 NTSTATUS status;
5747 /* In parameters */
5748 r.in.domain_handle = domain_handle;
5749 r.in.access_mask = access_mask;
5750 r.in.rid = rid;
5752 if (DEBUGLEVEL >= 10) {
5753 NDR_PRINT_IN_DEBUG(samr_OpenUser, &r);
5756 status = cli->dispatch(cli,
5757 mem_ctx,
5758 &ndr_table_samr,
5759 NDR_SAMR_OPENUSER,
5760 &r);
5762 if (!NT_STATUS_IS_OK(status)) {
5763 return status;
5766 if (DEBUGLEVEL >= 10) {
5767 NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r);
5770 if (NT_STATUS_IS_ERR(status)) {
5771 return status;
5774 /* Return variables */
5775 *user_handle = *r.out.user_handle;
5777 /* Return result */
5778 return r.out.result;
5781 struct rpccli_samr_DeleteUser_state {
5782 struct samr_DeleteUser orig;
5783 struct samr_DeleteUser tmp;
5784 TALLOC_CTX *out_mem_ctx;
5785 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5788 static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq);
5790 struct tevent_req *rpccli_samr_DeleteUser_send(TALLOC_CTX *mem_ctx,
5791 struct tevent_context *ev,
5792 struct rpc_pipe_client *cli,
5793 struct policy_handle *_user_handle /* [in,out] [ref] */)
5795 struct tevent_req *req;
5796 struct rpccli_samr_DeleteUser_state *state;
5797 struct tevent_req *subreq;
5799 req = tevent_req_create(mem_ctx, &state,
5800 struct rpccli_samr_DeleteUser_state);
5801 if (req == NULL) {
5802 return NULL;
5804 state->out_mem_ctx = NULL;
5805 state->dispatch_recv = cli->dispatch_recv;
5807 /* In parameters */
5808 state->orig.in.user_handle = _user_handle;
5810 /* Out parameters */
5811 state->orig.out.user_handle = _user_handle;
5813 /* Result */
5814 ZERO_STRUCT(state->orig.out.result);
5816 if (DEBUGLEVEL >= 10) {
5817 NDR_PRINT_IN_DEBUG(samr_DeleteUser, &state->orig);
5820 state->out_mem_ctx = talloc_named_const(state, 0,
5821 "rpccli_samr_DeleteUser_out_memory");
5822 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5823 return tevent_req_post(req, ev);
5826 /* make a temporary copy, that we pass to the dispatch function */
5827 state->tmp = state->orig;
5829 subreq = cli->dispatch_send(state, ev, cli,
5830 &ndr_table_samr,
5831 NDR_SAMR_DELETEUSER,
5832 &state->tmp);
5833 if (tevent_req_nomem(subreq, req)) {
5834 return tevent_req_post(req, ev);
5836 tevent_req_set_callback(subreq, rpccli_samr_DeleteUser_done, req);
5837 return req;
5840 static void rpccli_samr_DeleteUser_done(struct tevent_req *subreq)
5842 struct tevent_req *req = tevent_req_callback_data(
5843 subreq, struct tevent_req);
5844 struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
5845 req, struct rpccli_samr_DeleteUser_state);
5846 NTSTATUS status;
5847 TALLOC_CTX *mem_ctx;
5849 if (state->out_mem_ctx) {
5850 mem_ctx = state->out_mem_ctx;
5851 } else {
5852 mem_ctx = state;
5855 status = state->dispatch_recv(subreq, mem_ctx);
5856 TALLOC_FREE(subreq);
5857 if (!NT_STATUS_IS_OK(status)) {
5858 tevent_req_nterror(req, status);
5859 return;
5862 /* Copy out parameters */
5863 *state->orig.out.user_handle = *state->tmp.out.user_handle;
5865 /* Copy result */
5866 state->orig.out.result = state->tmp.out.result;
5868 /* Reset temporary structure */
5869 ZERO_STRUCT(state->tmp);
5871 if (DEBUGLEVEL >= 10) {
5872 NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &state->orig);
5875 tevent_req_done(req);
5878 NTSTATUS rpccli_samr_DeleteUser_recv(struct tevent_req *req,
5879 TALLOC_CTX *mem_ctx,
5880 NTSTATUS *result)
5882 struct rpccli_samr_DeleteUser_state *state = tevent_req_data(
5883 req, struct rpccli_samr_DeleteUser_state);
5884 NTSTATUS status;
5886 if (tevent_req_is_nterror(req, &status)) {
5887 tevent_req_received(req);
5888 return status;
5891 /* Steal possbile out parameters to the callers context */
5892 talloc_steal(mem_ctx, state->out_mem_ctx);
5894 /* Return result */
5895 *result = state->orig.out.result;
5897 tevent_req_received(req);
5898 return NT_STATUS_OK;
5901 NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
5902 TALLOC_CTX *mem_ctx,
5903 struct policy_handle *user_handle /* [in,out] [ref] */)
5905 struct samr_DeleteUser r;
5906 NTSTATUS status;
5908 /* In parameters */
5909 r.in.user_handle = user_handle;
5911 if (DEBUGLEVEL >= 10) {
5912 NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r);
5915 status = cli->dispatch(cli,
5916 mem_ctx,
5917 &ndr_table_samr,
5918 NDR_SAMR_DELETEUSER,
5919 &r);
5921 if (!NT_STATUS_IS_OK(status)) {
5922 return status;
5925 if (DEBUGLEVEL >= 10) {
5926 NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r);
5929 if (NT_STATUS_IS_ERR(status)) {
5930 return status;
5933 /* Return variables */
5934 *user_handle = *r.out.user_handle;
5936 /* Return result */
5937 return r.out.result;
5940 struct rpccli_samr_QueryUserInfo_state {
5941 struct samr_QueryUserInfo orig;
5942 struct samr_QueryUserInfo tmp;
5943 TALLOC_CTX *out_mem_ctx;
5944 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5947 static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq);
5949 struct tevent_req *rpccli_samr_QueryUserInfo_send(TALLOC_CTX *mem_ctx,
5950 struct tevent_context *ev,
5951 struct rpc_pipe_client *cli,
5952 struct policy_handle *_user_handle /* [in] [ref] */,
5953 enum samr_UserInfoLevel _level /* [in] */,
5954 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
5956 struct tevent_req *req;
5957 struct rpccli_samr_QueryUserInfo_state *state;
5958 struct tevent_req *subreq;
5960 req = tevent_req_create(mem_ctx, &state,
5961 struct rpccli_samr_QueryUserInfo_state);
5962 if (req == NULL) {
5963 return NULL;
5965 state->out_mem_ctx = NULL;
5966 state->dispatch_recv = cli->dispatch_recv;
5968 /* In parameters */
5969 state->orig.in.user_handle = _user_handle;
5970 state->orig.in.level = _level;
5972 /* Out parameters */
5973 state->orig.out.info = _info;
5975 /* Result */
5976 ZERO_STRUCT(state->orig.out.result);
5978 if (DEBUGLEVEL >= 10) {
5979 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &state->orig);
5982 state->out_mem_ctx = talloc_named_const(state, 0,
5983 "rpccli_samr_QueryUserInfo_out_memory");
5984 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5985 return tevent_req_post(req, ev);
5988 /* make a temporary copy, that we pass to the dispatch function */
5989 state->tmp = state->orig;
5991 subreq = cli->dispatch_send(state, ev, cli,
5992 &ndr_table_samr,
5993 NDR_SAMR_QUERYUSERINFO,
5994 &state->tmp);
5995 if (tevent_req_nomem(subreq, req)) {
5996 return tevent_req_post(req, ev);
5998 tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo_done, req);
5999 return req;
6002 static void rpccli_samr_QueryUserInfo_done(struct tevent_req *subreq)
6004 struct tevent_req *req = tevent_req_callback_data(
6005 subreq, struct tevent_req);
6006 struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
6007 req, struct rpccli_samr_QueryUserInfo_state);
6008 NTSTATUS status;
6009 TALLOC_CTX *mem_ctx;
6011 if (state->out_mem_ctx) {
6012 mem_ctx = state->out_mem_ctx;
6013 } else {
6014 mem_ctx = state;
6017 status = state->dispatch_recv(subreq, mem_ctx);
6018 TALLOC_FREE(subreq);
6019 if (!NT_STATUS_IS_OK(status)) {
6020 tevent_req_nterror(req, status);
6021 return;
6024 /* Copy out parameters */
6025 *state->orig.out.info = *state->tmp.out.info;
6027 /* Copy result */
6028 state->orig.out.result = state->tmp.out.result;
6030 /* Reset temporary structure */
6031 ZERO_STRUCT(state->tmp);
6033 if (DEBUGLEVEL >= 10) {
6034 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &state->orig);
6037 tevent_req_done(req);
6040 NTSTATUS rpccli_samr_QueryUserInfo_recv(struct tevent_req *req,
6041 TALLOC_CTX *mem_ctx,
6042 NTSTATUS *result)
6044 struct rpccli_samr_QueryUserInfo_state *state = tevent_req_data(
6045 req, struct rpccli_samr_QueryUserInfo_state);
6046 NTSTATUS status;
6048 if (tevent_req_is_nterror(req, &status)) {
6049 tevent_req_received(req);
6050 return status;
6053 /* Steal possbile out parameters to the callers context */
6054 talloc_steal(mem_ctx, state->out_mem_ctx);
6056 /* Return result */
6057 *result = state->orig.out.result;
6059 tevent_req_received(req);
6060 return NT_STATUS_OK;
6063 NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
6064 TALLOC_CTX *mem_ctx,
6065 struct policy_handle *user_handle /* [in] [ref] */,
6066 enum samr_UserInfoLevel level /* [in] */,
6067 union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
6069 struct samr_QueryUserInfo r;
6070 NTSTATUS status;
6072 /* In parameters */
6073 r.in.user_handle = user_handle;
6074 r.in.level = level;
6076 if (DEBUGLEVEL >= 10) {
6077 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r);
6080 status = cli->dispatch(cli,
6081 mem_ctx,
6082 &ndr_table_samr,
6083 NDR_SAMR_QUERYUSERINFO,
6084 &r);
6086 if (!NT_STATUS_IS_OK(status)) {
6087 return status;
6090 if (DEBUGLEVEL >= 10) {
6091 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r);
6094 if (NT_STATUS_IS_ERR(status)) {
6095 return status;
6098 /* Return variables */
6099 *info = *r.out.info;
6101 /* Return result */
6102 return r.out.result;
6105 struct rpccli_samr_SetUserInfo_state {
6106 struct samr_SetUserInfo orig;
6107 struct samr_SetUserInfo tmp;
6108 TALLOC_CTX *out_mem_ctx;
6109 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6112 static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq);
6114 struct tevent_req *rpccli_samr_SetUserInfo_send(TALLOC_CTX *mem_ctx,
6115 struct tevent_context *ev,
6116 struct rpc_pipe_client *cli,
6117 struct policy_handle *_user_handle /* [in] [ref] */,
6118 enum samr_UserInfoLevel _level /* [in] */,
6119 union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
6121 struct tevent_req *req;
6122 struct rpccli_samr_SetUserInfo_state *state;
6123 struct tevent_req *subreq;
6125 req = tevent_req_create(mem_ctx, &state,
6126 struct rpccli_samr_SetUserInfo_state);
6127 if (req == NULL) {
6128 return NULL;
6130 state->out_mem_ctx = NULL;
6131 state->dispatch_recv = cli->dispatch_recv;
6133 /* In parameters */
6134 state->orig.in.user_handle = _user_handle;
6135 state->orig.in.level = _level;
6136 state->orig.in.info = _info;
6138 /* Out parameters */
6140 /* Result */
6141 ZERO_STRUCT(state->orig.out.result);
6143 if (DEBUGLEVEL >= 10) {
6144 NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &state->orig);
6147 /* make a temporary copy, that we pass to the dispatch function */
6148 state->tmp = state->orig;
6150 subreq = cli->dispatch_send(state, ev, cli,
6151 &ndr_table_samr,
6152 NDR_SAMR_SETUSERINFO,
6153 &state->tmp);
6154 if (tevent_req_nomem(subreq, req)) {
6155 return tevent_req_post(req, ev);
6157 tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo_done, req);
6158 return req;
6161 static void rpccli_samr_SetUserInfo_done(struct tevent_req *subreq)
6163 struct tevent_req *req = tevent_req_callback_data(
6164 subreq, struct tevent_req);
6165 struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
6166 req, struct rpccli_samr_SetUserInfo_state);
6167 NTSTATUS status;
6168 TALLOC_CTX *mem_ctx;
6170 if (state->out_mem_ctx) {
6171 mem_ctx = state->out_mem_ctx;
6172 } else {
6173 mem_ctx = state;
6176 status = state->dispatch_recv(subreq, mem_ctx);
6177 TALLOC_FREE(subreq);
6178 if (!NT_STATUS_IS_OK(status)) {
6179 tevent_req_nterror(req, status);
6180 return;
6183 /* Copy out parameters */
6185 /* Copy result */
6186 state->orig.out.result = state->tmp.out.result;
6188 /* Reset temporary structure */
6189 ZERO_STRUCT(state->tmp);
6191 if (DEBUGLEVEL >= 10) {
6192 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &state->orig);
6195 tevent_req_done(req);
6198 NTSTATUS rpccli_samr_SetUserInfo_recv(struct tevent_req *req,
6199 TALLOC_CTX *mem_ctx,
6200 NTSTATUS *result)
6202 struct rpccli_samr_SetUserInfo_state *state = tevent_req_data(
6203 req, struct rpccli_samr_SetUserInfo_state);
6204 NTSTATUS status;
6206 if (tevent_req_is_nterror(req, &status)) {
6207 tevent_req_received(req);
6208 return status;
6211 /* Steal possbile out parameters to the callers context */
6212 talloc_steal(mem_ctx, state->out_mem_ctx);
6214 /* Return result */
6215 *result = state->orig.out.result;
6217 tevent_req_received(req);
6218 return NT_STATUS_OK;
6221 NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
6222 TALLOC_CTX *mem_ctx,
6223 struct policy_handle *user_handle /* [in] [ref] */,
6224 enum samr_UserInfoLevel level /* [in] */,
6225 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
6227 struct samr_SetUserInfo r;
6228 NTSTATUS status;
6230 /* In parameters */
6231 r.in.user_handle = user_handle;
6232 r.in.level = level;
6233 r.in.info = info;
6235 if (DEBUGLEVEL >= 10) {
6236 NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r);
6239 status = cli->dispatch(cli,
6240 mem_ctx,
6241 &ndr_table_samr,
6242 NDR_SAMR_SETUSERINFO,
6243 &r);
6245 if (!NT_STATUS_IS_OK(status)) {
6246 return status;
6249 if (DEBUGLEVEL >= 10) {
6250 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r);
6253 if (NT_STATUS_IS_ERR(status)) {
6254 return status;
6257 /* Return variables */
6259 /* Return result */
6260 return r.out.result;
6263 struct rpccli_samr_ChangePasswordUser_state {
6264 struct samr_ChangePasswordUser orig;
6265 struct samr_ChangePasswordUser tmp;
6266 TALLOC_CTX *out_mem_ctx;
6267 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6270 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq);
6272 struct tevent_req *rpccli_samr_ChangePasswordUser_send(TALLOC_CTX *mem_ctx,
6273 struct tevent_context *ev,
6274 struct rpc_pipe_client *cli,
6275 struct policy_handle *_user_handle /* [in] [ref] */,
6276 uint8_t _lm_present /* [in] */,
6277 struct samr_Password *_old_lm_crypted /* [in] [unique] */,
6278 struct samr_Password *_new_lm_crypted /* [in] [unique] */,
6279 uint8_t _nt_present /* [in] */,
6280 struct samr_Password *_old_nt_crypted /* [in] [unique] */,
6281 struct samr_Password *_new_nt_crypted /* [in] [unique] */,
6282 uint8_t _cross1_present /* [in] */,
6283 struct samr_Password *_nt_cross /* [in] [unique] */,
6284 uint8_t _cross2_present /* [in] */,
6285 struct samr_Password *_lm_cross /* [in] [unique] */)
6287 struct tevent_req *req;
6288 struct rpccli_samr_ChangePasswordUser_state *state;
6289 struct tevent_req *subreq;
6291 req = tevent_req_create(mem_ctx, &state,
6292 struct rpccli_samr_ChangePasswordUser_state);
6293 if (req == NULL) {
6294 return NULL;
6296 state->out_mem_ctx = NULL;
6297 state->dispatch_recv = cli->dispatch_recv;
6299 /* In parameters */
6300 state->orig.in.user_handle = _user_handle;
6301 state->orig.in.lm_present = _lm_present;
6302 state->orig.in.old_lm_crypted = _old_lm_crypted;
6303 state->orig.in.new_lm_crypted = _new_lm_crypted;
6304 state->orig.in.nt_present = _nt_present;
6305 state->orig.in.old_nt_crypted = _old_nt_crypted;
6306 state->orig.in.new_nt_crypted = _new_nt_crypted;
6307 state->orig.in.cross1_present = _cross1_present;
6308 state->orig.in.nt_cross = _nt_cross;
6309 state->orig.in.cross2_present = _cross2_present;
6310 state->orig.in.lm_cross = _lm_cross;
6312 /* Out parameters */
6314 /* Result */
6315 ZERO_STRUCT(state->orig.out.result);
6317 if (DEBUGLEVEL >= 10) {
6318 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &state->orig);
6321 /* make a temporary copy, that we pass to the dispatch function */
6322 state->tmp = state->orig;
6324 subreq = cli->dispatch_send(state, ev, cli,
6325 &ndr_table_samr,
6326 NDR_SAMR_CHANGEPASSWORDUSER,
6327 &state->tmp);
6328 if (tevent_req_nomem(subreq, req)) {
6329 return tevent_req_post(req, ev);
6331 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser_done, req);
6332 return req;
6335 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req *subreq)
6337 struct tevent_req *req = tevent_req_callback_data(
6338 subreq, struct tevent_req);
6339 struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
6340 req, struct rpccli_samr_ChangePasswordUser_state);
6341 NTSTATUS status;
6342 TALLOC_CTX *mem_ctx;
6344 if (state->out_mem_ctx) {
6345 mem_ctx = state->out_mem_ctx;
6346 } else {
6347 mem_ctx = state;
6350 status = state->dispatch_recv(subreq, mem_ctx);
6351 TALLOC_FREE(subreq);
6352 if (!NT_STATUS_IS_OK(status)) {
6353 tevent_req_nterror(req, status);
6354 return;
6357 /* Copy out parameters */
6359 /* Copy result */
6360 state->orig.out.result = state->tmp.out.result;
6362 /* Reset temporary structure */
6363 ZERO_STRUCT(state->tmp);
6365 if (DEBUGLEVEL >= 10) {
6366 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &state->orig);
6369 tevent_req_done(req);
6372 NTSTATUS rpccli_samr_ChangePasswordUser_recv(struct tevent_req *req,
6373 TALLOC_CTX *mem_ctx,
6374 NTSTATUS *result)
6376 struct rpccli_samr_ChangePasswordUser_state *state = tevent_req_data(
6377 req, struct rpccli_samr_ChangePasswordUser_state);
6378 NTSTATUS status;
6380 if (tevent_req_is_nterror(req, &status)) {
6381 tevent_req_received(req);
6382 return status;
6385 /* Steal possbile out parameters to the callers context */
6386 talloc_steal(mem_ctx, state->out_mem_ctx);
6388 /* Return result */
6389 *result = state->orig.out.result;
6391 tevent_req_received(req);
6392 return NT_STATUS_OK;
6395 NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
6396 TALLOC_CTX *mem_ctx,
6397 struct policy_handle *user_handle /* [in] [ref] */,
6398 uint8_t lm_present /* [in] */,
6399 struct samr_Password *old_lm_crypted /* [in] [unique] */,
6400 struct samr_Password *new_lm_crypted /* [in] [unique] */,
6401 uint8_t nt_present /* [in] */,
6402 struct samr_Password *old_nt_crypted /* [in] [unique] */,
6403 struct samr_Password *new_nt_crypted /* [in] [unique] */,
6404 uint8_t cross1_present /* [in] */,
6405 struct samr_Password *nt_cross /* [in] [unique] */,
6406 uint8_t cross2_present /* [in] */,
6407 struct samr_Password *lm_cross /* [in] [unique] */)
6409 struct samr_ChangePasswordUser r;
6410 NTSTATUS status;
6412 /* In parameters */
6413 r.in.user_handle = user_handle;
6414 r.in.lm_present = lm_present;
6415 r.in.old_lm_crypted = old_lm_crypted;
6416 r.in.new_lm_crypted = new_lm_crypted;
6417 r.in.nt_present = nt_present;
6418 r.in.old_nt_crypted = old_nt_crypted;
6419 r.in.new_nt_crypted = new_nt_crypted;
6420 r.in.cross1_present = cross1_present;
6421 r.in.nt_cross = nt_cross;
6422 r.in.cross2_present = cross2_present;
6423 r.in.lm_cross = lm_cross;
6425 if (DEBUGLEVEL >= 10) {
6426 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r);
6429 status = cli->dispatch(cli,
6430 mem_ctx,
6431 &ndr_table_samr,
6432 NDR_SAMR_CHANGEPASSWORDUSER,
6433 &r);
6435 if (!NT_STATUS_IS_OK(status)) {
6436 return status;
6439 if (DEBUGLEVEL >= 10) {
6440 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r);
6443 if (NT_STATUS_IS_ERR(status)) {
6444 return status;
6447 /* Return variables */
6449 /* Return result */
6450 return r.out.result;
6453 struct rpccli_samr_GetGroupsForUser_state {
6454 struct samr_GetGroupsForUser orig;
6455 struct samr_GetGroupsForUser tmp;
6456 TALLOC_CTX *out_mem_ctx;
6457 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6460 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq);
6462 struct tevent_req *rpccli_samr_GetGroupsForUser_send(TALLOC_CTX *mem_ctx,
6463 struct tevent_context *ev,
6464 struct rpc_pipe_client *cli,
6465 struct policy_handle *_user_handle /* [in] [ref] */,
6466 struct samr_RidWithAttributeArray **_rids /* [out] [ref] */)
6468 struct tevent_req *req;
6469 struct rpccli_samr_GetGroupsForUser_state *state;
6470 struct tevent_req *subreq;
6472 req = tevent_req_create(mem_ctx, &state,
6473 struct rpccli_samr_GetGroupsForUser_state);
6474 if (req == NULL) {
6475 return NULL;
6477 state->out_mem_ctx = NULL;
6478 state->dispatch_recv = cli->dispatch_recv;
6480 /* In parameters */
6481 state->orig.in.user_handle = _user_handle;
6483 /* Out parameters */
6484 state->orig.out.rids = _rids;
6486 /* Result */
6487 ZERO_STRUCT(state->orig.out.result);
6489 if (DEBUGLEVEL >= 10) {
6490 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &state->orig);
6493 state->out_mem_ctx = talloc_named_const(state, 0,
6494 "rpccli_samr_GetGroupsForUser_out_memory");
6495 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6496 return tevent_req_post(req, ev);
6499 /* make a temporary copy, that we pass to the dispatch function */
6500 state->tmp = state->orig;
6502 subreq = cli->dispatch_send(state, ev, cli,
6503 &ndr_table_samr,
6504 NDR_SAMR_GETGROUPSFORUSER,
6505 &state->tmp);
6506 if (tevent_req_nomem(subreq, req)) {
6507 return tevent_req_post(req, ev);
6509 tevent_req_set_callback(subreq, rpccli_samr_GetGroupsForUser_done, req);
6510 return req;
6513 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req *subreq)
6515 struct tevent_req *req = tevent_req_callback_data(
6516 subreq, struct tevent_req);
6517 struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
6518 req, struct rpccli_samr_GetGroupsForUser_state);
6519 NTSTATUS status;
6520 TALLOC_CTX *mem_ctx;
6522 if (state->out_mem_ctx) {
6523 mem_ctx = state->out_mem_ctx;
6524 } else {
6525 mem_ctx = state;
6528 status = state->dispatch_recv(subreq, mem_ctx);
6529 TALLOC_FREE(subreq);
6530 if (!NT_STATUS_IS_OK(status)) {
6531 tevent_req_nterror(req, status);
6532 return;
6535 /* Copy out parameters */
6536 *state->orig.out.rids = *state->tmp.out.rids;
6538 /* Copy result */
6539 state->orig.out.result = state->tmp.out.result;
6541 /* Reset temporary structure */
6542 ZERO_STRUCT(state->tmp);
6544 if (DEBUGLEVEL >= 10) {
6545 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &state->orig);
6548 tevent_req_done(req);
6551 NTSTATUS rpccli_samr_GetGroupsForUser_recv(struct tevent_req *req,
6552 TALLOC_CTX *mem_ctx,
6553 NTSTATUS *result)
6555 struct rpccli_samr_GetGroupsForUser_state *state = tevent_req_data(
6556 req, struct rpccli_samr_GetGroupsForUser_state);
6557 NTSTATUS status;
6559 if (tevent_req_is_nterror(req, &status)) {
6560 tevent_req_received(req);
6561 return status;
6564 /* Steal possbile out parameters to the callers context */
6565 talloc_steal(mem_ctx, state->out_mem_ctx);
6567 /* Return result */
6568 *result = state->orig.out.result;
6570 tevent_req_received(req);
6571 return NT_STATUS_OK;
6574 NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
6575 TALLOC_CTX *mem_ctx,
6576 struct policy_handle *user_handle /* [in] [ref] */,
6577 struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
6579 struct samr_GetGroupsForUser r;
6580 NTSTATUS status;
6582 /* In parameters */
6583 r.in.user_handle = user_handle;
6585 if (DEBUGLEVEL >= 10) {
6586 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r);
6589 status = cli->dispatch(cli,
6590 mem_ctx,
6591 &ndr_table_samr,
6592 NDR_SAMR_GETGROUPSFORUSER,
6593 &r);
6595 if (!NT_STATUS_IS_OK(status)) {
6596 return status;
6599 if (DEBUGLEVEL >= 10) {
6600 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r);
6603 if (NT_STATUS_IS_ERR(status)) {
6604 return status;
6607 /* Return variables */
6608 *rids = *r.out.rids;
6610 /* Return result */
6611 return r.out.result;
6614 struct rpccli_samr_QueryDisplayInfo_state {
6615 struct samr_QueryDisplayInfo orig;
6616 struct samr_QueryDisplayInfo tmp;
6617 TALLOC_CTX *out_mem_ctx;
6618 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6621 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq);
6623 struct tevent_req *rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX *mem_ctx,
6624 struct tevent_context *ev,
6625 struct rpc_pipe_client *cli,
6626 struct policy_handle *_domain_handle /* [in] [ref] */,
6627 uint16_t _level /* [in] */,
6628 uint32_t _start_idx /* [in] */,
6629 uint32_t _max_entries /* [in] */,
6630 uint32_t _buf_size /* [in] */,
6631 uint32_t *_total_size /* [out] [ref] */,
6632 uint32_t *_returned_size /* [out] [ref] */,
6633 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
6635 struct tevent_req *req;
6636 struct rpccli_samr_QueryDisplayInfo_state *state;
6637 struct tevent_req *subreq;
6639 req = tevent_req_create(mem_ctx, &state,
6640 struct rpccli_samr_QueryDisplayInfo_state);
6641 if (req == NULL) {
6642 return NULL;
6644 state->out_mem_ctx = NULL;
6645 state->dispatch_recv = cli->dispatch_recv;
6647 /* In parameters */
6648 state->orig.in.domain_handle = _domain_handle;
6649 state->orig.in.level = _level;
6650 state->orig.in.start_idx = _start_idx;
6651 state->orig.in.max_entries = _max_entries;
6652 state->orig.in.buf_size = _buf_size;
6654 /* Out parameters */
6655 state->orig.out.total_size = _total_size;
6656 state->orig.out.returned_size = _returned_size;
6657 state->orig.out.info = _info;
6659 /* Result */
6660 ZERO_STRUCT(state->orig.out.result);
6662 if (DEBUGLEVEL >= 10) {
6663 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &state->orig);
6666 state->out_mem_ctx = talloc_named_const(state, 0,
6667 "rpccli_samr_QueryDisplayInfo_out_memory");
6668 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6669 return tevent_req_post(req, ev);
6672 /* make a temporary copy, that we pass to the dispatch function */
6673 state->tmp = state->orig;
6675 subreq = cli->dispatch_send(state, ev, cli,
6676 &ndr_table_samr,
6677 NDR_SAMR_QUERYDISPLAYINFO,
6678 &state->tmp);
6679 if (tevent_req_nomem(subreq, req)) {
6680 return tevent_req_post(req, ev);
6682 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo_done, req);
6683 return req;
6686 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req *subreq)
6688 struct tevent_req *req = tevent_req_callback_data(
6689 subreq, struct tevent_req);
6690 struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
6691 req, struct rpccli_samr_QueryDisplayInfo_state);
6692 NTSTATUS status;
6693 TALLOC_CTX *mem_ctx;
6695 if (state->out_mem_ctx) {
6696 mem_ctx = state->out_mem_ctx;
6697 } else {
6698 mem_ctx = state;
6701 status = state->dispatch_recv(subreq, mem_ctx);
6702 TALLOC_FREE(subreq);
6703 if (!NT_STATUS_IS_OK(status)) {
6704 tevent_req_nterror(req, status);
6705 return;
6708 /* Copy out parameters */
6709 *state->orig.out.total_size = *state->tmp.out.total_size;
6710 *state->orig.out.returned_size = *state->tmp.out.returned_size;
6711 *state->orig.out.info = *state->tmp.out.info;
6713 /* Copy result */
6714 state->orig.out.result = state->tmp.out.result;
6716 /* Reset temporary structure */
6717 ZERO_STRUCT(state->tmp);
6719 if (DEBUGLEVEL >= 10) {
6720 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &state->orig);
6723 tevent_req_done(req);
6726 NTSTATUS rpccli_samr_QueryDisplayInfo_recv(struct tevent_req *req,
6727 TALLOC_CTX *mem_ctx,
6728 NTSTATUS *result)
6730 struct rpccli_samr_QueryDisplayInfo_state *state = tevent_req_data(
6731 req, struct rpccli_samr_QueryDisplayInfo_state);
6732 NTSTATUS status;
6734 if (tevent_req_is_nterror(req, &status)) {
6735 tevent_req_received(req);
6736 return status;
6739 /* Steal possbile out parameters to the callers context */
6740 talloc_steal(mem_ctx, state->out_mem_ctx);
6742 /* Return result */
6743 *result = state->orig.out.result;
6745 tevent_req_received(req);
6746 return NT_STATUS_OK;
6749 NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
6750 TALLOC_CTX *mem_ctx,
6751 struct policy_handle *domain_handle /* [in] [ref] */,
6752 uint16_t level /* [in] */,
6753 uint32_t start_idx /* [in] */,
6754 uint32_t max_entries /* [in] */,
6755 uint32_t buf_size /* [in] */,
6756 uint32_t *total_size /* [out] [ref] */,
6757 uint32_t *returned_size /* [out] [ref] */,
6758 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
6760 struct samr_QueryDisplayInfo r;
6761 NTSTATUS status;
6763 /* In parameters */
6764 r.in.domain_handle = domain_handle;
6765 r.in.level = level;
6766 r.in.start_idx = start_idx;
6767 r.in.max_entries = max_entries;
6768 r.in.buf_size = buf_size;
6770 if (DEBUGLEVEL >= 10) {
6771 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r);
6774 status = cli->dispatch(cli,
6775 mem_ctx,
6776 &ndr_table_samr,
6777 NDR_SAMR_QUERYDISPLAYINFO,
6778 &r);
6780 if (!NT_STATUS_IS_OK(status)) {
6781 return status;
6784 if (DEBUGLEVEL >= 10) {
6785 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r);
6788 if (NT_STATUS_IS_ERR(status)) {
6789 return status;
6792 /* Return variables */
6793 *total_size = *r.out.total_size;
6794 *returned_size = *r.out.returned_size;
6795 *info = *r.out.info;
6797 /* Return result */
6798 return r.out.result;
6801 struct rpccli_samr_GetDisplayEnumerationIndex_state {
6802 struct samr_GetDisplayEnumerationIndex orig;
6803 struct samr_GetDisplayEnumerationIndex tmp;
6804 TALLOC_CTX *out_mem_ctx;
6805 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6808 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq);
6810 struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX *mem_ctx,
6811 struct tevent_context *ev,
6812 struct rpc_pipe_client *cli,
6813 struct policy_handle *_domain_handle /* [in] [ref] */,
6814 uint16_t _level /* [in] */,
6815 struct lsa_String *_name /* [in] [ref] */,
6816 uint32_t *_idx /* [out] [ref] */)
6818 struct tevent_req *req;
6819 struct rpccli_samr_GetDisplayEnumerationIndex_state *state;
6820 struct tevent_req *subreq;
6822 req = tevent_req_create(mem_ctx, &state,
6823 struct rpccli_samr_GetDisplayEnumerationIndex_state);
6824 if (req == NULL) {
6825 return NULL;
6827 state->out_mem_ctx = NULL;
6828 state->dispatch_recv = cli->dispatch_recv;
6830 /* In parameters */
6831 state->orig.in.domain_handle = _domain_handle;
6832 state->orig.in.level = _level;
6833 state->orig.in.name = _name;
6835 /* Out parameters */
6836 state->orig.out.idx = _idx;
6838 /* Result */
6839 ZERO_STRUCT(state->orig.out.result);
6841 if (DEBUGLEVEL >= 10) {
6842 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &state->orig);
6845 state->out_mem_ctx = talloc_named_const(state, 0,
6846 "rpccli_samr_GetDisplayEnumerationIndex_out_memory");
6847 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6848 return tevent_req_post(req, ev);
6851 /* make a temporary copy, that we pass to the dispatch function */
6852 state->tmp = state->orig;
6854 subreq = cli->dispatch_send(state, ev, cli,
6855 &ndr_table_samr,
6856 NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
6857 &state->tmp);
6858 if (tevent_req_nomem(subreq, req)) {
6859 return tevent_req_post(req, ev);
6861 tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex_done, req);
6862 return req;
6865 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req *subreq)
6867 struct tevent_req *req = tevent_req_callback_data(
6868 subreq, struct tevent_req);
6869 struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
6870 req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
6871 NTSTATUS status;
6872 TALLOC_CTX *mem_ctx;
6874 if (state->out_mem_ctx) {
6875 mem_ctx = state->out_mem_ctx;
6876 } else {
6877 mem_ctx = state;
6880 status = state->dispatch_recv(subreq, mem_ctx);
6881 TALLOC_FREE(subreq);
6882 if (!NT_STATUS_IS_OK(status)) {
6883 tevent_req_nterror(req, status);
6884 return;
6887 /* Copy out parameters */
6888 *state->orig.out.idx = *state->tmp.out.idx;
6890 /* Copy result */
6891 state->orig.out.result = state->tmp.out.result;
6893 /* Reset temporary structure */
6894 ZERO_STRUCT(state->tmp);
6896 if (DEBUGLEVEL >= 10) {
6897 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &state->orig);
6900 tevent_req_done(req);
6903 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req *req,
6904 TALLOC_CTX *mem_ctx,
6905 NTSTATUS *result)
6907 struct rpccli_samr_GetDisplayEnumerationIndex_state *state = tevent_req_data(
6908 req, struct rpccli_samr_GetDisplayEnumerationIndex_state);
6909 NTSTATUS status;
6911 if (tevent_req_is_nterror(req, &status)) {
6912 tevent_req_received(req);
6913 return status;
6916 /* Steal possbile out parameters to the callers context */
6917 talloc_steal(mem_ctx, state->out_mem_ctx);
6919 /* Return result */
6920 *result = state->orig.out.result;
6922 tevent_req_received(req);
6923 return NT_STATUS_OK;
6926 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
6927 TALLOC_CTX *mem_ctx,
6928 struct policy_handle *domain_handle /* [in] [ref] */,
6929 uint16_t level /* [in] */,
6930 struct lsa_String *name /* [in] [ref] */,
6931 uint32_t *idx /* [out] [ref] */)
6933 struct samr_GetDisplayEnumerationIndex r;
6934 NTSTATUS status;
6936 /* In parameters */
6937 r.in.domain_handle = domain_handle;
6938 r.in.level = level;
6939 r.in.name = name;
6941 if (DEBUGLEVEL >= 10) {
6942 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r);
6945 status = cli->dispatch(cli,
6946 mem_ctx,
6947 &ndr_table_samr,
6948 NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
6949 &r);
6951 if (!NT_STATUS_IS_OK(status)) {
6952 return status;
6955 if (DEBUGLEVEL >= 10) {
6956 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r);
6959 if (NT_STATUS_IS_ERR(status)) {
6960 return status;
6963 /* Return variables */
6964 *idx = *r.out.idx;
6966 /* Return result */
6967 return r.out.result;
6970 struct rpccli_samr_TestPrivateFunctionsDomain_state {
6971 struct samr_TestPrivateFunctionsDomain orig;
6972 struct samr_TestPrivateFunctionsDomain tmp;
6973 TALLOC_CTX *out_mem_ctx;
6974 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6977 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq);
6979 struct tevent_req *rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX *mem_ctx,
6980 struct tevent_context *ev,
6981 struct rpc_pipe_client *cli,
6982 struct policy_handle *_domain_handle /* [in] [ref] */)
6984 struct tevent_req *req;
6985 struct rpccli_samr_TestPrivateFunctionsDomain_state *state;
6986 struct tevent_req *subreq;
6988 req = tevent_req_create(mem_ctx, &state,
6989 struct rpccli_samr_TestPrivateFunctionsDomain_state);
6990 if (req == NULL) {
6991 return NULL;
6993 state->out_mem_ctx = NULL;
6994 state->dispatch_recv = cli->dispatch_recv;
6996 /* In parameters */
6997 state->orig.in.domain_handle = _domain_handle;
6999 /* Out parameters */
7001 /* Result */
7002 ZERO_STRUCT(state->orig.out.result);
7004 if (DEBUGLEVEL >= 10) {
7005 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &state->orig);
7008 /* make a temporary copy, that we pass to the dispatch function */
7009 state->tmp = state->orig;
7011 subreq = cli->dispatch_send(state, ev, cli,
7012 &ndr_table_samr,
7013 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
7014 &state->tmp);
7015 if (tevent_req_nomem(subreq, req)) {
7016 return tevent_req_post(req, ev);
7018 tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsDomain_done, req);
7019 return req;
7022 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req *subreq)
7024 struct tevent_req *req = tevent_req_callback_data(
7025 subreq, struct tevent_req);
7026 struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
7027 req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
7028 NTSTATUS status;
7029 TALLOC_CTX *mem_ctx;
7031 if (state->out_mem_ctx) {
7032 mem_ctx = state->out_mem_ctx;
7033 } else {
7034 mem_ctx = state;
7037 status = state->dispatch_recv(subreq, mem_ctx);
7038 TALLOC_FREE(subreq);
7039 if (!NT_STATUS_IS_OK(status)) {
7040 tevent_req_nterror(req, status);
7041 return;
7044 /* Copy out parameters */
7046 /* Copy result */
7047 state->orig.out.result = state->tmp.out.result;
7049 /* Reset temporary structure */
7050 ZERO_STRUCT(state->tmp);
7052 if (DEBUGLEVEL >= 10) {
7053 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &state->orig);
7056 tevent_req_done(req);
7059 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req *req,
7060 TALLOC_CTX *mem_ctx,
7061 NTSTATUS *result)
7063 struct rpccli_samr_TestPrivateFunctionsDomain_state *state = tevent_req_data(
7064 req, struct rpccli_samr_TestPrivateFunctionsDomain_state);
7065 NTSTATUS status;
7067 if (tevent_req_is_nterror(req, &status)) {
7068 tevent_req_received(req);
7069 return status;
7072 /* Steal possbile out parameters to the callers context */
7073 talloc_steal(mem_ctx, state->out_mem_ctx);
7075 /* Return result */
7076 *result = state->orig.out.result;
7078 tevent_req_received(req);
7079 return NT_STATUS_OK;
7082 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
7083 TALLOC_CTX *mem_ctx,
7084 struct policy_handle *domain_handle /* [in] [ref] */)
7086 struct samr_TestPrivateFunctionsDomain r;
7087 NTSTATUS status;
7089 /* In parameters */
7090 r.in.domain_handle = domain_handle;
7092 if (DEBUGLEVEL >= 10) {
7093 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r);
7096 status = cli->dispatch(cli,
7097 mem_ctx,
7098 &ndr_table_samr,
7099 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
7100 &r);
7102 if (!NT_STATUS_IS_OK(status)) {
7103 return status;
7106 if (DEBUGLEVEL >= 10) {
7107 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r);
7110 if (NT_STATUS_IS_ERR(status)) {
7111 return status;
7114 /* Return variables */
7116 /* Return result */
7117 return r.out.result;
7120 struct rpccli_samr_TestPrivateFunctionsUser_state {
7121 struct samr_TestPrivateFunctionsUser orig;
7122 struct samr_TestPrivateFunctionsUser tmp;
7123 TALLOC_CTX *out_mem_ctx;
7124 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7127 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq);
7129 struct tevent_req *rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX *mem_ctx,
7130 struct tevent_context *ev,
7131 struct rpc_pipe_client *cli,
7132 struct policy_handle *_user_handle /* [in] [ref] */)
7134 struct tevent_req *req;
7135 struct rpccli_samr_TestPrivateFunctionsUser_state *state;
7136 struct tevent_req *subreq;
7138 req = tevent_req_create(mem_ctx, &state,
7139 struct rpccli_samr_TestPrivateFunctionsUser_state);
7140 if (req == NULL) {
7141 return NULL;
7143 state->out_mem_ctx = NULL;
7144 state->dispatch_recv = cli->dispatch_recv;
7146 /* In parameters */
7147 state->orig.in.user_handle = _user_handle;
7149 /* Out parameters */
7151 /* Result */
7152 ZERO_STRUCT(state->orig.out.result);
7154 if (DEBUGLEVEL >= 10) {
7155 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &state->orig);
7158 /* make a temporary copy, that we pass to the dispatch function */
7159 state->tmp = state->orig;
7161 subreq = cli->dispatch_send(state, ev, cli,
7162 &ndr_table_samr,
7163 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
7164 &state->tmp);
7165 if (tevent_req_nomem(subreq, req)) {
7166 return tevent_req_post(req, ev);
7168 tevent_req_set_callback(subreq, rpccli_samr_TestPrivateFunctionsUser_done, req);
7169 return req;
7172 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req *subreq)
7174 struct tevent_req *req = tevent_req_callback_data(
7175 subreq, struct tevent_req);
7176 struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
7177 req, struct rpccli_samr_TestPrivateFunctionsUser_state);
7178 NTSTATUS status;
7179 TALLOC_CTX *mem_ctx;
7181 if (state->out_mem_ctx) {
7182 mem_ctx = state->out_mem_ctx;
7183 } else {
7184 mem_ctx = state;
7187 status = state->dispatch_recv(subreq, mem_ctx);
7188 TALLOC_FREE(subreq);
7189 if (!NT_STATUS_IS_OK(status)) {
7190 tevent_req_nterror(req, status);
7191 return;
7194 /* Copy out parameters */
7196 /* Copy result */
7197 state->orig.out.result = state->tmp.out.result;
7199 /* Reset temporary structure */
7200 ZERO_STRUCT(state->tmp);
7202 if (DEBUGLEVEL >= 10) {
7203 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &state->orig);
7206 tevent_req_done(req);
7209 NTSTATUS rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req *req,
7210 TALLOC_CTX *mem_ctx,
7211 NTSTATUS *result)
7213 struct rpccli_samr_TestPrivateFunctionsUser_state *state = tevent_req_data(
7214 req, struct rpccli_samr_TestPrivateFunctionsUser_state);
7215 NTSTATUS status;
7217 if (tevent_req_is_nterror(req, &status)) {
7218 tevent_req_received(req);
7219 return status;
7222 /* Steal possbile out parameters to the callers context */
7223 talloc_steal(mem_ctx, state->out_mem_ctx);
7225 /* Return result */
7226 *result = state->orig.out.result;
7228 tevent_req_received(req);
7229 return NT_STATUS_OK;
7232 NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
7233 TALLOC_CTX *mem_ctx,
7234 struct policy_handle *user_handle /* [in] [ref] */)
7236 struct samr_TestPrivateFunctionsUser r;
7237 NTSTATUS status;
7239 /* In parameters */
7240 r.in.user_handle = user_handle;
7242 if (DEBUGLEVEL >= 10) {
7243 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r);
7246 status = cli->dispatch(cli,
7247 mem_ctx,
7248 &ndr_table_samr,
7249 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
7250 &r);
7252 if (!NT_STATUS_IS_OK(status)) {
7253 return status;
7256 if (DEBUGLEVEL >= 10) {
7257 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r);
7260 if (NT_STATUS_IS_ERR(status)) {
7261 return status;
7264 /* Return variables */
7266 /* Return result */
7267 return r.out.result;
7270 struct rpccli_samr_GetUserPwInfo_state {
7271 struct samr_GetUserPwInfo orig;
7272 struct samr_GetUserPwInfo tmp;
7273 TALLOC_CTX *out_mem_ctx;
7274 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7277 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq);
7279 struct tevent_req *rpccli_samr_GetUserPwInfo_send(TALLOC_CTX *mem_ctx,
7280 struct tevent_context *ev,
7281 struct rpc_pipe_client *cli,
7282 struct policy_handle *_user_handle /* [in] [ref] */,
7283 struct samr_PwInfo *_info /* [out] [ref] */)
7285 struct tevent_req *req;
7286 struct rpccli_samr_GetUserPwInfo_state *state;
7287 struct tevent_req *subreq;
7289 req = tevent_req_create(mem_ctx, &state,
7290 struct rpccli_samr_GetUserPwInfo_state);
7291 if (req == NULL) {
7292 return NULL;
7294 state->out_mem_ctx = NULL;
7295 state->dispatch_recv = cli->dispatch_recv;
7297 /* In parameters */
7298 state->orig.in.user_handle = _user_handle;
7300 /* Out parameters */
7301 state->orig.out.info = _info;
7303 /* Result */
7304 ZERO_STRUCT(state->orig.out.result);
7306 if (DEBUGLEVEL >= 10) {
7307 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &state->orig);
7310 state->out_mem_ctx = talloc_named_const(state, 0,
7311 "rpccli_samr_GetUserPwInfo_out_memory");
7312 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7313 return tevent_req_post(req, ev);
7316 /* make a temporary copy, that we pass to the dispatch function */
7317 state->tmp = state->orig;
7319 subreq = cli->dispatch_send(state, ev, cli,
7320 &ndr_table_samr,
7321 NDR_SAMR_GETUSERPWINFO,
7322 &state->tmp);
7323 if (tevent_req_nomem(subreq, req)) {
7324 return tevent_req_post(req, ev);
7326 tevent_req_set_callback(subreq, rpccli_samr_GetUserPwInfo_done, req);
7327 return req;
7330 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req *subreq)
7332 struct tevent_req *req = tevent_req_callback_data(
7333 subreq, struct tevent_req);
7334 struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
7335 req, struct rpccli_samr_GetUserPwInfo_state);
7336 NTSTATUS status;
7337 TALLOC_CTX *mem_ctx;
7339 if (state->out_mem_ctx) {
7340 mem_ctx = state->out_mem_ctx;
7341 } else {
7342 mem_ctx = state;
7345 status = state->dispatch_recv(subreq, mem_ctx);
7346 TALLOC_FREE(subreq);
7347 if (!NT_STATUS_IS_OK(status)) {
7348 tevent_req_nterror(req, status);
7349 return;
7352 /* Copy out parameters */
7353 *state->orig.out.info = *state->tmp.out.info;
7355 /* Copy result */
7356 state->orig.out.result = state->tmp.out.result;
7358 /* Reset temporary structure */
7359 ZERO_STRUCT(state->tmp);
7361 if (DEBUGLEVEL >= 10) {
7362 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &state->orig);
7365 tevent_req_done(req);
7368 NTSTATUS rpccli_samr_GetUserPwInfo_recv(struct tevent_req *req,
7369 TALLOC_CTX *mem_ctx,
7370 NTSTATUS *result)
7372 struct rpccli_samr_GetUserPwInfo_state *state = tevent_req_data(
7373 req, struct rpccli_samr_GetUserPwInfo_state);
7374 NTSTATUS status;
7376 if (tevent_req_is_nterror(req, &status)) {
7377 tevent_req_received(req);
7378 return status;
7381 /* Steal possbile out parameters to the callers context */
7382 talloc_steal(mem_ctx, state->out_mem_ctx);
7384 /* Return result */
7385 *result = state->orig.out.result;
7387 tevent_req_received(req);
7388 return NT_STATUS_OK;
7391 NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
7392 TALLOC_CTX *mem_ctx,
7393 struct policy_handle *user_handle /* [in] [ref] */,
7394 struct samr_PwInfo *info /* [out] [ref] */)
7396 struct samr_GetUserPwInfo r;
7397 NTSTATUS status;
7399 /* In parameters */
7400 r.in.user_handle = user_handle;
7402 if (DEBUGLEVEL >= 10) {
7403 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r);
7406 status = cli->dispatch(cli,
7407 mem_ctx,
7408 &ndr_table_samr,
7409 NDR_SAMR_GETUSERPWINFO,
7410 &r);
7412 if (!NT_STATUS_IS_OK(status)) {
7413 return status;
7416 if (DEBUGLEVEL >= 10) {
7417 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r);
7420 if (NT_STATUS_IS_ERR(status)) {
7421 return status;
7424 /* Return variables */
7425 *info = *r.out.info;
7427 /* Return result */
7428 return r.out.result;
7431 struct rpccli_samr_RemoveMemberFromForeignDomain_state {
7432 struct samr_RemoveMemberFromForeignDomain orig;
7433 struct samr_RemoveMemberFromForeignDomain tmp;
7434 TALLOC_CTX *out_mem_ctx;
7435 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7438 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq);
7440 struct tevent_req *rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX *mem_ctx,
7441 struct tevent_context *ev,
7442 struct rpc_pipe_client *cli,
7443 struct policy_handle *_domain_handle /* [in] [ref] */,
7444 struct dom_sid2 *_sid /* [in] [ref] */)
7446 struct tevent_req *req;
7447 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state;
7448 struct tevent_req *subreq;
7450 req = tevent_req_create(mem_ctx, &state,
7451 struct rpccli_samr_RemoveMemberFromForeignDomain_state);
7452 if (req == NULL) {
7453 return NULL;
7455 state->out_mem_ctx = NULL;
7456 state->dispatch_recv = cli->dispatch_recv;
7458 /* In parameters */
7459 state->orig.in.domain_handle = _domain_handle;
7460 state->orig.in.sid = _sid;
7462 /* Out parameters */
7464 /* Result */
7465 ZERO_STRUCT(state->orig.out.result);
7467 if (DEBUGLEVEL >= 10) {
7468 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &state->orig);
7471 /* make a temporary copy, that we pass to the dispatch function */
7472 state->tmp = state->orig;
7474 subreq = cli->dispatch_send(state, ev, cli,
7475 &ndr_table_samr,
7476 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
7477 &state->tmp);
7478 if (tevent_req_nomem(subreq, req)) {
7479 return tevent_req_post(req, ev);
7481 tevent_req_set_callback(subreq, rpccli_samr_RemoveMemberFromForeignDomain_done, req);
7482 return req;
7485 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req *subreq)
7487 struct tevent_req *req = tevent_req_callback_data(
7488 subreq, struct tevent_req);
7489 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
7490 req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
7491 NTSTATUS status;
7492 TALLOC_CTX *mem_ctx;
7494 if (state->out_mem_ctx) {
7495 mem_ctx = state->out_mem_ctx;
7496 } else {
7497 mem_ctx = state;
7500 status = state->dispatch_recv(subreq, mem_ctx);
7501 TALLOC_FREE(subreq);
7502 if (!NT_STATUS_IS_OK(status)) {
7503 tevent_req_nterror(req, status);
7504 return;
7507 /* Copy out parameters */
7509 /* Copy result */
7510 state->orig.out.result = state->tmp.out.result;
7512 /* Reset temporary structure */
7513 ZERO_STRUCT(state->tmp);
7515 if (DEBUGLEVEL >= 10) {
7516 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &state->orig);
7519 tevent_req_done(req);
7522 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req *req,
7523 TALLOC_CTX *mem_ctx,
7524 NTSTATUS *result)
7526 struct rpccli_samr_RemoveMemberFromForeignDomain_state *state = tevent_req_data(
7527 req, struct rpccli_samr_RemoveMemberFromForeignDomain_state);
7528 NTSTATUS status;
7530 if (tevent_req_is_nterror(req, &status)) {
7531 tevent_req_received(req);
7532 return status;
7535 /* Steal possbile out parameters to the callers context */
7536 talloc_steal(mem_ctx, state->out_mem_ctx);
7538 /* Return result */
7539 *result = state->orig.out.result;
7541 tevent_req_received(req);
7542 return NT_STATUS_OK;
7545 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
7546 TALLOC_CTX *mem_ctx,
7547 struct policy_handle *domain_handle /* [in] [ref] */,
7548 struct dom_sid2 *sid /* [in] [ref] */)
7550 struct samr_RemoveMemberFromForeignDomain r;
7551 NTSTATUS status;
7553 /* In parameters */
7554 r.in.domain_handle = domain_handle;
7555 r.in.sid = sid;
7557 if (DEBUGLEVEL >= 10) {
7558 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
7561 status = cli->dispatch(cli,
7562 mem_ctx,
7563 &ndr_table_samr,
7564 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
7565 &r);
7567 if (!NT_STATUS_IS_OK(status)) {
7568 return status;
7571 if (DEBUGLEVEL >= 10) {
7572 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
7575 if (NT_STATUS_IS_ERR(status)) {
7576 return status;
7579 /* Return variables */
7581 /* Return result */
7582 return r.out.result;
7585 struct rpccli_samr_QueryDomainInfo2_state {
7586 struct samr_QueryDomainInfo2 orig;
7587 struct samr_QueryDomainInfo2 tmp;
7588 TALLOC_CTX *out_mem_ctx;
7589 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7592 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq);
7594 struct tevent_req *rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX *mem_ctx,
7595 struct tevent_context *ev,
7596 struct rpc_pipe_client *cli,
7597 struct policy_handle *_domain_handle /* [in] [ref] */,
7598 enum samr_DomainInfoClass _level /* [in] */,
7599 union samr_DomainInfo **_info /* [out] [ref,switch_is(level)] */)
7601 struct tevent_req *req;
7602 struct rpccli_samr_QueryDomainInfo2_state *state;
7603 struct tevent_req *subreq;
7605 req = tevent_req_create(mem_ctx, &state,
7606 struct rpccli_samr_QueryDomainInfo2_state);
7607 if (req == NULL) {
7608 return NULL;
7610 state->out_mem_ctx = NULL;
7611 state->dispatch_recv = cli->dispatch_recv;
7613 /* In parameters */
7614 state->orig.in.domain_handle = _domain_handle;
7615 state->orig.in.level = _level;
7617 /* Out parameters */
7618 state->orig.out.info = _info;
7620 /* Result */
7621 ZERO_STRUCT(state->orig.out.result);
7623 if (DEBUGLEVEL >= 10) {
7624 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &state->orig);
7627 state->out_mem_ctx = talloc_named_const(state, 0,
7628 "rpccli_samr_QueryDomainInfo2_out_memory");
7629 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7630 return tevent_req_post(req, ev);
7633 /* make a temporary copy, that we pass to the dispatch function */
7634 state->tmp = state->orig;
7636 subreq = cli->dispatch_send(state, ev, cli,
7637 &ndr_table_samr,
7638 NDR_SAMR_QUERYDOMAININFO2,
7639 &state->tmp);
7640 if (tevent_req_nomem(subreq, req)) {
7641 return tevent_req_post(req, ev);
7643 tevent_req_set_callback(subreq, rpccli_samr_QueryDomainInfo2_done, req);
7644 return req;
7647 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req *subreq)
7649 struct tevent_req *req = tevent_req_callback_data(
7650 subreq, struct tevent_req);
7651 struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
7652 req, struct rpccli_samr_QueryDomainInfo2_state);
7653 NTSTATUS status;
7654 TALLOC_CTX *mem_ctx;
7656 if (state->out_mem_ctx) {
7657 mem_ctx = state->out_mem_ctx;
7658 } else {
7659 mem_ctx = state;
7662 status = state->dispatch_recv(subreq, mem_ctx);
7663 TALLOC_FREE(subreq);
7664 if (!NT_STATUS_IS_OK(status)) {
7665 tevent_req_nterror(req, status);
7666 return;
7669 /* Copy out parameters */
7670 *state->orig.out.info = *state->tmp.out.info;
7672 /* Copy result */
7673 state->orig.out.result = state->tmp.out.result;
7675 /* Reset temporary structure */
7676 ZERO_STRUCT(state->tmp);
7678 if (DEBUGLEVEL >= 10) {
7679 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &state->orig);
7682 tevent_req_done(req);
7685 NTSTATUS rpccli_samr_QueryDomainInfo2_recv(struct tevent_req *req,
7686 TALLOC_CTX *mem_ctx,
7687 NTSTATUS *result)
7689 struct rpccli_samr_QueryDomainInfo2_state *state = tevent_req_data(
7690 req, struct rpccli_samr_QueryDomainInfo2_state);
7691 NTSTATUS status;
7693 if (tevent_req_is_nterror(req, &status)) {
7694 tevent_req_received(req);
7695 return status;
7698 /* Steal possbile out parameters to the callers context */
7699 talloc_steal(mem_ctx, state->out_mem_ctx);
7701 /* Return result */
7702 *result = state->orig.out.result;
7704 tevent_req_received(req);
7705 return NT_STATUS_OK;
7708 NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
7709 TALLOC_CTX *mem_ctx,
7710 struct policy_handle *domain_handle /* [in] [ref] */,
7711 enum samr_DomainInfoClass level /* [in] */,
7712 union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
7714 struct samr_QueryDomainInfo2 r;
7715 NTSTATUS status;
7717 /* In parameters */
7718 r.in.domain_handle = domain_handle;
7719 r.in.level = level;
7721 if (DEBUGLEVEL >= 10) {
7722 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r);
7725 status = cli->dispatch(cli,
7726 mem_ctx,
7727 &ndr_table_samr,
7728 NDR_SAMR_QUERYDOMAININFO2,
7729 &r);
7731 if (!NT_STATUS_IS_OK(status)) {
7732 return status;
7735 if (DEBUGLEVEL >= 10) {
7736 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r);
7739 if (NT_STATUS_IS_ERR(status)) {
7740 return status;
7743 /* Return variables */
7744 *info = *r.out.info;
7746 /* Return result */
7747 return r.out.result;
7750 struct rpccli_samr_QueryUserInfo2_state {
7751 struct samr_QueryUserInfo2 orig;
7752 struct samr_QueryUserInfo2 tmp;
7753 TALLOC_CTX *out_mem_ctx;
7754 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7757 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq);
7759 struct tevent_req *rpccli_samr_QueryUserInfo2_send(TALLOC_CTX *mem_ctx,
7760 struct tevent_context *ev,
7761 struct rpc_pipe_client *cli,
7762 struct policy_handle *_user_handle /* [in] [ref] */,
7763 enum samr_UserInfoLevel _level /* [in] */,
7764 union samr_UserInfo **_info /* [out] [ref,switch_is(level)] */)
7766 struct tevent_req *req;
7767 struct rpccli_samr_QueryUserInfo2_state *state;
7768 struct tevent_req *subreq;
7770 req = tevent_req_create(mem_ctx, &state,
7771 struct rpccli_samr_QueryUserInfo2_state);
7772 if (req == NULL) {
7773 return NULL;
7775 state->out_mem_ctx = NULL;
7776 state->dispatch_recv = cli->dispatch_recv;
7778 /* In parameters */
7779 state->orig.in.user_handle = _user_handle;
7780 state->orig.in.level = _level;
7782 /* Out parameters */
7783 state->orig.out.info = _info;
7785 /* Result */
7786 ZERO_STRUCT(state->orig.out.result);
7788 if (DEBUGLEVEL >= 10) {
7789 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &state->orig);
7792 state->out_mem_ctx = talloc_named_const(state, 0,
7793 "rpccli_samr_QueryUserInfo2_out_memory");
7794 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7795 return tevent_req_post(req, ev);
7798 /* make a temporary copy, that we pass to the dispatch function */
7799 state->tmp = state->orig;
7801 subreq = cli->dispatch_send(state, ev, cli,
7802 &ndr_table_samr,
7803 NDR_SAMR_QUERYUSERINFO2,
7804 &state->tmp);
7805 if (tevent_req_nomem(subreq, req)) {
7806 return tevent_req_post(req, ev);
7808 tevent_req_set_callback(subreq, rpccli_samr_QueryUserInfo2_done, req);
7809 return req;
7812 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req *subreq)
7814 struct tevent_req *req = tevent_req_callback_data(
7815 subreq, struct tevent_req);
7816 struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
7817 req, struct rpccli_samr_QueryUserInfo2_state);
7818 NTSTATUS status;
7819 TALLOC_CTX *mem_ctx;
7821 if (state->out_mem_ctx) {
7822 mem_ctx = state->out_mem_ctx;
7823 } else {
7824 mem_ctx = state;
7827 status = state->dispatch_recv(subreq, mem_ctx);
7828 TALLOC_FREE(subreq);
7829 if (!NT_STATUS_IS_OK(status)) {
7830 tevent_req_nterror(req, status);
7831 return;
7834 /* Copy out parameters */
7835 *state->orig.out.info = *state->tmp.out.info;
7837 /* Copy result */
7838 state->orig.out.result = state->tmp.out.result;
7840 /* Reset temporary structure */
7841 ZERO_STRUCT(state->tmp);
7843 if (DEBUGLEVEL >= 10) {
7844 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &state->orig);
7847 tevent_req_done(req);
7850 NTSTATUS rpccli_samr_QueryUserInfo2_recv(struct tevent_req *req,
7851 TALLOC_CTX *mem_ctx,
7852 NTSTATUS *result)
7854 struct rpccli_samr_QueryUserInfo2_state *state = tevent_req_data(
7855 req, struct rpccli_samr_QueryUserInfo2_state);
7856 NTSTATUS status;
7858 if (tevent_req_is_nterror(req, &status)) {
7859 tevent_req_received(req);
7860 return status;
7863 /* Steal possbile out parameters to the callers context */
7864 talloc_steal(mem_ctx, state->out_mem_ctx);
7866 /* Return result */
7867 *result = state->orig.out.result;
7869 tevent_req_received(req);
7870 return NT_STATUS_OK;
7873 NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
7874 TALLOC_CTX *mem_ctx,
7875 struct policy_handle *user_handle /* [in] [ref] */,
7876 enum samr_UserInfoLevel level /* [in] */,
7877 union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
7879 struct samr_QueryUserInfo2 r;
7880 NTSTATUS status;
7882 /* In parameters */
7883 r.in.user_handle = user_handle;
7884 r.in.level = level;
7886 if (DEBUGLEVEL >= 10) {
7887 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r);
7890 status = cli->dispatch(cli,
7891 mem_ctx,
7892 &ndr_table_samr,
7893 NDR_SAMR_QUERYUSERINFO2,
7894 &r);
7896 if (!NT_STATUS_IS_OK(status)) {
7897 return status;
7900 if (DEBUGLEVEL >= 10) {
7901 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r);
7904 if (NT_STATUS_IS_ERR(status)) {
7905 return status;
7908 /* Return variables */
7909 *info = *r.out.info;
7911 /* Return result */
7912 return r.out.result;
7915 struct rpccli_samr_QueryDisplayInfo2_state {
7916 struct samr_QueryDisplayInfo2 orig;
7917 struct samr_QueryDisplayInfo2 tmp;
7918 TALLOC_CTX *out_mem_ctx;
7919 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7922 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq);
7924 struct tevent_req *rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX *mem_ctx,
7925 struct tevent_context *ev,
7926 struct rpc_pipe_client *cli,
7927 struct policy_handle *_domain_handle /* [in] [ref] */,
7928 uint16_t _level /* [in] */,
7929 uint32_t _start_idx /* [in] */,
7930 uint32_t _max_entries /* [in] */,
7931 uint32_t _buf_size /* [in] */,
7932 uint32_t *_total_size /* [out] [ref] */,
7933 uint32_t *_returned_size /* [out] [ref] */,
7934 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
7936 struct tevent_req *req;
7937 struct rpccli_samr_QueryDisplayInfo2_state *state;
7938 struct tevent_req *subreq;
7940 req = tevent_req_create(mem_ctx, &state,
7941 struct rpccli_samr_QueryDisplayInfo2_state);
7942 if (req == NULL) {
7943 return NULL;
7945 state->out_mem_ctx = NULL;
7946 state->dispatch_recv = cli->dispatch_recv;
7948 /* In parameters */
7949 state->orig.in.domain_handle = _domain_handle;
7950 state->orig.in.level = _level;
7951 state->orig.in.start_idx = _start_idx;
7952 state->orig.in.max_entries = _max_entries;
7953 state->orig.in.buf_size = _buf_size;
7955 /* Out parameters */
7956 state->orig.out.total_size = _total_size;
7957 state->orig.out.returned_size = _returned_size;
7958 state->orig.out.info = _info;
7960 /* Result */
7961 ZERO_STRUCT(state->orig.out.result);
7963 if (DEBUGLEVEL >= 10) {
7964 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &state->orig);
7967 state->out_mem_ctx = talloc_named_const(state, 0,
7968 "rpccli_samr_QueryDisplayInfo2_out_memory");
7969 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7970 return tevent_req_post(req, ev);
7973 /* make a temporary copy, that we pass to the dispatch function */
7974 state->tmp = state->orig;
7976 subreq = cli->dispatch_send(state, ev, cli,
7977 &ndr_table_samr,
7978 NDR_SAMR_QUERYDISPLAYINFO2,
7979 &state->tmp);
7980 if (tevent_req_nomem(subreq, req)) {
7981 return tevent_req_post(req, ev);
7983 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo2_done, req);
7984 return req;
7987 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req *subreq)
7989 struct tevent_req *req = tevent_req_callback_data(
7990 subreq, struct tevent_req);
7991 struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
7992 req, struct rpccli_samr_QueryDisplayInfo2_state);
7993 NTSTATUS status;
7994 TALLOC_CTX *mem_ctx;
7996 if (state->out_mem_ctx) {
7997 mem_ctx = state->out_mem_ctx;
7998 } else {
7999 mem_ctx = state;
8002 status = state->dispatch_recv(subreq, mem_ctx);
8003 TALLOC_FREE(subreq);
8004 if (!NT_STATUS_IS_OK(status)) {
8005 tevent_req_nterror(req, status);
8006 return;
8009 /* Copy out parameters */
8010 *state->orig.out.total_size = *state->tmp.out.total_size;
8011 *state->orig.out.returned_size = *state->tmp.out.returned_size;
8012 *state->orig.out.info = *state->tmp.out.info;
8014 /* Copy result */
8015 state->orig.out.result = state->tmp.out.result;
8017 /* Reset temporary structure */
8018 ZERO_STRUCT(state->tmp);
8020 if (DEBUGLEVEL >= 10) {
8021 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &state->orig);
8024 tevent_req_done(req);
8027 NTSTATUS rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req *req,
8028 TALLOC_CTX *mem_ctx,
8029 NTSTATUS *result)
8031 struct rpccli_samr_QueryDisplayInfo2_state *state = tevent_req_data(
8032 req, struct rpccli_samr_QueryDisplayInfo2_state);
8033 NTSTATUS status;
8035 if (tevent_req_is_nterror(req, &status)) {
8036 tevent_req_received(req);
8037 return status;
8040 /* Steal possbile out parameters to the callers context */
8041 talloc_steal(mem_ctx, state->out_mem_ctx);
8043 /* Return result */
8044 *result = state->orig.out.result;
8046 tevent_req_received(req);
8047 return NT_STATUS_OK;
8050 NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
8051 TALLOC_CTX *mem_ctx,
8052 struct policy_handle *domain_handle /* [in] [ref] */,
8053 uint16_t level /* [in] */,
8054 uint32_t start_idx /* [in] */,
8055 uint32_t max_entries /* [in] */,
8056 uint32_t buf_size /* [in] */,
8057 uint32_t *total_size /* [out] [ref] */,
8058 uint32_t *returned_size /* [out] [ref] */,
8059 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
8061 struct samr_QueryDisplayInfo2 r;
8062 NTSTATUS status;
8064 /* In parameters */
8065 r.in.domain_handle = domain_handle;
8066 r.in.level = level;
8067 r.in.start_idx = start_idx;
8068 r.in.max_entries = max_entries;
8069 r.in.buf_size = buf_size;
8071 if (DEBUGLEVEL >= 10) {
8072 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r);
8075 status = cli->dispatch(cli,
8076 mem_ctx,
8077 &ndr_table_samr,
8078 NDR_SAMR_QUERYDISPLAYINFO2,
8079 &r);
8081 if (!NT_STATUS_IS_OK(status)) {
8082 return status;
8085 if (DEBUGLEVEL >= 10) {
8086 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r);
8089 if (NT_STATUS_IS_ERR(status)) {
8090 return status;
8093 /* Return variables */
8094 *total_size = *r.out.total_size;
8095 *returned_size = *r.out.returned_size;
8096 *info = *r.out.info;
8098 /* Return result */
8099 return r.out.result;
8102 struct rpccli_samr_GetDisplayEnumerationIndex2_state {
8103 struct samr_GetDisplayEnumerationIndex2 orig;
8104 struct samr_GetDisplayEnumerationIndex2 tmp;
8105 TALLOC_CTX *out_mem_ctx;
8106 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8109 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq);
8111 struct tevent_req *rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX *mem_ctx,
8112 struct tevent_context *ev,
8113 struct rpc_pipe_client *cli,
8114 struct policy_handle *_domain_handle /* [in] [ref] */,
8115 uint16_t _level /* [in] */,
8116 struct lsa_String *_name /* [in] [ref] */,
8117 uint32_t *_idx /* [out] [ref] */)
8119 struct tevent_req *req;
8120 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state;
8121 struct tevent_req *subreq;
8123 req = tevent_req_create(mem_ctx, &state,
8124 struct rpccli_samr_GetDisplayEnumerationIndex2_state);
8125 if (req == NULL) {
8126 return NULL;
8128 state->out_mem_ctx = NULL;
8129 state->dispatch_recv = cli->dispatch_recv;
8131 /* In parameters */
8132 state->orig.in.domain_handle = _domain_handle;
8133 state->orig.in.level = _level;
8134 state->orig.in.name = _name;
8136 /* Out parameters */
8137 state->orig.out.idx = _idx;
8139 /* Result */
8140 ZERO_STRUCT(state->orig.out.result);
8142 if (DEBUGLEVEL >= 10) {
8143 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &state->orig);
8146 state->out_mem_ctx = talloc_named_const(state, 0,
8147 "rpccli_samr_GetDisplayEnumerationIndex2_out_memory");
8148 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8149 return tevent_req_post(req, ev);
8152 /* make a temporary copy, that we pass to the dispatch function */
8153 state->tmp = state->orig;
8155 subreq = cli->dispatch_send(state, ev, cli,
8156 &ndr_table_samr,
8157 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
8158 &state->tmp);
8159 if (tevent_req_nomem(subreq, req)) {
8160 return tevent_req_post(req, ev);
8162 tevent_req_set_callback(subreq, rpccli_samr_GetDisplayEnumerationIndex2_done, req);
8163 return req;
8166 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req *subreq)
8168 struct tevent_req *req = tevent_req_callback_data(
8169 subreq, struct tevent_req);
8170 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
8171 req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
8172 NTSTATUS status;
8173 TALLOC_CTX *mem_ctx;
8175 if (state->out_mem_ctx) {
8176 mem_ctx = state->out_mem_ctx;
8177 } else {
8178 mem_ctx = state;
8181 status = state->dispatch_recv(subreq, mem_ctx);
8182 TALLOC_FREE(subreq);
8183 if (!NT_STATUS_IS_OK(status)) {
8184 tevent_req_nterror(req, status);
8185 return;
8188 /* Copy out parameters */
8189 *state->orig.out.idx = *state->tmp.out.idx;
8191 /* Copy result */
8192 state->orig.out.result = state->tmp.out.result;
8194 /* Reset temporary structure */
8195 ZERO_STRUCT(state->tmp);
8197 if (DEBUGLEVEL >= 10) {
8198 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &state->orig);
8201 tevent_req_done(req);
8204 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req *req,
8205 TALLOC_CTX *mem_ctx,
8206 NTSTATUS *result)
8208 struct rpccli_samr_GetDisplayEnumerationIndex2_state *state = tevent_req_data(
8209 req, struct rpccli_samr_GetDisplayEnumerationIndex2_state);
8210 NTSTATUS status;
8212 if (tevent_req_is_nterror(req, &status)) {
8213 tevent_req_received(req);
8214 return status;
8217 /* Steal possbile out parameters to the callers context */
8218 talloc_steal(mem_ctx, state->out_mem_ctx);
8220 /* Return result */
8221 *result = state->orig.out.result;
8223 tevent_req_received(req);
8224 return NT_STATUS_OK;
8227 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
8228 TALLOC_CTX *mem_ctx,
8229 struct policy_handle *domain_handle /* [in] [ref] */,
8230 uint16_t level /* [in] */,
8231 struct lsa_String *name /* [in] [ref] */,
8232 uint32_t *idx /* [out] [ref] */)
8234 struct samr_GetDisplayEnumerationIndex2 r;
8235 NTSTATUS status;
8237 /* In parameters */
8238 r.in.domain_handle = domain_handle;
8239 r.in.level = level;
8240 r.in.name = name;
8242 if (DEBUGLEVEL >= 10) {
8243 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
8246 status = cli->dispatch(cli,
8247 mem_ctx,
8248 &ndr_table_samr,
8249 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
8250 &r);
8252 if (!NT_STATUS_IS_OK(status)) {
8253 return status;
8256 if (DEBUGLEVEL >= 10) {
8257 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
8260 if (NT_STATUS_IS_ERR(status)) {
8261 return status;
8264 /* Return variables */
8265 *idx = *r.out.idx;
8267 /* Return result */
8268 return r.out.result;
8271 struct rpccli_samr_CreateUser2_state {
8272 struct samr_CreateUser2 orig;
8273 struct samr_CreateUser2 tmp;
8274 TALLOC_CTX *out_mem_ctx;
8275 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8278 static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq);
8280 struct tevent_req *rpccli_samr_CreateUser2_send(TALLOC_CTX *mem_ctx,
8281 struct tevent_context *ev,
8282 struct rpc_pipe_client *cli,
8283 struct policy_handle *_domain_handle /* [in] [ref] */,
8284 struct lsa_String *_account_name /* [in] [ref] */,
8285 uint32_t _acct_flags /* [in] */,
8286 uint32_t _access_mask /* [in] */,
8287 struct policy_handle *_user_handle /* [out] [ref] */,
8288 uint32_t *_access_granted /* [out] [ref] */,
8289 uint32_t *_rid /* [out] [ref] */)
8291 struct tevent_req *req;
8292 struct rpccli_samr_CreateUser2_state *state;
8293 struct tevent_req *subreq;
8295 req = tevent_req_create(mem_ctx, &state,
8296 struct rpccli_samr_CreateUser2_state);
8297 if (req == NULL) {
8298 return NULL;
8300 state->out_mem_ctx = NULL;
8301 state->dispatch_recv = cli->dispatch_recv;
8303 /* In parameters */
8304 state->orig.in.domain_handle = _domain_handle;
8305 state->orig.in.account_name = _account_name;
8306 state->orig.in.acct_flags = _acct_flags;
8307 state->orig.in.access_mask = _access_mask;
8309 /* Out parameters */
8310 state->orig.out.user_handle = _user_handle;
8311 state->orig.out.access_granted = _access_granted;
8312 state->orig.out.rid = _rid;
8314 /* Result */
8315 ZERO_STRUCT(state->orig.out.result);
8317 if (DEBUGLEVEL >= 10) {
8318 NDR_PRINT_IN_DEBUG(samr_CreateUser2, &state->orig);
8321 state->out_mem_ctx = talloc_named_const(state, 0,
8322 "rpccli_samr_CreateUser2_out_memory");
8323 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8324 return tevent_req_post(req, ev);
8327 /* make a temporary copy, that we pass to the dispatch function */
8328 state->tmp = state->orig;
8330 subreq = cli->dispatch_send(state, ev, cli,
8331 &ndr_table_samr,
8332 NDR_SAMR_CREATEUSER2,
8333 &state->tmp);
8334 if (tevent_req_nomem(subreq, req)) {
8335 return tevent_req_post(req, ev);
8337 tevent_req_set_callback(subreq, rpccli_samr_CreateUser2_done, req);
8338 return req;
8341 static void rpccli_samr_CreateUser2_done(struct tevent_req *subreq)
8343 struct tevent_req *req = tevent_req_callback_data(
8344 subreq, struct tevent_req);
8345 struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
8346 req, struct rpccli_samr_CreateUser2_state);
8347 NTSTATUS status;
8348 TALLOC_CTX *mem_ctx;
8350 if (state->out_mem_ctx) {
8351 mem_ctx = state->out_mem_ctx;
8352 } else {
8353 mem_ctx = state;
8356 status = state->dispatch_recv(subreq, mem_ctx);
8357 TALLOC_FREE(subreq);
8358 if (!NT_STATUS_IS_OK(status)) {
8359 tevent_req_nterror(req, status);
8360 return;
8363 /* Copy out parameters */
8364 *state->orig.out.user_handle = *state->tmp.out.user_handle;
8365 *state->orig.out.access_granted = *state->tmp.out.access_granted;
8366 *state->orig.out.rid = *state->tmp.out.rid;
8368 /* Copy result */
8369 state->orig.out.result = state->tmp.out.result;
8371 /* Reset temporary structure */
8372 ZERO_STRUCT(state->tmp);
8374 if (DEBUGLEVEL >= 10) {
8375 NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &state->orig);
8378 tevent_req_done(req);
8381 NTSTATUS rpccli_samr_CreateUser2_recv(struct tevent_req *req,
8382 TALLOC_CTX *mem_ctx,
8383 NTSTATUS *result)
8385 struct rpccli_samr_CreateUser2_state *state = tevent_req_data(
8386 req, struct rpccli_samr_CreateUser2_state);
8387 NTSTATUS status;
8389 if (tevent_req_is_nterror(req, &status)) {
8390 tevent_req_received(req);
8391 return status;
8394 /* Steal possbile out parameters to the callers context */
8395 talloc_steal(mem_ctx, state->out_mem_ctx);
8397 /* Return result */
8398 *result = state->orig.out.result;
8400 tevent_req_received(req);
8401 return NT_STATUS_OK;
8404 NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
8405 TALLOC_CTX *mem_ctx,
8406 struct policy_handle *domain_handle /* [in] [ref] */,
8407 struct lsa_String *account_name /* [in] [ref] */,
8408 uint32_t acct_flags /* [in] */,
8409 uint32_t access_mask /* [in] */,
8410 struct policy_handle *user_handle /* [out] [ref] */,
8411 uint32_t *access_granted /* [out] [ref] */,
8412 uint32_t *rid /* [out] [ref] */)
8414 struct samr_CreateUser2 r;
8415 NTSTATUS status;
8417 /* In parameters */
8418 r.in.domain_handle = domain_handle;
8419 r.in.account_name = account_name;
8420 r.in.acct_flags = acct_flags;
8421 r.in.access_mask = access_mask;
8423 if (DEBUGLEVEL >= 10) {
8424 NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r);
8427 status = cli->dispatch(cli,
8428 mem_ctx,
8429 &ndr_table_samr,
8430 NDR_SAMR_CREATEUSER2,
8431 &r);
8433 if (!NT_STATUS_IS_OK(status)) {
8434 return status;
8437 if (DEBUGLEVEL >= 10) {
8438 NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r);
8441 if (NT_STATUS_IS_ERR(status)) {
8442 return status;
8445 /* Return variables */
8446 *user_handle = *r.out.user_handle;
8447 *access_granted = *r.out.access_granted;
8448 *rid = *r.out.rid;
8450 /* Return result */
8451 return r.out.result;
8454 struct rpccli_samr_QueryDisplayInfo3_state {
8455 struct samr_QueryDisplayInfo3 orig;
8456 struct samr_QueryDisplayInfo3 tmp;
8457 TALLOC_CTX *out_mem_ctx;
8458 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8461 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq);
8463 struct tevent_req *rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX *mem_ctx,
8464 struct tevent_context *ev,
8465 struct rpc_pipe_client *cli,
8466 struct policy_handle *_domain_handle /* [in] [ref] */,
8467 uint16_t _level /* [in] */,
8468 uint32_t _start_idx /* [in] */,
8469 uint32_t _max_entries /* [in] */,
8470 uint32_t _buf_size /* [in] */,
8471 uint32_t *_total_size /* [out] [ref] */,
8472 uint32_t *_returned_size /* [out] [ref] */,
8473 union samr_DispInfo *_info /* [out] [ref,switch_is(level)] */)
8475 struct tevent_req *req;
8476 struct rpccli_samr_QueryDisplayInfo3_state *state;
8477 struct tevent_req *subreq;
8479 req = tevent_req_create(mem_ctx, &state,
8480 struct rpccli_samr_QueryDisplayInfo3_state);
8481 if (req == NULL) {
8482 return NULL;
8484 state->out_mem_ctx = NULL;
8485 state->dispatch_recv = cli->dispatch_recv;
8487 /* In parameters */
8488 state->orig.in.domain_handle = _domain_handle;
8489 state->orig.in.level = _level;
8490 state->orig.in.start_idx = _start_idx;
8491 state->orig.in.max_entries = _max_entries;
8492 state->orig.in.buf_size = _buf_size;
8494 /* Out parameters */
8495 state->orig.out.total_size = _total_size;
8496 state->orig.out.returned_size = _returned_size;
8497 state->orig.out.info = _info;
8499 /* Result */
8500 ZERO_STRUCT(state->orig.out.result);
8502 if (DEBUGLEVEL >= 10) {
8503 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &state->orig);
8506 state->out_mem_ctx = talloc_named_const(state, 0,
8507 "rpccli_samr_QueryDisplayInfo3_out_memory");
8508 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8509 return tevent_req_post(req, ev);
8512 /* make a temporary copy, that we pass to the dispatch function */
8513 state->tmp = state->orig;
8515 subreq = cli->dispatch_send(state, ev, cli,
8516 &ndr_table_samr,
8517 NDR_SAMR_QUERYDISPLAYINFO3,
8518 &state->tmp);
8519 if (tevent_req_nomem(subreq, req)) {
8520 return tevent_req_post(req, ev);
8522 tevent_req_set_callback(subreq, rpccli_samr_QueryDisplayInfo3_done, req);
8523 return req;
8526 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req *subreq)
8528 struct tevent_req *req = tevent_req_callback_data(
8529 subreq, struct tevent_req);
8530 struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
8531 req, struct rpccli_samr_QueryDisplayInfo3_state);
8532 NTSTATUS status;
8533 TALLOC_CTX *mem_ctx;
8535 if (state->out_mem_ctx) {
8536 mem_ctx = state->out_mem_ctx;
8537 } else {
8538 mem_ctx = state;
8541 status = state->dispatch_recv(subreq, mem_ctx);
8542 TALLOC_FREE(subreq);
8543 if (!NT_STATUS_IS_OK(status)) {
8544 tevent_req_nterror(req, status);
8545 return;
8548 /* Copy out parameters */
8549 *state->orig.out.total_size = *state->tmp.out.total_size;
8550 *state->orig.out.returned_size = *state->tmp.out.returned_size;
8551 *state->orig.out.info = *state->tmp.out.info;
8553 /* Copy result */
8554 state->orig.out.result = state->tmp.out.result;
8556 /* Reset temporary structure */
8557 ZERO_STRUCT(state->tmp);
8559 if (DEBUGLEVEL >= 10) {
8560 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &state->orig);
8563 tevent_req_done(req);
8566 NTSTATUS rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req *req,
8567 TALLOC_CTX *mem_ctx,
8568 NTSTATUS *result)
8570 struct rpccli_samr_QueryDisplayInfo3_state *state = tevent_req_data(
8571 req, struct rpccli_samr_QueryDisplayInfo3_state);
8572 NTSTATUS status;
8574 if (tevent_req_is_nterror(req, &status)) {
8575 tevent_req_received(req);
8576 return status;
8579 /* Steal possbile out parameters to the callers context */
8580 talloc_steal(mem_ctx, state->out_mem_ctx);
8582 /* Return result */
8583 *result = state->orig.out.result;
8585 tevent_req_received(req);
8586 return NT_STATUS_OK;
8589 NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
8590 TALLOC_CTX *mem_ctx,
8591 struct policy_handle *domain_handle /* [in] [ref] */,
8592 uint16_t level /* [in] */,
8593 uint32_t start_idx /* [in] */,
8594 uint32_t max_entries /* [in] */,
8595 uint32_t buf_size /* [in] */,
8596 uint32_t *total_size /* [out] [ref] */,
8597 uint32_t *returned_size /* [out] [ref] */,
8598 union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
8600 struct samr_QueryDisplayInfo3 r;
8601 NTSTATUS status;
8603 /* In parameters */
8604 r.in.domain_handle = domain_handle;
8605 r.in.level = level;
8606 r.in.start_idx = start_idx;
8607 r.in.max_entries = max_entries;
8608 r.in.buf_size = buf_size;
8610 if (DEBUGLEVEL >= 10) {
8611 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r);
8614 status = cli->dispatch(cli,
8615 mem_ctx,
8616 &ndr_table_samr,
8617 NDR_SAMR_QUERYDISPLAYINFO3,
8618 &r);
8620 if (!NT_STATUS_IS_OK(status)) {
8621 return status;
8624 if (DEBUGLEVEL >= 10) {
8625 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r);
8628 if (NT_STATUS_IS_ERR(status)) {
8629 return status;
8632 /* Return variables */
8633 *total_size = *r.out.total_size;
8634 *returned_size = *r.out.returned_size;
8635 *info = *r.out.info;
8637 /* Return result */
8638 return r.out.result;
8641 struct rpccli_samr_AddMultipleMembersToAlias_state {
8642 struct samr_AddMultipleMembersToAlias orig;
8643 struct samr_AddMultipleMembersToAlias tmp;
8644 TALLOC_CTX *out_mem_ctx;
8645 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8648 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq);
8650 struct tevent_req *rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX *mem_ctx,
8651 struct tevent_context *ev,
8652 struct rpc_pipe_client *cli,
8653 struct policy_handle *_alias_handle /* [in] [ref] */,
8654 struct lsa_SidArray *_sids /* [in] [ref] */)
8656 struct tevent_req *req;
8657 struct rpccli_samr_AddMultipleMembersToAlias_state *state;
8658 struct tevent_req *subreq;
8660 req = tevent_req_create(mem_ctx, &state,
8661 struct rpccli_samr_AddMultipleMembersToAlias_state);
8662 if (req == NULL) {
8663 return NULL;
8665 state->out_mem_ctx = NULL;
8666 state->dispatch_recv = cli->dispatch_recv;
8668 /* In parameters */
8669 state->orig.in.alias_handle = _alias_handle;
8670 state->orig.in.sids = _sids;
8672 /* Out parameters */
8674 /* Result */
8675 ZERO_STRUCT(state->orig.out.result);
8677 if (DEBUGLEVEL >= 10) {
8678 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &state->orig);
8681 /* make a temporary copy, that we pass to the dispatch function */
8682 state->tmp = state->orig;
8684 subreq = cli->dispatch_send(state, ev, cli,
8685 &ndr_table_samr,
8686 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
8687 &state->tmp);
8688 if (tevent_req_nomem(subreq, req)) {
8689 return tevent_req_post(req, ev);
8691 tevent_req_set_callback(subreq, rpccli_samr_AddMultipleMembersToAlias_done, req);
8692 return req;
8695 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req *subreq)
8697 struct tevent_req *req = tevent_req_callback_data(
8698 subreq, struct tevent_req);
8699 struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
8700 req, struct rpccli_samr_AddMultipleMembersToAlias_state);
8701 NTSTATUS status;
8702 TALLOC_CTX *mem_ctx;
8704 if (state->out_mem_ctx) {
8705 mem_ctx = state->out_mem_ctx;
8706 } else {
8707 mem_ctx = state;
8710 status = state->dispatch_recv(subreq, mem_ctx);
8711 TALLOC_FREE(subreq);
8712 if (!NT_STATUS_IS_OK(status)) {
8713 tevent_req_nterror(req, status);
8714 return;
8717 /* Copy out parameters */
8719 /* Copy result */
8720 state->orig.out.result = state->tmp.out.result;
8722 /* Reset temporary structure */
8723 ZERO_STRUCT(state->tmp);
8725 if (DEBUGLEVEL >= 10) {
8726 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &state->orig);
8729 tevent_req_done(req);
8732 NTSTATUS rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req *req,
8733 TALLOC_CTX *mem_ctx,
8734 NTSTATUS *result)
8736 struct rpccli_samr_AddMultipleMembersToAlias_state *state = tevent_req_data(
8737 req, struct rpccli_samr_AddMultipleMembersToAlias_state);
8738 NTSTATUS status;
8740 if (tevent_req_is_nterror(req, &status)) {
8741 tevent_req_received(req);
8742 return status;
8745 /* Steal possbile out parameters to the callers context */
8746 talloc_steal(mem_ctx, state->out_mem_ctx);
8748 /* Return result */
8749 *result = state->orig.out.result;
8751 tevent_req_received(req);
8752 return NT_STATUS_OK;
8755 NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
8756 TALLOC_CTX *mem_ctx,
8757 struct policy_handle *alias_handle /* [in] [ref] */,
8758 struct lsa_SidArray *sids /* [in] [ref] */)
8760 struct samr_AddMultipleMembersToAlias r;
8761 NTSTATUS status;
8763 /* In parameters */
8764 r.in.alias_handle = alias_handle;
8765 r.in.sids = sids;
8767 if (DEBUGLEVEL >= 10) {
8768 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r);
8771 status = cli->dispatch(cli,
8772 mem_ctx,
8773 &ndr_table_samr,
8774 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
8775 &r);
8777 if (!NT_STATUS_IS_OK(status)) {
8778 return status;
8781 if (DEBUGLEVEL >= 10) {
8782 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r);
8785 if (NT_STATUS_IS_ERR(status)) {
8786 return status;
8789 /* Return variables */
8791 /* Return result */
8792 return r.out.result;
8795 struct rpccli_samr_RemoveMultipleMembersFromAlias_state {
8796 struct samr_RemoveMultipleMembersFromAlias orig;
8797 struct samr_RemoveMultipleMembersFromAlias tmp;
8798 TALLOC_CTX *out_mem_ctx;
8799 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8802 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq);
8804 struct tevent_req *rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX *mem_ctx,
8805 struct tevent_context *ev,
8806 struct rpc_pipe_client *cli,
8807 struct policy_handle *_alias_handle /* [in] [ref] */,
8808 struct lsa_SidArray *_sids /* [in] [ref] */)
8810 struct tevent_req *req;
8811 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state;
8812 struct tevent_req *subreq;
8814 req = tevent_req_create(mem_ctx, &state,
8815 struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
8816 if (req == NULL) {
8817 return NULL;
8819 state->out_mem_ctx = NULL;
8820 state->dispatch_recv = cli->dispatch_recv;
8822 /* In parameters */
8823 state->orig.in.alias_handle = _alias_handle;
8824 state->orig.in.sids = _sids;
8826 /* Out parameters */
8828 /* Result */
8829 ZERO_STRUCT(state->orig.out.result);
8831 if (DEBUGLEVEL >= 10) {
8832 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &state->orig);
8835 /* make a temporary copy, that we pass to the dispatch function */
8836 state->tmp = state->orig;
8838 subreq = cli->dispatch_send(state, ev, cli,
8839 &ndr_table_samr,
8840 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
8841 &state->tmp);
8842 if (tevent_req_nomem(subreq, req)) {
8843 return tevent_req_post(req, ev);
8845 tevent_req_set_callback(subreq, rpccli_samr_RemoveMultipleMembersFromAlias_done, req);
8846 return req;
8849 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req *subreq)
8851 struct tevent_req *req = tevent_req_callback_data(
8852 subreq, struct tevent_req);
8853 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
8854 req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
8855 NTSTATUS status;
8856 TALLOC_CTX *mem_ctx;
8858 if (state->out_mem_ctx) {
8859 mem_ctx = state->out_mem_ctx;
8860 } else {
8861 mem_ctx = state;
8864 status = state->dispatch_recv(subreq, mem_ctx);
8865 TALLOC_FREE(subreq);
8866 if (!NT_STATUS_IS_OK(status)) {
8867 tevent_req_nterror(req, status);
8868 return;
8871 /* Copy out parameters */
8873 /* Copy result */
8874 state->orig.out.result = state->tmp.out.result;
8876 /* Reset temporary structure */
8877 ZERO_STRUCT(state->tmp);
8879 if (DEBUGLEVEL >= 10) {
8880 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &state->orig);
8883 tevent_req_done(req);
8886 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req *req,
8887 TALLOC_CTX *mem_ctx,
8888 NTSTATUS *result)
8890 struct rpccli_samr_RemoveMultipleMembersFromAlias_state *state = tevent_req_data(
8891 req, struct rpccli_samr_RemoveMultipleMembersFromAlias_state);
8892 NTSTATUS status;
8894 if (tevent_req_is_nterror(req, &status)) {
8895 tevent_req_received(req);
8896 return status;
8899 /* Steal possbile out parameters to the callers context */
8900 talloc_steal(mem_ctx, state->out_mem_ctx);
8902 /* Return result */
8903 *result = state->orig.out.result;
8905 tevent_req_received(req);
8906 return NT_STATUS_OK;
8909 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
8910 TALLOC_CTX *mem_ctx,
8911 struct policy_handle *alias_handle /* [in] [ref] */,
8912 struct lsa_SidArray *sids /* [in] [ref] */)
8914 struct samr_RemoveMultipleMembersFromAlias r;
8915 NTSTATUS status;
8917 /* In parameters */
8918 r.in.alias_handle = alias_handle;
8919 r.in.sids = sids;
8921 if (DEBUGLEVEL >= 10) {
8922 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
8925 status = cli->dispatch(cli,
8926 mem_ctx,
8927 &ndr_table_samr,
8928 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
8929 &r);
8931 if (!NT_STATUS_IS_OK(status)) {
8932 return status;
8935 if (DEBUGLEVEL >= 10) {
8936 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
8939 if (NT_STATUS_IS_ERR(status)) {
8940 return status;
8943 /* Return variables */
8945 /* Return result */
8946 return r.out.result;
8949 struct rpccli_samr_OemChangePasswordUser2_state {
8950 struct samr_OemChangePasswordUser2 orig;
8951 struct samr_OemChangePasswordUser2 tmp;
8952 TALLOC_CTX *out_mem_ctx;
8953 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8956 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq);
8958 struct tevent_req *rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
8959 struct tevent_context *ev,
8960 struct rpc_pipe_client *cli,
8961 struct lsa_AsciiString *_server /* [in] [unique] */,
8962 struct lsa_AsciiString *_account /* [in] [ref] */,
8963 struct samr_CryptPassword *_password /* [in] [unique] */,
8964 struct samr_Password *_hash /* [in] [unique] */)
8966 struct tevent_req *req;
8967 struct rpccli_samr_OemChangePasswordUser2_state *state;
8968 struct tevent_req *subreq;
8970 req = tevent_req_create(mem_ctx, &state,
8971 struct rpccli_samr_OemChangePasswordUser2_state);
8972 if (req == NULL) {
8973 return NULL;
8975 state->out_mem_ctx = NULL;
8976 state->dispatch_recv = cli->dispatch_recv;
8978 /* In parameters */
8979 state->orig.in.server = _server;
8980 state->orig.in.account = _account;
8981 state->orig.in.password = _password;
8982 state->orig.in.hash = _hash;
8984 /* Out parameters */
8986 /* Result */
8987 ZERO_STRUCT(state->orig.out.result);
8989 if (DEBUGLEVEL >= 10) {
8990 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &state->orig);
8993 /* make a temporary copy, that we pass to the dispatch function */
8994 state->tmp = state->orig;
8996 subreq = cli->dispatch_send(state, ev, cli,
8997 &ndr_table_samr,
8998 NDR_SAMR_OEMCHANGEPASSWORDUSER2,
8999 &state->tmp);
9000 if (tevent_req_nomem(subreq, req)) {
9001 return tevent_req_post(req, ev);
9003 tevent_req_set_callback(subreq, rpccli_samr_OemChangePasswordUser2_done, req);
9004 return req;
9007 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req *subreq)
9009 struct tevent_req *req = tevent_req_callback_data(
9010 subreq, struct tevent_req);
9011 struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
9012 req, struct rpccli_samr_OemChangePasswordUser2_state);
9013 NTSTATUS status;
9014 TALLOC_CTX *mem_ctx;
9016 if (state->out_mem_ctx) {
9017 mem_ctx = state->out_mem_ctx;
9018 } else {
9019 mem_ctx = state;
9022 status = state->dispatch_recv(subreq, mem_ctx);
9023 TALLOC_FREE(subreq);
9024 if (!NT_STATUS_IS_OK(status)) {
9025 tevent_req_nterror(req, status);
9026 return;
9029 /* Copy out parameters */
9031 /* Copy result */
9032 state->orig.out.result = state->tmp.out.result;
9034 /* Reset temporary structure */
9035 ZERO_STRUCT(state->tmp);
9037 if (DEBUGLEVEL >= 10) {
9038 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &state->orig);
9041 tevent_req_done(req);
9044 NTSTATUS rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req *req,
9045 TALLOC_CTX *mem_ctx,
9046 NTSTATUS *result)
9048 struct rpccli_samr_OemChangePasswordUser2_state *state = tevent_req_data(
9049 req, struct rpccli_samr_OemChangePasswordUser2_state);
9050 NTSTATUS status;
9052 if (tevent_req_is_nterror(req, &status)) {
9053 tevent_req_received(req);
9054 return status;
9057 /* Steal possbile out parameters to the callers context */
9058 talloc_steal(mem_ctx, state->out_mem_ctx);
9060 /* Return result */
9061 *result = state->orig.out.result;
9063 tevent_req_received(req);
9064 return NT_STATUS_OK;
9067 NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
9068 TALLOC_CTX *mem_ctx,
9069 struct lsa_AsciiString *server /* [in] [unique] */,
9070 struct lsa_AsciiString *account /* [in] [ref] */,
9071 struct samr_CryptPassword *password /* [in] [unique] */,
9072 struct samr_Password *hash /* [in] [unique] */)
9074 struct samr_OemChangePasswordUser2 r;
9075 NTSTATUS status;
9077 /* In parameters */
9078 r.in.server = server;
9079 r.in.account = account;
9080 r.in.password = password;
9081 r.in.hash = hash;
9083 if (DEBUGLEVEL >= 10) {
9084 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r);
9087 status = cli->dispatch(cli,
9088 mem_ctx,
9089 &ndr_table_samr,
9090 NDR_SAMR_OEMCHANGEPASSWORDUSER2,
9091 &r);
9093 if (!NT_STATUS_IS_OK(status)) {
9094 return status;
9097 if (DEBUGLEVEL >= 10) {
9098 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r);
9101 if (NT_STATUS_IS_ERR(status)) {
9102 return status;
9105 /* Return variables */
9107 /* Return result */
9108 return r.out.result;
9111 struct rpccli_samr_ChangePasswordUser2_state {
9112 struct samr_ChangePasswordUser2 orig;
9113 struct samr_ChangePasswordUser2 tmp;
9114 TALLOC_CTX *out_mem_ctx;
9115 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9118 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq);
9120 struct tevent_req *rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX *mem_ctx,
9121 struct tevent_context *ev,
9122 struct rpc_pipe_client *cli,
9123 struct lsa_String *_server /* [in] [unique] */,
9124 struct lsa_String *_account /* [in] [ref] */,
9125 struct samr_CryptPassword *_nt_password /* [in] [unique] */,
9126 struct samr_Password *_nt_verifier /* [in] [unique] */,
9127 uint8_t _lm_change /* [in] */,
9128 struct samr_CryptPassword *_lm_password /* [in] [unique] */,
9129 struct samr_Password *_lm_verifier /* [in] [unique] */)
9131 struct tevent_req *req;
9132 struct rpccli_samr_ChangePasswordUser2_state *state;
9133 struct tevent_req *subreq;
9135 req = tevent_req_create(mem_ctx, &state,
9136 struct rpccli_samr_ChangePasswordUser2_state);
9137 if (req == NULL) {
9138 return NULL;
9140 state->out_mem_ctx = NULL;
9141 state->dispatch_recv = cli->dispatch_recv;
9143 /* In parameters */
9144 state->orig.in.server = _server;
9145 state->orig.in.account = _account;
9146 state->orig.in.nt_password = _nt_password;
9147 state->orig.in.nt_verifier = _nt_verifier;
9148 state->orig.in.lm_change = _lm_change;
9149 state->orig.in.lm_password = _lm_password;
9150 state->orig.in.lm_verifier = _lm_verifier;
9152 /* Out parameters */
9154 /* Result */
9155 ZERO_STRUCT(state->orig.out.result);
9157 if (DEBUGLEVEL >= 10) {
9158 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &state->orig);
9161 /* make a temporary copy, that we pass to the dispatch function */
9162 state->tmp = state->orig;
9164 subreq = cli->dispatch_send(state, ev, cli,
9165 &ndr_table_samr,
9166 NDR_SAMR_CHANGEPASSWORDUSER2,
9167 &state->tmp);
9168 if (tevent_req_nomem(subreq, req)) {
9169 return tevent_req_post(req, ev);
9171 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser2_done, req);
9172 return req;
9175 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req *subreq)
9177 struct tevent_req *req = tevent_req_callback_data(
9178 subreq, struct tevent_req);
9179 struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
9180 req, struct rpccli_samr_ChangePasswordUser2_state);
9181 NTSTATUS status;
9182 TALLOC_CTX *mem_ctx;
9184 if (state->out_mem_ctx) {
9185 mem_ctx = state->out_mem_ctx;
9186 } else {
9187 mem_ctx = state;
9190 status = state->dispatch_recv(subreq, mem_ctx);
9191 TALLOC_FREE(subreq);
9192 if (!NT_STATUS_IS_OK(status)) {
9193 tevent_req_nterror(req, status);
9194 return;
9197 /* Copy out parameters */
9199 /* Copy result */
9200 state->orig.out.result = state->tmp.out.result;
9202 /* Reset temporary structure */
9203 ZERO_STRUCT(state->tmp);
9205 if (DEBUGLEVEL >= 10) {
9206 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &state->orig);
9209 tevent_req_done(req);
9212 NTSTATUS rpccli_samr_ChangePasswordUser2_recv(struct tevent_req *req,
9213 TALLOC_CTX *mem_ctx,
9214 NTSTATUS *result)
9216 struct rpccli_samr_ChangePasswordUser2_state *state = tevent_req_data(
9217 req, struct rpccli_samr_ChangePasswordUser2_state);
9218 NTSTATUS status;
9220 if (tevent_req_is_nterror(req, &status)) {
9221 tevent_req_received(req);
9222 return status;
9225 /* Steal possbile out parameters to the callers context */
9226 talloc_steal(mem_ctx, state->out_mem_ctx);
9228 /* Return result */
9229 *result = state->orig.out.result;
9231 tevent_req_received(req);
9232 return NT_STATUS_OK;
9235 NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
9236 TALLOC_CTX *mem_ctx,
9237 struct lsa_String *server /* [in] [unique] */,
9238 struct lsa_String *account /* [in] [ref] */,
9239 struct samr_CryptPassword *nt_password /* [in] [unique] */,
9240 struct samr_Password *nt_verifier /* [in] [unique] */,
9241 uint8_t lm_change /* [in] */,
9242 struct samr_CryptPassword *lm_password /* [in] [unique] */,
9243 struct samr_Password *lm_verifier /* [in] [unique] */)
9245 struct samr_ChangePasswordUser2 r;
9246 NTSTATUS status;
9248 /* In parameters */
9249 r.in.server = server;
9250 r.in.account = account;
9251 r.in.nt_password = nt_password;
9252 r.in.nt_verifier = nt_verifier;
9253 r.in.lm_change = lm_change;
9254 r.in.lm_password = lm_password;
9255 r.in.lm_verifier = lm_verifier;
9257 if (DEBUGLEVEL >= 10) {
9258 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r);
9261 status = cli->dispatch(cli,
9262 mem_ctx,
9263 &ndr_table_samr,
9264 NDR_SAMR_CHANGEPASSWORDUSER2,
9265 &r);
9267 if (!NT_STATUS_IS_OK(status)) {
9268 return status;
9271 if (DEBUGLEVEL >= 10) {
9272 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r);
9275 if (NT_STATUS_IS_ERR(status)) {
9276 return status;
9279 /* Return variables */
9281 /* Return result */
9282 return r.out.result;
9285 struct rpccli_samr_GetDomPwInfo_state {
9286 struct samr_GetDomPwInfo orig;
9287 struct samr_GetDomPwInfo tmp;
9288 TALLOC_CTX *out_mem_ctx;
9289 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9292 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq);
9294 struct tevent_req *rpccli_samr_GetDomPwInfo_send(TALLOC_CTX *mem_ctx,
9295 struct tevent_context *ev,
9296 struct rpc_pipe_client *cli,
9297 struct lsa_String *_domain_name /* [in] [unique] */,
9298 struct samr_PwInfo *_info /* [out] [ref] */)
9300 struct tevent_req *req;
9301 struct rpccli_samr_GetDomPwInfo_state *state;
9302 struct tevent_req *subreq;
9304 req = tevent_req_create(mem_ctx, &state,
9305 struct rpccli_samr_GetDomPwInfo_state);
9306 if (req == NULL) {
9307 return NULL;
9309 state->out_mem_ctx = NULL;
9310 state->dispatch_recv = cli->dispatch_recv;
9312 /* In parameters */
9313 state->orig.in.domain_name = _domain_name;
9315 /* Out parameters */
9316 state->orig.out.info = _info;
9318 /* Result */
9319 ZERO_STRUCT(state->orig.out.result);
9321 if (DEBUGLEVEL >= 10) {
9322 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &state->orig);
9325 state->out_mem_ctx = talloc_named_const(state, 0,
9326 "rpccli_samr_GetDomPwInfo_out_memory");
9327 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9328 return tevent_req_post(req, ev);
9331 /* make a temporary copy, that we pass to the dispatch function */
9332 state->tmp = state->orig;
9334 subreq = cli->dispatch_send(state, ev, cli,
9335 &ndr_table_samr,
9336 NDR_SAMR_GETDOMPWINFO,
9337 &state->tmp);
9338 if (tevent_req_nomem(subreq, req)) {
9339 return tevent_req_post(req, ev);
9341 tevent_req_set_callback(subreq, rpccli_samr_GetDomPwInfo_done, req);
9342 return req;
9345 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req *subreq)
9347 struct tevent_req *req = tevent_req_callback_data(
9348 subreq, struct tevent_req);
9349 struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
9350 req, struct rpccli_samr_GetDomPwInfo_state);
9351 NTSTATUS status;
9352 TALLOC_CTX *mem_ctx;
9354 if (state->out_mem_ctx) {
9355 mem_ctx = state->out_mem_ctx;
9356 } else {
9357 mem_ctx = state;
9360 status = state->dispatch_recv(subreq, mem_ctx);
9361 TALLOC_FREE(subreq);
9362 if (!NT_STATUS_IS_OK(status)) {
9363 tevent_req_nterror(req, status);
9364 return;
9367 /* Copy out parameters */
9368 *state->orig.out.info = *state->tmp.out.info;
9370 /* Copy result */
9371 state->orig.out.result = state->tmp.out.result;
9373 /* Reset temporary structure */
9374 ZERO_STRUCT(state->tmp);
9376 if (DEBUGLEVEL >= 10) {
9377 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &state->orig);
9380 tevent_req_done(req);
9383 NTSTATUS rpccli_samr_GetDomPwInfo_recv(struct tevent_req *req,
9384 TALLOC_CTX *mem_ctx,
9385 NTSTATUS *result)
9387 struct rpccli_samr_GetDomPwInfo_state *state = tevent_req_data(
9388 req, struct rpccli_samr_GetDomPwInfo_state);
9389 NTSTATUS status;
9391 if (tevent_req_is_nterror(req, &status)) {
9392 tevent_req_received(req);
9393 return status;
9396 /* Steal possbile out parameters to the callers context */
9397 talloc_steal(mem_ctx, state->out_mem_ctx);
9399 /* Return result */
9400 *result = state->orig.out.result;
9402 tevent_req_received(req);
9403 return NT_STATUS_OK;
9406 NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
9407 TALLOC_CTX *mem_ctx,
9408 struct lsa_String *domain_name /* [in] [unique] */,
9409 struct samr_PwInfo *info /* [out] [ref] */)
9411 struct samr_GetDomPwInfo r;
9412 NTSTATUS status;
9414 /* In parameters */
9415 r.in.domain_name = domain_name;
9417 if (DEBUGLEVEL >= 10) {
9418 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r);
9421 status = cli->dispatch(cli,
9422 mem_ctx,
9423 &ndr_table_samr,
9424 NDR_SAMR_GETDOMPWINFO,
9425 &r);
9427 if (!NT_STATUS_IS_OK(status)) {
9428 return status;
9431 if (DEBUGLEVEL >= 10) {
9432 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r);
9435 if (NT_STATUS_IS_ERR(status)) {
9436 return status;
9439 /* Return variables */
9440 *info = *r.out.info;
9442 /* Return result */
9443 return r.out.result;
9446 struct rpccli_samr_Connect2_state {
9447 struct samr_Connect2 orig;
9448 struct samr_Connect2 tmp;
9449 TALLOC_CTX *out_mem_ctx;
9450 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9453 static void rpccli_samr_Connect2_done(struct tevent_req *subreq);
9455 struct tevent_req *rpccli_samr_Connect2_send(TALLOC_CTX *mem_ctx,
9456 struct tevent_context *ev,
9457 struct rpc_pipe_client *cli,
9458 const char *_system_name /* [in] [unique,charset(UTF16)] */,
9459 uint32_t _access_mask /* [in] */,
9460 struct policy_handle *_connect_handle /* [out] [ref] */)
9462 struct tevent_req *req;
9463 struct rpccli_samr_Connect2_state *state;
9464 struct tevent_req *subreq;
9466 req = tevent_req_create(mem_ctx, &state,
9467 struct rpccli_samr_Connect2_state);
9468 if (req == NULL) {
9469 return NULL;
9471 state->out_mem_ctx = NULL;
9472 state->dispatch_recv = cli->dispatch_recv;
9474 /* In parameters */
9475 state->orig.in.system_name = _system_name;
9476 state->orig.in.access_mask = _access_mask;
9478 /* Out parameters */
9479 state->orig.out.connect_handle = _connect_handle;
9481 /* Result */
9482 ZERO_STRUCT(state->orig.out.result);
9484 if (DEBUGLEVEL >= 10) {
9485 NDR_PRINT_IN_DEBUG(samr_Connect2, &state->orig);
9488 state->out_mem_ctx = talloc_named_const(state, 0,
9489 "rpccli_samr_Connect2_out_memory");
9490 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9491 return tevent_req_post(req, ev);
9494 /* make a temporary copy, that we pass to the dispatch function */
9495 state->tmp = state->orig;
9497 subreq = cli->dispatch_send(state, ev, cli,
9498 &ndr_table_samr,
9499 NDR_SAMR_CONNECT2,
9500 &state->tmp);
9501 if (tevent_req_nomem(subreq, req)) {
9502 return tevent_req_post(req, ev);
9504 tevent_req_set_callback(subreq, rpccli_samr_Connect2_done, req);
9505 return req;
9508 static void rpccli_samr_Connect2_done(struct tevent_req *subreq)
9510 struct tevent_req *req = tevent_req_callback_data(
9511 subreq, struct tevent_req);
9512 struct rpccli_samr_Connect2_state *state = tevent_req_data(
9513 req, struct rpccli_samr_Connect2_state);
9514 NTSTATUS status;
9515 TALLOC_CTX *mem_ctx;
9517 if (state->out_mem_ctx) {
9518 mem_ctx = state->out_mem_ctx;
9519 } else {
9520 mem_ctx = state;
9523 status = state->dispatch_recv(subreq, mem_ctx);
9524 TALLOC_FREE(subreq);
9525 if (!NT_STATUS_IS_OK(status)) {
9526 tevent_req_nterror(req, status);
9527 return;
9530 /* Copy out parameters */
9531 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
9533 /* Copy result */
9534 state->orig.out.result = state->tmp.out.result;
9536 /* Reset temporary structure */
9537 ZERO_STRUCT(state->tmp);
9539 if (DEBUGLEVEL >= 10) {
9540 NDR_PRINT_OUT_DEBUG(samr_Connect2, &state->orig);
9543 tevent_req_done(req);
9546 NTSTATUS rpccli_samr_Connect2_recv(struct tevent_req *req,
9547 TALLOC_CTX *mem_ctx,
9548 NTSTATUS *result)
9550 struct rpccli_samr_Connect2_state *state = tevent_req_data(
9551 req, struct rpccli_samr_Connect2_state);
9552 NTSTATUS status;
9554 if (tevent_req_is_nterror(req, &status)) {
9555 tevent_req_received(req);
9556 return status;
9559 /* Steal possbile out parameters to the callers context */
9560 talloc_steal(mem_ctx, state->out_mem_ctx);
9562 /* Return result */
9563 *result = state->orig.out.result;
9565 tevent_req_received(req);
9566 return NT_STATUS_OK;
9569 NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
9570 TALLOC_CTX *mem_ctx,
9571 const char *system_name /* [in] [unique,charset(UTF16)] */,
9572 uint32_t access_mask /* [in] */,
9573 struct policy_handle *connect_handle /* [out] [ref] */)
9575 struct samr_Connect2 r;
9576 NTSTATUS status;
9578 /* In parameters */
9579 r.in.system_name = system_name;
9580 r.in.access_mask = access_mask;
9582 if (DEBUGLEVEL >= 10) {
9583 NDR_PRINT_IN_DEBUG(samr_Connect2, &r);
9586 status = cli->dispatch(cli,
9587 mem_ctx,
9588 &ndr_table_samr,
9589 NDR_SAMR_CONNECT2,
9590 &r);
9592 if (!NT_STATUS_IS_OK(status)) {
9593 return status;
9596 if (DEBUGLEVEL >= 10) {
9597 NDR_PRINT_OUT_DEBUG(samr_Connect2, &r);
9600 if (NT_STATUS_IS_ERR(status)) {
9601 return status;
9604 /* Return variables */
9605 *connect_handle = *r.out.connect_handle;
9607 /* Return result */
9608 return r.out.result;
9611 struct rpccli_samr_SetUserInfo2_state {
9612 struct samr_SetUserInfo2 orig;
9613 struct samr_SetUserInfo2 tmp;
9614 TALLOC_CTX *out_mem_ctx;
9615 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9618 static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq);
9620 struct tevent_req *rpccli_samr_SetUserInfo2_send(TALLOC_CTX *mem_ctx,
9621 struct tevent_context *ev,
9622 struct rpc_pipe_client *cli,
9623 struct policy_handle *_user_handle /* [in] [ref] */,
9624 enum samr_UserInfoLevel _level /* [in] */,
9625 union samr_UserInfo *_info /* [in] [ref,switch_is(level)] */)
9627 struct tevent_req *req;
9628 struct rpccli_samr_SetUserInfo2_state *state;
9629 struct tevent_req *subreq;
9631 req = tevent_req_create(mem_ctx, &state,
9632 struct rpccli_samr_SetUserInfo2_state);
9633 if (req == NULL) {
9634 return NULL;
9636 state->out_mem_ctx = NULL;
9637 state->dispatch_recv = cli->dispatch_recv;
9639 /* In parameters */
9640 state->orig.in.user_handle = _user_handle;
9641 state->orig.in.level = _level;
9642 state->orig.in.info = _info;
9644 /* Out parameters */
9646 /* Result */
9647 ZERO_STRUCT(state->orig.out.result);
9649 if (DEBUGLEVEL >= 10) {
9650 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &state->orig);
9653 /* make a temporary copy, that we pass to the dispatch function */
9654 state->tmp = state->orig;
9656 subreq = cli->dispatch_send(state, ev, cli,
9657 &ndr_table_samr,
9658 NDR_SAMR_SETUSERINFO2,
9659 &state->tmp);
9660 if (tevent_req_nomem(subreq, req)) {
9661 return tevent_req_post(req, ev);
9663 tevent_req_set_callback(subreq, rpccli_samr_SetUserInfo2_done, req);
9664 return req;
9667 static void rpccli_samr_SetUserInfo2_done(struct tevent_req *subreq)
9669 struct tevent_req *req = tevent_req_callback_data(
9670 subreq, struct tevent_req);
9671 struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
9672 req, struct rpccli_samr_SetUserInfo2_state);
9673 NTSTATUS status;
9674 TALLOC_CTX *mem_ctx;
9676 if (state->out_mem_ctx) {
9677 mem_ctx = state->out_mem_ctx;
9678 } else {
9679 mem_ctx = state;
9682 status = state->dispatch_recv(subreq, mem_ctx);
9683 TALLOC_FREE(subreq);
9684 if (!NT_STATUS_IS_OK(status)) {
9685 tevent_req_nterror(req, status);
9686 return;
9689 /* Copy out parameters */
9691 /* Copy result */
9692 state->orig.out.result = state->tmp.out.result;
9694 /* Reset temporary structure */
9695 ZERO_STRUCT(state->tmp);
9697 if (DEBUGLEVEL >= 10) {
9698 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &state->orig);
9701 tevent_req_done(req);
9704 NTSTATUS rpccli_samr_SetUserInfo2_recv(struct tevent_req *req,
9705 TALLOC_CTX *mem_ctx,
9706 NTSTATUS *result)
9708 struct rpccli_samr_SetUserInfo2_state *state = tevent_req_data(
9709 req, struct rpccli_samr_SetUserInfo2_state);
9710 NTSTATUS status;
9712 if (tevent_req_is_nterror(req, &status)) {
9713 tevent_req_received(req);
9714 return status;
9717 /* Steal possbile out parameters to the callers context */
9718 talloc_steal(mem_ctx, state->out_mem_ctx);
9720 /* Return result */
9721 *result = state->orig.out.result;
9723 tevent_req_received(req);
9724 return NT_STATUS_OK;
9727 NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
9728 TALLOC_CTX *mem_ctx,
9729 struct policy_handle *user_handle /* [in] [ref] */,
9730 enum samr_UserInfoLevel level /* [in] */,
9731 union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
9733 struct samr_SetUserInfo2 r;
9734 NTSTATUS status;
9736 /* In parameters */
9737 r.in.user_handle = user_handle;
9738 r.in.level = level;
9739 r.in.info = info;
9741 if (DEBUGLEVEL >= 10) {
9742 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r);
9745 status = cli->dispatch(cli,
9746 mem_ctx,
9747 &ndr_table_samr,
9748 NDR_SAMR_SETUSERINFO2,
9749 &r);
9751 if (!NT_STATUS_IS_OK(status)) {
9752 return status;
9755 if (DEBUGLEVEL >= 10) {
9756 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r);
9759 if (NT_STATUS_IS_ERR(status)) {
9760 return status;
9763 /* Return variables */
9765 /* Return result */
9766 return r.out.result;
9769 struct rpccli_samr_SetBootKeyInformation_state {
9770 struct samr_SetBootKeyInformation orig;
9771 struct samr_SetBootKeyInformation tmp;
9772 TALLOC_CTX *out_mem_ctx;
9773 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9776 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq);
9778 struct tevent_req *rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
9779 struct tevent_context *ev,
9780 struct rpc_pipe_client *cli,
9781 struct policy_handle *_connect_handle /* [in] [ref] */,
9782 uint32_t _unknown1 /* [in] */,
9783 uint32_t _unknown2 /* [in] */,
9784 uint32_t _unknown3 /* [in] */)
9786 struct tevent_req *req;
9787 struct rpccli_samr_SetBootKeyInformation_state *state;
9788 struct tevent_req *subreq;
9790 req = tevent_req_create(mem_ctx, &state,
9791 struct rpccli_samr_SetBootKeyInformation_state);
9792 if (req == NULL) {
9793 return NULL;
9795 state->out_mem_ctx = NULL;
9796 state->dispatch_recv = cli->dispatch_recv;
9798 /* In parameters */
9799 state->orig.in.connect_handle = _connect_handle;
9800 state->orig.in.unknown1 = _unknown1;
9801 state->orig.in.unknown2 = _unknown2;
9802 state->orig.in.unknown3 = _unknown3;
9804 /* Out parameters */
9806 /* Result */
9807 ZERO_STRUCT(state->orig.out.result);
9809 if (DEBUGLEVEL >= 10) {
9810 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &state->orig);
9813 /* make a temporary copy, that we pass to the dispatch function */
9814 state->tmp = state->orig;
9816 subreq = cli->dispatch_send(state, ev, cli,
9817 &ndr_table_samr,
9818 NDR_SAMR_SETBOOTKEYINFORMATION,
9819 &state->tmp);
9820 if (tevent_req_nomem(subreq, req)) {
9821 return tevent_req_post(req, ev);
9823 tevent_req_set_callback(subreq, rpccli_samr_SetBootKeyInformation_done, req);
9824 return req;
9827 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req *subreq)
9829 struct tevent_req *req = tevent_req_callback_data(
9830 subreq, struct tevent_req);
9831 struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
9832 req, struct rpccli_samr_SetBootKeyInformation_state);
9833 NTSTATUS status;
9834 TALLOC_CTX *mem_ctx;
9836 if (state->out_mem_ctx) {
9837 mem_ctx = state->out_mem_ctx;
9838 } else {
9839 mem_ctx = state;
9842 status = state->dispatch_recv(subreq, mem_ctx);
9843 TALLOC_FREE(subreq);
9844 if (!NT_STATUS_IS_OK(status)) {
9845 tevent_req_nterror(req, status);
9846 return;
9849 /* Copy out parameters */
9851 /* Copy result */
9852 state->orig.out.result = state->tmp.out.result;
9854 /* Reset temporary structure */
9855 ZERO_STRUCT(state->tmp);
9857 if (DEBUGLEVEL >= 10) {
9858 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &state->orig);
9861 tevent_req_done(req);
9864 NTSTATUS rpccli_samr_SetBootKeyInformation_recv(struct tevent_req *req,
9865 TALLOC_CTX *mem_ctx,
9866 NTSTATUS *result)
9868 struct rpccli_samr_SetBootKeyInformation_state *state = tevent_req_data(
9869 req, struct rpccli_samr_SetBootKeyInformation_state);
9870 NTSTATUS status;
9872 if (tevent_req_is_nterror(req, &status)) {
9873 tevent_req_received(req);
9874 return status;
9877 /* Steal possbile out parameters to the callers context */
9878 talloc_steal(mem_ctx, state->out_mem_ctx);
9880 /* Return result */
9881 *result = state->orig.out.result;
9883 tevent_req_received(req);
9884 return NT_STATUS_OK;
9887 NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
9888 TALLOC_CTX *mem_ctx,
9889 struct policy_handle *connect_handle /* [in] [ref] */,
9890 uint32_t unknown1 /* [in] */,
9891 uint32_t unknown2 /* [in] */,
9892 uint32_t unknown3 /* [in] */)
9894 struct samr_SetBootKeyInformation r;
9895 NTSTATUS status;
9897 /* In parameters */
9898 r.in.connect_handle = connect_handle;
9899 r.in.unknown1 = unknown1;
9900 r.in.unknown2 = unknown2;
9901 r.in.unknown3 = unknown3;
9903 if (DEBUGLEVEL >= 10) {
9904 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r);
9907 status = cli->dispatch(cli,
9908 mem_ctx,
9909 &ndr_table_samr,
9910 NDR_SAMR_SETBOOTKEYINFORMATION,
9911 &r);
9913 if (!NT_STATUS_IS_OK(status)) {
9914 return status;
9917 if (DEBUGLEVEL >= 10) {
9918 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r);
9921 if (NT_STATUS_IS_ERR(status)) {
9922 return status;
9925 /* Return variables */
9927 /* Return result */
9928 return r.out.result;
9931 struct rpccli_samr_GetBootKeyInformation_state {
9932 struct samr_GetBootKeyInformation orig;
9933 struct samr_GetBootKeyInformation tmp;
9934 TALLOC_CTX *out_mem_ctx;
9935 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9938 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq);
9940 struct tevent_req *rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX *mem_ctx,
9941 struct tevent_context *ev,
9942 struct rpc_pipe_client *cli,
9943 struct policy_handle *_domain_handle /* [in] [ref] */,
9944 uint32_t *_unknown /* [out] [ref] */)
9946 struct tevent_req *req;
9947 struct rpccli_samr_GetBootKeyInformation_state *state;
9948 struct tevent_req *subreq;
9950 req = tevent_req_create(mem_ctx, &state,
9951 struct rpccli_samr_GetBootKeyInformation_state);
9952 if (req == NULL) {
9953 return NULL;
9955 state->out_mem_ctx = NULL;
9956 state->dispatch_recv = cli->dispatch_recv;
9958 /* In parameters */
9959 state->orig.in.domain_handle = _domain_handle;
9961 /* Out parameters */
9962 state->orig.out.unknown = _unknown;
9964 /* Result */
9965 ZERO_STRUCT(state->orig.out.result);
9967 if (DEBUGLEVEL >= 10) {
9968 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &state->orig);
9971 state->out_mem_ctx = talloc_named_const(state, 0,
9972 "rpccli_samr_GetBootKeyInformation_out_memory");
9973 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9974 return tevent_req_post(req, ev);
9977 /* make a temporary copy, that we pass to the dispatch function */
9978 state->tmp = state->orig;
9980 subreq = cli->dispatch_send(state, ev, cli,
9981 &ndr_table_samr,
9982 NDR_SAMR_GETBOOTKEYINFORMATION,
9983 &state->tmp);
9984 if (tevent_req_nomem(subreq, req)) {
9985 return tevent_req_post(req, ev);
9987 tevent_req_set_callback(subreq, rpccli_samr_GetBootKeyInformation_done, req);
9988 return req;
9991 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req *subreq)
9993 struct tevent_req *req = tevent_req_callback_data(
9994 subreq, struct tevent_req);
9995 struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
9996 req, struct rpccli_samr_GetBootKeyInformation_state);
9997 NTSTATUS status;
9998 TALLOC_CTX *mem_ctx;
10000 if (state->out_mem_ctx) {
10001 mem_ctx = state->out_mem_ctx;
10002 } else {
10003 mem_ctx = state;
10006 status = state->dispatch_recv(subreq, mem_ctx);
10007 TALLOC_FREE(subreq);
10008 if (!NT_STATUS_IS_OK(status)) {
10009 tevent_req_nterror(req, status);
10010 return;
10013 /* Copy out parameters */
10014 *state->orig.out.unknown = *state->tmp.out.unknown;
10016 /* Copy result */
10017 state->orig.out.result = state->tmp.out.result;
10019 /* Reset temporary structure */
10020 ZERO_STRUCT(state->tmp);
10022 if (DEBUGLEVEL >= 10) {
10023 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &state->orig);
10026 tevent_req_done(req);
10029 NTSTATUS rpccli_samr_GetBootKeyInformation_recv(struct tevent_req *req,
10030 TALLOC_CTX *mem_ctx,
10031 NTSTATUS *result)
10033 struct rpccli_samr_GetBootKeyInformation_state *state = tevent_req_data(
10034 req, struct rpccli_samr_GetBootKeyInformation_state);
10035 NTSTATUS status;
10037 if (tevent_req_is_nterror(req, &status)) {
10038 tevent_req_received(req);
10039 return status;
10042 /* Steal possbile out parameters to the callers context */
10043 talloc_steal(mem_ctx, state->out_mem_ctx);
10045 /* Return result */
10046 *result = state->orig.out.result;
10048 tevent_req_received(req);
10049 return NT_STATUS_OK;
10052 NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
10053 TALLOC_CTX *mem_ctx,
10054 struct policy_handle *domain_handle /* [in] [ref] */,
10055 uint32_t *unknown /* [out] [ref] */)
10057 struct samr_GetBootKeyInformation r;
10058 NTSTATUS status;
10060 /* In parameters */
10061 r.in.domain_handle = domain_handle;
10063 if (DEBUGLEVEL >= 10) {
10064 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r);
10067 status = cli->dispatch(cli,
10068 mem_ctx,
10069 &ndr_table_samr,
10070 NDR_SAMR_GETBOOTKEYINFORMATION,
10071 &r);
10073 if (!NT_STATUS_IS_OK(status)) {
10074 return status;
10077 if (DEBUGLEVEL >= 10) {
10078 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r);
10081 if (NT_STATUS_IS_ERR(status)) {
10082 return status;
10085 /* Return variables */
10086 *unknown = *r.out.unknown;
10088 /* Return result */
10089 return r.out.result;
10092 struct rpccli_samr_Connect3_state {
10093 struct samr_Connect3 orig;
10094 struct samr_Connect3 tmp;
10095 TALLOC_CTX *out_mem_ctx;
10096 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10099 static void rpccli_samr_Connect3_done(struct tevent_req *subreq);
10101 struct tevent_req *rpccli_samr_Connect3_send(TALLOC_CTX *mem_ctx,
10102 struct tevent_context *ev,
10103 struct rpc_pipe_client *cli,
10104 const char *_system_name /* [in] [unique,charset(UTF16)] */,
10105 uint32_t _unknown /* [in] */,
10106 uint32_t _access_mask /* [in] */,
10107 struct policy_handle *_connect_handle /* [out] [ref] */)
10109 struct tevent_req *req;
10110 struct rpccli_samr_Connect3_state *state;
10111 struct tevent_req *subreq;
10113 req = tevent_req_create(mem_ctx, &state,
10114 struct rpccli_samr_Connect3_state);
10115 if (req == NULL) {
10116 return NULL;
10118 state->out_mem_ctx = NULL;
10119 state->dispatch_recv = cli->dispatch_recv;
10121 /* In parameters */
10122 state->orig.in.system_name = _system_name;
10123 state->orig.in.unknown = _unknown;
10124 state->orig.in.access_mask = _access_mask;
10126 /* Out parameters */
10127 state->orig.out.connect_handle = _connect_handle;
10129 /* Result */
10130 ZERO_STRUCT(state->orig.out.result);
10132 if (DEBUGLEVEL >= 10) {
10133 NDR_PRINT_IN_DEBUG(samr_Connect3, &state->orig);
10136 state->out_mem_ctx = talloc_named_const(state, 0,
10137 "rpccli_samr_Connect3_out_memory");
10138 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10139 return tevent_req_post(req, ev);
10142 /* make a temporary copy, that we pass to the dispatch function */
10143 state->tmp = state->orig;
10145 subreq = cli->dispatch_send(state, ev, cli,
10146 &ndr_table_samr,
10147 NDR_SAMR_CONNECT3,
10148 &state->tmp);
10149 if (tevent_req_nomem(subreq, req)) {
10150 return tevent_req_post(req, ev);
10152 tevent_req_set_callback(subreq, rpccli_samr_Connect3_done, req);
10153 return req;
10156 static void rpccli_samr_Connect3_done(struct tevent_req *subreq)
10158 struct tevent_req *req = tevent_req_callback_data(
10159 subreq, struct tevent_req);
10160 struct rpccli_samr_Connect3_state *state = tevent_req_data(
10161 req, struct rpccli_samr_Connect3_state);
10162 NTSTATUS status;
10163 TALLOC_CTX *mem_ctx;
10165 if (state->out_mem_ctx) {
10166 mem_ctx = state->out_mem_ctx;
10167 } else {
10168 mem_ctx = state;
10171 status = state->dispatch_recv(subreq, mem_ctx);
10172 TALLOC_FREE(subreq);
10173 if (!NT_STATUS_IS_OK(status)) {
10174 tevent_req_nterror(req, status);
10175 return;
10178 /* Copy out parameters */
10179 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
10181 /* Copy result */
10182 state->orig.out.result = state->tmp.out.result;
10184 /* Reset temporary structure */
10185 ZERO_STRUCT(state->tmp);
10187 if (DEBUGLEVEL >= 10) {
10188 NDR_PRINT_OUT_DEBUG(samr_Connect3, &state->orig);
10191 tevent_req_done(req);
10194 NTSTATUS rpccli_samr_Connect3_recv(struct tevent_req *req,
10195 TALLOC_CTX *mem_ctx,
10196 NTSTATUS *result)
10198 struct rpccli_samr_Connect3_state *state = tevent_req_data(
10199 req, struct rpccli_samr_Connect3_state);
10200 NTSTATUS status;
10202 if (tevent_req_is_nterror(req, &status)) {
10203 tevent_req_received(req);
10204 return status;
10207 /* Steal possbile out parameters to the callers context */
10208 talloc_steal(mem_ctx, state->out_mem_ctx);
10210 /* Return result */
10211 *result = state->orig.out.result;
10213 tevent_req_received(req);
10214 return NT_STATUS_OK;
10217 NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
10218 TALLOC_CTX *mem_ctx,
10219 const char *system_name /* [in] [unique,charset(UTF16)] */,
10220 uint32_t unknown /* [in] */,
10221 uint32_t access_mask /* [in] */,
10222 struct policy_handle *connect_handle /* [out] [ref] */)
10224 struct samr_Connect3 r;
10225 NTSTATUS status;
10227 /* In parameters */
10228 r.in.system_name = system_name;
10229 r.in.unknown = unknown;
10230 r.in.access_mask = access_mask;
10232 if (DEBUGLEVEL >= 10) {
10233 NDR_PRINT_IN_DEBUG(samr_Connect3, &r);
10236 status = cli->dispatch(cli,
10237 mem_ctx,
10238 &ndr_table_samr,
10239 NDR_SAMR_CONNECT3,
10240 &r);
10242 if (!NT_STATUS_IS_OK(status)) {
10243 return status;
10246 if (DEBUGLEVEL >= 10) {
10247 NDR_PRINT_OUT_DEBUG(samr_Connect3, &r);
10250 if (NT_STATUS_IS_ERR(status)) {
10251 return status;
10254 /* Return variables */
10255 *connect_handle = *r.out.connect_handle;
10257 /* Return result */
10258 return r.out.result;
10261 struct rpccli_samr_Connect4_state {
10262 struct samr_Connect4 orig;
10263 struct samr_Connect4 tmp;
10264 TALLOC_CTX *out_mem_ctx;
10265 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10268 static void rpccli_samr_Connect4_done(struct tevent_req *subreq);
10270 struct tevent_req *rpccli_samr_Connect4_send(TALLOC_CTX *mem_ctx,
10271 struct tevent_context *ev,
10272 struct rpc_pipe_client *cli,
10273 const char *_system_name /* [in] [unique,charset(UTF16)] */,
10274 enum samr_ConnectVersion _client_version /* [in] */,
10275 uint32_t _access_mask /* [in] */,
10276 struct policy_handle *_connect_handle /* [out] [ref] */)
10278 struct tevent_req *req;
10279 struct rpccli_samr_Connect4_state *state;
10280 struct tevent_req *subreq;
10282 req = tevent_req_create(mem_ctx, &state,
10283 struct rpccli_samr_Connect4_state);
10284 if (req == NULL) {
10285 return NULL;
10287 state->out_mem_ctx = NULL;
10288 state->dispatch_recv = cli->dispatch_recv;
10290 /* In parameters */
10291 state->orig.in.system_name = _system_name;
10292 state->orig.in.client_version = _client_version;
10293 state->orig.in.access_mask = _access_mask;
10295 /* Out parameters */
10296 state->orig.out.connect_handle = _connect_handle;
10298 /* Result */
10299 ZERO_STRUCT(state->orig.out.result);
10301 if (DEBUGLEVEL >= 10) {
10302 NDR_PRINT_IN_DEBUG(samr_Connect4, &state->orig);
10305 state->out_mem_ctx = talloc_named_const(state, 0,
10306 "rpccli_samr_Connect4_out_memory");
10307 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10308 return tevent_req_post(req, ev);
10311 /* make a temporary copy, that we pass to the dispatch function */
10312 state->tmp = state->orig;
10314 subreq = cli->dispatch_send(state, ev, cli,
10315 &ndr_table_samr,
10316 NDR_SAMR_CONNECT4,
10317 &state->tmp);
10318 if (tevent_req_nomem(subreq, req)) {
10319 return tevent_req_post(req, ev);
10321 tevent_req_set_callback(subreq, rpccli_samr_Connect4_done, req);
10322 return req;
10325 static void rpccli_samr_Connect4_done(struct tevent_req *subreq)
10327 struct tevent_req *req = tevent_req_callback_data(
10328 subreq, struct tevent_req);
10329 struct rpccli_samr_Connect4_state *state = tevent_req_data(
10330 req, struct rpccli_samr_Connect4_state);
10331 NTSTATUS status;
10332 TALLOC_CTX *mem_ctx;
10334 if (state->out_mem_ctx) {
10335 mem_ctx = state->out_mem_ctx;
10336 } else {
10337 mem_ctx = state;
10340 status = state->dispatch_recv(subreq, mem_ctx);
10341 TALLOC_FREE(subreq);
10342 if (!NT_STATUS_IS_OK(status)) {
10343 tevent_req_nterror(req, status);
10344 return;
10347 /* Copy out parameters */
10348 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
10350 /* Copy result */
10351 state->orig.out.result = state->tmp.out.result;
10353 /* Reset temporary structure */
10354 ZERO_STRUCT(state->tmp);
10356 if (DEBUGLEVEL >= 10) {
10357 NDR_PRINT_OUT_DEBUG(samr_Connect4, &state->orig);
10360 tevent_req_done(req);
10363 NTSTATUS rpccli_samr_Connect4_recv(struct tevent_req *req,
10364 TALLOC_CTX *mem_ctx,
10365 NTSTATUS *result)
10367 struct rpccli_samr_Connect4_state *state = tevent_req_data(
10368 req, struct rpccli_samr_Connect4_state);
10369 NTSTATUS status;
10371 if (tevent_req_is_nterror(req, &status)) {
10372 tevent_req_received(req);
10373 return status;
10376 /* Steal possbile out parameters to the callers context */
10377 talloc_steal(mem_ctx, state->out_mem_ctx);
10379 /* Return result */
10380 *result = state->orig.out.result;
10382 tevent_req_received(req);
10383 return NT_STATUS_OK;
10386 NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
10387 TALLOC_CTX *mem_ctx,
10388 const char *system_name /* [in] [unique,charset(UTF16)] */,
10389 enum samr_ConnectVersion client_version /* [in] */,
10390 uint32_t access_mask /* [in] */,
10391 struct policy_handle *connect_handle /* [out] [ref] */)
10393 struct samr_Connect4 r;
10394 NTSTATUS status;
10396 /* In parameters */
10397 r.in.system_name = system_name;
10398 r.in.client_version = client_version;
10399 r.in.access_mask = access_mask;
10401 if (DEBUGLEVEL >= 10) {
10402 NDR_PRINT_IN_DEBUG(samr_Connect4, &r);
10405 status = cli->dispatch(cli,
10406 mem_ctx,
10407 &ndr_table_samr,
10408 NDR_SAMR_CONNECT4,
10409 &r);
10411 if (!NT_STATUS_IS_OK(status)) {
10412 return status;
10415 if (DEBUGLEVEL >= 10) {
10416 NDR_PRINT_OUT_DEBUG(samr_Connect4, &r);
10419 if (NT_STATUS_IS_ERR(status)) {
10420 return status;
10423 /* Return variables */
10424 *connect_handle = *r.out.connect_handle;
10426 /* Return result */
10427 return r.out.result;
10430 struct rpccli_samr_ChangePasswordUser3_state {
10431 struct samr_ChangePasswordUser3 orig;
10432 struct samr_ChangePasswordUser3 tmp;
10433 TALLOC_CTX *out_mem_ctx;
10434 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10437 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq);
10439 struct tevent_req *rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX *mem_ctx,
10440 struct tevent_context *ev,
10441 struct rpc_pipe_client *cli,
10442 struct lsa_String *_server /* [in] [unique] */,
10443 struct lsa_String *_account /* [in] [ref] */,
10444 struct samr_CryptPassword *_nt_password /* [in] [unique] */,
10445 struct samr_Password *_nt_verifier /* [in] [unique] */,
10446 uint8_t _lm_change /* [in] */,
10447 struct samr_CryptPassword *_lm_password /* [in] [unique] */,
10448 struct samr_Password *_lm_verifier /* [in] [unique] */,
10449 struct samr_CryptPassword *_password3 /* [in] [unique] */,
10450 struct samr_DomInfo1 **_dominfo /* [out] [ref] */,
10451 struct samr_ChangeReject **_reject /* [out] [ref] */)
10453 struct tevent_req *req;
10454 struct rpccli_samr_ChangePasswordUser3_state *state;
10455 struct tevent_req *subreq;
10457 req = tevent_req_create(mem_ctx, &state,
10458 struct rpccli_samr_ChangePasswordUser3_state);
10459 if (req == NULL) {
10460 return NULL;
10462 state->out_mem_ctx = NULL;
10463 state->dispatch_recv = cli->dispatch_recv;
10465 /* In parameters */
10466 state->orig.in.server = _server;
10467 state->orig.in.account = _account;
10468 state->orig.in.nt_password = _nt_password;
10469 state->orig.in.nt_verifier = _nt_verifier;
10470 state->orig.in.lm_change = _lm_change;
10471 state->orig.in.lm_password = _lm_password;
10472 state->orig.in.lm_verifier = _lm_verifier;
10473 state->orig.in.password3 = _password3;
10475 /* Out parameters */
10476 state->orig.out.dominfo = _dominfo;
10477 state->orig.out.reject = _reject;
10479 /* Result */
10480 ZERO_STRUCT(state->orig.out.result);
10482 if (DEBUGLEVEL >= 10) {
10483 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &state->orig);
10486 state->out_mem_ctx = talloc_named_const(state, 0,
10487 "rpccli_samr_ChangePasswordUser3_out_memory");
10488 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10489 return tevent_req_post(req, ev);
10492 /* make a temporary copy, that we pass to the dispatch function */
10493 state->tmp = state->orig;
10495 subreq = cli->dispatch_send(state, ev, cli,
10496 &ndr_table_samr,
10497 NDR_SAMR_CHANGEPASSWORDUSER3,
10498 &state->tmp);
10499 if (tevent_req_nomem(subreq, req)) {
10500 return tevent_req_post(req, ev);
10502 tevent_req_set_callback(subreq, rpccli_samr_ChangePasswordUser3_done, req);
10503 return req;
10506 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req *subreq)
10508 struct tevent_req *req = tevent_req_callback_data(
10509 subreq, struct tevent_req);
10510 struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
10511 req, struct rpccli_samr_ChangePasswordUser3_state);
10512 NTSTATUS status;
10513 TALLOC_CTX *mem_ctx;
10515 if (state->out_mem_ctx) {
10516 mem_ctx = state->out_mem_ctx;
10517 } else {
10518 mem_ctx = state;
10521 status = state->dispatch_recv(subreq, mem_ctx);
10522 TALLOC_FREE(subreq);
10523 if (!NT_STATUS_IS_OK(status)) {
10524 tevent_req_nterror(req, status);
10525 return;
10528 /* Copy out parameters */
10529 *state->orig.out.dominfo = *state->tmp.out.dominfo;
10530 *state->orig.out.reject = *state->tmp.out.reject;
10532 /* Copy result */
10533 state->orig.out.result = state->tmp.out.result;
10535 /* Reset temporary structure */
10536 ZERO_STRUCT(state->tmp);
10538 if (DEBUGLEVEL >= 10) {
10539 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &state->orig);
10542 tevent_req_done(req);
10545 NTSTATUS rpccli_samr_ChangePasswordUser3_recv(struct tevent_req *req,
10546 TALLOC_CTX *mem_ctx,
10547 NTSTATUS *result)
10549 struct rpccli_samr_ChangePasswordUser3_state *state = tevent_req_data(
10550 req, struct rpccli_samr_ChangePasswordUser3_state);
10551 NTSTATUS status;
10553 if (tevent_req_is_nterror(req, &status)) {
10554 tevent_req_received(req);
10555 return status;
10558 /* Steal possbile out parameters to the callers context */
10559 talloc_steal(mem_ctx, state->out_mem_ctx);
10561 /* Return result */
10562 *result = state->orig.out.result;
10564 tevent_req_received(req);
10565 return NT_STATUS_OK;
10568 NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
10569 TALLOC_CTX *mem_ctx,
10570 struct lsa_String *server /* [in] [unique] */,
10571 struct lsa_String *account /* [in] [ref] */,
10572 struct samr_CryptPassword *nt_password /* [in] [unique] */,
10573 struct samr_Password *nt_verifier /* [in] [unique] */,
10574 uint8_t lm_change /* [in] */,
10575 struct samr_CryptPassword *lm_password /* [in] [unique] */,
10576 struct samr_Password *lm_verifier /* [in] [unique] */,
10577 struct samr_CryptPassword *password3 /* [in] [unique] */,
10578 struct samr_DomInfo1 **dominfo /* [out] [ref] */,
10579 struct samr_ChangeReject **reject /* [out] [ref] */)
10581 struct samr_ChangePasswordUser3 r;
10582 NTSTATUS status;
10584 /* In parameters */
10585 r.in.server = server;
10586 r.in.account = account;
10587 r.in.nt_password = nt_password;
10588 r.in.nt_verifier = nt_verifier;
10589 r.in.lm_change = lm_change;
10590 r.in.lm_password = lm_password;
10591 r.in.lm_verifier = lm_verifier;
10592 r.in.password3 = password3;
10594 if (DEBUGLEVEL >= 10) {
10595 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &r);
10598 status = cli->dispatch(cli,
10599 mem_ctx,
10600 &ndr_table_samr,
10601 NDR_SAMR_CHANGEPASSWORDUSER3,
10602 &r);
10604 if (!NT_STATUS_IS_OK(status)) {
10605 return status;
10608 if (DEBUGLEVEL >= 10) {
10609 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &r);
10612 if (NT_STATUS_IS_ERR(status)) {
10613 return status;
10616 /* Return variables */
10617 *dominfo = *r.out.dominfo;
10618 *reject = *r.out.reject;
10620 /* Return result */
10621 return r.out.result;
10624 struct rpccli_samr_Connect5_state {
10625 struct samr_Connect5 orig;
10626 struct samr_Connect5 tmp;
10627 TALLOC_CTX *out_mem_ctx;
10628 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10631 static void rpccli_samr_Connect5_done(struct tevent_req *subreq);
10633 struct tevent_req *rpccli_samr_Connect5_send(TALLOC_CTX *mem_ctx,
10634 struct tevent_context *ev,
10635 struct rpc_pipe_client *cli,
10636 const char *_system_name /* [in] [unique,charset(UTF16)] */,
10637 uint32_t _access_mask /* [in] */,
10638 uint32_t _level_in /* [in] */,
10639 union samr_ConnectInfo *_info_in /* [in] [ref,switch_is(level_in)] */,
10640 uint32_t *_level_out /* [out] [ref] */,
10641 union samr_ConnectInfo *_info_out /* [out] [ref,switch_is(*level_out)] */,
10642 struct policy_handle *_connect_handle /* [out] [ref] */)
10644 struct tevent_req *req;
10645 struct rpccli_samr_Connect5_state *state;
10646 struct tevent_req *subreq;
10648 req = tevent_req_create(mem_ctx, &state,
10649 struct rpccli_samr_Connect5_state);
10650 if (req == NULL) {
10651 return NULL;
10653 state->out_mem_ctx = NULL;
10654 state->dispatch_recv = cli->dispatch_recv;
10656 /* In parameters */
10657 state->orig.in.system_name = _system_name;
10658 state->orig.in.access_mask = _access_mask;
10659 state->orig.in.level_in = _level_in;
10660 state->orig.in.info_in = _info_in;
10662 /* Out parameters */
10663 state->orig.out.level_out = _level_out;
10664 state->orig.out.info_out = _info_out;
10665 state->orig.out.connect_handle = _connect_handle;
10667 /* Result */
10668 ZERO_STRUCT(state->orig.out.result);
10670 if (DEBUGLEVEL >= 10) {
10671 NDR_PRINT_IN_DEBUG(samr_Connect5, &state->orig);
10674 state->out_mem_ctx = talloc_named_const(state, 0,
10675 "rpccli_samr_Connect5_out_memory");
10676 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10677 return tevent_req_post(req, ev);
10680 /* make a temporary copy, that we pass to the dispatch function */
10681 state->tmp = state->orig;
10683 subreq = cli->dispatch_send(state, ev, cli,
10684 &ndr_table_samr,
10685 NDR_SAMR_CONNECT5,
10686 &state->tmp);
10687 if (tevent_req_nomem(subreq, req)) {
10688 return tevent_req_post(req, ev);
10690 tevent_req_set_callback(subreq, rpccli_samr_Connect5_done, req);
10691 return req;
10694 static void rpccli_samr_Connect5_done(struct tevent_req *subreq)
10696 struct tevent_req *req = tevent_req_callback_data(
10697 subreq, struct tevent_req);
10698 struct rpccli_samr_Connect5_state *state = tevent_req_data(
10699 req, struct rpccli_samr_Connect5_state);
10700 NTSTATUS status;
10701 TALLOC_CTX *mem_ctx;
10703 if (state->out_mem_ctx) {
10704 mem_ctx = state->out_mem_ctx;
10705 } else {
10706 mem_ctx = state;
10709 status = state->dispatch_recv(subreq, mem_ctx);
10710 TALLOC_FREE(subreq);
10711 if (!NT_STATUS_IS_OK(status)) {
10712 tevent_req_nterror(req, status);
10713 return;
10716 /* Copy out parameters */
10717 *state->orig.out.level_out = *state->tmp.out.level_out;
10718 *state->orig.out.info_out = *state->tmp.out.info_out;
10719 *state->orig.out.connect_handle = *state->tmp.out.connect_handle;
10721 /* Copy result */
10722 state->orig.out.result = state->tmp.out.result;
10724 /* Reset temporary structure */
10725 ZERO_STRUCT(state->tmp);
10727 if (DEBUGLEVEL >= 10) {
10728 NDR_PRINT_OUT_DEBUG(samr_Connect5, &state->orig);
10731 tevent_req_done(req);
10734 NTSTATUS rpccli_samr_Connect5_recv(struct tevent_req *req,
10735 TALLOC_CTX *mem_ctx,
10736 NTSTATUS *result)
10738 struct rpccli_samr_Connect5_state *state = tevent_req_data(
10739 req, struct rpccli_samr_Connect5_state);
10740 NTSTATUS status;
10742 if (tevent_req_is_nterror(req, &status)) {
10743 tevent_req_received(req);
10744 return status;
10747 /* Steal possbile out parameters to the callers context */
10748 talloc_steal(mem_ctx, state->out_mem_ctx);
10750 /* Return result */
10751 *result = state->orig.out.result;
10753 tevent_req_received(req);
10754 return NT_STATUS_OK;
10757 NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
10758 TALLOC_CTX *mem_ctx,
10759 const char *system_name /* [in] [unique,charset(UTF16)] */,
10760 uint32_t access_mask /* [in] */,
10761 uint32_t level_in /* [in] */,
10762 union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */,
10763 uint32_t *level_out /* [out] [ref] */,
10764 union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */,
10765 struct policy_handle *connect_handle /* [out] [ref] */)
10767 struct samr_Connect5 r;
10768 NTSTATUS status;
10770 /* In parameters */
10771 r.in.system_name = system_name;
10772 r.in.access_mask = access_mask;
10773 r.in.level_in = level_in;
10774 r.in.info_in = info_in;
10776 if (DEBUGLEVEL >= 10) {
10777 NDR_PRINT_IN_DEBUG(samr_Connect5, &r);
10780 status = cli->dispatch(cli,
10781 mem_ctx,
10782 &ndr_table_samr,
10783 NDR_SAMR_CONNECT5,
10784 &r);
10786 if (!NT_STATUS_IS_OK(status)) {
10787 return status;
10790 if (DEBUGLEVEL >= 10) {
10791 NDR_PRINT_OUT_DEBUG(samr_Connect5, &r);
10794 if (NT_STATUS_IS_ERR(status)) {
10795 return status;
10798 /* Return variables */
10799 *level_out = *r.out.level_out;
10800 *info_out = *r.out.info_out;
10801 *connect_handle = *r.out.connect_handle;
10803 /* Return result */
10804 return r.out.result;
10807 struct rpccli_samr_RidToSid_state {
10808 struct samr_RidToSid orig;
10809 struct samr_RidToSid tmp;
10810 TALLOC_CTX *out_mem_ctx;
10811 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10814 static void rpccli_samr_RidToSid_done(struct tevent_req *subreq);
10816 struct tevent_req *rpccli_samr_RidToSid_send(TALLOC_CTX *mem_ctx,
10817 struct tevent_context *ev,
10818 struct rpc_pipe_client *cli,
10819 struct policy_handle *_domain_handle /* [in] [ref] */,
10820 uint32_t _rid /* [in] */,
10821 struct dom_sid2 **_sid /* [out] [ref] */)
10823 struct tevent_req *req;
10824 struct rpccli_samr_RidToSid_state *state;
10825 struct tevent_req *subreq;
10827 req = tevent_req_create(mem_ctx, &state,
10828 struct rpccli_samr_RidToSid_state);
10829 if (req == NULL) {
10830 return NULL;
10832 state->out_mem_ctx = NULL;
10833 state->dispatch_recv = cli->dispatch_recv;
10835 /* In parameters */
10836 state->orig.in.domain_handle = _domain_handle;
10837 state->orig.in.rid = _rid;
10839 /* Out parameters */
10840 state->orig.out.sid = _sid;
10842 /* Result */
10843 ZERO_STRUCT(state->orig.out.result);
10845 if (DEBUGLEVEL >= 10) {
10846 NDR_PRINT_IN_DEBUG(samr_RidToSid, &state->orig);
10849 state->out_mem_ctx = talloc_named_const(state, 0,
10850 "rpccli_samr_RidToSid_out_memory");
10851 if (tevent_req_nomem(state->out_mem_ctx, req)) {
10852 return tevent_req_post(req, ev);
10855 /* make a temporary copy, that we pass to the dispatch function */
10856 state->tmp = state->orig;
10858 subreq = cli->dispatch_send(state, ev, cli,
10859 &ndr_table_samr,
10860 NDR_SAMR_RIDTOSID,
10861 &state->tmp);
10862 if (tevent_req_nomem(subreq, req)) {
10863 return tevent_req_post(req, ev);
10865 tevent_req_set_callback(subreq, rpccli_samr_RidToSid_done, req);
10866 return req;
10869 static void rpccli_samr_RidToSid_done(struct tevent_req *subreq)
10871 struct tevent_req *req = tevent_req_callback_data(
10872 subreq, struct tevent_req);
10873 struct rpccli_samr_RidToSid_state *state = tevent_req_data(
10874 req, struct rpccli_samr_RidToSid_state);
10875 NTSTATUS status;
10876 TALLOC_CTX *mem_ctx;
10878 if (state->out_mem_ctx) {
10879 mem_ctx = state->out_mem_ctx;
10880 } else {
10881 mem_ctx = state;
10884 status = state->dispatch_recv(subreq, mem_ctx);
10885 TALLOC_FREE(subreq);
10886 if (!NT_STATUS_IS_OK(status)) {
10887 tevent_req_nterror(req, status);
10888 return;
10891 /* Copy out parameters */
10892 *state->orig.out.sid = *state->tmp.out.sid;
10894 /* Copy result */
10895 state->orig.out.result = state->tmp.out.result;
10897 /* Reset temporary structure */
10898 ZERO_STRUCT(state->tmp);
10900 if (DEBUGLEVEL >= 10) {
10901 NDR_PRINT_OUT_DEBUG(samr_RidToSid, &state->orig);
10904 tevent_req_done(req);
10907 NTSTATUS rpccli_samr_RidToSid_recv(struct tevent_req *req,
10908 TALLOC_CTX *mem_ctx,
10909 NTSTATUS *result)
10911 struct rpccli_samr_RidToSid_state *state = tevent_req_data(
10912 req, struct rpccli_samr_RidToSid_state);
10913 NTSTATUS status;
10915 if (tevent_req_is_nterror(req, &status)) {
10916 tevent_req_received(req);
10917 return status;
10920 /* Steal possbile out parameters to the callers context */
10921 talloc_steal(mem_ctx, state->out_mem_ctx);
10923 /* Return result */
10924 *result = state->orig.out.result;
10926 tevent_req_received(req);
10927 return NT_STATUS_OK;
10930 NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
10931 TALLOC_CTX *mem_ctx,
10932 struct policy_handle *domain_handle /* [in] [ref] */,
10933 uint32_t rid /* [in] */,
10934 struct dom_sid2 **sid /* [out] [ref] */)
10936 struct samr_RidToSid r;
10937 NTSTATUS status;
10939 /* In parameters */
10940 r.in.domain_handle = domain_handle;
10941 r.in.rid = rid;
10943 if (DEBUGLEVEL >= 10) {
10944 NDR_PRINT_IN_DEBUG(samr_RidToSid, &r);
10947 status = cli->dispatch(cli,
10948 mem_ctx,
10949 &ndr_table_samr,
10950 NDR_SAMR_RIDTOSID,
10951 &r);
10953 if (!NT_STATUS_IS_OK(status)) {
10954 return status;
10957 if (DEBUGLEVEL >= 10) {
10958 NDR_PRINT_OUT_DEBUG(samr_RidToSid, &r);
10961 if (NT_STATUS_IS_ERR(status)) {
10962 return status;
10965 /* Return variables */
10966 *sid = *r.out.sid;
10968 /* Return result */
10969 return r.out.result;
10972 struct rpccli_samr_SetDsrmPassword_state {
10973 struct samr_SetDsrmPassword orig;
10974 struct samr_SetDsrmPassword tmp;
10975 TALLOC_CTX *out_mem_ctx;
10976 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10979 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq);
10981 struct tevent_req *rpccli_samr_SetDsrmPassword_send(TALLOC_CTX *mem_ctx,
10982 struct tevent_context *ev,
10983 struct rpc_pipe_client *cli,
10984 struct lsa_String *_name /* [in] [unique] */,
10985 uint32_t _unknown /* [in] */,
10986 struct samr_Password *_hash /* [in] [unique] */)
10988 struct tevent_req *req;
10989 struct rpccli_samr_SetDsrmPassword_state *state;
10990 struct tevent_req *subreq;
10992 req = tevent_req_create(mem_ctx, &state,
10993 struct rpccli_samr_SetDsrmPassword_state);
10994 if (req == NULL) {
10995 return NULL;
10997 state->out_mem_ctx = NULL;
10998 state->dispatch_recv = cli->dispatch_recv;
11000 /* In parameters */
11001 state->orig.in.name = _name;
11002 state->orig.in.unknown = _unknown;
11003 state->orig.in.hash = _hash;
11005 /* Out parameters */
11007 /* Result */
11008 ZERO_STRUCT(state->orig.out.result);
11010 if (DEBUGLEVEL >= 10) {
11011 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &state->orig);
11014 /* make a temporary copy, that we pass to the dispatch function */
11015 state->tmp = state->orig;
11017 subreq = cli->dispatch_send(state, ev, cli,
11018 &ndr_table_samr,
11019 NDR_SAMR_SETDSRMPASSWORD,
11020 &state->tmp);
11021 if (tevent_req_nomem(subreq, req)) {
11022 return tevent_req_post(req, ev);
11024 tevent_req_set_callback(subreq, rpccli_samr_SetDsrmPassword_done, req);
11025 return req;
11028 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req *subreq)
11030 struct tevent_req *req = tevent_req_callback_data(
11031 subreq, struct tevent_req);
11032 struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
11033 req, struct rpccli_samr_SetDsrmPassword_state);
11034 NTSTATUS status;
11035 TALLOC_CTX *mem_ctx;
11037 if (state->out_mem_ctx) {
11038 mem_ctx = state->out_mem_ctx;
11039 } else {
11040 mem_ctx = state;
11043 status = state->dispatch_recv(subreq, mem_ctx);
11044 TALLOC_FREE(subreq);
11045 if (!NT_STATUS_IS_OK(status)) {
11046 tevent_req_nterror(req, status);
11047 return;
11050 /* Copy out parameters */
11052 /* Copy result */
11053 state->orig.out.result = state->tmp.out.result;
11055 /* Reset temporary structure */
11056 ZERO_STRUCT(state->tmp);
11058 if (DEBUGLEVEL >= 10) {
11059 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &state->orig);
11062 tevent_req_done(req);
11065 NTSTATUS rpccli_samr_SetDsrmPassword_recv(struct tevent_req *req,
11066 TALLOC_CTX *mem_ctx,
11067 NTSTATUS *result)
11069 struct rpccli_samr_SetDsrmPassword_state *state = tevent_req_data(
11070 req, struct rpccli_samr_SetDsrmPassword_state);
11071 NTSTATUS status;
11073 if (tevent_req_is_nterror(req, &status)) {
11074 tevent_req_received(req);
11075 return status;
11078 /* Steal possbile out parameters to the callers context */
11079 talloc_steal(mem_ctx, state->out_mem_ctx);
11081 /* Return result */
11082 *result = state->orig.out.result;
11084 tevent_req_received(req);
11085 return NT_STATUS_OK;
11088 NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
11089 TALLOC_CTX *mem_ctx,
11090 struct lsa_String *name /* [in] [unique] */,
11091 uint32_t unknown /* [in] */,
11092 struct samr_Password *hash /* [in] [unique] */)
11094 struct samr_SetDsrmPassword r;
11095 NTSTATUS status;
11097 /* In parameters */
11098 r.in.name = name;
11099 r.in.unknown = unknown;
11100 r.in.hash = hash;
11102 if (DEBUGLEVEL >= 10) {
11103 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &r);
11106 status = cli->dispatch(cli,
11107 mem_ctx,
11108 &ndr_table_samr,
11109 NDR_SAMR_SETDSRMPASSWORD,
11110 &r);
11112 if (!NT_STATUS_IS_OK(status)) {
11113 return status;
11116 if (DEBUGLEVEL >= 10) {
11117 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &r);
11120 if (NT_STATUS_IS_ERR(status)) {
11121 return status;
11124 /* Return variables */
11126 /* Return result */
11127 return r.out.result;
11130 struct rpccli_samr_ValidatePassword_state {
11131 struct samr_ValidatePassword orig;
11132 struct samr_ValidatePassword tmp;
11133 TALLOC_CTX *out_mem_ctx;
11134 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11137 static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq);
11139 struct tevent_req *rpccli_samr_ValidatePassword_send(TALLOC_CTX *mem_ctx,
11140 struct tevent_context *ev,
11141 struct rpc_pipe_client *cli,
11142 enum samr_ValidatePasswordLevel _level /* [in] */,
11143 union samr_ValidatePasswordReq *_req /* [in] [ref,switch_is(level)] */,
11144 union samr_ValidatePasswordRep **_rep /* [out] [ref,switch_is(level)] */)
11146 struct tevent_req *req;
11147 struct rpccli_samr_ValidatePassword_state *state;
11148 struct tevent_req *subreq;
11150 req = tevent_req_create(mem_ctx, &state,
11151 struct rpccli_samr_ValidatePassword_state);
11152 if (req == NULL) {
11153 return NULL;
11155 state->out_mem_ctx = NULL;
11156 state->dispatch_recv = cli->dispatch_recv;
11158 /* In parameters */
11159 state->orig.in.level = _level;
11160 state->orig.in.req = _req;
11162 /* Out parameters */
11163 state->orig.out.rep = _rep;
11165 /* Result */
11166 ZERO_STRUCT(state->orig.out.result);
11168 if (DEBUGLEVEL >= 10) {
11169 NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &state->orig);
11172 state->out_mem_ctx = talloc_named_const(state, 0,
11173 "rpccli_samr_ValidatePassword_out_memory");
11174 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11175 return tevent_req_post(req, ev);
11178 /* make a temporary copy, that we pass to the dispatch function */
11179 state->tmp = state->orig;
11181 subreq = cli->dispatch_send(state, ev, cli,
11182 &ndr_table_samr,
11183 NDR_SAMR_VALIDATEPASSWORD,
11184 &state->tmp);
11185 if (tevent_req_nomem(subreq, req)) {
11186 return tevent_req_post(req, ev);
11188 tevent_req_set_callback(subreq, rpccli_samr_ValidatePassword_done, req);
11189 return req;
11192 static void rpccli_samr_ValidatePassword_done(struct tevent_req *subreq)
11194 struct tevent_req *req = tevent_req_callback_data(
11195 subreq, struct tevent_req);
11196 struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
11197 req, struct rpccli_samr_ValidatePassword_state);
11198 NTSTATUS status;
11199 TALLOC_CTX *mem_ctx;
11201 if (state->out_mem_ctx) {
11202 mem_ctx = state->out_mem_ctx;
11203 } else {
11204 mem_ctx = state;
11207 status = state->dispatch_recv(subreq, mem_ctx);
11208 TALLOC_FREE(subreq);
11209 if (!NT_STATUS_IS_OK(status)) {
11210 tevent_req_nterror(req, status);
11211 return;
11214 /* Copy out parameters */
11215 *state->orig.out.rep = *state->tmp.out.rep;
11217 /* Copy result */
11218 state->orig.out.result = state->tmp.out.result;
11220 /* Reset temporary structure */
11221 ZERO_STRUCT(state->tmp);
11223 if (DEBUGLEVEL >= 10) {
11224 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &state->orig);
11227 tevent_req_done(req);
11230 NTSTATUS rpccli_samr_ValidatePassword_recv(struct tevent_req *req,
11231 TALLOC_CTX *mem_ctx,
11232 NTSTATUS *result)
11234 struct rpccli_samr_ValidatePassword_state *state = tevent_req_data(
11235 req, struct rpccli_samr_ValidatePassword_state);
11236 NTSTATUS status;
11238 if (tevent_req_is_nterror(req, &status)) {
11239 tevent_req_received(req);
11240 return status;
11243 /* Steal possbile out parameters to the callers context */
11244 talloc_steal(mem_ctx, state->out_mem_ctx);
11246 /* Return result */
11247 *result = state->orig.out.result;
11249 tevent_req_received(req);
11250 return NT_STATUS_OK;
11253 NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli,
11254 TALLOC_CTX *mem_ctx,
11255 enum samr_ValidatePasswordLevel level /* [in] */,
11256 union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */,
11257 union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */)
11259 struct samr_ValidatePassword r;
11260 NTSTATUS status;
11262 /* In parameters */
11263 r.in.level = level;
11264 r.in.req = req;
11266 if (DEBUGLEVEL >= 10) {
11267 NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &r);
11270 status = cli->dispatch(cli,
11271 mem_ctx,
11272 &ndr_table_samr,
11273 NDR_SAMR_VALIDATEPASSWORD,
11274 &r);
11276 if (!NT_STATUS_IS_OK(status)) {
11277 return status;
11280 if (DEBUGLEVEL >= 10) {
11281 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &r);
11284 if (NT_STATUS_IS_ERR(status)) {
11285 return status;
11288 /* Return variables */
11289 *rep = *r.out.rep;
11291 /* Return result */
11292 return r.out.result;