util_strlist: Add some more "const"s - small correction
[Samba/ekacnet.git] / librpc / gen_ndr / cli_lsa.c
blobbc51b71798b7c035828221cbab968bd980b7a8d7
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_lsa.h"
9 struct rpccli_lsa_Close_state {
10 struct lsa_Close orig;
11 struct lsa_Close tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_lsa_Close_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_lsa_Close_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 struct policy_handle *_handle /* [in,out] [ref] */)
23 struct tevent_req *req;
24 struct rpccli_lsa_Close_state *state;
25 struct tevent_req *subreq;
27 req = tevent_req_create(mem_ctx, &state,
28 struct rpccli_lsa_Close_state);
29 if (req == NULL) {
30 return NULL;
32 state->out_mem_ctx = NULL;
33 state->dispatch_recv = cli->dispatch_recv;
35 /* In parameters */
36 state->orig.in.handle = _handle;
38 /* Out parameters */
39 state->orig.out.handle = _handle;
41 /* Result */
42 ZERO_STRUCT(state->orig.out.result);
44 if (DEBUGLEVEL >= 10) {
45 NDR_PRINT_IN_DEBUG(lsa_Close, &state->orig);
48 state->out_mem_ctx = talloc_named_const(state, 0,
49 "rpccli_lsa_Close_out_memory");
50 if (tevent_req_nomem(state->out_mem_ctx, req)) {
51 return tevent_req_post(req, ev);
54 /* make a temporary copy, that we pass to the dispatch function */
55 state->tmp = state->orig;
57 subreq = cli->dispatch_send(state, ev, cli,
58 &ndr_table_lsarpc,
59 NDR_LSA_CLOSE,
60 &state->tmp);
61 if (tevent_req_nomem(subreq, req)) {
62 return tevent_req_post(req, ev);
64 tevent_req_set_callback(subreq, rpccli_lsa_Close_done, req);
65 return req;
68 static void rpccli_lsa_Close_done(struct tevent_req *subreq)
70 struct tevent_req *req = tevent_req_callback_data(
71 subreq, struct tevent_req);
72 struct rpccli_lsa_Close_state *state = tevent_req_data(
73 req, struct rpccli_lsa_Close_state);
74 NTSTATUS status;
75 TALLOC_CTX *mem_ctx;
77 if (state->out_mem_ctx) {
78 mem_ctx = state->out_mem_ctx;
79 } else {
80 mem_ctx = state;
83 status = state->dispatch_recv(subreq, mem_ctx);
84 TALLOC_FREE(subreq);
85 if (!NT_STATUS_IS_OK(status)) {
86 tevent_req_nterror(req, status);
87 return;
90 /* Copy out parameters */
91 *state->orig.out.handle = *state->tmp.out.handle;
93 /* Copy result */
94 state->orig.out.result = state->tmp.out.result;
96 /* Reset temporary structure */
97 ZERO_STRUCT(state->tmp);
99 if (DEBUGLEVEL >= 10) {
100 NDR_PRINT_OUT_DEBUG(lsa_Close, &state->orig);
103 tevent_req_done(req);
106 NTSTATUS rpccli_lsa_Close_recv(struct tevent_req *req,
107 TALLOC_CTX *mem_ctx,
108 NTSTATUS *result)
110 struct rpccli_lsa_Close_state *state = tevent_req_data(
111 req, struct rpccli_lsa_Close_state);
112 NTSTATUS status;
114 if (tevent_req_is_nterror(req, &status)) {
115 tevent_req_received(req);
116 return status;
119 /* Steal possbile out parameters to the callers context */
120 talloc_steal(mem_ctx, state->out_mem_ctx);
122 /* Return result */
123 *result = state->orig.out.result;
125 tevent_req_received(req);
126 return NT_STATUS_OK;
129 NTSTATUS rpccli_lsa_Close(struct rpc_pipe_client *cli,
130 TALLOC_CTX *mem_ctx,
131 struct policy_handle *handle /* [in,out] [ref] */)
133 struct lsa_Close r;
134 NTSTATUS status;
136 /* In parameters */
137 r.in.handle = handle;
139 if (DEBUGLEVEL >= 10) {
140 NDR_PRINT_IN_DEBUG(lsa_Close, &r);
143 status = cli->dispatch(cli,
144 mem_ctx,
145 &ndr_table_lsarpc,
146 NDR_LSA_CLOSE,
147 &r);
149 if (!NT_STATUS_IS_OK(status)) {
150 return status;
153 if (DEBUGLEVEL >= 10) {
154 NDR_PRINT_OUT_DEBUG(lsa_Close, &r);
157 if (NT_STATUS_IS_ERR(status)) {
158 return status;
161 /* Return variables */
162 *handle = *r.out.handle;
164 /* Return result */
165 return r.out.result;
168 struct rpccli_lsa_Delete_state {
169 struct lsa_Delete orig;
170 struct lsa_Delete tmp;
171 TALLOC_CTX *out_mem_ctx;
172 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
175 static void rpccli_lsa_Delete_done(struct tevent_req *subreq);
177 struct tevent_req *rpccli_lsa_Delete_send(TALLOC_CTX *mem_ctx,
178 struct tevent_context *ev,
179 struct rpc_pipe_client *cli,
180 struct policy_handle *_handle /* [in] [ref] */)
182 struct tevent_req *req;
183 struct rpccli_lsa_Delete_state *state;
184 struct tevent_req *subreq;
186 req = tevent_req_create(mem_ctx, &state,
187 struct rpccli_lsa_Delete_state);
188 if (req == NULL) {
189 return NULL;
191 state->out_mem_ctx = NULL;
192 state->dispatch_recv = cli->dispatch_recv;
194 /* In parameters */
195 state->orig.in.handle = _handle;
197 /* Out parameters */
199 /* Result */
200 ZERO_STRUCT(state->orig.out.result);
202 if (DEBUGLEVEL >= 10) {
203 NDR_PRINT_IN_DEBUG(lsa_Delete, &state->orig);
206 /* make a temporary copy, that we pass to the dispatch function */
207 state->tmp = state->orig;
209 subreq = cli->dispatch_send(state, ev, cli,
210 &ndr_table_lsarpc,
211 NDR_LSA_DELETE,
212 &state->tmp);
213 if (tevent_req_nomem(subreq, req)) {
214 return tevent_req_post(req, ev);
216 tevent_req_set_callback(subreq, rpccli_lsa_Delete_done, req);
217 return req;
220 static void rpccli_lsa_Delete_done(struct tevent_req *subreq)
222 struct tevent_req *req = tevent_req_callback_data(
223 subreq, struct tevent_req);
224 struct rpccli_lsa_Delete_state *state = tevent_req_data(
225 req, struct rpccli_lsa_Delete_state);
226 NTSTATUS status;
227 TALLOC_CTX *mem_ctx;
229 if (state->out_mem_ctx) {
230 mem_ctx = state->out_mem_ctx;
231 } else {
232 mem_ctx = state;
235 status = state->dispatch_recv(subreq, mem_ctx);
236 TALLOC_FREE(subreq);
237 if (!NT_STATUS_IS_OK(status)) {
238 tevent_req_nterror(req, status);
239 return;
242 /* Copy out parameters */
244 /* Copy result */
245 state->orig.out.result = state->tmp.out.result;
247 /* Reset temporary structure */
248 ZERO_STRUCT(state->tmp);
250 if (DEBUGLEVEL >= 10) {
251 NDR_PRINT_OUT_DEBUG(lsa_Delete, &state->orig);
254 tevent_req_done(req);
257 NTSTATUS rpccli_lsa_Delete_recv(struct tevent_req *req,
258 TALLOC_CTX *mem_ctx,
259 NTSTATUS *result)
261 struct rpccli_lsa_Delete_state *state = tevent_req_data(
262 req, struct rpccli_lsa_Delete_state);
263 NTSTATUS status;
265 if (tevent_req_is_nterror(req, &status)) {
266 tevent_req_received(req);
267 return status;
270 /* Steal possbile out parameters to the callers context */
271 talloc_steal(mem_ctx, state->out_mem_ctx);
273 /* Return result */
274 *result = state->orig.out.result;
276 tevent_req_received(req);
277 return NT_STATUS_OK;
280 NTSTATUS rpccli_lsa_Delete(struct rpc_pipe_client *cli,
281 TALLOC_CTX *mem_ctx,
282 struct policy_handle *handle /* [in] [ref] */)
284 struct lsa_Delete r;
285 NTSTATUS status;
287 /* In parameters */
288 r.in.handle = handle;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_IN_DEBUG(lsa_Delete, &r);
294 status = cli->dispatch(cli,
295 mem_ctx,
296 &ndr_table_lsarpc,
297 NDR_LSA_DELETE,
298 &r);
300 if (!NT_STATUS_IS_OK(status)) {
301 return status;
304 if (DEBUGLEVEL >= 10) {
305 NDR_PRINT_OUT_DEBUG(lsa_Delete, &r);
308 if (NT_STATUS_IS_ERR(status)) {
309 return status;
312 /* Return variables */
314 /* Return result */
315 return r.out.result;
318 struct rpccli_lsa_EnumPrivs_state {
319 struct lsa_EnumPrivs orig;
320 struct lsa_EnumPrivs tmp;
321 TALLOC_CTX *out_mem_ctx;
322 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
325 static void rpccli_lsa_EnumPrivs_done(struct tevent_req *subreq);
327 struct tevent_req *rpccli_lsa_EnumPrivs_send(TALLOC_CTX *mem_ctx,
328 struct tevent_context *ev,
329 struct rpc_pipe_client *cli,
330 struct policy_handle *_handle /* [in] [ref] */,
331 uint32_t *_resume_handle /* [in,out] [ref] */,
332 struct lsa_PrivArray *_privs /* [out] [ref] */,
333 uint32_t _max_count /* [in] */)
335 struct tevent_req *req;
336 struct rpccli_lsa_EnumPrivs_state *state;
337 struct tevent_req *subreq;
339 req = tevent_req_create(mem_ctx, &state,
340 struct rpccli_lsa_EnumPrivs_state);
341 if (req == NULL) {
342 return NULL;
344 state->out_mem_ctx = NULL;
345 state->dispatch_recv = cli->dispatch_recv;
347 /* In parameters */
348 state->orig.in.handle = _handle;
349 state->orig.in.resume_handle = _resume_handle;
350 state->orig.in.max_count = _max_count;
352 /* Out parameters */
353 state->orig.out.resume_handle = _resume_handle;
354 state->orig.out.privs = _privs;
356 /* Result */
357 ZERO_STRUCT(state->orig.out.result);
359 if (DEBUGLEVEL >= 10) {
360 NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, &state->orig);
363 state->out_mem_ctx = talloc_named_const(state, 0,
364 "rpccli_lsa_EnumPrivs_out_memory");
365 if (tevent_req_nomem(state->out_mem_ctx, req)) {
366 return tevent_req_post(req, ev);
369 /* make a temporary copy, that we pass to the dispatch function */
370 state->tmp = state->orig;
372 subreq = cli->dispatch_send(state, ev, cli,
373 &ndr_table_lsarpc,
374 NDR_LSA_ENUMPRIVS,
375 &state->tmp);
376 if (tevent_req_nomem(subreq, req)) {
377 return tevent_req_post(req, ev);
379 tevent_req_set_callback(subreq, rpccli_lsa_EnumPrivs_done, req);
380 return req;
383 static void rpccli_lsa_EnumPrivs_done(struct tevent_req *subreq)
385 struct tevent_req *req = tevent_req_callback_data(
386 subreq, struct tevent_req);
387 struct rpccli_lsa_EnumPrivs_state *state = tevent_req_data(
388 req, struct rpccli_lsa_EnumPrivs_state);
389 NTSTATUS status;
390 TALLOC_CTX *mem_ctx;
392 if (state->out_mem_ctx) {
393 mem_ctx = state->out_mem_ctx;
394 } else {
395 mem_ctx = state;
398 status = state->dispatch_recv(subreq, mem_ctx);
399 TALLOC_FREE(subreq);
400 if (!NT_STATUS_IS_OK(status)) {
401 tevent_req_nterror(req, status);
402 return;
405 /* Copy out parameters */
406 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
407 *state->orig.out.privs = *state->tmp.out.privs;
409 /* Copy result */
410 state->orig.out.result = state->tmp.out.result;
412 /* Reset temporary structure */
413 ZERO_STRUCT(state->tmp);
415 if (DEBUGLEVEL >= 10) {
416 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &state->orig);
419 tevent_req_done(req);
422 NTSTATUS rpccli_lsa_EnumPrivs_recv(struct tevent_req *req,
423 TALLOC_CTX *mem_ctx,
424 NTSTATUS *result)
426 struct rpccli_lsa_EnumPrivs_state *state = tevent_req_data(
427 req, struct rpccli_lsa_EnumPrivs_state);
428 NTSTATUS status;
430 if (tevent_req_is_nterror(req, &status)) {
431 tevent_req_received(req);
432 return status;
435 /* Steal possbile out parameters to the callers context */
436 talloc_steal(mem_ctx, state->out_mem_ctx);
438 /* Return result */
439 *result = state->orig.out.result;
441 tevent_req_received(req);
442 return NT_STATUS_OK;
445 NTSTATUS rpccli_lsa_EnumPrivs(struct rpc_pipe_client *cli,
446 TALLOC_CTX *mem_ctx,
447 struct policy_handle *handle /* [in] [ref] */,
448 uint32_t *resume_handle /* [in,out] [ref] */,
449 struct lsa_PrivArray *privs /* [out] [ref] */,
450 uint32_t max_count /* [in] */)
452 struct lsa_EnumPrivs r;
453 NTSTATUS status;
455 /* In parameters */
456 r.in.handle = handle;
457 r.in.resume_handle = resume_handle;
458 r.in.max_count = max_count;
460 if (DEBUGLEVEL >= 10) {
461 NDR_PRINT_IN_DEBUG(lsa_EnumPrivs, &r);
464 status = cli->dispatch(cli,
465 mem_ctx,
466 &ndr_table_lsarpc,
467 NDR_LSA_ENUMPRIVS,
468 &r);
470 if (!NT_STATUS_IS_OK(status)) {
471 return status;
474 if (DEBUGLEVEL >= 10) {
475 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivs, &r);
478 if (NT_STATUS_IS_ERR(status)) {
479 return status;
482 /* Return variables */
483 *resume_handle = *r.out.resume_handle;
484 *privs = *r.out.privs;
486 /* Return result */
487 return r.out.result;
490 struct rpccli_lsa_QuerySecurity_state {
491 struct lsa_QuerySecurity orig;
492 struct lsa_QuerySecurity tmp;
493 TALLOC_CTX *out_mem_ctx;
494 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
497 static void rpccli_lsa_QuerySecurity_done(struct tevent_req *subreq);
499 struct tevent_req *rpccli_lsa_QuerySecurity_send(TALLOC_CTX *mem_ctx,
500 struct tevent_context *ev,
501 struct rpc_pipe_client *cli,
502 struct policy_handle *_handle /* [in] [ref] */,
503 uint32_t _sec_info /* [in] */,
504 struct sec_desc_buf **_sdbuf /* [out] [ref] */)
506 struct tevent_req *req;
507 struct rpccli_lsa_QuerySecurity_state *state;
508 struct tevent_req *subreq;
510 req = tevent_req_create(mem_ctx, &state,
511 struct rpccli_lsa_QuerySecurity_state);
512 if (req == NULL) {
513 return NULL;
515 state->out_mem_ctx = NULL;
516 state->dispatch_recv = cli->dispatch_recv;
518 /* In parameters */
519 state->orig.in.handle = _handle;
520 state->orig.in.sec_info = _sec_info;
522 /* Out parameters */
523 state->orig.out.sdbuf = _sdbuf;
525 /* Result */
526 ZERO_STRUCT(state->orig.out.result);
528 if (DEBUGLEVEL >= 10) {
529 NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, &state->orig);
532 state->out_mem_ctx = talloc_named_const(state, 0,
533 "rpccli_lsa_QuerySecurity_out_memory");
534 if (tevent_req_nomem(state->out_mem_ctx, req)) {
535 return tevent_req_post(req, ev);
538 /* make a temporary copy, that we pass to the dispatch function */
539 state->tmp = state->orig;
541 subreq = cli->dispatch_send(state, ev, cli,
542 &ndr_table_lsarpc,
543 NDR_LSA_QUERYSECURITY,
544 &state->tmp);
545 if (tevent_req_nomem(subreq, req)) {
546 return tevent_req_post(req, ev);
548 tevent_req_set_callback(subreq, rpccli_lsa_QuerySecurity_done, req);
549 return req;
552 static void rpccli_lsa_QuerySecurity_done(struct tevent_req *subreq)
554 struct tevent_req *req = tevent_req_callback_data(
555 subreq, struct tevent_req);
556 struct rpccli_lsa_QuerySecurity_state *state = tevent_req_data(
557 req, struct rpccli_lsa_QuerySecurity_state);
558 NTSTATUS status;
559 TALLOC_CTX *mem_ctx;
561 if (state->out_mem_ctx) {
562 mem_ctx = state->out_mem_ctx;
563 } else {
564 mem_ctx = state;
567 status = state->dispatch_recv(subreq, mem_ctx);
568 TALLOC_FREE(subreq);
569 if (!NT_STATUS_IS_OK(status)) {
570 tevent_req_nterror(req, status);
571 return;
574 /* Copy out parameters */
575 *state->orig.out.sdbuf = *state->tmp.out.sdbuf;
577 /* Copy result */
578 state->orig.out.result = state->tmp.out.result;
580 /* Reset temporary structure */
581 ZERO_STRUCT(state->tmp);
583 if (DEBUGLEVEL >= 10) {
584 NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &state->orig);
587 tevent_req_done(req);
590 NTSTATUS rpccli_lsa_QuerySecurity_recv(struct tevent_req *req,
591 TALLOC_CTX *mem_ctx,
592 NTSTATUS *result)
594 struct rpccli_lsa_QuerySecurity_state *state = tevent_req_data(
595 req, struct rpccli_lsa_QuerySecurity_state);
596 NTSTATUS status;
598 if (tevent_req_is_nterror(req, &status)) {
599 tevent_req_received(req);
600 return status;
603 /* Steal possbile out parameters to the callers context */
604 talloc_steal(mem_ctx, state->out_mem_ctx);
606 /* Return result */
607 *result = state->orig.out.result;
609 tevent_req_received(req);
610 return NT_STATUS_OK;
613 NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli,
614 TALLOC_CTX *mem_ctx,
615 struct policy_handle *handle /* [in] [ref] */,
616 uint32_t sec_info /* [in] */,
617 struct sec_desc_buf **sdbuf /* [out] [ref] */)
619 struct lsa_QuerySecurity r;
620 NTSTATUS status;
622 /* In parameters */
623 r.in.handle = handle;
624 r.in.sec_info = sec_info;
626 if (DEBUGLEVEL >= 10) {
627 NDR_PRINT_IN_DEBUG(lsa_QuerySecurity, &r);
630 status = cli->dispatch(cli,
631 mem_ctx,
632 &ndr_table_lsarpc,
633 NDR_LSA_QUERYSECURITY,
634 &r);
636 if (!NT_STATUS_IS_OK(status)) {
637 return status;
640 if (DEBUGLEVEL >= 10) {
641 NDR_PRINT_OUT_DEBUG(lsa_QuerySecurity, &r);
644 if (NT_STATUS_IS_ERR(status)) {
645 return status;
648 /* Return variables */
649 *sdbuf = *r.out.sdbuf;
651 /* Return result */
652 return r.out.result;
655 struct rpccli_lsa_SetSecObj_state {
656 struct lsa_SetSecObj orig;
657 struct lsa_SetSecObj tmp;
658 TALLOC_CTX *out_mem_ctx;
659 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
662 static void rpccli_lsa_SetSecObj_done(struct tevent_req *subreq);
664 struct tevent_req *rpccli_lsa_SetSecObj_send(TALLOC_CTX *mem_ctx,
665 struct tevent_context *ev,
666 struct rpc_pipe_client *cli,
667 struct policy_handle *_handle /* [in] [ref] */,
668 uint32_t _sec_info /* [in] */,
669 struct sec_desc_buf *_sdbuf /* [in] [ref] */)
671 struct tevent_req *req;
672 struct rpccli_lsa_SetSecObj_state *state;
673 struct tevent_req *subreq;
675 req = tevent_req_create(mem_ctx, &state,
676 struct rpccli_lsa_SetSecObj_state);
677 if (req == NULL) {
678 return NULL;
680 state->out_mem_ctx = NULL;
681 state->dispatch_recv = cli->dispatch_recv;
683 /* In parameters */
684 state->orig.in.handle = _handle;
685 state->orig.in.sec_info = _sec_info;
686 state->orig.in.sdbuf = _sdbuf;
688 /* Out parameters */
690 /* Result */
691 ZERO_STRUCT(state->orig.out.result);
693 if (DEBUGLEVEL >= 10) {
694 NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &state->orig);
697 /* make a temporary copy, that we pass to the dispatch function */
698 state->tmp = state->orig;
700 subreq = cli->dispatch_send(state, ev, cli,
701 &ndr_table_lsarpc,
702 NDR_LSA_SETSECOBJ,
703 &state->tmp);
704 if (tevent_req_nomem(subreq, req)) {
705 return tevent_req_post(req, ev);
707 tevent_req_set_callback(subreq, rpccli_lsa_SetSecObj_done, req);
708 return req;
711 static void rpccli_lsa_SetSecObj_done(struct tevent_req *subreq)
713 struct tevent_req *req = tevent_req_callback_data(
714 subreq, struct tevent_req);
715 struct rpccli_lsa_SetSecObj_state *state = tevent_req_data(
716 req, struct rpccli_lsa_SetSecObj_state);
717 NTSTATUS status;
718 TALLOC_CTX *mem_ctx;
720 if (state->out_mem_ctx) {
721 mem_ctx = state->out_mem_ctx;
722 } else {
723 mem_ctx = state;
726 status = state->dispatch_recv(subreq, mem_ctx);
727 TALLOC_FREE(subreq);
728 if (!NT_STATUS_IS_OK(status)) {
729 tevent_req_nterror(req, status);
730 return;
733 /* Copy out parameters */
735 /* Copy result */
736 state->orig.out.result = state->tmp.out.result;
738 /* Reset temporary structure */
739 ZERO_STRUCT(state->tmp);
741 if (DEBUGLEVEL >= 10) {
742 NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &state->orig);
745 tevent_req_done(req);
748 NTSTATUS rpccli_lsa_SetSecObj_recv(struct tevent_req *req,
749 TALLOC_CTX *mem_ctx,
750 NTSTATUS *result)
752 struct rpccli_lsa_SetSecObj_state *state = tevent_req_data(
753 req, struct rpccli_lsa_SetSecObj_state);
754 NTSTATUS status;
756 if (tevent_req_is_nterror(req, &status)) {
757 tevent_req_received(req);
758 return status;
761 /* Steal possbile out parameters to the callers context */
762 talloc_steal(mem_ctx, state->out_mem_ctx);
764 /* Return result */
765 *result = state->orig.out.result;
767 tevent_req_received(req);
768 return NT_STATUS_OK;
771 NTSTATUS rpccli_lsa_SetSecObj(struct rpc_pipe_client *cli,
772 TALLOC_CTX *mem_ctx,
773 struct policy_handle *handle /* [in] [ref] */,
774 uint32_t sec_info /* [in] */,
775 struct sec_desc_buf *sdbuf /* [in] [ref] */)
777 struct lsa_SetSecObj r;
778 NTSTATUS status;
780 /* In parameters */
781 r.in.handle = handle;
782 r.in.sec_info = sec_info;
783 r.in.sdbuf = sdbuf;
785 if (DEBUGLEVEL >= 10) {
786 NDR_PRINT_IN_DEBUG(lsa_SetSecObj, &r);
789 status = cli->dispatch(cli,
790 mem_ctx,
791 &ndr_table_lsarpc,
792 NDR_LSA_SETSECOBJ,
793 &r);
795 if (!NT_STATUS_IS_OK(status)) {
796 return status;
799 if (DEBUGLEVEL >= 10) {
800 NDR_PRINT_OUT_DEBUG(lsa_SetSecObj, &r);
803 if (NT_STATUS_IS_ERR(status)) {
804 return status;
807 /* Return variables */
809 /* Return result */
810 return r.out.result;
813 struct rpccli_lsa_ChangePassword_state {
814 struct lsa_ChangePassword orig;
815 struct lsa_ChangePassword tmp;
816 TALLOC_CTX *out_mem_ctx;
817 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
820 static void rpccli_lsa_ChangePassword_done(struct tevent_req *subreq);
822 struct tevent_req *rpccli_lsa_ChangePassword_send(TALLOC_CTX *mem_ctx,
823 struct tevent_context *ev,
824 struct rpc_pipe_client *cli)
826 struct tevent_req *req;
827 struct rpccli_lsa_ChangePassword_state *state;
828 struct tevent_req *subreq;
830 req = tevent_req_create(mem_ctx, &state,
831 struct rpccli_lsa_ChangePassword_state);
832 if (req == NULL) {
833 return NULL;
835 state->out_mem_ctx = NULL;
836 state->dispatch_recv = cli->dispatch_recv;
838 /* In parameters */
840 /* Out parameters */
842 /* Result */
843 ZERO_STRUCT(state->orig.out.result);
845 if (DEBUGLEVEL >= 10) {
846 NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &state->orig);
849 /* make a temporary copy, that we pass to the dispatch function */
850 state->tmp = state->orig;
852 subreq = cli->dispatch_send(state, ev, cli,
853 &ndr_table_lsarpc,
854 NDR_LSA_CHANGEPASSWORD,
855 &state->tmp);
856 if (tevent_req_nomem(subreq, req)) {
857 return tevent_req_post(req, ev);
859 tevent_req_set_callback(subreq, rpccli_lsa_ChangePassword_done, req);
860 return req;
863 static void rpccli_lsa_ChangePassword_done(struct tevent_req *subreq)
865 struct tevent_req *req = tevent_req_callback_data(
866 subreq, struct tevent_req);
867 struct rpccli_lsa_ChangePassword_state *state = tevent_req_data(
868 req, struct rpccli_lsa_ChangePassword_state);
869 NTSTATUS status;
870 TALLOC_CTX *mem_ctx;
872 if (state->out_mem_ctx) {
873 mem_ctx = state->out_mem_ctx;
874 } else {
875 mem_ctx = state;
878 status = state->dispatch_recv(subreq, mem_ctx);
879 TALLOC_FREE(subreq);
880 if (!NT_STATUS_IS_OK(status)) {
881 tevent_req_nterror(req, status);
882 return;
885 /* Copy out parameters */
887 /* Copy result */
888 state->orig.out.result = state->tmp.out.result;
890 /* Reset temporary structure */
891 ZERO_STRUCT(state->tmp);
893 if (DEBUGLEVEL >= 10) {
894 NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &state->orig);
897 tevent_req_done(req);
900 NTSTATUS rpccli_lsa_ChangePassword_recv(struct tevent_req *req,
901 TALLOC_CTX *mem_ctx,
902 NTSTATUS *result)
904 struct rpccli_lsa_ChangePassword_state *state = tevent_req_data(
905 req, struct rpccli_lsa_ChangePassword_state);
906 NTSTATUS status;
908 if (tevent_req_is_nterror(req, &status)) {
909 tevent_req_received(req);
910 return status;
913 /* Steal possbile out parameters to the callers context */
914 talloc_steal(mem_ctx, state->out_mem_ctx);
916 /* Return result */
917 *result = state->orig.out.result;
919 tevent_req_received(req);
920 return NT_STATUS_OK;
923 NTSTATUS rpccli_lsa_ChangePassword(struct rpc_pipe_client *cli,
924 TALLOC_CTX *mem_ctx)
926 struct lsa_ChangePassword r;
927 NTSTATUS status;
929 /* In parameters */
931 if (DEBUGLEVEL >= 10) {
932 NDR_PRINT_IN_DEBUG(lsa_ChangePassword, &r);
935 status = cli->dispatch(cli,
936 mem_ctx,
937 &ndr_table_lsarpc,
938 NDR_LSA_CHANGEPASSWORD,
939 &r);
941 if (!NT_STATUS_IS_OK(status)) {
942 return status;
945 if (DEBUGLEVEL >= 10) {
946 NDR_PRINT_OUT_DEBUG(lsa_ChangePassword, &r);
949 if (NT_STATUS_IS_ERR(status)) {
950 return status;
953 /* Return variables */
955 /* Return result */
956 return r.out.result;
959 struct rpccli_lsa_OpenPolicy_state {
960 struct lsa_OpenPolicy orig;
961 struct lsa_OpenPolicy tmp;
962 TALLOC_CTX *out_mem_ctx;
963 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
966 static void rpccli_lsa_OpenPolicy_done(struct tevent_req *subreq);
968 struct tevent_req *rpccli_lsa_OpenPolicy_send(TALLOC_CTX *mem_ctx,
969 struct tevent_context *ev,
970 struct rpc_pipe_client *cli,
971 uint16_t *_system_name /* [in] [unique] */,
972 struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
973 uint32_t _access_mask /* [in] */,
974 struct policy_handle *_handle /* [out] [ref] */)
976 struct tevent_req *req;
977 struct rpccli_lsa_OpenPolicy_state *state;
978 struct tevent_req *subreq;
980 req = tevent_req_create(mem_ctx, &state,
981 struct rpccli_lsa_OpenPolicy_state);
982 if (req == NULL) {
983 return NULL;
985 state->out_mem_ctx = NULL;
986 state->dispatch_recv = cli->dispatch_recv;
988 /* In parameters */
989 state->orig.in.system_name = _system_name;
990 state->orig.in.attr = _attr;
991 state->orig.in.access_mask = _access_mask;
993 /* Out parameters */
994 state->orig.out.handle = _handle;
996 /* Result */
997 ZERO_STRUCT(state->orig.out.result);
999 if (DEBUGLEVEL >= 10) {
1000 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &state->orig);
1003 state->out_mem_ctx = talloc_named_const(state, 0,
1004 "rpccli_lsa_OpenPolicy_out_memory");
1005 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1006 return tevent_req_post(req, ev);
1009 /* make a temporary copy, that we pass to the dispatch function */
1010 state->tmp = state->orig;
1012 subreq = cli->dispatch_send(state, ev, cli,
1013 &ndr_table_lsarpc,
1014 NDR_LSA_OPENPOLICY,
1015 &state->tmp);
1016 if (tevent_req_nomem(subreq, req)) {
1017 return tevent_req_post(req, ev);
1019 tevent_req_set_callback(subreq, rpccli_lsa_OpenPolicy_done, req);
1020 return req;
1023 static void rpccli_lsa_OpenPolicy_done(struct tevent_req *subreq)
1025 struct tevent_req *req = tevent_req_callback_data(
1026 subreq, struct tevent_req);
1027 struct rpccli_lsa_OpenPolicy_state *state = tevent_req_data(
1028 req, struct rpccli_lsa_OpenPolicy_state);
1029 NTSTATUS status;
1030 TALLOC_CTX *mem_ctx;
1032 if (state->out_mem_ctx) {
1033 mem_ctx = state->out_mem_ctx;
1034 } else {
1035 mem_ctx = state;
1038 status = state->dispatch_recv(subreq, mem_ctx);
1039 TALLOC_FREE(subreq);
1040 if (!NT_STATUS_IS_OK(status)) {
1041 tevent_req_nterror(req, status);
1042 return;
1045 /* Copy out parameters */
1046 *state->orig.out.handle = *state->tmp.out.handle;
1048 /* Copy result */
1049 state->orig.out.result = state->tmp.out.result;
1051 /* Reset temporary structure */
1052 ZERO_STRUCT(state->tmp);
1054 if (DEBUGLEVEL >= 10) {
1055 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &state->orig);
1058 tevent_req_done(req);
1061 NTSTATUS rpccli_lsa_OpenPolicy_recv(struct tevent_req *req,
1062 TALLOC_CTX *mem_ctx,
1063 NTSTATUS *result)
1065 struct rpccli_lsa_OpenPolicy_state *state = tevent_req_data(
1066 req, struct rpccli_lsa_OpenPolicy_state);
1067 NTSTATUS status;
1069 if (tevent_req_is_nterror(req, &status)) {
1070 tevent_req_received(req);
1071 return status;
1074 /* Steal possbile out parameters to the callers context */
1075 talloc_steal(mem_ctx, state->out_mem_ctx);
1077 /* Return result */
1078 *result = state->orig.out.result;
1080 tevent_req_received(req);
1081 return NT_STATUS_OK;
1084 NTSTATUS rpccli_lsa_OpenPolicy(struct rpc_pipe_client *cli,
1085 TALLOC_CTX *mem_ctx,
1086 uint16_t *system_name /* [in] [unique] */,
1087 struct lsa_ObjectAttribute *attr /* [in] [ref] */,
1088 uint32_t access_mask /* [in] */,
1089 struct policy_handle *handle /* [out] [ref] */)
1091 struct lsa_OpenPolicy r;
1092 NTSTATUS status;
1094 /* In parameters */
1095 r.in.system_name = system_name;
1096 r.in.attr = attr;
1097 r.in.access_mask = access_mask;
1099 if (DEBUGLEVEL >= 10) {
1100 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy, &r);
1103 status = cli->dispatch(cli,
1104 mem_ctx,
1105 &ndr_table_lsarpc,
1106 NDR_LSA_OPENPOLICY,
1107 &r);
1109 if (!NT_STATUS_IS_OK(status)) {
1110 return status;
1113 if (DEBUGLEVEL >= 10) {
1114 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy, &r);
1117 if (NT_STATUS_IS_ERR(status)) {
1118 return status;
1121 /* Return variables */
1122 *handle = *r.out.handle;
1124 /* Return result */
1125 return r.out.result;
1128 struct rpccli_lsa_QueryInfoPolicy_state {
1129 struct lsa_QueryInfoPolicy orig;
1130 struct lsa_QueryInfoPolicy tmp;
1131 TALLOC_CTX *out_mem_ctx;
1132 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1135 static void rpccli_lsa_QueryInfoPolicy_done(struct tevent_req *subreq);
1137 struct tevent_req *rpccli_lsa_QueryInfoPolicy_send(TALLOC_CTX *mem_ctx,
1138 struct tevent_context *ev,
1139 struct rpc_pipe_client *cli,
1140 struct policy_handle *_handle /* [in] [ref] */,
1141 enum lsa_PolicyInfo _level /* [in] */,
1142 union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */)
1144 struct tevent_req *req;
1145 struct rpccli_lsa_QueryInfoPolicy_state *state;
1146 struct tevent_req *subreq;
1148 req = tevent_req_create(mem_ctx, &state,
1149 struct rpccli_lsa_QueryInfoPolicy_state);
1150 if (req == NULL) {
1151 return NULL;
1153 state->out_mem_ctx = NULL;
1154 state->dispatch_recv = cli->dispatch_recv;
1156 /* In parameters */
1157 state->orig.in.handle = _handle;
1158 state->orig.in.level = _level;
1160 /* Out parameters */
1161 state->orig.out.info = _info;
1163 /* Result */
1164 ZERO_STRUCT(state->orig.out.result);
1166 if (DEBUGLEVEL >= 10) {
1167 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &state->orig);
1170 state->out_mem_ctx = talloc_named_const(state, 0,
1171 "rpccli_lsa_QueryInfoPolicy_out_memory");
1172 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1173 return tevent_req_post(req, ev);
1176 /* make a temporary copy, that we pass to the dispatch function */
1177 state->tmp = state->orig;
1179 subreq = cli->dispatch_send(state, ev, cli,
1180 &ndr_table_lsarpc,
1181 NDR_LSA_QUERYINFOPOLICY,
1182 &state->tmp);
1183 if (tevent_req_nomem(subreq, req)) {
1184 return tevent_req_post(req, ev);
1186 tevent_req_set_callback(subreq, rpccli_lsa_QueryInfoPolicy_done, req);
1187 return req;
1190 static void rpccli_lsa_QueryInfoPolicy_done(struct tevent_req *subreq)
1192 struct tevent_req *req = tevent_req_callback_data(
1193 subreq, struct tevent_req);
1194 struct rpccli_lsa_QueryInfoPolicy_state *state = tevent_req_data(
1195 req, struct rpccli_lsa_QueryInfoPolicy_state);
1196 NTSTATUS status;
1197 TALLOC_CTX *mem_ctx;
1199 if (state->out_mem_ctx) {
1200 mem_ctx = state->out_mem_ctx;
1201 } else {
1202 mem_ctx = state;
1205 status = state->dispatch_recv(subreq, mem_ctx);
1206 TALLOC_FREE(subreq);
1207 if (!NT_STATUS_IS_OK(status)) {
1208 tevent_req_nterror(req, status);
1209 return;
1212 /* Copy out parameters */
1213 *state->orig.out.info = *state->tmp.out.info;
1215 /* Copy result */
1216 state->orig.out.result = state->tmp.out.result;
1218 /* Reset temporary structure */
1219 ZERO_STRUCT(state->tmp);
1221 if (DEBUGLEVEL >= 10) {
1222 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &state->orig);
1225 tevent_req_done(req);
1228 NTSTATUS rpccli_lsa_QueryInfoPolicy_recv(struct tevent_req *req,
1229 TALLOC_CTX *mem_ctx,
1230 NTSTATUS *result)
1232 struct rpccli_lsa_QueryInfoPolicy_state *state = tevent_req_data(
1233 req, struct rpccli_lsa_QueryInfoPolicy_state);
1234 NTSTATUS status;
1236 if (tevent_req_is_nterror(req, &status)) {
1237 tevent_req_received(req);
1238 return status;
1241 /* Steal possbile out parameters to the callers context */
1242 talloc_steal(mem_ctx, state->out_mem_ctx);
1244 /* Return result */
1245 *result = state->orig.out.result;
1247 tevent_req_received(req);
1248 return NT_STATUS_OK;
1251 NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli,
1252 TALLOC_CTX *mem_ctx,
1253 struct policy_handle *handle /* [in] [ref] */,
1254 enum lsa_PolicyInfo level /* [in] */,
1255 union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
1257 struct lsa_QueryInfoPolicy r;
1258 NTSTATUS status;
1260 /* In parameters */
1261 r.in.handle = handle;
1262 r.in.level = level;
1264 if (DEBUGLEVEL >= 10) {
1265 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy, &r);
1268 status = cli->dispatch(cli,
1269 mem_ctx,
1270 &ndr_table_lsarpc,
1271 NDR_LSA_QUERYINFOPOLICY,
1272 &r);
1274 if (!NT_STATUS_IS_OK(status)) {
1275 return status;
1278 if (DEBUGLEVEL >= 10) {
1279 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy, &r);
1282 if (NT_STATUS_IS_ERR(status)) {
1283 return status;
1286 /* Return variables */
1287 *info = *r.out.info;
1289 /* Return result */
1290 return r.out.result;
1293 struct rpccli_lsa_SetInfoPolicy_state {
1294 struct lsa_SetInfoPolicy orig;
1295 struct lsa_SetInfoPolicy tmp;
1296 TALLOC_CTX *out_mem_ctx;
1297 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1300 static void rpccli_lsa_SetInfoPolicy_done(struct tevent_req *subreq);
1302 struct tevent_req *rpccli_lsa_SetInfoPolicy_send(TALLOC_CTX *mem_ctx,
1303 struct tevent_context *ev,
1304 struct rpc_pipe_client *cli,
1305 struct policy_handle *_handle /* [in] [ref] */,
1306 enum lsa_PolicyInfo _level /* [in] */,
1307 union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */)
1309 struct tevent_req *req;
1310 struct rpccli_lsa_SetInfoPolicy_state *state;
1311 struct tevent_req *subreq;
1313 req = tevent_req_create(mem_ctx, &state,
1314 struct rpccli_lsa_SetInfoPolicy_state);
1315 if (req == NULL) {
1316 return NULL;
1318 state->out_mem_ctx = NULL;
1319 state->dispatch_recv = cli->dispatch_recv;
1321 /* In parameters */
1322 state->orig.in.handle = _handle;
1323 state->orig.in.level = _level;
1324 state->orig.in.info = _info;
1326 /* Out parameters */
1328 /* Result */
1329 ZERO_STRUCT(state->orig.out.result);
1331 if (DEBUGLEVEL >= 10) {
1332 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &state->orig);
1335 /* make a temporary copy, that we pass to the dispatch function */
1336 state->tmp = state->orig;
1338 subreq = cli->dispatch_send(state, ev, cli,
1339 &ndr_table_lsarpc,
1340 NDR_LSA_SETINFOPOLICY,
1341 &state->tmp);
1342 if (tevent_req_nomem(subreq, req)) {
1343 return tevent_req_post(req, ev);
1345 tevent_req_set_callback(subreq, rpccli_lsa_SetInfoPolicy_done, req);
1346 return req;
1349 static void rpccli_lsa_SetInfoPolicy_done(struct tevent_req *subreq)
1351 struct tevent_req *req = tevent_req_callback_data(
1352 subreq, struct tevent_req);
1353 struct rpccli_lsa_SetInfoPolicy_state *state = tevent_req_data(
1354 req, struct rpccli_lsa_SetInfoPolicy_state);
1355 NTSTATUS status;
1356 TALLOC_CTX *mem_ctx;
1358 if (state->out_mem_ctx) {
1359 mem_ctx = state->out_mem_ctx;
1360 } else {
1361 mem_ctx = state;
1364 status = state->dispatch_recv(subreq, mem_ctx);
1365 TALLOC_FREE(subreq);
1366 if (!NT_STATUS_IS_OK(status)) {
1367 tevent_req_nterror(req, status);
1368 return;
1371 /* Copy out parameters */
1373 /* Copy result */
1374 state->orig.out.result = state->tmp.out.result;
1376 /* Reset temporary structure */
1377 ZERO_STRUCT(state->tmp);
1379 if (DEBUGLEVEL >= 10) {
1380 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &state->orig);
1383 tevent_req_done(req);
1386 NTSTATUS rpccli_lsa_SetInfoPolicy_recv(struct tevent_req *req,
1387 TALLOC_CTX *mem_ctx,
1388 NTSTATUS *result)
1390 struct rpccli_lsa_SetInfoPolicy_state *state = tevent_req_data(
1391 req, struct rpccli_lsa_SetInfoPolicy_state);
1392 NTSTATUS status;
1394 if (tevent_req_is_nterror(req, &status)) {
1395 tevent_req_received(req);
1396 return status;
1399 /* Steal possbile out parameters to the callers context */
1400 talloc_steal(mem_ctx, state->out_mem_ctx);
1402 /* Return result */
1403 *result = state->orig.out.result;
1405 tevent_req_received(req);
1406 return NT_STATUS_OK;
1409 NTSTATUS rpccli_lsa_SetInfoPolicy(struct rpc_pipe_client *cli,
1410 TALLOC_CTX *mem_ctx,
1411 struct policy_handle *handle /* [in] [ref] */,
1412 enum lsa_PolicyInfo level /* [in] */,
1413 union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
1415 struct lsa_SetInfoPolicy r;
1416 NTSTATUS status;
1418 /* In parameters */
1419 r.in.handle = handle;
1420 r.in.level = level;
1421 r.in.info = info;
1423 if (DEBUGLEVEL >= 10) {
1424 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy, &r);
1427 status = cli->dispatch(cli,
1428 mem_ctx,
1429 &ndr_table_lsarpc,
1430 NDR_LSA_SETINFOPOLICY,
1431 &r);
1433 if (!NT_STATUS_IS_OK(status)) {
1434 return status;
1437 if (DEBUGLEVEL >= 10) {
1438 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy, &r);
1441 if (NT_STATUS_IS_ERR(status)) {
1442 return status;
1445 /* Return variables */
1447 /* Return result */
1448 return r.out.result;
1451 struct rpccli_lsa_ClearAuditLog_state {
1452 struct lsa_ClearAuditLog orig;
1453 struct lsa_ClearAuditLog tmp;
1454 TALLOC_CTX *out_mem_ctx;
1455 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1458 static void rpccli_lsa_ClearAuditLog_done(struct tevent_req *subreq);
1460 struct tevent_req *rpccli_lsa_ClearAuditLog_send(TALLOC_CTX *mem_ctx,
1461 struct tevent_context *ev,
1462 struct rpc_pipe_client *cli)
1464 struct tevent_req *req;
1465 struct rpccli_lsa_ClearAuditLog_state *state;
1466 struct tevent_req *subreq;
1468 req = tevent_req_create(mem_ctx, &state,
1469 struct rpccli_lsa_ClearAuditLog_state);
1470 if (req == NULL) {
1471 return NULL;
1473 state->out_mem_ctx = NULL;
1474 state->dispatch_recv = cli->dispatch_recv;
1476 /* In parameters */
1478 /* Out parameters */
1480 /* Result */
1481 ZERO_STRUCT(state->orig.out.result);
1483 if (DEBUGLEVEL >= 10) {
1484 NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &state->orig);
1487 /* make a temporary copy, that we pass to the dispatch function */
1488 state->tmp = state->orig;
1490 subreq = cli->dispatch_send(state, ev, cli,
1491 &ndr_table_lsarpc,
1492 NDR_LSA_CLEARAUDITLOG,
1493 &state->tmp);
1494 if (tevent_req_nomem(subreq, req)) {
1495 return tevent_req_post(req, ev);
1497 tevent_req_set_callback(subreq, rpccli_lsa_ClearAuditLog_done, req);
1498 return req;
1501 static void rpccli_lsa_ClearAuditLog_done(struct tevent_req *subreq)
1503 struct tevent_req *req = tevent_req_callback_data(
1504 subreq, struct tevent_req);
1505 struct rpccli_lsa_ClearAuditLog_state *state = tevent_req_data(
1506 req, struct rpccli_lsa_ClearAuditLog_state);
1507 NTSTATUS status;
1508 TALLOC_CTX *mem_ctx;
1510 if (state->out_mem_ctx) {
1511 mem_ctx = state->out_mem_ctx;
1512 } else {
1513 mem_ctx = state;
1516 status = state->dispatch_recv(subreq, mem_ctx);
1517 TALLOC_FREE(subreq);
1518 if (!NT_STATUS_IS_OK(status)) {
1519 tevent_req_nterror(req, status);
1520 return;
1523 /* Copy out parameters */
1525 /* Copy result */
1526 state->orig.out.result = state->tmp.out.result;
1528 /* Reset temporary structure */
1529 ZERO_STRUCT(state->tmp);
1531 if (DEBUGLEVEL >= 10) {
1532 NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &state->orig);
1535 tevent_req_done(req);
1538 NTSTATUS rpccli_lsa_ClearAuditLog_recv(struct tevent_req *req,
1539 TALLOC_CTX *mem_ctx,
1540 NTSTATUS *result)
1542 struct rpccli_lsa_ClearAuditLog_state *state = tevent_req_data(
1543 req, struct rpccli_lsa_ClearAuditLog_state);
1544 NTSTATUS status;
1546 if (tevent_req_is_nterror(req, &status)) {
1547 tevent_req_received(req);
1548 return status;
1551 /* Steal possbile out parameters to the callers context */
1552 talloc_steal(mem_ctx, state->out_mem_ctx);
1554 /* Return result */
1555 *result = state->orig.out.result;
1557 tevent_req_received(req);
1558 return NT_STATUS_OK;
1561 NTSTATUS rpccli_lsa_ClearAuditLog(struct rpc_pipe_client *cli,
1562 TALLOC_CTX *mem_ctx)
1564 struct lsa_ClearAuditLog r;
1565 NTSTATUS status;
1567 /* In parameters */
1569 if (DEBUGLEVEL >= 10) {
1570 NDR_PRINT_IN_DEBUG(lsa_ClearAuditLog, &r);
1573 status = cli->dispatch(cli,
1574 mem_ctx,
1575 &ndr_table_lsarpc,
1576 NDR_LSA_CLEARAUDITLOG,
1577 &r);
1579 if (!NT_STATUS_IS_OK(status)) {
1580 return status;
1583 if (DEBUGLEVEL >= 10) {
1584 NDR_PRINT_OUT_DEBUG(lsa_ClearAuditLog, &r);
1587 if (NT_STATUS_IS_ERR(status)) {
1588 return status;
1591 /* Return variables */
1593 /* Return result */
1594 return r.out.result;
1597 struct rpccli_lsa_CreateAccount_state {
1598 struct lsa_CreateAccount orig;
1599 struct lsa_CreateAccount tmp;
1600 TALLOC_CTX *out_mem_ctx;
1601 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1604 static void rpccli_lsa_CreateAccount_done(struct tevent_req *subreq);
1606 struct tevent_req *rpccli_lsa_CreateAccount_send(TALLOC_CTX *mem_ctx,
1607 struct tevent_context *ev,
1608 struct rpc_pipe_client *cli,
1609 struct policy_handle *_handle /* [in] [ref] */,
1610 struct dom_sid2 *_sid /* [in] [ref] */,
1611 uint32_t _access_mask /* [in] */,
1612 struct policy_handle *_acct_handle /* [out] [ref] */)
1614 struct tevent_req *req;
1615 struct rpccli_lsa_CreateAccount_state *state;
1616 struct tevent_req *subreq;
1618 req = tevent_req_create(mem_ctx, &state,
1619 struct rpccli_lsa_CreateAccount_state);
1620 if (req == NULL) {
1621 return NULL;
1623 state->out_mem_ctx = NULL;
1624 state->dispatch_recv = cli->dispatch_recv;
1626 /* In parameters */
1627 state->orig.in.handle = _handle;
1628 state->orig.in.sid = _sid;
1629 state->orig.in.access_mask = _access_mask;
1631 /* Out parameters */
1632 state->orig.out.acct_handle = _acct_handle;
1634 /* Result */
1635 ZERO_STRUCT(state->orig.out.result);
1637 if (DEBUGLEVEL >= 10) {
1638 NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &state->orig);
1641 state->out_mem_ctx = talloc_named_const(state, 0,
1642 "rpccli_lsa_CreateAccount_out_memory");
1643 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1644 return tevent_req_post(req, ev);
1647 /* make a temporary copy, that we pass to the dispatch function */
1648 state->tmp = state->orig;
1650 subreq = cli->dispatch_send(state, ev, cli,
1651 &ndr_table_lsarpc,
1652 NDR_LSA_CREATEACCOUNT,
1653 &state->tmp);
1654 if (tevent_req_nomem(subreq, req)) {
1655 return tevent_req_post(req, ev);
1657 tevent_req_set_callback(subreq, rpccli_lsa_CreateAccount_done, req);
1658 return req;
1661 static void rpccli_lsa_CreateAccount_done(struct tevent_req *subreq)
1663 struct tevent_req *req = tevent_req_callback_data(
1664 subreq, struct tevent_req);
1665 struct rpccli_lsa_CreateAccount_state *state = tevent_req_data(
1666 req, struct rpccli_lsa_CreateAccount_state);
1667 NTSTATUS status;
1668 TALLOC_CTX *mem_ctx;
1670 if (state->out_mem_ctx) {
1671 mem_ctx = state->out_mem_ctx;
1672 } else {
1673 mem_ctx = state;
1676 status = state->dispatch_recv(subreq, mem_ctx);
1677 TALLOC_FREE(subreq);
1678 if (!NT_STATUS_IS_OK(status)) {
1679 tevent_req_nterror(req, status);
1680 return;
1683 /* Copy out parameters */
1684 *state->orig.out.acct_handle = *state->tmp.out.acct_handle;
1686 /* Copy result */
1687 state->orig.out.result = state->tmp.out.result;
1689 /* Reset temporary structure */
1690 ZERO_STRUCT(state->tmp);
1692 if (DEBUGLEVEL >= 10) {
1693 NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &state->orig);
1696 tevent_req_done(req);
1699 NTSTATUS rpccli_lsa_CreateAccount_recv(struct tevent_req *req,
1700 TALLOC_CTX *mem_ctx,
1701 NTSTATUS *result)
1703 struct rpccli_lsa_CreateAccount_state *state = tevent_req_data(
1704 req, struct rpccli_lsa_CreateAccount_state);
1705 NTSTATUS status;
1707 if (tevent_req_is_nterror(req, &status)) {
1708 tevent_req_received(req);
1709 return status;
1712 /* Steal possbile out parameters to the callers context */
1713 talloc_steal(mem_ctx, state->out_mem_ctx);
1715 /* Return result */
1716 *result = state->orig.out.result;
1718 tevent_req_received(req);
1719 return NT_STATUS_OK;
1722 NTSTATUS rpccli_lsa_CreateAccount(struct rpc_pipe_client *cli,
1723 TALLOC_CTX *mem_ctx,
1724 struct policy_handle *handle /* [in] [ref] */,
1725 struct dom_sid2 *sid /* [in] [ref] */,
1726 uint32_t access_mask /* [in] */,
1727 struct policy_handle *acct_handle /* [out] [ref] */)
1729 struct lsa_CreateAccount r;
1730 NTSTATUS status;
1732 /* In parameters */
1733 r.in.handle = handle;
1734 r.in.sid = sid;
1735 r.in.access_mask = access_mask;
1737 if (DEBUGLEVEL >= 10) {
1738 NDR_PRINT_IN_DEBUG(lsa_CreateAccount, &r);
1741 status = cli->dispatch(cli,
1742 mem_ctx,
1743 &ndr_table_lsarpc,
1744 NDR_LSA_CREATEACCOUNT,
1745 &r);
1747 if (!NT_STATUS_IS_OK(status)) {
1748 return status;
1751 if (DEBUGLEVEL >= 10) {
1752 NDR_PRINT_OUT_DEBUG(lsa_CreateAccount, &r);
1755 if (NT_STATUS_IS_ERR(status)) {
1756 return status;
1759 /* Return variables */
1760 *acct_handle = *r.out.acct_handle;
1762 /* Return result */
1763 return r.out.result;
1766 struct rpccli_lsa_EnumAccounts_state {
1767 struct lsa_EnumAccounts orig;
1768 struct lsa_EnumAccounts tmp;
1769 TALLOC_CTX *out_mem_ctx;
1770 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1773 static void rpccli_lsa_EnumAccounts_done(struct tevent_req *subreq);
1775 struct tevent_req *rpccli_lsa_EnumAccounts_send(TALLOC_CTX *mem_ctx,
1776 struct tevent_context *ev,
1777 struct rpc_pipe_client *cli,
1778 struct policy_handle *_handle /* [in] [ref] */,
1779 uint32_t *_resume_handle /* [in,out] [ref] */,
1780 struct lsa_SidArray *_sids /* [out] [ref] */,
1781 uint32_t _num_entries /* [in] [range(0,8192)] */)
1783 struct tevent_req *req;
1784 struct rpccli_lsa_EnumAccounts_state *state;
1785 struct tevent_req *subreq;
1787 req = tevent_req_create(mem_ctx, &state,
1788 struct rpccli_lsa_EnumAccounts_state);
1789 if (req == NULL) {
1790 return NULL;
1792 state->out_mem_ctx = NULL;
1793 state->dispatch_recv = cli->dispatch_recv;
1795 /* In parameters */
1796 state->orig.in.handle = _handle;
1797 state->orig.in.resume_handle = _resume_handle;
1798 state->orig.in.num_entries = _num_entries;
1800 /* Out parameters */
1801 state->orig.out.resume_handle = _resume_handle;
1802 state->orig.out.sids = _sids;
1804 /* Result */
1805 ZERO_STRUCT(state->orig.out.result);
1807 if (DEBUGLEVEL >= 10) {
1808 NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &state->orig);
1811 state->out_mem_ctx = talloc_named_const(state, 0,
1812 "rpccli_lsa_EnumAccounts_out_memory");
1813 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1814 return tevent_req_post(req, ev);
1817 /* make a temporary copy, that we pass to the dispatch function */
1818 state->tmp = state->orig;
1820 subreq = cli->dispatch_send(state, ev, cli,
1821 &ndr_table_lsarpc,
1822 NDR_LSA_ENUMACCOUNTS,
1823 &state->tmp);
1824 if (tevent_req_nomem(subreq, req)) {
1825 return tevent_req_post(req, ev);
1827 tevent_req_set_callback(subreq, rpccli_lsa_EnumAccounts_done, req);
1828 return req;
1831 static void rpccli_lsa_EnumAccounts_done(struct tevent_req *subreq)
1833 struct tevent_req *req = tevent_req_callback_data(
1834 subreq, struct tevent_req);
1835 struct rpccli_lsa_EnumAccounts_state *state = tevent_req_data(
1836 req, struct rpccli_lsa_EnumAccounts_state);
1837 NTSTATUS status;
1838 TALLOC_CTX *mem_ctx;
1840 if (state->out_mem_ctx) {
1841 mem_ctx = state->out_mem_ctx;
1842 } else {
1843 mem_ctx = state;
1846 status = state->dispatch_recv(subreq, mem_ctx);
1847 TALLOC_FREE(subreq);
1848 if (!NT_STATUS_IS_OK(status)) {
1849 tevent_req_nterror(req, status);
1850 return;
1853 /* Copy out parameters */
1854 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
1855 *state->orig.out.sids = *state->tmp.out.sids;
1857 /* Copy result */
1858 state->orig.out.result = state->tmp.out.result;
1860 /* Reset temporary structure */
1861 ZERO_STRUCT(state->tmp);
1863 if (DEBUGLEVEL >= 10) {
1864 NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &state->orig);
1867 tevent_req_done(req);
1870 NTSTATUS rpccli_lsa_EnumAccounts_recv(struct tevent_req *req,
1871 TALLOC_CTX *mem_ctx,
1872 NTSTATUS *result)
1874 struct rpccli_lsa_EnumAccounts_state *state = tevent_req_data(
1875 req, struct rpccli_lsa_EnumAccounts_state);
1876 NTSTATUS status;
1878 if (tevent_req_is_nterror(req, &status)) {
1879 tevent_req_received(req);
1880 return status;
1883 /* Steal possbile out parameters to the callers context */
1884 talloc_steal(mem_ctx, state->out_mem_ctx);
1886 /* Return result */
1887 *result = state->orig.out.result;
1889 tevent_req_received(req);
1890 return NT_STATUS_OK;
1893 NTSTATUS rpccli_lsa_EnumAccounts(struct rpc_pipe_client *cli,
1894 TALLOC_CTX *mem_ctx,
1895 struct policy_handle *handle /* [in] [ref] */,
1896 uint32_t *resume_handle /* [in,out] [ref] */,
1897 struct lsa_SidArray *sids /* [out] [ref] */,
1898 uint32_t num_entries /* [in] [range(0,8192)] */)
1900 struct lsa_EnumAccounts r;
1901 NTSTATUS status;
1903 /* In parameters */
1904 r.in.handle = handle;
1905 r.in.resume_handle = resume_handle;
1906 r.in.num_entries = num_entries;
1908 if (DEBUGLEVEL >= 10) {
1909 NDR_PRINT_IN_DEBUG(lsa_EnumAccounts, &r);
1912 status = cli->dispatch(cli,
1913 mem_ctx,
1914 &ndr_table_lsarpc,
1915 NDR_LSA_ENUMACCOUNTS,
1916 &r);
1918 if (!NT_STATUS_IS_OK(status)) {
1919 return status;
1922 if (DEBUGLEVEL >= 10) {
1923 NDR_PRINT_OUT_DEBUG(lsa_EnumAccounts, &r);
1926 if (NT_STATUS_IS_ERR(status)) {
1927 return status;
1930 /* Return variables */
1931 *resume_handle = *r.out.resume_handle;
1932 *sids = *r.out.sids;
1934 /* Return result */
1935 return r.out.result;
1938 struct rpccli_lsa_CreateTrustedDomain_state {
1939 struct lsa_CreateTrustedDomain orig;
1940 struct lsa_CreateTrustedDomain tmp;
1941 TALLOC_CTX *out_mem_ctx;
1942 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1945 static void rpccli_lsa_CreateTrustedDomain_done(struct tevent_req *subreq);
1947 struct tevent_req *rpccli_lsa_CreateTrustedDomain_send(TALLOC_CTX *mem_ctx,
1948 struct tevent_context *ev,
1949 struct rpc_pipe_client *cli,
1950 struct policy_handle *_policy_handle /* [in] [ref] */,
1951 struct lsa_DomainInfo *_info /* [in] [ref] */,
1952 uint32_t _access_mask /* [in] */,
1953 struct policy_handle *_trustdom_handle /* [out] [ref] */)
1955 struct tevent_req *req;
1956 struct rpccli_lsa_CreateTrustedDomain_state *state;
1957 struct tevent_req *subreq;
1959 req = tevent_req_create(mem_ctx, &state,
1960 struct rpccli_lsa_CreateTrustedDomain_state);
1961 if (req == NULL) {
1962 return NULL;
1964 state->out_mem_ctx = NULL;
1965 state->dispatch_recv = cli->dispatch_recv;
1967 /* In parameters */
1968 state->orig.in.policy_handle = _policy_handle;
1969 state->orig.in.info = _info;
1970 state->orig.in.access_mask = _access_mask;
1972 /* Out parameters */
1973 state->orig.out.trustdom_handle = _trustdom_handle;
1975 /* Result */
1976 ZERO_STRUCT(state->orig.out.result);
1978 if (DEBUGLEVEL >= 10) {
1979 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &state->orig);
1982 state->out_mem_ctx = talloc_named_const(state, 0,
1983 "rpccli_lsa_CreateTrustedDomain_out_memory");
1984 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1985 return tevent_req_post(req, ev);
1988 /* make a temporary copy, that we pass to the dispatch function */
1989 state->tmp = state->orig;
1991 subreq = cli->dispatch_send(state, ev, cli,
1992 &ndr_table_lsarpc,
1993 NDR_LSA_CREATETRUSTEDDOMAIN,
1994 &state->tmp);
1995 if (tevent_req_nomem(subreq, req)) {
1996 return tevent_req_post(req, ev);
1998 tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomain_done, req);
1999 return req;
2002 static void rpccli_lsa_CreateTrustedDomain_done(struct tevent_req *subreq)
2004 struct tevent_req *req = tevent_req_callback_data(
2005 subreq, struct tevent_req);
2006 struct rpccli_lsa_CreateTrustedDomain_state *state = tevent_req_data(
2007 req, struct rpccli_lsa_CreateTrustedDomain_state);
2008 NTSTATUS status;
2009 TALLOC_CTX *mem_ctx;
2011 if (state->out_mem_ctx) {
2012 mem_ctx = state->out_mem_ctx;
2013 } else {
2014 mem_ctx = state;
2017 status = state->dispatch_recv(subreq, mem_ctx);
2018 TALLOC_FREE(subreq);
2019 if (!NT_STATUS_IS_OK(status)) {
2020 tevent_req_nterror(req, status);
2021 return;
2024 /* Copy out parameters */
2025 *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
2027 /* Copy result */
2028 state->orig.out.result = state->tmp.out.result;
2030 /* Reset temporary structure */
2031 ZERO_STRUCT(state->tmp);
2033 if (DEBUGLEVEL >= 10) {
2034 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &state->orig);
2037 tevent_req_done(req);
2040 NTSTATUS rpccli_lsa_CreateTrustedDomain_recv(struct tevent_req *req,
2041 TALLOC_CTX *mem_ctx,
2042 NTSTATUS *result)
2044 struct rpccli_lsa_CreateTrustedDomain_state *state = tevent_req_data(
2045 req, struct rpccli_lsa_CreateTrustedDomain_state);
2046 NTSTATUS status;
2048 if (tevent_req_is_nterror(req, &status)) {
2049 tevent_req_received(req);
2050 return status;
2053 /* Steal possbile out parameters to the callers context */
2054 talloc_steal(mem_ctx, state->out_mem_ctx);
2056 /* Return result */
2057 *result = state->orig.out.result;
2059 tevent_req_received(req);
2060 return NT_STATUS_OK;
2063 NTSTATUS rpccli_lsa_CreateTrustedDomain(struct rpc_pipe_client *cli,
2064 TALLOC_CTX *mem_ctx,
2065 struct policy_handle *policy_handle /* [in] [ref] */,
2066 struct lsa_DomainInfo *info /* [in] [ref] */,
2067 uint32_t access_mask /* [in] */,
2068 struct policy_handle *trustdom_handle /* [out] [ref] */)
2070 struct lsa_CreateTrustedDomain r;
2071 NTSTATUS status;
2073 /* In parameters */
2074 r.in.policy_handle = policy_handle;
2075 r.in.info = info;
2076 r.in.access_mask = access_mask;
2078 if (DEBUGLEVEL >= 10) {
2079 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomain, &r);
2082 status = cli->dispatch(cli,
2083 mem_ctx,
2084 &ndr_table_lsarpc,
2085 NDR_LSA_CREATETRUSTEDDOMAIN,
2086 &r);
2088 if (!NT_STATUS_IS_OK(status)) {
2089 return status;
2092 if (DEBUGLEVEL >= 10) {
2093 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomain, &r);
2096 if (NT_STATUS_IS_ERR(status)) {
2097 return status;
2100 /* Return variables */
2101 *trustdom_handle = *r.out.trustdom_handle;
2103 /* Return result */
2104 return r.out.result;
2107 struct rpccli_lsa_EnumTrustDom_state {
2108 struct lsa_EnumTrustDom orig;
2109 struct lsa_EnumTrustDom tmp;
2110 TALLOC_CTX *out_mem_ctx;
2111 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2114 static void rpccli_lsa_EnumTrustDom_done(struct tevent_req *subreq);
2116 struct tevent_req *rpccli_lsa_EnumTrustDom_send(TALLOC_CTX *mem_ctx,
2117 struct tevent_context *ev,
2118 struct rpc_pipe_client *cli,
2119 struct policy_handle *_handle /* [in] [ref] */,
2120 uint32_t *_resume_handle /* [in,out] [ref] */,
2121 struct lsa_DomainList *_domains /* [out] [ref] */,
2122 uint32_t _max_size /* [in] */)
2124 struct tevent_req *req;
2125 struct rpccli_lsa_EnumTrustDom_state *state;
2126 struct tevent_req *subreq;
2128 req = tevent_req_create(mem_ctx, &state,
2129 struct rpccli_lsa_EnumTrustDom_state);
2130 if (req == NULL) {
2131 return NULL;
2133 state->out_mem_ctx = NULL;
2134 state->dispatch_recv = cli->dispatch_recv;
2136 /* In parameters */
2137 state->orig.in.handle = _handle;
2138 state->orig.in.resume_handle = _resume_handle;
2139 state->orig.in.max_size = _max_size;
2141 /* Out parameters */
2142 state->orig.out.resume_handle = _resume_handle;
2143 state->orig.out.domains = _domains;
2145 /* Result */
2146 ZERO_STRUCT(state->orig.out.result);
2148 if (DEBUGLEVEL >= 10) {
2149 NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &state->orig);
2152 state->out_mem_ctx = talloc_named_const(state, 0,
2153 "rpccli_lsa_EnumTrustDom_out_memory");
2154 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2155 return tevent_req_post(req, ev);
2158 /* make a temporary copy, that we pass to the dispatch function */
2159 state->tmp = state->orig;
2161 subreq = cli->dispatch_send(state, ev, cli,
2162 &ndr_table_lsarpc,
2163 NDR_LSA_ENUMTRUSTDOM,
2164 &state->tmp);
2165 if (tevent_req_nomem(subreq, req)) {
2166 return tevent_req_post(req, ev);
2168 tevent_req_set_callback(subreq, rpccli_lsa_EnumTrustDom_done, req);
2169 return req;
2172 static void rpccli_lsa_EnumTrustDom_done(struct tevent_req *subreq)
2174 struct tevent_req *req = tevent_req_callback_data(
2175 subreq, struct tevent_req);
2176 struct rpccli_lsa_EnumTrustDom_state *state = tevent_req_data(
2177 req, struct rpccli_lsa_EnumTrustDom_state);
2178 NTSTATUS status;
2179 TALLOC_CTX *mem_ctx;
2181 if (state->out_mem_ctx) {
2182 mem_ctx = state->out_mem_ctx;
2183 } else {
2184 mem_ctx = state;
2187 status = state->dispatch_recv(subreq, mem_ctx);
2188 TALLOC_FREE(subreq);
2189 if (!NT_STATUS_IS_OK(status)) {
2190 tevent_req_nterror(req, status);
2191 return;
2194 /* Copy out parameters */
2195 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2196 *state->orig.out.domains = *state->tmp.out.domains;
2198 /* Copy result */
2199 state->orig.out.result = state->tmp.out.result;
2201 /* Reset temporary structure */
2202 ZERO_STRUCT(state->tmp);
2204 if (DEBUGLEVEL >= 10) {
2205 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &state->orig);
2208 tevent_req_done(req);
2211 NTSTATUS rpccli_lsa_EnumTrustDom_recv(struct tevent_req *req,
2212 TALLOC_CTX *mem_ctx,
2213 NTSTATUS *result)
2215 struct rpccli_lsa_EnumTrustDom_state *state = tevent_req_data(
2216 req, struct rpccli_lsa_EnumTrustDom_state);
2217 NTSTATUS status;
2219 if (tevent_req_is_nterror(req, &status)) {
2220 tevent_req_received(req);
2221 return status;
2224 /* Steal possbile out parameters to the callers context */
2225 talloc_steal(mem_ctx, state->out_mem_ctx);
2227 /* Return result */
2228 *result = state->orig.out.result;
2230 tevent_req_received(req);
2231 return NT_STATUS_OK;
2234 NTSTATUS rpccli_lsa_EnumTrustDom(struct rpc_pipe_client *cli,
2235 TALLOC_CTX *mem_ctx,
2236 struct policy_handle *handle /* [in] [ref] */,
2237 uint32_t *resume_handle /* [in,out] [ref] */,
2238 struct lsa_DomainList *domains /* [out] [ref] */,
2239 uint32_t max_size /* [in] */)
2241 struct lsa_EnumTrustDom r;
2242 NTSTATUS status;
2244 /* In parameters */
2245 r.in.handle = handle;
2246 r.in.resume_handle = resume_handle;
2247 r.in.max_size = max_size;
2249 if (DEBUGLEVEL >= 10) {
2250 NDR_PRINT_IN_DEBUG(lsa_EnumTrustDom, &r);
2253 status = cli->dispatch(cli,
2254 mem_ctx,
2255 &ndr_table_lsarpc,
2256 NDR_LSA_ENUMTRUSTDOM,
2257 &r);
2259 if (!NT_STATUS_IS_OK(status)) {
2260 return status;
2263 if (DEBUGLEVEL >= 10) {
2264 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustDom, &r);
2267 if (NT_STATUS_IS_ERR(status)) {
2268 return status;
2271 /* Return variables */
2272 *resume_handle = *r.out.resume_handle;
2273 *domains = *r.out.domains;
2275 /* Return result */
2276 return r.out.result;
2279 struct rpccli_lsa_LookupNames_state {
2280 struct lsa_LookupNames orig;
2281 struct lsa_LookupNames tmp;
2282 TALLOC_CTX *out_mem_ctx;
2283 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2286 static void rpccli_lsa_LookupNames_done(struct tevent_req *subreq);
2288 struct tevent_req *rpccli_lsa_LookupNames_send(TALLOC_CTX *mem_ctx,
2289 struct tevent_context *ev,
2290 struct rpc_pipe_client *cli,
2291 struct policy_handle *_handle /* [in] [ref] */,
2292 uint32_t _num_names /* [in] [range(0,1000)] */,
2293 struct lsa_String *_names /* [in] [size_is(num_names)] */,
2294 struct lsa_RefDomainList **_domains /* [out] [ref] */,
2295 struct lsa_TransSidArray *_sids /* [in,out] [ref] */,
2296 enum lsa_LookupNamesLevel _level /* [in] */,
2297 uint32_t *_count /* [in,out] [ref] */)
2299 struct tevent_req *req;
2300 struct rpccli_lsa_LookupNames_state *state;
2301 struct tevent_req *subreq;
2303 req = tevent_req_create(mem_ctx, &state,
2304 struct rpccli_lsa_LookupNames_state);
2305 if (req == NULL) {
2306 return NULL;
2308 state->out_mem_ctx = NULL;
2309 state->dispatch_recv = cli->dispatch_recv;
2311 /* In parameters */
2312 state->orig.in.handle = _handle;
2313 state->orig.in.num_names = _num_names;
2314 state->orig.in.names = _names;
2315 state->orig.in.sids = _sids;
2316 state->orig.in.level = _level;
2317 state->orig.in.count = _count;
2319 /* Out parameters */
2320 state->orig.out.domains = _domains;
2321 state->orig.out.sids = _sids;
2322 state->orig.out.count = _count;
2324 /* Result */
2325 ZERO_STRUCT(state->orig.out.result);
2327 if (DEBUGLEVEL >= 10) {
2328 NDR_PRINT_IN_DEBUG(lsa_LookupNames, &state->orig);
2331 state->out_mem_ctx = talloc_named_const(state, 0,
2332 "rpccli_lsa_LookupNames_out_memory");
2333 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2334 return tevent_req_post(req, ev);
2337 /* make a temporary copy, that we pass to the dispatch function */
2338 state->tmp = state->orig;
2340 subreq = cli->dispatch_send(state, ev, cli,
2341 &ndr_table_lsarpc,
2342 NDR_LSA_LOOKUPNAMES,
2343 &state->tmp);
2344 if (tevent_req_nomem(subreq, req)) {
2345 return tevent_req_post(req, ev);
2347 tevent_req_set_callback(subreq, rpccli_lsa_LookupNames_done, req);
2348 return req;
2351 static void rpccli_lsa_LookupNames_done(struct tevent_req *subreq)
2353 struct tevent_req *req = tevent_req_callback_data(
2354 subreq, struct tevent_req);
2355 struct rpccli_lsa_LookupNames_state *state = tevent_req_data(
2356 req, struct rpccli_lsa_LookupNames_state);
2357 NTSTATUS status;
2358 TALLOC_CTX *mem_ctx;
2360 if (state->out_mem_ctx) {
2361 mem_ctx = state->out_mem_ctx;
2362 } else {
2363 mem_ctx = state;
2366 status = state->dispatch_recv(subreq, mem_ctx);
2367 TALLOC_FREE(subreq);
2368 if (!NT_STATUS_IS_OK(status)) {
2369 tevent_req_nterror(req, status);
2370 return;
2373 /* Copy out parameters */
2374 *state->orig.out.domains = *state->tmp.out.domains;
2375 *state->orig.out.sids = *state->tmp.out.sids;
2376 *state->orig.out.count = *state->tmp.out.count;
2378 /* Copy result */
2379 state->orig.out.result = state->tmp.out.result;
2381 /* Reset temporary structure */
2382 ZERO_STRUCT(state->tmp);
2384 if (DEBUGLEVEL >= 10) {
2385 NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &state->orig);
2388 tevent_req_done(req);
2391 NTSTATUS rpccli_lsa_LookupNames_recv(struct tevent_req *req,
2392 TALLOC_CTX *mem_ctx,
2393 NTSTATUS *result)
2395 struct rpccli_lsa_LookupNames_state *state = tevent_req_data(
2396 req, struct rpccli_lsa_LookupNames_state);
2397 NTSTATUS status;
2399 if (tevent_req_is_nterror(req, &status)) {
2400 tevent_req_received(req);
2401 return status;
2404 /* Steal possbile out parameters to the callers context */
2405 talloc_steal(mem_ctx, state->out_mem_ctx);
2407 /* Return result */
2408 *result = state->orig.out.result;
2410 tevent_req_received(req);
2411 return NT_STATUS_OK;
2414 NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli,
2415 TALLOC_CTX *mem_ctx,
2416 struct policy_handle *handle /* [in] [ref] */,
2417 uint32_t num_names /* [in] [range(0,1000)] */,
2418 struct lsa_String *names /* [in] [size_is(num_names)] */,
2419 struct lsa_RefDomainList **domains /* [out] [ref] */,
2420 struct lsa_TransSidArray *sids /* [in,out] [ref] */,
2421 enum lsa_LookupNamesLevel level /* [in] */,
2422 uint32_t *count /* [in,out] [ref] */)
2424 struct lsa_LookupNames r;
2425 NTSTATUS status;
2427 /* In parameters */
2428 r.in.handle = handle;
2429 r.in.num_names = num_names;
2430 r.in.names = names;
2431 r.in.sids = sids;
2432 r.in.level = level;
2433 r.in.count = count;
2435 if (DEBUGLEVEL >= 10) {
2436 NDR_PRINT_IN_DEBUG(lsa_LookupNames, &r);
2439 status = cli->dispatch(cli,
2440 mem_ctx,
2441 &ndr_table_lsarpc,
2442 NDR_LSA_LOOKUPNAMES,
2443 &r);
2445 if (!NT_STATUS_IS_OK(status)) {
2446 return status;
2449 if (DEBUGLEVEL >= 10) {
2450 NDR_PRINT_OUT_DEBUG(lsa_LookupNames, &r);
2453 if (NT_STATUS_IS_ERR(status)) {
2454 return status;
2457 /* Return variables */
2458 *domains = *r.out.domains;
2459 *sids = *r.out.sids;
2460 *count = *r.out.count;
2462 /* Return result */
2463 return r.out.result;
2466 struct rpccli_lsa_LookupSids_state {
2467 struct lsa_LookupSids orig;
2468 struct lsa_LookupSids tmp;
2469 TALLOC_CTX *out_mem_ctx;
2470 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2473 static void rpccli_lsa_LookupSids_done(struct tevent_req *subreq);
2475 struct tevent_req *rpccli_lsa_LookupSids_send(TALLOC_CTX *mem_ctx,
2476 struct tevent_context *ev,
2477 struct rpc_pipe_client *cli,
2478 struct policy_handle *_handle /* [in] [ref] */,
2479 struct lsa_SidArray *_sids /* [in] [ref] */,
2480 struct lsa_RefDomainList **_domains /* [out] [ref] */,
2481 struct lsa_TransNameArray *_names /* [in,out] [ref] */,
2482 uint16_t _level /* [in] */,
2483 uint32_t *_count /* [in,out] [ref] */)
2485 struct tevent_req *req;
2486 struct rpccli_lsa_LookupSids_state *state;
2487 struct tevent_req *subreq;
2489 req = tevent_req_create(mem_ctx, &state,
2490 struct rpccli_lsa_LookupSids_state);
2491 if (req == NULL) {
2492 return NULL;
2494 state->out_mem_ctx = NULL;
2495 state->dispatch_recv = cli->dispatch_recv;
2497 /* In parameters */
2498 state->orig.in.handle = _handle;
2499 state->orig.in.sids = _sids;
2500 state->orig.in.names = _names;
2501 state->orig.in.level = _level;
2502 state->orig.in.count = _count;
2504 /* Out parameters */
2505 state->orig.out.domains = _domains;
2506 state->orig.out.names = _names;
2507 state->orig.out.count = _count;
2509 /* Result */
2510 ZERO_STRUCT(state->orig.out.result);
2512 if (DEBUGLEVEL >= 10) {
2513 NDR_PRINT_IN_DEBUG(lsa_LookupSids, &state->orig);
2516 state->out_mem_ctx = talloc_named_const(state, 0,
2517 "rpccli_lsa_LookupSids_out_memory");
2518 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2519 return tevent_req_post(req, ev);
2522 /* make a temporary copy, that we pass to the dispatch function */
2523 state->tmp = state->orig;
2525 subreq = cli->dispatch_send(state, ev, cli,
2526 &ndr_table_lsarpc,
2527 NDR_LSA_LOOKUPSIDS,
2528 &state->tmp);
2529 if (tevent_req_nomem(subreq, req)) {
2530 return tevent_req_post(req, ev);
2532 tevent_req_set_callback(subreq, rpccli_lsa_LookupSids_done, req);
2533 return req;
2536 static void rpccli_lsa_LookupSids_done(struct tevent_req *subreq)
2538 struct tevent_req *req = tevent_req_callback_data(
2539 subreq, struct tevent_req);
2540 struct rpccli_lsa_LookupSids_state *state = tevent_req_data(
2541 req, struct rpccli_lsa_LookupSids_state);
2542 NTSTATUS status;
2543 TALLOC_CTX *mem_ctx;
2545 if (state->out_mem_ctx) {
2546 mem_ctx = state->out_mem_ctx;
2547 } else {
2548 mem_ctx = state;
2551 status = state->dispatch_recv(subreq, mem_ctx);
2552 TALLOC_FREE(subreq);
2553 if (!NT_STATUS_IS_OK(status)) {
2554 tevent_req_nterror(req, status);
2555 return;
2558 /* Copy out parameters */
2559 *state->orig.out.domains = *state->tmp.out.domains;
2560 *state->orig.out.names = *state->tmp.out.names;
2561 *state->orig.out.count = *state->tmp.out.count;
2563 /* Copy result */
2564 state->orig.out.result = state->tmp.out.result;
2566 /* Reset temporary structure */
2567 ZERO_STRUCT(state->tmp);
2569 if (DEBUGLEVEL >= 10) {
2570 NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &state->orig);
2573 tevent_req_done(req);
2576 NTSTATUS rpccli_lsa_LookupSids_recv(struct tevent_req *req,
2577 TALLOC_CTX *mem_ctx,
2578 NTSTATUS *result)
2580 struct rpccli_lsa_LookupSids_state *state = tevent_req_data(
2581 req, struct rpccli_lsa_LookupSids_state);
2582 NTSTATUS status;
2584 if (tevent_req_is_nterror(req, &status)) {
2585 tevent_req_received(req);
2586 return status;
2589 /* Steal possbile out parameters to the callers context */
2590 talloc_steal(mem_ctx, state->out_mem_ctx);
2592 /* Return result */
2593 *result = state->orig.out.result;
2595 tevent_req_received(req);
2596 return NT_STATUS_OK;
2599 NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli,
2600 TALLOC_CTX *mem_ctx,
2601 struct policy_handle *handle /* [in] [ref] */,
2602 struct lsa_SidArray *sids /* [in] [ref] */,
2603 struct lsa_RefDomainList **domains /* [out] [ref] */,
2604 struct lsa_TransNameArray *names /* [in,out] [ref] */,
2605 uint16_t level /* [in] */,
2606 uint32_t *count /* [in,out] [ref] */)
2608 struct lsa_LookupSids r;
2609 NTSTATUS status;
2611 /* In parameters */
2612 r.in.handle = handle;
2613 r.in.sids = sids;
2614 r.in.names = names;
2615 r.in.level = level;
2616 r.in.count = count;
2618 if (DEBUGLEVEL >= 10) {
2619 NDR_PRINT_IN_DEBUG(lsa_LookupSids, &r);
2622 status = cli->dispatch(cli,
2623 mem_ctx,
2624 &ndr_table_lsarpc,
2625 NDR_LSA_LOOKUPSIDS,
2626 &r);
2628 if (!NT_STATUS_IS_OK(status)) {
2629 return status;
2632 if (DEBUGLEVEL >= 10) {
2633 NDR_PRINT_OUT_DEBUG(lsa_LookupSids, &r);
2636 if (NT_STATUS_IS_ERR(status)) {
2637 return status;
2640 /* Return variables */
2641 *domains = *r.out.domains;
2642 *names = *r.out.names;
2643 *count = *r.out.count;
2645 /* Return result */
2646 return r.out.result;
2649 struct rpccli_lsa_CreateSecret_state {
2650 struct lsa_CreateSecret orig;
2651 struct lsa_CreateSecret tmp;
2652 TALLOC_CTX *out_mem_ctx;
2653 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2656 static void rpccli_lsa_CreateSecret_done(struct tevent_req *subreq);
2658 struct tevent_req *rpccli_lsa_CreateSecret_send(TALLOC_CTX *mem_ctx,
2659 struct tevent_context *ev,
2660 struct rpc_pipe_client *cli,
2661 struct policy_handle *_handle /* [in] [ref] */,
2662 struct lsa_String _name /* [in] */,
2663 uint32_t _access_mask /* [in] */,
2664 struct policy_handle *_sec_handle /* [out] [ref] */)
2666 struct tevent_req *req;
2667 struct rpccli_lsa_CreateSecret_state *state;
2668 struct tevent_req *subreq;
2670 req = tevent_req_create(mem_ctx, &state,
2671 struct rpccli_lsa_CreateSecret_state);
2672 if (req == NULL) {
2673 return NULL;
2675 state->out_mem_ctx = NULL;
2676 state->dispatch_recv = cli->dispatch_recv;
2678 /* In parameters */
2679 state->orig.in.handle = _handle;
2680 state->orig.in.name = _name;
2681 state->orig.in.access_mask = _access_mask;
2683 /* Out parameters */
2684 state->orig.out.sec_handle = _sec_handle;
2686 /* Result */
2687 ZERO_STRUCT(state->orig.out.result);
2689 if (DEBUGLEVEL >= 10) {
2690 NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &state->orig);
2693 state->out_mem_ctx = talloc_named_const(state, 0,
2694 "rpccli_lsa_CreateSecret_out_memory");
2695 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2696 return tevent_req_post(req, ev);
2699 /* make a temporary copy, that we pass to the dispatch function */
2700 state->tmp = state->orig;
2702 subreq = cli->dispatch_send(state, ev, cli,
2703 &ndr_table_lsarpc,
2704 NDR_LSA_CREATESECRET,
2705 &state->tmp);
2706 if (tevent_req_nomem(subreq, req)) {
2707 return tevent_req_post(req, ev);
2709 tevent_req_set_callback(subreq, rpccli_lsa_CreateSecret_done, req);
2710 return req;
2713 static void rpccli_lsa_CreateSecret_done(struct tevent_req *subreq)
2715 struct tevent_req *req = tevent_req_callback_data(
2716 subreq, struct tevent_req);
2717 struct rpccli_lsa_CreateSecret_state *state = tevent_req_data(
2718 req, struct rpccli_lsa_CreateSecret_state);
2719 NTSTATUS status;
2720 TALLOC_CTX *mem_ctx;
2722 if (state->out_mem_ctx) {
2723 mem_ctx = state->out_mem_ctx;
2724 } else {
2725 mem_ctx = state;
2728 status = state->dispatch_recv(subreq, mem_ctx);
2729 TALLOC_FREE(subreq);
2730 if (!NT_STATUS_IS_OK(status)) {
2731 tevent_req_nterror(req, status);
2732 return;
2735 /* Copy out parameters */
2736 *state->orig.out.sec_handle = *state->tmp.out.sec_handle;
2738 /* Copy result */
2739 state->orig.out.result = state->tmp.out.result;
2741 /* Reset temporary structure */
2742 ZERO_STRUCT(state->tmp);
2744 if (DEBUGLEVEL >= 10) {
2745 NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &state->orig);
2748 tevent_req_done(req);
2751 NTSTATUS rpccli_lsa_CreateSecret_recv(struct tevent_req *req,
2752 TALLOC_CTX *mem_ctx,
2753 NTSTATUS *result)
2755 struct rpccli_lsa_CreateSecret_state *state = tevent_req_data(
2756 req, struct rpccli_lsa_CreateSecret_state);
2757 NTSTATUS status;
2759 if (tevent_req_is_nterror(req, &status)) {
2760 tevent_req_received(req);
2761 return status;
2764 /* Steal possbile out parameters to the callers context */
2765 talloc_steal(mem_ctx, state->out_mem_ctx);
2767 /* Return result */
2768 *result = state->orig.out.result;
2770 tevent_req_received(req);
2771 return NT_STATUS_OK;
2774 NTSTATUS rpccli_lsa_CreateSecret(struct rpc_pipe_client *cli,
2775 TALLOC_CTX *mem_ctx,
2776 struct policy_handle *handle /* [in] [ref] */,
2777 struct lsa_String name /* [in] */,
2778 uint32_t access_mask /* [in] */,
2779 struct policy_handle *sec_handle /* [out] [ref] */)
2781 struct lsa_CreateSecret r;
2782 NTSTATUS status;
2784 /* In parameters */
2785 r.in.handle = handle;
2786 r.in.name = name;
2787 r.in.access_mask = access_mask;
2789 if (DEBUGLEVEL >= 10) {
2790 NDR_PRINT_IN_DEBUG(lsa_CreateSecret, &r);
2793 status = cli->dispatch(cli,
2794 mem_ctx,
2795 &ndr_table_lsarpc,
2796 NDR_LSA_CREATESECRET,
2797 &r);
2799 if (!NT_STATUS_IS_OK(status)) {
2800 return status;
2803 if (DEBUGLEVEL >= 10) {
2804 NDR_PRINT_OUT_DEBUG(lsa_CreateSecret, &r);
2807 if (NT_STATUS_IS_ERR(status)) {
2808 return status;
2811 /* Return variables */
2812 *sec_handle = *r.out.sec_handle;
2814 /* Return result */
2815 return r.out.result;
2818 struct rpccli_lsa_OpenAccount_state {
2819 struct lsa_OpenAccount orig;
2820 struct lsa_OpenAccount tmp;
2821 TALLOC_CTX *out_mem_ctx;
2822 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2825 static void rpccli_lsa_OpenAccount_done(struct tevent_req *subreq);
2827 struct tevent_req *rpccli_lsa_OpenAccount_send(TALLOC_CTX *mem_ctx,
2828 struct tevent_context *ev,
2829 struct rpc_pipe_client *cli,
2830 struct policy_handle *_handle /* [in] [ref] */,
2831 struct dom_sid2 *_sid /* [in] [ref] */,
2832 uint32_t _access_mask /* [in] */,
2833 struct policy_handle *_acct_handle /* [out] [ref] */)
2835 struct tevent_req *req;
2836 struct rpccli_lsa_OpenAccount_state *state;
2837 struct tevent_req *subreq;
2839 req = tevent_req_create(mem_ctx, &state,
2840 struct rpccli_lsa_OpenAccount_state);
2841 if (req == NULL) {
2842 return NULL;
2844 state->out_mem_ctx = NULL;
2845 state->dispatch_recv = cli->dispatch_recv;
2847 /* In parameters */
2848 state->orig.in.handle = _handle;
2849 state->orig.in.sid = _sid;
2850 state->orig.in.access_mask = _access_mask;
2852 /* Out parameters */
2853 state->orig.out.acct_handle = _acct_handle;
2855 /* Result */
2856 ZERO_STRUCT(state->orig.out.result);
2858 if (DEBUGLEVEL >= 10) {
2859 NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &state->orig);
2862 state->out_mem_ctx = talloc_named_const(state, 0,
2863 "rpccli_lsa_OpenAccount_out_memory");
2864 if (tevent_req_nomem(state->out_mem_ctx, req)) {
2865 return tevent_req_post(req, ev);
2868 /* make a temporary copy, that we pass to the dispatch function */
2869 state->tmp = state->orig;
2871 subreq = cli->dispatch_send(state, ev, cli,
2872 &ndr_table_lsarpc,
2873 NDR_LSA_OPENACCOUNT,
2874 &state->tmp);
2875 if (tevent_req_nomem(subreq, req)) {
2876 return tevent_req_post(req, ev);
2878 tevent_req_set_callback(subreq, rpccli_lsa_OpenAccount_done, req);
2879 return req;
2882 static void rpccli_lsa_OpenAccount_done(struct tevent_req *subreq)
2884 struct tevent_req *req = tevent_req_callback_data(
2885 subreq, struct tevent_req);
2886 struct rpccli_lsa_OpenAccount_state *state = tevent_req_data(
2887 req, struct rpccli_lsa_OpenAccount_state);
2888 NTSTATUS status;
2889 TALLOC_CTX *mem_ctx;
2891 if (state->out_mem_ctx) {
2892 mem_ctx = state->out_mem_ctx;
2893 } else {
2894 mem_ctx = state;
2897 status = state->dispatch_recv(subreq, mem_ctx);
2898 TALLOC_FREE(subreq);
2899 if (!NT_STATUS_IS_OK(status)) {
2900 tevent_req_nterror(req, status);
2901 return;
2904 /* Copy out parameters */
2905 *state->orig.out.acct_handle = *state->tmp.out.acct_handle;
2907 /* Copy result */
2908 state->orig.out.result = state->tmp.out.result;
2910 /* Reset temporary structure */
2911 ZERO_STRUCT(state->tmp);
2913 if (DEBUGLEVEL >= 10) {
2914 NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &state->orig);
2917 tevent_req_done(req);
2920 NTSTATUS rpccli_lsa_OpenAccount_recv(struct tevent_req *req,
2921 TALLOC_CTX *mem_ctx,
2922 NTSTATUS *result)
2924 struct rpccli_lsa_OpenAccount_state *state = tevent_req_data(
2925 req, struct rpccli_lsa_OpenAccount_state);
2926 NTSTATUS status;
2928 if (tevent_req_is_nterror(req, &status)) {
2929 tevent_req_received(req);
2930 return status;
2933 /* Steal possbile out parameters to the callers context */
2934 talloc_steal(mem_ctx, state->out_mem_ctx);
2936 /* Return result */
2937 *result = state->orig.out.result;
2939 tevent_req_received(req);
2940 return NT_STATUS_OK;
2943 NTSTATUS rpccli_lsa_OpenAccount(struct rpc_pipe_client *cli,
2944 TALLOC_CTX *mem_ctx,
2945 struct policy_handle *handle /* [in] [ref] */,
2946 struct dom_sid2 *sid /* [in] [ref] */,
2947 uint32_t access_mask /* [in] */,
2948 struct policy_handle *acct_handle /* [out] [ref] */)
2950 struct lsa_OpenAccount r;
2951 NTSTATUS status;
2953 /* In parameters */
2954 r.in.handle = handle;
2955 r.in.sid = sid;
2956 r.in.access_mask = access_mask;
2958 if (DEBUGLEVEL >= 10) {
2959 NDR_PRINT_IN_DEBUG(lsa_OpenAccount, &r);
2962 status = cli->dispatch(cli,
2963 mem_ctx,
2964 &ndr_table_lsarpc,
2965 NDR_LSA_OPENACCOUNT,
2966 &r);
2968 if (!NT_STATUS_IS_OK(status)) {
2969 return status;
2972 if (DEBUGLEVEL >= 10) {
2973 NDR_PRINT_OUT_DEBUG(lsa_OpenAccount, &r);
2976 if (NT_STATUS_IS_ERR(status)) {
2977 return status;
2980 /* Return variables */
2981 *acct_handle = *r.out.acct_handle;
2983 /* Return result */
2984 return r.out.result;
2987 struct rpccli_lsa_EnumPrivsAccount_state {
2988 struct lsa_EnumPrivsAccount orig;
2989 struct lsa_EnumPrivsAccount tmp;
2990 TALLOC_CTX *out_mem_ctx;
2991 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2994 static void rpccli_lsa_EnumPrivsAccount_done(struct tevent_req *subreq);
2996 struct tevent_req *rpccli_lsa_EnumPrivsAccount_send(TALLOC_CTX *mem_ctx,
2997 struct tevent_context *ev,
2998 struct rpc_pipe_client *cli,
2999 struct policy_handle *_handle /* [in] [ref] */,
3000 struct lsa_PrivilegeSet **_privs /* [out] [ref] */)
3002 struct tevent_req *req;
3003 struct rpccli_lsa_EnumPrivsAccount_state *state;
3004 struct tevent_req *subreq;
3006 req = tevent_req_create(mem_ctx, &state,
3007 struct rpccli_lsa_EnumPrivsAccount_state);
3008 if (req == NULL) {
3009 return NULL;
3011 state->out_mem_ctx = NULL;
3012 state->dispatch_recv = cli->dispatch_recv;
3014 /* In parameters */
3015 state->orig.in.handle = _handle;
3017 /* Out parameters */
3018 state->orig.out.privs = _privs;
3020 /* Result */
3021 ZERO_STRUCT(state->orig.out.result);
3023 if (DEBUGLEVEL >= 10) {
3024 NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &state->orig);
3027 state->out_mem_ctx = talloc_named_const(state, 0,
3028 "rpccli_lsa_EnumPrivsAccount_out_memory");
3029 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3030 return tevent_req_post(req, ev);
3033 /* make a temporary copy, that we pass to the dispatch function */
3034 state->tmp = state->orig;
3036 subreq = cli->dispatch_send(state, ev, cli,
3037 &ndr_table_lsarpc,
3038 NDR_LSA_ENUMPRIVSACCOUNT,
3039 &state->tmp);
3040 if (tevent_req_nomem(subreq, req)) {
3041 return tevent_req_post(req, ev);
3043 tevent_req_set_callback(subreq, rpccli_lsa_EnumPrivsAccount_done, req);
3044 return req;
3047 static void rpccli_lsa_EnumPrivsAccount_done(struct tevent_req *subreq)
3049 struct tevent_req *req = tevent_req_callback_data(
3050 subreq, struct tevent_req);
3051 struct rpccli_lsa_EnumPrivsAccount_state *state = tevent_req_data(
3052 req, struct rpccli_lsa_EnumPrivsAccount_state);
3053 NTSTATUS status;
3054 TALLOC_CTX *mem_ctx;
3056 if (state->out_mem_ctx) {
3057 mem_ctx = state->out_mem_ctx;
3058 } else {
3059 mem_ctx = state;
3062 status = state->dispatch_recv(subreq, mem_ctx);
3063 TALLOC_FREE(subreq);
3064 if (!NT_STATUS_IS_OK(status)) {
3065 tevent_req_nterror(req, status);
3066 return;
3069 /* Copy out parameters */
3070 *state->orig.out.privs = *state->tmp.out.privs;
3072 /* Copy result */
3073 state->orig.out.result = state->tmp.out.result;
3075 /* Reset temporary structure */
3076 ZERO_STRUCT(state->tmp);
3078 if (DEBUGLEVEL >= 10) {
3079 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &state->orig);
3082 tevent_req_done(req);
3085 NTSTATUS rpccli_lsa_EnumPrivsAccount_recv(struct tevent_req *req,
3086 TALLOC_CTX *mem_ctx,
3087 NTSTATUS *result)
3089 struct rpccli_lsa_EnumPrivsAccount_state *state = tevent_req_data(
3090 req, struct rpccli_lsa_EnumPrivsAccount_state);
3091 NTSTATUS status;
3093 if (tevent_req_is_nterror(req, &status)) {
3094 tevent_req_received(req);
3095 return status;
3098 /* Steal possbile out parameters to the callers context */
3099 talloc_steal(mem_ctx, state->out_mem_ctx);
3101 /* Return result */
3102 *result = state->orig.out.result;
3104 tevent_req_received(req);
3105 return NT_STATUS_OK;
3108 NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli,
3109 TALLOC_CTX *mem_ctx,
3110 struct policy_handle *handle /* [in] [ref] */,
3111 struct lsa_PrivilegeSet **privs /* [out] [ref] */)
3113 struct lsa_EnumPrivsAccount r;
3114 NTSTATUS status;
3116 /* In parameters */
3117 r.in.handle = handle;
3119 if (DEBUGLEVEL >= 10) {
3120 NDR_PRINT_IN_DEBUG(lsa_EnumPrivsAccount, &r);
3123 status = cli->dispatch(cli,
3124 mem_ctx,
3125 &ndr_table_lsarpc,
3126 NDR_LSA_ENUMPRIVSACCOUNT,
3127 &r);
3129 if (!NT_STATUS_IS_OK(status)) {
3130 return status;
3133 if (DEBUGLEVEL >= 10) {
3134 NDR_PRINT_OUT_DEBUG(lsa_EnumPrivsAccount, &r);
3137 if (NT_STATUS_IS_ERR(status)) {
3138 return status;
3141 /* Return variables */
3142 *privs = *r.out.privs;
3144 /* Return result */
3145 return r.out.result;
3148 struct rpccli_lsa_AddPrivilegesToAccount_state {
3149 struct lsa_AddPrivilegesToAccount orig;
3150 struct lsa_AddPrivilegesToAccount tmp;
3151 TALLOC_CTX *out_mem_ctx;
3152 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3155 static void rpccli_lsa_AddPrivilegesToAccount_done(struct tevent_req *subreq);
3157 struct tevent_req *rpccli_lsa_AddPrivilegesToAccount_send(TALLOC_CTX *mem_ctx,
3158 struct tevent_context *ev,
3159 struct rpc_pipe_client *cli,
3160 struct policy_handle *_handle /* [in] [ref] */,
3161 struct lsa_PrivilegeSet *_privs /* [in] [ref] */)
3163 struct tevent_req *req;
3164 struct rpccli_lsa_AddPrivilegesToAccount_state *state;
3165 struct tevent_req *subreq;
3167 req = tevent_req_create(mem_ctx, &state,
3168 struct rpccli_lsa_AddPrivilegesToAccount_state);
3169 if (req == NULL) {
3170 return NULL;
3172 state->out_mem_ctx = NULL;
3173 state->dispatch_recv = cli->dispatch_recv;
3175 /* In parameters */
3176 state->orig.in.handle = _handle;
3177 state->orig.in.privs = _privs;
3179 /* Out parameters */
3181 /* Result */
3182 ZERO_STRUCT(state->orig.out.result);
3184 if (DEBUGLEVEL >= 10) {
3185 NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &state->orig);
3188 /* make a temporary copy, that we pass to the dispatch function */
3189 state->tmp = state->orig;
3191 subreq = cli->dispatch_send(state, ev, cli,
3192 &ndr_table_lsarpc,
3193 NDR_LSA_ADDPRIVILEGESTOACCOUNT,
3194 &state->tmp);
3195 if (tevent_req_nomem(subreq, req)) {
3196 return tevent_req_post(req, ev);
3198 tevent_req_set_callback(subreq, rpccli_lsa_AddPrivilegesToAccount_done, req);
3199 return req;
3202 static void rpccli_lsa_AddPrivilegesToAccount_done(struct tevent_req *subreq)
3204 struct tevent_req *req = tevent_req_callback_data(
3205 subreq, struct tevent_req);
3206 struct rpccli_lsa_AddPrivilegesToAccount_state *state = tevent_req_data(
3207 req, struct rpccli_lsa_AddPrivilegesToAccount_state);
3208 NTSTATUS status;
3209 TALLOC_CTX *mem_ctx;
3211 if (state->out_mem_ctx) {
3212 mem_ctx = state->out_mem_ctx;
3213 } else {
3214 mem_ctx = state;
3217 status = state->dispatch_recv(subreq, mem_ctx);
3218 TALLOC_FREE(subreq);
3219 if (!NT_STATUS_IS_OK(status)) {
3220 tevent_req_nterror(req, status);
3221 return;
3224 /* Copy out parameters */
3226 /* Copy result */
3227 state->orig.out.result = state->tmp.out.result;
3229 /* Reset temporary structure */
3230 ZERO_STRUCT(state->tmp);
3232 if (DEBUGLEVEL >= 10) {
3233 NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &state->orig);
3236 tevent_req_done(req);
3239 NTSTATUS rpccli_lsa_AddPrivilegesToAccount_recv(struct tevent_req *req,
3240 TALLOC_CTX *mem_ctx,
3241 NTSTATUS *result)
3243 struct rpccli_lsa_AddPrivilegesToAccount_state *state = tevent_req_data(
3244 req, struct rpccli_lsa_AddPrivilegesToAccount_state);
3245 NTSTATUS status;
3247 if (tevent_req_is_nterror(req, &status)) {
3248 tevent_req_received(req);
3249 return status;
3252 /* Steal possbile out parameters to the callers context */
3253 talloc_steal(mem_ctx, state->out_mem_ctx);
3255 /* Return result */
3256 *result = state->orig.out.result;
3258 tevent_req_received(req);
3259 return NT_STATUS_OK;
3262 NTSTATUS rpccli_lsa_AddPrivilegesToAccount(struct rpc_pipe_client *cli,
3263 TALLOC_CTX *mem_ctx,
3264 struct policy_handle *handle /* [in] [ref] */,
3265 struct lsa_PrivilegeSet *privs /* [in] [ref] */)
3267 struct lsa_AddPrivilegesToAccount r;
3268 NTSTATUS status;
3270 /* In parameters */
3271 r.in.handle = handle;
3272 r.in.privs = privs;
3274 if (DEBUGLEVEL >= 10) {
3275 NDR_PRINT_IN_DEBUG(lsa_AddPrivilegesToAccount, &r);
3278 status = cli->dispatch(cli,
3279 mem_ctx,
3280 &ndr_table_lsarpc,
3281 NDR_LSA_ADDPRIVILEGESTOACCOUNT,
3282 &r);
3284 if (!NT_STATUS_IS_OK(status)) {
3285 return status;
3288 if (DEBUGLEVEL >= 10) {
3289 NDR_PRINT_OUT_DEBUG(lsa_AddPrivilegesToAccount, &r);
3292 if (NT_STATUS_IS_ERR(status)) {
3293 return status;
3296 /* Return variables */
3298 /* Return result */
3299 return r.out.result;
3302 struct rpccli_lsa_RemovePrivilegesFromAccount_state {
3303 struct lsa_RemovePrivilegesFromAccount orig;
3304 struct lsa_RemovePrivilegesFromAccount tmp;
3305 TALLOC_CTX *out_mem_ctx;
3306 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3309 static void rpccli_lsa_RemovePrivilegesFromAccount_done(struct tevent_req *subreq);
3311 struct tevent_req *rpccli_lsa_RemovePrivilegesFromAccount_send(TALLOC_CTX *mem_ctx,
3312 struct tevent_context *ev,
3313 struct rpc_pipe_client *cli,
3314 struct policy_handle *_handle /* [in] [ref] */,
3315 uint8_t _remove_all /* [in] */,
3316 struct lsa_PrivilegeSet *_privs /* [in] [unique] */)
3318 struct tevent_req *req;
3319 struct rpccli_lsa_RemovePrivilegesFromAccount_state *state;
3320 struct tevent_req *subreq;
3322 req = tevent_req_create(mem_ctx, &state,
3323 struct rpccli_lsa_RemovePrivilegesFromAccount_state);
3324 if (req == NULL) {
3325 return NULL;
3327 state->out_mem_ctx = NULL;
3328 state->dispatch_recv = cli->dispatch_recv;
3330 /* In parameters */
3331 state->orig.in.handle = _handle;
3332 state->orig.in.remove_all = _remove_all;
3333 state->orig.in.privs = _privs;
3335 /* Out parameters */
3337 /* Result */
3338 ZERO_STRUCT(state->orig.out.result);
3340 if (DEBUGLEVEL >= 10) {
3341 NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &state->orig);
3344 /* make a temporary copy, that we pass to the dispatch function */
3345 state->tmp = state->orig;
3347 subreq = cli->dispatch_send(state, ev, cli,
3348 &ndr_table_lsarpc,
3349 NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT,
3350 &state->tmp);
3351 if (tevent_req_nomem(subreq, req)) {
3352 return tevent_req_post(req, ev);
3354 tevent_req_set_callback(subreq, rpccli_lsa_RemovePrivilegesFromAccount_done, req);
3355 return req;
3358 static void rpccli_lsa_RemovePrivilegesFromAccount_done(struct tevent_req *subreq)
3360 struct tevent_req *req = tevent_req_callback_data(
3361 subreq, struct tevent_req);
3362 struct rpccli_lsa_RemovePrivilegesFromAccount_state *state = tevent_req_data(
3363 req, struct rpccli_lsa_RemovePrivilegesFromAccount_state);
3364 NTSTATUS status;
3365 TALLOC_CTX *mem_ctx;
3367 if (state->out_mem_ctx) {
3368 mem_ctx = state->out_mem_ctx;
3369 } else {
3370 mem_ctx = state;
3373 status = state->dispatch_recv(subreq, mem_ctx);
3374 TALLOC_FREE(subreq);
3375 if (!NT_STATUS_IS_OK(status)) {
3376 tevent_req_nterror(req, status);
3377 return;
3380 /* Copy out parameters */
3382 /* Copy result */
3383 state->orig.out.result = state->tmp.out.result;
3385 /* Reset temporary structure */
3386 ZERO_STRUCT(state->tmp);
3388 if (DEBUGLEVEL >= 10) {
3389 NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &state->orig);
3392 tevent_req_done(req);
3395 NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount_recv(struct tevent_req *req,
3396 TALLOC_CTX *mem_ctx,
3397 NTSTATUS *result)
3399 struct rpccli_lsa_RemovePrivilegesFromAccount_state *state = tevent_req_data(
3400 req, struct rpccli_lsa_RemovePrivilegesFromAccount_state);
3401 NTSTATUS status;
3403 if (tevent_req_is_nterror(req, &status)) {
3404 tevent_req_received(req);
3405 return status;
3408 /* Steal possbile out parameters to the callers context */
3409 talloc_steal(mem_ctx, state->out_mem_ctx);
3411 /* Return result */
3412 *result = state->orig.out.result;
3414 tevent_req_received(req);
3415 return NT_STATUS_OK;
3418 NTSTATUS rpccli_lsa_RemovePrivilegesFromAccount(struct rpc_pipe_client *cli,
3419 TALLOC_CTX *mem_ctx,
3420 struct policy_handle *handle /* [in] [ref] */,
3421 uint8_t remove_all /* [in] */,
3422 struct lsa_PrivilegeSet *privs /* [in] [unique] */)
3424 struct lsa_RemovePrivilegesFromAccount r;
3425 NTSTATUS status;
3427 /* In parameters */
3428 r.in.handle = handle;
3429 r.in.remove_all = remove_all;
3430 r.in.privs = privs;
3432 if (DEBUGLEVEL >= 10) {
3433 NDR_PRINT_IN_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
3436 status = cli->dispatch(cli,
3437 mem_ctx,
3438 &ndr_table_lsarpc,
3439 NDR_LSA_REMOVEPRIVILEGESFROMACCOUNT,
3440 &r);
3442 if (!NT_STATUS_IS_OK(status)) {
3443 return status;
3446 if (DEBUGLEVEL >= 10) {
3447 NDR_PRINT_OUT_DEBUG(lsa_RemovePrivilegesFromAccount, &r);
3450 if (NT_STATUS_IS_ERR(status)) {
3451 return status;
3454 /* Return variables */
3456 /* Return result */
3457 return r.out.result;
3460 struct rpccli_lsa_GetQuotasForAccount_state {
3461 struct lsa_GetQuotasForAccount orig;
3462 struct lsa_GetQuotasForAccount tmp;
3463 TALLOC_CTX *out_mem_ctx;
3464 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3467 static void rpccli_lsa_GetQuotasForAccount_done(struct tevent_req *subreq);
3469 struct tevent_req *rpccli_lsa_GetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
3470 struct tevent_context *ev,
3471 struct rpc_pipe_client *cli)
3473 struct tevent_req *req;
3474 struct rpccli_lsa_GetQuotasForAccount_state *state;
3475 struct tevent_req *subreq;
3477 req = tevent_req_create(mem_ctx, &state,
3478 struct rpccli_lsa_GetQuotasForAccount_state);
3479 if (req == NULL) {
3480 return NULL;
3482 state->out_mem_ctx = NULL;
3483 state->dispatch_recv = cli->dispatch_recv;
3485 /* In parameters */
3487 /* Out parameters */
3489 /* Result */
3490 ZERO_STRUCT(state->orig.out.result);
3492 if (DEBUGLEVEL >= 10) {
3493 NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &state->orig);
3496 /* make a temporary copy, that we pass to the dispatch function */
3497 state->tmp = state->orig;
3499 subreq = cli->dispatch_send(state, ev, cli,
3500 &ndr_table_lsarpc,
3501 NDR_LSA_GETQUOTASFORACCOUNT,
3502 &state->tmp);
3503 if (tevent_req_nomem(subreq, req)) {
3504 return tevent_req_post(req, ev);
3506 tevent_req_set_callback(subreq, rpccli_lsa_GetQuotasForAccount_done, req);
3507 return req;
3510 static void rpccli_lsa_GetQuotasForAccount_done(struct tevent_req *subreq)
3512 struct tevent_req *req = tevent_req_callback_data(
3513 subreq, struct tevent_req);
3514 struct rpccli_lsa_GetQuotasForAccount_state *state = tevent_req_data(
3515 req, struct rpccli_lsa_GetQuotasForAccount_state);
3516 NTSTATUS status;
3517 TALLOC_CTX *mem_ctx;
3519 if (state->out_mem_ctx) {
3520 mem_ctx = state->out_mem_ctx;
3521 } else {
3522 mem_ctx = state;
3525 status = state->dispatch_recv(subreq, mem_ctx);
3526 TALLOC_FREE(subreq);
3527 if (!NT_STATUS_IS_OK(status)) {
3528 tevent_req_nterror(req, status);
3529 return;
3532 /* Copy out parameters */
3534 /* Copy result */
3535 state->orig.out.result = state->tmp.out.result;
3537 /* Reset temporary structure */
3538 ZERO_STRUCT(state->tmp);
3540 if (DEBUGLEVEL >= 10) {
3541 NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &state->orig);
3544 tevent_req_done(req);
3547 NTSTATUS rpccli_lsa_GetQuotasForAccount_recv(struct tevent_req *req,
3548 TALLOC_CTX *mem_ctx,
3549 NTSTATUS *result)
3551 struct rpccli_lsa_GetQuotasForAccount_state *state = tevent_req_data(
3552 req, struct rpccli_lsa_GetQuotasForAccount_state);
3553 NTSTATUS status;
3555 if (tevent_req_is_nterror(req, &status)) {
3556 tevent_req_received(req);
3557 return status;
3560 /* Steal possbile out parameters to the callers context */
3561 talloc_steal(mem_ctx, state->out_mem_ctx);
3563 /* Return result */
3564 *result = state->orig.out.result;
3566 tevent_req_received(req);
3567 return NT_STATUS_OK;
3570 NTSTATUS rpccli_lsa_GetQuotasForAccount(struct rpc_pipe_client *cli,
3571 TALLOC_CTX *mem_ctx)
3573 struct lsa_GetQuotasForAccount r;
3574 NTSTATUS status;
3576 /* In parameters */
3578 if (DEBUGLEVEL >= 10) {
3579 NDR_PRINT_IN_DEBUG(lsa_GetQuotasForAccount, &r);
3582 status = cli->dispatch(cli,
3583 mem_ctx,
3584 &ndr_table_lsarpc,
3585 NDR_LSA_GETQUOTASFORACCOUNT,
3586 &r);
3588 if (!NT_STATUS_IS_OK(status)) {
3589 return status;
3592 if (DEBUGLEVEL >= 10) {
3593 NDR_PRINT_OUT_DEBUG(lsa_GetQuotasForAccount, &r);
3596 if (NT_STATUS_IS_ERR(status)) {
3597 return status;
3600 /* Return variables */
3602 /* Return result */
3603 return r.out.result;
3606 struct rpccli_lsa_SetQuotasForAccount_state {
3607 struct lsa_SetQuotasForAccount orig;
3608 struct lsa_SetQuotasForAccount tmp;
3609 TALLOC_CTX *out_mem_ctx;
3610 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3613 static void rpccli_lsa_SetQuotasForAccount_done(struct tevent_req *subreq);
3615 struct tevent_req *rpccli_lsa_SetQuotasForAccount_send(TALLOC_CTX *mem_ctx,
3616 struct tevent_context *ev,
3617 struct rpc_pipe_client *cli)
3619 struct tevent_req *req;
3620 struct rpccli_lsa_SetQuotasForAccount_state *state;
3621 struct tevent_req *subreq;
3623 req = tevent_req_create(mem_ctx, &state,
3624 struct rpccli_lsa_SetQuotasForAccount_state);
3625 if (req == NULL) {
3626 return NULL;
3628 state->out_mem_ctx = NULL;
3629 state->dispatch_recv = cli->dispatch_recv;
3631 /* In parameters */
3633 /* Out parameters */
3635 /* Result */
3636 ZERO_STRUCT(state->orig.out.result);
3638 if (DEBUGLEVEL >= 10) {
3639 NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &state->orig);
3642 /* make a temporary copy, that we pass to the dispatch function */
3643 state->tmp = state->orig;
3645 subreq = cli->dispatch_send(state, ev, cli,
3646 &ndr_table_lsarpc,
3647 NDR_LSA_SETQUOTASFORACCOUNT,
3648 &state->tmp);
3649 if (tevent_req_nomem(subreq, req)) {
3650 return tevent_req_post(req, ev);
3652 tevent_req_set_callback(subreq, rpccli_lsa_SetQuotasForAccount_done, req);
3653 return req;
3656 static void rpccli_lsa_SetQuotasForAccount_done(struct tevent_req *subreq)
3658 struct tevent_req *req = tevent_req_callback_data(
3659 subreq, struct tevent_req);
3660 struct rpccli_lsa_SetQuotasForAccount_state *state = tevent_req_data(
3661 req, struct rpccli_lsa_SetQuotasForAccount_state);
3662 NTSTATUS status;
3663 TALLOC_CTX *mem_ctx;
3665 if (state->out_mem_ctx) {
3666 mem_ctx = state->out_mem_ctx;
3667 } else {
3668 mem_ctx = state;
3671 status = state->dispatch_recv(subreq, mem_ctx);
3672 TALLOC_FREE(subreq);
3673 if (!NT_STATUS_IS_OK(status)) {
3674 tevent_req_nterror(req, status);
3675 return;
3678 /* Copy out parameters */
3680 /* Copy result */
3681 state->orig.out.result = state->tmp.out.result;
3683 /* Reset temporary structure */
3684 ZERO_STRUCT(state->tmp);
3686 if (DEBUGLEVEL >= 10) {
3687 NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &state->orig);
3690 tevent_req_done(req);
3693 NTSTATUS rpccli_lsa_SetQuotasForAccount_recv(struct tevent_req *req,
3694 TALLOC_CTX *mem_ctx,
3695 NTSTATUS *result)
3697 struct rpccli_lsa_SetQuotasForAccount_state *state = tevent_req_data(
3698 req, struct rpccli_lsa_SetQuotasForAccount_state);
3699 NTSTATUS status;
3701 if (tevent_req_is_nterror(req, &status)) {
3702 tevent_req_received(req);
3703 return status;
3706 /* Steal possbile out parameters to the callers context */
3707 talloc_steal(mem_ctx, state->out_mem_ctx);
3709 /* Return result */
3710 *result = state->orig.out.result;
3712 tevent_req_received(req);
3713 return NT_STATUS_OK;
3716 NTSTATUS rpccli_lsa_SetQuotasForAccount(struct rpc_pipe_client *cli,
3717 TALLOC_CTX *mem_ctx)
3719 struct lsa_SetQuotasForAccount r;
3720 NTSTATUS status;
3722 /* In parameters */
3724 if (DEBUGLEVEL >= 10) {
3725 NDR_PRINT_IN_DEBUG(lsa_SetQuotasForAccount, &r);
3728 status = cli->dispatch(cli,
3729 mem_ctx,
3730 &ndr_table_lsarpc,
3731 NDR_LSA_SETQUOTASFORACCOUNT,
3732 &r);
3734 if (!NT_STATUS_IS_OK(status)) {
3735 return status;
3738 if (DEBUGLEVEL >= 10) {
3739 NDR_PRINT_OUT_DEBUG(lsa_SetQuotasForAccount, &r);
3742 if (NT_STATUS_IS_ERR(status)) {
3743 return status;
3746 /* Return variables */
3748 /* Return result */
3749 return r.out.result;
3752 struct rpccli_lsa_GetSystemAccessAccount_state {
3753 struct lsa_GetSystemAccessAccount orig;
3754 struct lsa_GetSystemAccessAccount tmp;
3755 TALLOC_CTX *out_mem_ctx;
3756 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3759 static void rpccli_lsa_GetSystemAccessAccount_done(struct tevent_req *subreq);
3761 struct tevent_req *rpccli_lsa_GetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
3762 struct tevent_context *ev,
3763 struct rpc_pipe_client *cli,
3764 struct policy_handle *_handle /* [in] [ref] */,
3765 uint32_t *_access_mask /* [out] [ref] */)
3767 struct tevent_req *req;
3768 struct rpccli_lsa_GetSystemAccessAccount_state *state;
3769 struct tevent_req *subreq;
3771 req = tevent_req_create(mem_ctx, &state,
3772 struct rpccli_lsa_GetSystemAccessAccount_state);
3773 if (req == NULL) {
3774 return NULL;
3776 state->out_mem_ctx = NULL;
3777 state->dispatch_recv = cli->dispatch_recv;
3779 /* In parameters */
3780 state->orig.in.handle = _handle;
3782 /* Out parameters */
3783 state->orig.out.access_mask = _access_mask;
3785 /* Result */
3786 ZERO_STRUCT(state->orig.out.result);
3788 if (DEBUGLEVEL >= 10) {
3789 NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &state->orig);
3792 state->out_mem_ctx = talloc_named_const(state, 0,
3793 "rpccli_lsa_GetSystemAccessAccount_out_memory");
3794 if (tevent_req_nomem(state->out_mem_ctx, req)) {
3795 return tevent_req_post(req, ev);
3798 /* make a temporary copy, that we pass to the dispatch function */
3799 state->tmp = state->orig;
3801 subreq = cli->dispatch_send(state, ev, cli,
3802 &ndr_table_lsarpc,
3803 NDR_LSA_GETSYSTEMACCESSACCOUNT,
3804 &state->tmp);
3805 if (tevent_req_nomem(subreq, req)) {
3806 return tevent_req_post(req, ev);
3808 tevent_req_set_callback(subreq, rpccli_lsa_GetSystemAccessAccount_done, req);
3809 return req;
3812 static void rpccli_lsa_GetSystemAccessAccount_done(struct tevent_req *subreq)
3814 struct tevent_req *req = tevent_req_callback_data(
3815 subreq, struct tevent_req);
3816 struct rpccli_lsa_GetSystemAccessAccount_state *state = tevent_req_data(
3817 req, struct rpccli_lsa_GetSystemAccessAccount_state);
3818 NTSTATUS status;
3819 TALLOC_CTX *mem_ctx;
3821 if (state->out_mem_ctx) {
3822 mem_ctx = state->out_mem_ctx;
3823 } else {
3824 mem_ctx = state;
3827 status = state->dispatch_recv(subreq, mem_ctx);
3828 TALLOC_FREE(subreq);
3829 if (!NT_STATUS_IS_OK(status)) {
3830 tevent_req_nterror(req, status);
3831 return;
3834 /* Copy out parameters */
3835 *state->orig.out.access_mask = *state->tmp.out.access_mask;
3837 /* Copy result */
3838 state->orig.out.result = state->tmp.out.result;
3840 /* Reset temporary structure */
3841 ZERO_STRUCT(state->tmp);
3843 if (DEBUGLEVEL >= 10) {
3844 NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &state->orig);
3847 tevent_req_done(req);
3850 NTSTATUS rpccli_lsa_GetSystemAccessAccount_recv(struct tevent_req *req,
3851 TALLOC_CTX *mem_ctx,
3852 NTSTATUS *result)
3854 struct rpccli_lsa_GetSystemAccessAccount_state *state = tevent_req_data(
3855 req, struct rpccli_lsa_GetSystemAccessAccount_state);
3856 NTSTATUS status;
3858 if (tevent_req_is_nterror(req, &status)) {
3859 tevent_req_received(req);
3860 return status;
3863 /* Steal possbile out parameters to the callers context */
3864 talloc_steal(mem_ctx, state->out_mem_ctx);
3866 /* Return result */
3867 *result = state->orig.out.result;
3869 tevent_req_received(req);
3870 return NT_STATUS_OK;
3873 NTSTATUS rpccli_lsa_GetSystemAccessAccount(struct rpc_pipe_client *cli,
3874 TALLOC_CTX *mem_ctx,
3875 struct policy_handle *handle /* [in] [ref] */,
3876 uint32_t *access_mask /* [out] [ref] */)
3878 struct lsa_GetSystemAccessAccount r;
3879 NTSTATUS status;
3881 /* In parameters */
3882 r.in.handle = handle;
3884 if (DEBUGLEVEL >= 10) {
3885 NDR_PRINT_IN_DEBUG(lsa_GetSystemAccessAccount, &r);
3888 status = cli->dispatch(cli,
3889 mem_ctx,
3890 &ndr_table_lsarpc,
3891 NDR_LSA_GETSYSTEMACCESSACCOUNT,
3892 &r);
3894 if (!NT_STATUS_IS_OK(status)) {
3895 return status;
3898 if (DEBUGLEVEL >= 10) {
3899 NDR_PRINT_OUT_DEBUG(lsa_GetSystemAccessAccount, &r);
3902 if (NT_STATUS_IS_ERR(status)) {
3903 return status;
3906 /* Return variables */
3907 *access_mask = *r.out.access_mask;
3909 /* Return result */
3910 return r.out.result;
3913 struct rpccli_lsa_SetSystemAccessAccount_state {
3914 struct lsa_SetSystemAccessAccount orig;
3915 struct lsa_SetSystemAccessAccount tmp;
3916 TALLOC_CTX *out_mem_ctx;
3917 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3920 static void rpccli_lsa_SetSystemAccessAccount_done(struct tevent_req *subreq);
3922 struct tevent_req *rpccli_lsa_SetSystemAccessAccount_send(TALLOC_CTX *mem_ctx,
3923 struct tevent_context *ev,
3924 struct rpc_pipe_client *cli,
3925 struct policy_handle *_handle /* [in] [ref] */,
3926 uint32_t _access_mask /* [in] */)
3928 struct tevent_req *req;
3929 struct rpccli_lsa_SetSystemAccessAccount_state *state;
3930 struct tevent_req *subreq;
3932 req = tevent_req_create(mem_ctx, &state,
3933 struct rpccli_lsa_SetSystemAccessAccount_state);
3934 if (req == NULL) {
3935 return NULL;
3937 state->out_mem_ctx = NULL;
3938 state->dispatch_recv = cli->dispatch_recv;
3940 /* In parameters */
3941 state->orig.in.handle = _handle;
3942 state->orig.in.access_mask = _access_mask;
3944 /* Out parameters */
3946 /* Result */
3947 ZERO_STRUCT(state->orig.out.result);
3949 if (DEBUGLEVEL >= 10) {
3950 NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &state->orig);
3953 /* make a temporary copy, that we pass to the dispatch function */
3954 state->tmp = state->orig;
3956 subreq = cli->dispatch_send(state, ev, cli,
3957 &ndr_table_lsarpc,
3958 NDR_LSA_SETSYSTEMACCESSACCOUNT,
3959 &state->tmp);
3960 if (tevent_req_nomem(subreq, req)) {
3961 return tevent_req_post(req, ev);
3963 tevent_req_set_callback(subreq, rpccli_lsa_SetSystemAccessAccount_done, req);
3964 return req;
3967 static void rpccli_lsa_SetSystemAccessAccount_done(struct tevent_req *subreq)
3969 struct tevent_req *req = tevent_req_callback_data(
3970 subreq, struct tevent_req);
3971 struct rpccli_lsa_SetSystemAccessAccount_state *state = tevent_req_data(
3972 req, struct rpccli_lsa_SetSystemAccessAccount_state);
3973 NTSTATUS status;
3974 TALLOC_CTX *mem_ctx;
3976 if (state->out_mem_ctx) {
3977 mem_ctx = state->out_mem_ctx;
3978 } else {
3979 mem_ctx = state;
3982 status = state->dispatch_recv(subreq, mem_ctx);
3983 TALLOC_FREE(subreq);
3984 if (!NT_STATUS_IS_OK(status)) {
3985 tevent_req_nterror(req, status);
3986 return;
3989 /* Copy out parameters */
3991 /* Copy result */
3992 state->orig.out.result = state->tmp.out.result;
3994 /* Reset temporary structure */
3995 ZERO_STRUCT(state->tmp);
3997 if (DEBUGLEVEL >= 10) {
3998 NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &state->orig);
4001 tevent_req_done(req);
4004 NTSTATUS rpccli_lsa_SetSystemAccessAccount_recv(struct tevent_req *req,
4005 TALLOC_CTX *mem_ctx,
4006 NTSTATUS *result)
4008 struct rpccli_lsa_SetSystemAccessAccount_state *state = tevent_req_data(
4009 req, struct rpccli_lsa_SetSystemAccessAccount_state);
4010 NTSTATUS status;
4012 if (tevent_req_is_nterror(req, &status)) {
4013 tevent_req_received(req);
4014 return status;
4017 /* Steal possbile out parameters to the callers context */
4018 talloc_steal(mem_ctx, state->out_mem_ctx);
4020 /* Return result */
4021 *result = state->orig.out.result;
4023 tevent_req_received(req);
4024 return NT_STATUS_OK;
4027 NTSTATUS rpccli_lsa_SetSystemAccessAccount(struct rpc_pipe_client *cli,
4028 TALLOC_CTX *mem_ctx,
4029 struct policy_handle *handle /* [in] [ref] */,
4030 uint32_t access_mask /* [in] */)
4032 struct lsa_SetSystemAccessAccount r;
4033 NTSTATUS status;
4035 /* In parameters */
4036 r.in.handle = handle;
4037 r.in.access_mask = access_mask;
4039 if (DEBUGLEVEL >= 10) {
4040 NDR_PRINT_IN_DEBUG(lsa_SetSystemAccessAccount, &r);
4043 status = cli->dispatch(cli,
4044 mem_ctx,
4045 &ndr_table_lsarpc,
4046 NDR_LSA_SETSYSTEMACCESSACCOUNT,
4047 &r);
4049 if (!NT_STATUS_IS_OK(status)) {
4050 return status;
4053 if (DEBUGLEVEL >= 10) {
4054 NDR_PRINT_OUT_DEBUG(lsa_SetSystemAccessAccount, &r);
4057 if (NT_STATUS_IS_ERR(status)) {
4058 return status;
4061 /* Return variables */
4063 /* Return result */
4064 return r.out.result;
4067 struct rpccli_lsa_OpenTrustedDomain_state {
4068 struct lsa_OpenTrustedDomain orig;
4069 struct lsa_OpenTrustedDomain tmp;
4070 TALLOC_CTX *out_mem_ctx;
4071 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4074 static void rpccli_lsa_OpenTrustedDomain_done(struct tevent_req *subreq);
4076 struct tevent_req *rpccli_lsa_OpenTrustedDomain_send(TALLOC_CTX *mem_ctx,
4077 struct tevent_context *ev,
4078 struct rpc_pipe_client *cli,
4079 struct policy_handle *_handle /* [in] [ref] */,
4080 struct dom_sid2 *_sid /* [in] [ref] */,
4081 uint32_t _access_mask /* [in] */,
4082 struct policy_handle *_trustdom_handle /* [out] [ref] */)
4084 struct tevent_req *req;
4085 struct rpccli_lsa_OpenTrustedDomain_state *state;
4086 struct tevent_req *subreq;
4088 req = tevent_req_create(mem_ctx, &state,
4089 struct rpccli_lsa_OpenTrustedDomain_state);
4090 if (req == NULL) {
4091 return NULL;
4093 state->out_mem_ctx = NULL;
4094 state->dispatch_recv = cli->dispatch_recv;
4096 /* In parameters */
4097 state->orig.in.handle = _handle;
4098 state->orig.in.sid = _sid;
4099 state->orig.in.access_mask = _access_mask;
4101 /* Out parameters */
4102 state->orig.out.trustdom_handle = _trustdom_handle;
4104 /* Result */
4105 ZERO_STRUCT(state->orig.out.result);
4107 if (DEBUGLEVEL >= 10) {
4108 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &state->orig);
4111 state->out_mem_ctx = talloc_named_const(state, 0,
4112 "rpccli_lsa_OpenTrustedDomain_out_memory");
4113 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4114 return tevent_req_post(req, ev);
4117 /* make a temporary copy, that we pass to the dispatch function */
4118 state->tmp = state->orig;
4120 subreq = cli->dispatch_send(state, ev, cli,
4121 &ndr_table_lsarpc,
4122 NDR_LSA_OPENTRUSTEDDOMAIN,
4123 &state->tmp);
4124 if (tevent_req_nomem(subreq, req)) {
4125 return tevent_req_post(req, ev);
4127 tevent_req_set_callback(subreq, rpccli_lsa_OpenTrustedDomain_done, req);
4128 return req;
4131 static void rpccli_lsa_OpenTrustedDomain_done(struct tevent_req *subreq)
4133 struct tevent_req *req = tevent_req_callback_data(
4134 subreq, struct tevent_req);
4135 struct rpccli_lsa_OpenTrustedDomain_state *state = tevent_req_data(
4136 req, struct rpccli_lsa_OpenTrustedDomain_state);
4137 NTSTATUS status;
4138 TALLOC_CTX *mem_ctx;
4140 if (state->out_mem_ctx) {
4141 mem_ctx = state->out_mem_ctx;
4142 } else {
4143 mem_ctx = state;
4146 status = state->dispatch_recv(subreq, mem_ctx);
4147 TALLOC_FREE(subreq);
4148 if (!NT_STATUS_IS_OK(status)) {
4149 tevent_req_nterror(req, status);
4150 return;
4153 /* Copy out parameters */
4154 *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
4156 /* Copy result */
4157 state->orig.out.result = state->tmp.out.result;
4159 /* Reset temporary structure */
4160 ZERO_STRUCT(state->tmp);
4162 if (DEBUGLEVEL >= 10) {
4163 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &state->orig);
4166 tevent_req_done(req);
4169 NTSTATUS rpccli_lsa_OpenTrustedDomain_recv(struct tevent_req *req,
4170 TALLOC_CTX *mem_ctx,
4171 NTSTATUS *result)
4173 struct rpccli_lsa_OpenTrustedDomain_state *state = tevent_req_data(
4174 req, struct rpccli_lsa_OpenTrustedDomain_state);
4175 NTSTATUS status;
4177 if (tevent_req_is_nterror(req, &status)) {
4178 tevent_req_received(req);
4179 return status;
4182 /* Steal possbile out parameters to the callers context */
4183 talloc_steal(mem_ctx, state->out_mem_ctx);
4185 /* Return result */
4186 *result = state->orig.out.result;
4188 tevent_req_received(req);
4189 return NT_STATUS_OK;
4192 NTSTATUS rpccli_lsa_OpenTrustedDomain(struct rpc_pipe_client *cli,
4193 TALLOC_CTX *mem_ctx,
4194 struct policy_handle *handle /* [in] [ref] */,
4195 struct dom_sid2 *sid /* [in] [ref] */,
4196 uint32_t access_mask /* [in] */,
4197 struct policy_handle *trustdom_handle /* [out] [ref] */)
4199 struct lsa_OpenTrustedDomain r;
4200 NTSTATUS status;
4202 /* In parameters */
4203 r.in.handle = handle;
4204 r.in.sid = sid;
4205 r.in.access_mask = access_mask;
4207 if (DEBUGLEVEL >= 10) {
4208 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomain, &r);
4211 status = cli->dispatch(cli,
4212 mem_ctx,
4213 &ndr_table_lsarpc,
4214 NDR_LSA_OPENTRUSTEDDOMAIN,
4215 &r);
4217 if (!NT_STATUS_IS_OK(status)) {
4218 return status;
4221 if (DEBUGLEVEL >= 10) {
4222 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomain, &r);
4225 if (NT_STATUS_IS_ERR(status)) {
4226 return status;
4229 /* Return variables */
4230 *trustdom_handle = *r.out.trustdom_handle;
4232 /* Return result */
4233 return r.out.result;
4236 struct rpccli_lsa_QueryTrustedDomainInfo_state {
4237 struct lsa_QueryTrustedDomainInfo orig;
4238 struct lsa_QueryTrustedDomainInfo tmp;
4239 TALLOC_CTX *out_mem_ctx;
4240 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4243 static void rpccli_lsa_QueryTrustedDomainInfo_done(struct tevent_req *subreq);
4245 struct tevent_req *rpccli_lsa_QueryTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
4246 struct tevent_context *ev,
4247 struct rpc_pipe_client *cli,
4248 struct policy_handle *_trustdom_handle /* [in] [ref] */,
4249 enum lsa_TrustDomInfoEnum _level /* [in] */,
4250 union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
4252 struct tevent_req *req;
4253 struct rpccli_lsa_QueryTrustedDomainInfo_state *state;
4254 struct tevent_req *subreq;
4256 req = tevent_req_create(mem_ctx, &state,
4257 struct rpccli_lsa_QueryTrustedDomainInfo_state);
4258 if (req == NULL) {
4259 return NULL;
4261 state->out_mem_ctx = NULL;
4262 state->dispatch_recv = cli->dispatch_recv;
4264 /* In parameters */
4265 state->orig.in.trustdom_handle = _trustdom_handle;
4266 state->orig.in.level = _level;
4268 /* Out parameters */
4269 state->orig.out.info = _info;
4271 /* Result */
4272 ZERO_STRUCT(state->orig.out.result);
4274 if (DEBUGLEVEL >= 10) {
4275 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &state->orig);
4278 state->out_mem_ctx = talloc_named_const(state, 0,
4279 "rpccli_lsa_QueryTrustedDomainInfo_out_memory");
4280 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4281 return tevent_req_post(req, ev);
4284 /* make a temporary copy, that we pass to the dispatch function */
4285 state->tmp = state->orig;
4287 subreq = cli->dispatch_send(state, ev, cli,
4288 &ndr_table_lsarpc,
4289 NDR_LSA_QUERYTRUSTEDDOMAININFO,
4290 &state->tmp);
4291 if (tevent_req_nomem(subreq, req)) {
4292 return tevent_req_post(req, ev);
4294 tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfo_done, req);
4295 return req;
4298 static void rpccli_lsa_QueryTrustedDomainInfo_done(struct tevent_req *subreq)
4300 struct tevent_req *req = tevent_req_callback_data(
4301 subreq, struct tevent_req);
4302 struct rpccli_lsa_QueryTrustedDomainInfo_state *state = tevent_req_data(
4303 req, struct rpccli_lsa_QueryTrustedDomainInfo_state);
4304 NTSTATUS status;
4305 TALLOC_CTX *mem_ctx;
4307 if (state->out_mem_ctx) {
4308 mem_ctx = state->out_mem_ctx;
4309 } else {
4310 mem_ctx = state;
4313 status = state->dispatch_recv(subreq, mem_ctx);
4314 TALLOC_FREE(subreq);
4315 if (!NT_STATUS_IS_OK(status)) {
4316 tevent_req_nterror(req, status);
4317 return;
4320 /* Copy out parameters */
4321 *state->orig.out.info = *state->tmp.out.info;
4323 /* Copy result */
4324 state->orig.out.result = state->tmp.out.result;
4326 /* Reset temporary structure */
4327 ZERO_STRUCT(state->tmp);
4329 if (DEBUGLEVEL >= 10) {
4330 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &state->orig);
4333 tevent_req_done(req);
4336 NTSTATUS rpccli_lsa_QueryTrustedDomainInfo_recv(struct tevent_req *req,
4337 TALLOC_CTX *mem_ctx,
4338 NTSTATUS *result)
4340 struct rpccli_lsa_QueryTrustedDomainInfo_state *state = tevent_req_data(
4341 req, struct rpccli_lsa_QueryTrustedDomainInfo_state);
4342 NTSTATUS status;
4344 if (tevent_req_is_nterror(req, &status)) {
4345 tevent_req_received(req);
4346 return status;
4349 /* Steal possbile out parameters to the callers context */
4350 talloc_steal(mem_ctx, state->out_mem_ctx);
4352 /* Return result */
4353 *result = state->orig.out.result;
4355 tevent_req_received(req);
4356 return NT_STATUS_OK;
4359 NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli,
4360 TALLOC_CTX *mem_ctx,
4361 struct policy_handle *trustdom_handle /* [in] [ref] */,
4362 enum lsa_TrustDomInfoEnum level /* [in] */,
4363 union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
4365 struct lsa_QueryTrustedDomainInfo r;
4366 NTSTATUS status;
4368 /* In parameters */
4369 r.in.trustdom_handle = trustdom_handle;
4370 r.in.level = level;
4372 if (DEBUGLEVEL >= 10) {
4373 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfo, &r);
4376 status = cli->dispatch(cli,
4377 mem_ctx,
4378 &ndr_table_lsarpc,
4379 NDR_LSA_QUERYTRUSTEDDOMAININFO,
4380 &r);
4382 if (!NT_STATUS_IS_OK(status)) {
4383 return status;
4386 if (DEBUGLEVEL >= 10) {
4387 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfo, &r);
4390 if (NT_STATUS_IS_ERR(status)) {
4391 return status;
4394 /* Return variables */
4395 *info = *r.out.info;
4397 /* Return result */
4398 return r.out.result;
4401 struct rpccli_lsa_SetInformationTrustedDomain_state {
4402 struct lsa_SetInformationTrustedDomain orig;
4403 struct lsa_SetInformationTrustedDomain tmp;
4404 TALLOC_CTX *out_mem_ctx;
4405 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4408 static void rpccli_lsa_SetInformationTrustedDomain_done(struct tevent_req *subreq);
4410 struct tevent_req *rpccli_lsa_SetInformationTrustedDomain_send(TALLOC_CTX *mem_ctx,
4411 struct tevent_context *ev,
4412 struct rpc_pipe_client *cli,
4413 struct policy_handle *_trustdom_handle /* [in] [ref] */,
4414 enum lsa_TrustDomInfoEnum _level /* [in] */,
4415 union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */)
4417 struct tevent_req *req;
4418 struct rpccli_lsa_SetInformationTrustedDomain_state *state;
4419 struct tevent_req *subreq;
4421 req = tevent_req_create(mem_ctx, &state,
4422 struct rpccli_lsa_SetInformationTrustedDomain_state);
4423 if (req == NULL) {
4424 return NULL;
4426 state->out_mem_ctx = NULL;
4427 state->dispatch_recv = cli->dispatch_recv;
4429 /* In parameters */
4430 state->orig.in.trustdom_handle = _trustdom_handle;
4431 state->orig.in.level = _level;
4432 state->orig.in.info = _info;
4434 /* Out parameters */
4436 /* Result */
4437 ZERO_STRUCT(state->orig.out.result);
4439 if (DEBUGLEVEL >= 10) {
4440 NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &state->orig);
4443 /* make a temporary copy, that we pass to the dispatch function */
4444 state->tmp = state->orig;
4446 subreq = cli->dispatch_send(state, ev, cli,
4447 &ndr_table_lsarpc,
4448 NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN,
4449 &state->tmp);
4450 if (tevent_req_nomem(subreq, req)) {
4451 return tevent_req_post(req, ev);
4453 tevent_req_set_callback(subreq, rpccli_lsa_SetInformationTrustedDomain_done, req);
4454 return req;
4457 static void rpccli_lsa_SetInformationTrustedDomain_done(struct tevent_req *subreq)
4459 struct tevent_req *req = tevent_req_callback_data(
4460 subreq, struct tevent_req);
4461 struct rpccli_lsa_SetInformationTrustedDomain_state *state = tevent_req_data(
4462 req, struct rpccli_lsa_SetInformationTrustedDomain_state);
4463 NTSTATUS status;
4464 TALLOC_CTX *mem_ctx;
4466 if (state->out_mem_ctx) {
4467 mem_ctx = state->out_mem_ctx;
4468 } else {
4469 mem_ctx = state;
4472 status = state->dispatch_recv(subreq, mem_ctx);
4473 TALLOC_FREE(subreq);
4474 if (!NT_STATUS_IS_OK(status)) {
4475 tevent_req_nterror(req, status);
4476 return;
4479 /* Copy out parameters */
4481 /* Copy result */
4482 state->orig.out.result = state->tmp.out.result;
4484 /* Reset temporary structure */
4485 ZERO_STRUCT(state->tmp);
4487 if (DEBUGLEVEL >= 10) {
4488 NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &state->orig);
4491 tevent_req_done(req);
4494 NTSTATUS rpccli_lsa_SetInformationTrustedDomain_recv(struct tevent_req *req,
4495 TALLOC_CTX *mem_ctx,
4496 NTSTATUS *result)
4498 struct rpccli_lsa_SetInformationTrustedDomain_state *state = tevent_req_data(
4499 req, struct rpccli_lsa_SetInformationTrustedDomain_state);
4500 NTSTATUS status;
4502 if (tevent_req_is_nterror(req, &status)) {
4503 tevent_req_received(req);
4504 return status;
4507 /* Steal possbile out parameters to the callers context */
4508 talloc_steal(mem_ctx, state->out_mem_ctx);
4510 /* Return result */
4511 *result = state->orig.out.result;
4513 tevent_req_received(req);
4514 return NT_STATUS_OK;
4517 NTSTATUS rpccli_lsa_SetInformationTrustedDomain(struct rpc_pipe_client *cli,
4518 TALLOC_CTX *mem_ctx,
4519 struct policy_handle *trustdom_handle /* [in] [ref] */,
4520 enum lsa_TrustDomInfoEnum level /* [in] */,
4521 union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
4523 struct lsa_SetInformationTrustedDomain r;
4524 NTSTATUS status;
4526 /* In parameters */
4527 r.in.trustdom_handle = trustdom_handle;
4528 r.in.level = level;
4529 r.in.info = info;
4531 if (DEBUGLEVEL >= 10) {
4532 NDR_PRINT_IN_DEBUG(lsa_SetInformationTrustedDomain, &r);
4535 status = cli->dispatch(cli,
4536 mem_ctx,
4537 &ndr_table_lsarpc,
4538 NDR_LSA_SETINFORMATIONTRUSTEDDOMAIN,
4539 &r);
4541 if (!NT_STATUS_IS_OK(status)) {
4542 return status;
4545 if (DEBUGLEVEL >= 10) {
4546 NDR_PRINT_OUT_DEBUG(lsa_SetInformationTrustedDomain, &r);
4549 if (NT_STATUS_IS_ERR(status)) {
4550 return status;
4553 /* Return variables */
4555 /* Return result */
4556 return r.out.result;
4559 struct rpccli_lsa_OpenSecret_state {
4560 struct lsa_OpenSecret orig;
4561 struct lsa_OpenSecret tmp;
4562 TALLOC_CTX *out_mem_ctx;
4563 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4566 static void rpccli_lsa_OpenSecret_done(struct tevent_req *subreq);
4568 struct tevent_req *rpccli_lsa_OpenSecret_send(TALLOC_CTX *mem_ctx,
4569 struct tevent_context *ev,
4570 struct rpc_pipe_client *cli,
4571 struct policy_handle *_handle /* [in] [ref] */,
4572 struct lsa_String _name /* [in] */,
4573 uint32_t _access_mask /* [in] */,
4574 struct policy_handle *_sec_handle /* [out] [ref] */)
4576 struct tevent_req *req;
4577 struct rpccli_lsa_OpenSecret_state *state;
4578 struct tevent_req *subreq;
4580 req = tevent_req_create(mem_ctx, &state,
4581 struct rpccli_lsa_OpenSecret_state);
4582 if (req == NULL) {
4583 return NULL;
4585 state->out_mem_ctx = NULL;
4586 state->dispatch_recv = cli->dispatch_recv;
4588 /* In parameters */
4589 state->orig.in.handle = _handle;
4590 state->orig.in.name = _name;
4591 state->orig.in.access_mask = _access_mask;
4593 /* Out parameters */
4594 state->orig.out.sec_handle = _sec_handle;
4596 /* Result */
4597 ZERO_STRUCT(state->orig.out.result);
4599 if (DEBUGLEVEL >= 10) {
4600 NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &state->orig);
4603 state->out_mem_ctx = talloc_named_const(state, 0,
4604 "rpccli_lsa_OpenSecret_out_memory");
4605 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4606 return tevent_req_post(req, ev);
4609 /* make a temporary copy, that we pass to the dispatch function */
4610 state->tmp = state->orig;
4612 subreq = cli->dispatch_send(state, ev, cli,
4613 &ndr_table_lsarpc,
4614 NDR_LSA_OPENSECRET,
4615 &state->tmp);
4616 if (tevent_req_nomem(subreq, req)) {
4617 return tevent_req_post(req, ev);
4619 tevent_req_set_callback(subreq, rpccli_lsa_OpenSecret_done, req);
4620 return req;
4623 static void rpccli_lsa_OpenSecret_done(struct tevent_req *subreq)
4625 struct tevent_req *req = tevent_req_callback_data(
4626 subreq, struct tevent_req);
4627 struct rpccli_lsa_OpenSecret_state *state = tevent_req_data(
4628 req, struct rpccli_lsa_OpenSecret_state);
4629 NTSTATUS status;
4630 TALLOC_CTX *mem_ctx;
4632 if (state->out_mem_ctx) {
4633 mem_ctx = state->out_mem_ctx;
4634 } else {
4635 mem_ctx = state;
4638 status = state->dispatch_recv(subreq, mem_ctx);
4639 TALLOC_FREE(subreq);
4640 if (!NT_STATUS_IS_OK(status)) {
4641 tevent_req_nterror(req, status);
4642 return;
4645 /* Copy out parameters */
4646 *state->orig.out.sec_handle = *state->tmp.out.sec_handle;
4648 /* Copy result */
4649 state->orig.out.result = state->tmp.out.result;
4651 /* Reset temporary structure */
4652 ZERO_STRUCT(state->tmp);
4654 if (DEBUGLEVEL >= 10) {
4655 NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &state->orig);
4658 tevent_req_done(req);
4661 NTSTATUS rpccli_lsa_OpenSecret_recv(struct tevent_req *req,
4662 TALLOC_CTX *mem_ctx,
4663 NTSTATUS *result)
4665 struct rpccli_lsa_OpenSecret_state *state = tevent_req_data(
4666 req, struct rpccli_lsa_OpenSecret_state);
4667 NTSTATUS status;
4669 if (tevent_req_is_nterror(req, &status)) {
4670 tevent_req_received(req);
4671 return status;
4674 /* Steal possbile out parameters to the callers context */
4675 talloc_steal(mem_ctx, state->out_mem_ctx);
4677 /* Return result */
4678 *result = state->orig.out.result;
4680 tevent_req_received(req);
4681 return NT_STATUS_OK;
4684 NTSTATUS rpccli_lsa_OpenSecret(struct rpc_pipe_client *cli,
4685 TALLOC_CTX *mem_ctx,
4686 struct policy_handle *handle /* [in] [ref] */,
4687 struct lsa_String name /* [in] */,
4688 uint32_t access_mask /* [in] */,
4689 struct policy_handle *sec_handle /* [out] [ref] */)
4691 struct lsa_OpenSecret r;
4692 NTSTATUS status;
4694 /* In parameters */
4695 r.in.handle = handle;
4696 r.in.name = name;
4697 r.in.access_mask = access_mask;
4699 if (DEBUGLEVEL >= 10) {
4700 NDR_PRINT_IN_DEBUG(lsa_OpenSecret, &r);
4703 status = cli->dispatch(cli,
4704 mem_ctx,
4705 &ndr_table_lsarpc,
4706 NDR_LSA_OPENSECRET,
4707 &r);
4709 if (!NT_STATUS_IS_OK(status)) {
4710 return status;
4713 if (DEBUGLEVEL >= 10) {
4714 NDR_PRINT_OUT_DEBUG(lsa_OpenSecret, &r);
4717 if (NT_STATUS_IS_ERR(status)) {
4718 return status;
4721 /* Return variables */
4722 *sec_handle = *r.out.sec_handle;
4724 /* Return result */
4725 return r.out.result;
4728 struct rpccli_lsa_SetSecret_state {
4729 struct lsa_SetSecret orig;
4730 struct lsa_SetSecret tmp;
4731 TALLOC_CTX *out_mem_ctx;
4732 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4735 static void rpccli_lsa_SetSecret_done(struct tevent_req *subreq);
4737 struct tevent_req *rpccli_lsa_SetSecret_send(TALLOC_CTX *mem_ctx,
4738 struct tevent_context *ev,
4739 struct rpc_pipe_client *cli,
4740 struct policy_handle *_sec_handle /* [in] [ref] */,
4741 struct lsa_DATA_BUF *_new_val /* [in] [unique] */,
4742 struct lsa_DATA_BUF *_old_val /* [in] [unique] */)
4744 struct tevent_req *req;
4745 struct rpccli_lsa_SetSecret_state *state;
4746 struct tevent_req *subreq;
4748 req = tevent_req_create(mem_ctx, &state,
4749 struct rpccli_lsa_SetSecret_state);
4750 if (req == NULL) {
4751 return NULL;
4753 state->out_mem_ctx = NULL;
4754 state->dispatch_recv = cli->dispatch_recv;
4756 /* In parameters */
4757 state->orig.in.sec_handle = _sec_handle;
4758 state->orig.in.new_val = _new_val;
4759 state->orig.in.old_val = _old_val;
4761 /* Out parameters */
4763 /* Result */
4764 ZERO_STRUCT(state->orig.out.result);
4766 if (DEBUGLEVEL >= 10) {
4767 NDR_PRINT_IN_DEBUG(lsa_SetSecret, &state->orig);
4770 /* make a temporary copy, that we pass to the dispatch function */
4771 state->tmp = state->orig;
4773 subreq = cli->dispatch_send(state, ev, cli,
4774 &ndr_table_lsarpc,
4775 NDR_LSA_SETSECRET,
4776 &state->tmp);
4777 if (tevent_req_nomem(subreq, req)) {
4778 return tevent_req_post(req, ev);
4780 tevent_req_set_callback(subreq, rpccli_lsa_SetSecret_done, req);
4781 return req;
4784 static void rpccli_lsa_SetSecret_done(struct tevent_req *subreq)
4786 struct tevent_req *req = tevent_req_callback_data(
4787 subreq, struct tevent_req);
4788 struct rpccli_lsa_SetSecret_state *state = tevent_req_data(
4789 req, struct rpccli_lsa_SetSecret_state);
4790 NTSTATUS status;
4791 TALLOC_CTX *mem_ctx;
4793 if (state->out_mem_ctx) {
4794 mem_ctx = state->out_mem_ctx;
4795 } else {
4796 mem_ctx = state;
4799 status = state->dispatch_recv(subreq, mem_ctx);
4800 TALLOC_FREE(subreq);
4801 if (!NT_STATUS_IS_OK(status)) {
4802 tevent_req_nterror(req, status);
4803 return;
4806 /* Copy out parameters */
4808 /* Copy result */
4809 state->orig.out.result = state->tmp.out.result;
4811 /* Reset temporary structure */
4812 ZERO_STRUCT(state->tmp);
4814 if (DEBUGLEVEL >= 10) {
4815 NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &state->orig);
4818 tevent_req_done(req);
4821 NTSTATUS rpccli_lsa_SetSecret_recv(struct tevent_req *req,
4822 TALLOC_CTX *mem_ctx,
4823 NTSTATUS *result)
4825 struct rpccli_lsa_SetSecret_state *state = tevent_req_data(
4826 req, struct rpccli_lsa_SetSecret_state);
4827 NTSTATUS status;
4829 if (tevent_req_is_nterror(req, &status)) {
4830 tevent_req_received(req);
4831 return status;
4834 /* Steal possbile out parameters to the callers context */
4835 talloc_steal(mem_ctx, state->out_mem_ctx);
4837 /* Return result */
4838 *result = state->orig.out.result;
4840 tevent_req_received(req);
4841 return NT_STATUS_OK;
4844 NTSTATUS rpccli_lsa_SetSecret(struct rpc_pipe_client *cli,
4845 TALLOC_CTX *mem_ctx,
4846 struct policy_handle *sec_handle /* [in] [ref] */,
4847 struct lsa_DATA_BUF *new_val /* [in] [unique] */,
4848 struct lsa_DATA_BUF *old_val /* [in] [unique] */)
4850 struct lsa_SetSecret r;
4851 NTSTATUS status;
4853 /* In parameters */
4854 r.in.sec_handle = sec_handle;
4855 r.in.new_val = new_val;
4856 r.in.old_val = old_val;
4858 if (DEBUGLEVEL >= 10) {
4859 NDR_PRINT_IN_DEBUG(lsa_SetSecret, &r);
4862 status = cli->dispatch(cli,
4863 mem_ctx,
4864 &ndr_table_lsarpc,
4865 NDR_LSA_SETSECRET,
4866 &r);
4868 if (!NT_STATUS_IS_OK(status)) {
4869 return status;
4872 if (DEBUGLEVEL >= 10) {
4873 NDR_PRINT_OUT_DEBUG(lsa_SetSecret, &r);
4876 if (NT_STATUS_IS_ERR(status)) {
4877 return status;
4880 /* Return variables */
4882 /* Return result */
4883 return r.out.result;
4886 struct rpccli_lsa_QuerySecret_state {
4887 struct lsa_QuerySecret orig;
4888 struct lsa_QuerySecret tmp;
4889 TALLOC_CTX *out_mem_ctx;
4890 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4893 static void rpccli_lsa_QuerySecret_done(struct tevent_req *subreq);
4895 struct tevent_req *rpccli_lsa_QuerySecret_send(TALLOC_CTX *mem_ctx,
4896 struct tevent_context *ev,
4897 struct rpc_pipe_client *cli,
4898 struct policy_handle *_sec_handle /* [in] [ref] */,
4899 struct lsa_DATA_BUF_PTR *_new_val /* [in,out] [unique] */,
4900 NTTIME *_new_mtime /* [in,out] [unique] */,
4901 struct lsa_DATA_BUF_PTR *_old_val /* [in,out] [unique] */,
4902 NTTIME *_old_mtime /* [in,out] [unique] */)
4904 struct tevent_req *req;
4905 struct rpccli_lsa_QuerySecret_state *state;
4906 struct tevent_req *subreq;
4908 req = tevent_req_create(mem_ctx, &state,
4909 struct rpccli_lsa_QuerySecret_state);
4910 if (req == NULL) {
4911 return NULL;
4913 state->out_mem_ctx = NULL;
4914 state->dispatch_recv = cli->dispatch_recv;
4916 /* In parameters */
4917 state->orig.in.sec_handle = _sec_handle;
4918 state->orig.in.new_val = _new_val;
4919 state->orig.in.new_mtime = _new_mtime;
4920 state->orig.in.old_val = _old_val;
4921 state->orig.in.old_mtime = _old_mtime;
4923 /* Out parameters */
4924 state->orig.out.new_val = _new_val;
4925 state->orig.out.new_mtime = _new_mtime;
4926 state->orig.out.old_val = _old_val;
4927 state->orig.out.old_mtime = _old_mtime;
4929 /* Result */
4930 ZERO_STRUCT(state->orig.out.result);
4932 if (DEBUGLEVEL >= 10) {
4933 NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &state->orig);
4936 state->out_mem_ctx = talloc_named_const(state, 0,
4937 "rpccli_lsa_QuerySecret_out_memory");
4938 if (tevent_req_nomem(state->out_mem_ctx, req)) {
4939 return tevent_req_post(req, ev);
4942 /* make a temporary copy, that we pass to the dispatch function */
4943 state->tmp = state->orig;
4945 subreq = cli->dispatch_send(state, ev, cli,
4946 &ndr_table_lsarpc,
4947 NDR_LSA_QUERYSECRET,
4948 &state->tmp);
4949 if (tevent_req_nomem(subreq, req)) {
4950 return tevent_req_post(req, ev);
4952 tevent_req_set_callback(subreq, rpccli_lsa_QuerySecret_done, req);
4953 return req;
4956 static void rpccli_lsa_QuerySecret_done(struct tevent_req *subreq)
4958 struct tevent_req *req = tevent_req_callback_data(
4959 subreq, struct tevent_req);
4960 struct rpccli_lsa_QuerySecret_state *state = tevent_req_data(
4961 req, struct rpccli_lsa_QuerySecret_state);
4962 NTSTATUS status;
4963 TALLOC_CTX *mem_ctx;
4965 if (state->out_mem_ctx) {
4966 mem_ctx = state->out_mem_ctx;
4967 } else {
4968 mem_ctx = state;
4971 status = state->dispatch_recv(subreq, mem_ctx);
4972 TALLOC_FREE(subreq);
4973 if (!NT_STATUS_IS_OK(status)) {
4974 tevent_req_nterror(req, status);
4975 return;
4978 /* Copy out parameters */
4979 if (state->orig.out.new_val && state->tmp.out.new_val) {
4980 *state->orig.out.new_val = *state->tmp.out.new_val;
4982 if (state->orig.out.new_mtime && state->tmp.out.new_mtime) {
4983 *state->orig.out.new_mtime = *state->tmp.out.new_mtime;
4985 if (state->orig.out.old_val && state->tmp.out.old_val) {
4986 *state->orig.out.old_val = *state->tmp.out.old_val;
4988 if (state->orig.out.old_mtime && state->tmp.out.old_mtime) {
4989 *state->orig.out.old_mtime = *state->tmp.out.old_mtime;
4992 /* Copy result */
4993 state->orig.out.result = state->tmp.out.result;
4995 /* Reset temporary structure */
4996 ZERO_STRUCT(state->tmp);
4998 if (DEBUGLEVEL >= 10) {
4999 NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &state->orig);
5002 tevent_req_done(req);
5005 NTSTATUS rpccli_lsa_QuerySecret_recv(struct tevent_req *req,
5006 TALLOC_CTX *mem_ctx,
5007 NTSTATUS *result)
5009 struct rpccli_lsa_QuerySecret_state *state = tevent_req_data(
5010 req, struct rpccli_lsa_QuerySecret_state);
5011 NTSTATUS status;
5013 if (tevent_req_is_nterror(req, &status)) {
5014 tevent_req_received(req);
5015 return status;
5018 /* Steal possbile out parameters to the callers context */
5019 talloc_steal(mem_ctx, state->out_mem_ctx);
5021 /* Return result */
5022 *result = state->orig.out.result;
5024 tevent_req_received(req);
5025 return NT_STATUS_OK;
5028 NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli,
5029 TALLOC_CTX *mem_ctx,
5030 struct policy_handle *sec_handle /* [in] [ref] */,
5031 struct lsa_DATA_BUF_PTR *new_val /* [in,out] [unique] */,
5032 NTTIME *new_mtime /* [in,out] [unique] */,
5033 struct lsa_DATA_BUF_PTR *old_val /* [in,out] [unique] */,
5034 NTTIME *old_mtime /* [in,out] [unique] */)
5036 struct lsa_QuerySecret r;
5037 NTSTATUS status;
5039 /* In parameters */
5040 r.in.sec_handle = sec_handle;
5041 r.in.new_val = new_val;
5042 r.in.new_mtime = new_mtime;
5043 r.in.old_val = old_val;
5044 r.in.old_mtime = old_mtime;
5046 if (DEBUGLEVEL >= 10) {
5047 NDR_PRINT_IN_DEBUG(lsa_QuerySecret, &r);
5050 status = cli->dispatch(cli,
5051 mem_ctx,
5052 &ndr_table_lsarpc,
5053 NDR_LSA_QUERYSECRET,
5054 &r);
5056 if (!NT_STATUS_IS_OK(status)) {
5057 return status;
5060 if (DEBUGLEVEL >= 10) {
5061 NDR_PRINT_OUT_DEBUG(lsa_QuerySecret, &r);
5064 if (NT_STATUS_IS_ERR(status)) {
5065 return status;
5068 /* Return variables */
5069 if (new_val && r.out.new_val) {
5070 *new_val = *r.out.new_val;
5072 if (new_mtime && r.out.new_mtime) {
5073 *new_mtime = *r.out.new_mtime;
5075 if (old_val && r.out.old_val) {
5076 *old_val = *r.out.old_val;
5078 if (old_mtime && r.out.old_mtime) {
5079 *old_mtime = *r.out.old_mtime;
5082 /* Return result */
5083 return r.out.result;
5086 struct rpccli_lsa_LookupPrivValue_state {
5087 struct lsa_LookupPrivValue orig;
5088 struct lsa_LookupPrivValue tmp;
5089 TALLOC_CTX *out_mem_ctx;
5090 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5093 static void rpccli_lsa_LookupPrivValue_done(struct tevent_req *subreq);
5095 struct tevent_req *rpccli_lsa_LookupPrivValue_send(TALLOC_CTX *mem_ctx,
5096 struct tevent_context *ev,
5097 struct rpc_pipe_client *cli,
5098 struct policy_handle *_handle /* [in] [ref] */,
5099 struct lsa_String *_name /* [in] [ref] */,
5100 struct lsa_LUID *_luid /* [out] [ref] */)
5102 struct tevent_req *req;
5103 struct rpccli_lsa_LookupPrivValue_state *state;
5104 struct tevent_req *subreq;
5106 req = tevent_req_create(mem_ctx, &state,
5107 struct rpccli_lsa_LookupPrivValue_state);
5108 if (req == NULL) {
5109 return NULL;
5111 state->out_mem_ctx = NULL;
5112 state->dispatch_recv = cli->dispatch_recv;
5114 /* In parameters */
5115 state->orig.in.handle = _handle;
5116 state->orig.in.name = _name;
5118 /* Out parameters */
5119 state->orig.out.luid = _luid;
5121 /* Result */
5122 ZERO_STRUCT(state->orig.out.result);
5124 if (DEBUGLEVEL >= 10) {
5125 NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &state->orig);
5128 state->out_mem_ctx = talloc_named_const(state, 0,
5129 "rpccli_lsa_LookupPrivValue_out_memory");
5130 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5131 return tevent_req_post(req, ev);
5134 /* make a temporary copy, that we pass to the dispatch function */
5135 state->tmp = state->orig;
5137 subreq = cli->dispatch_send(state, ev, cli,
5138 &ndr_table_lsarpc,
5139 NDR_LSA_LOOKUPPRIVVALUE,
5140 &state->tmp);
5141 if (tevent_req_nomem(subreq, req)) {
5142 return tevent_req_post(req, ev);
5144 tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivValue_done, req);
5145 return req;
5148 static void rpccli_lsa_LookupPrivValue_done(struct tevent_req *subreq)
5150 struct tevent_req *req = tevent_req_callback_data(
5151 subreq, struct tevent_req);
5152 struct rpccli_lsa_LookupPrivValue_state *state = tevent_req_data(
5153 req, struct rpccli_lsa_LookupPrivValue_state);
5154 NTSTATUS status;
5155 TALLOC_CTX *mem_ctx;
5157 if (state->out_mem_ctx) {
5158 mem_ctx = state->out_mem_ctx;
5159 } else {
5160 mem_ctx = state;
5163 status = state->dispatch_recv(subreq, mem_ctx);
5164 TALLOC_FREE(subreq);
5165 if (!NT_STATUS_IS_OK(status)) {
5166 tevent_req_nterror(req, status);
5167 return;
5170 /* Copy out parameters */
5171 *state->orig.out.luid = *state->tmp.out.luid;
5173 /* Copy result */
5174 state->orig.out.result = state->tmp.out.result;
5176 /* Reset temporary structure */
5177 ZERO_STRUCT(state->tmp);
5179 if (DEBUGLEVEL >= 10) {
5180 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &state->orig);
5183 tevent_req_done(req);
5186 NTSTATUS rpccli_lsa_LookupPrivValue_recv(struct tevent_req *req,
5187 TALLOC_CTX *mem_ctx,
5188 NTSTATUS *result)
5190 struct rpccli_lsa_LookupPrivValue_state *state = tevent_req_data(
5191 req, struct rpccli_lsa_LookupPrivValue_state);
5192 NTSTATUS status;
5194 if (tevent_req_is_nterror(req, &status)) {
5195 tevent_req_received(req);
5196 return status;
5199 /* Steal possbile out parameters to the callers context */
5200 talloc_steal(mem_ctx, state->out_mem_ctx);
5202 /* Return result */
5203 *result = state->orig.out.result;
5205 tevent_req_received(req);
5206 return NT_STATUS_OK;
5209 NTSTATUS rpccli_lsa_LookupPrivValue(struct rpc_pipe_client *cli,
5210 TALLOC_CTX *mem_ctx,
5211 struct policy_handle *handle /* [in] [ref] */,
5212 struct lsa_String *name /* [in] [ref] */,
5213 struct lsa_LUID *luid /* [out] [ref] */)
5215 struct lsa_LookupPrivValue r;
5216 NTSTATUS status;
5218 /* In parameters */
5219 r.in.handle = handle;
5220 r.in.name = name;
5222 if (DEBUGLEVEL >= 10) {
5223 NDR_PRINT_IN_DEBUG(lsa_LookupPrivValue, &r);
5226 status = cli->dispatch(cli,
5227 mem_ctx,
5228 &ndr_table_lsarpc,
5229 NDR_LSA_LOOKUPPRIVVALUE,
5230 &r);
5232 if (!NT_STATUS_IS_OK(status)) {
5233 return status;
5236 if (DEBUGLEVEL >= 10) {
5237 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivValue, &r);
5240 if (NT_STATUS_IS_ERR(status)) {
5241 return status;
5244 /* Return variables */
5245 *luid = *r.out.luid;
5247 /* Return result */
5248 return r.out.result;
5251 struct rpccli_lsa_LookupPrivName_state {
5252 struct lsa_LookupPrivName orig;
5253 struct lsa_LookupPrivName tmp;
5254 TALLOC_CTX *out_mem_ctx;
5255 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5258 static void rpccli_lsa_LookupPrivName_done(struct tevent_req *subreq);
5260 struct tevent_req *rpccli_lsa_LookupPrivName_send(TALLOC_CTX *mem_ctx,
5261 struct tevent_context *ev,
5262 struct rpc_pipe_client *cli,
5263 struct policy_handle *_handle /* [in] [ref] */,
5264 struct lsa_LUID *_luid /* [in] [ref] */,
5265 struct lsa_StringLarge **_name /* [out] [ref] */)
5267 struct tevent_req *req;
5268 struct rpccli_lsa_LookupPrivName_state *state;
5269 struct tevent_req *subreq;
5271 req = tevent_req_create(mem_ctx, &state,
5272 struct rpccli_lsa_LookupPrivName_state);
5273 if (req == NULL) {
5274 return NULL;
5276 state->out_mem_ctx = NULL;
5277 state->dispatch_recv = cli->dispatch_recv;
5279 /* In parameters */
5280 state->orig.in.handle = _handle;
5281 state->orig.in.luid = _luid;
5283 /* Out parameters */
5284 state->orig.out.name = _name;
5286 /* Result */
5287 ZERO_STRUCT(state->orig.out.result);
5289 if (DEBUGLEVEL >= 10) {
5290 NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &state->orig);
5293 state->out_mem_ctx = talloc_named_const(state, 0,
5294 "rpccli_lsa_LookupPrivName_out_memory");
5295 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5296 return tevent_req_post(req, ev);
5299 /* make a temporary copy, that we pass to the dispatch function */
5300 state->tmp = state->orig;
5302 subreq = cli->dispatch_send(state, ev, cli,
5303 &ndr_table_lsarpc,
5304 NDR_LSA_LOOKUPPRIVNAME,
5305 &state->tmp);
5306 if (tevent_req_nomem(subreq, req)) {
5307 return tevent_req_post(req, ev);
5309 tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivName_done, req);
5310 return req;
5313 static void rpccli_lsa_LookupPrivName_done(struct tevent_req *subreq)
5315 struct tevent_req *req = tevent_req_callback_data(
5316 subreq, struct tevent_req);
5317 struct rpccli_lsa_LookupPrivName_state *state = tevent_req_data(
5318 req, struct rpccli_lsa_LookupPrivName_state);
5319 NTSTATUS status;
5320 TALLOC_CTX *mem_ctx;
5322 if (state->out_mem_ctx) {
5323 mem_ctx = state->out_mem_ctx;
5324 } else {
5325 mem_ctx = state;
5328 status = state->dispatch_recv(subreq, mem_ctx);
5329 TALLOC_FREE(subreq);
5330 if (!NT_STATUS_IS_OK(status)) {
5331 tevent_req_nterror(req, status);
5332 return;
5335 /* Copy out parameters */
5336 *state->orig.out.name = *state->tmp.out.name;
5338 /* Copy result */
5339 state->orig.out.result = state->tmp.out.result;
5341 /* Reset temporary structure */
5342 ZERO_STRUCT(state->tmp);
5344 if (DEBUGLEVEL >= 10) {
5345 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &state->orig);
5348 tevent_req_done(req);
5351 NTSTATUS rpccli_lsa_LookupPrivName_recv(struct tevent_req *req,
5352 TALLOC_CTX *mem_ctx,
5353 NTSTATUS *result)
5355 struct rpccli_lsa_LookupPrivName_state *state = tevent_req_data(
5356 req, struct rpccli_lsa_LookupPrivName_state);
5357 NTSTATUS status;
5359 if (tevent_req_is_nterror(req, &status)) {
5360 tevent_req_received(req);
5361 return status;
5364 /* Steal possbile out parameters to the callers context */
5365 talloc_steal(mem_ctx, state->out_mem_ctx);
5367 /* Return result */
5368 *result = state->orig.out.result;
5370 tevent_req_received(req);
5371 return NT_STATUS_OK;
5374 NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
5375 TALLOC_CTX *mem_ctx,
5376 struct policy_handle *handle /* [in] [ref] */,
5377 struct lsa_LUID *luid /* [in] [ref] */,
5378 struct lsa_StringLarge **name /* [out] [ref] */)
5380 struct lsa_LookupPrivName r;
5381 NTSTATUS status;
5383 /* In parameters */
5384 r.in.handle = handle;
5385 r.in.luid = luid;
5387 if (DEBUGLEVEL >= 10) {
5388 NDR_PRINT_IN_DEBUG(lsa_LookupPrivName, &r);
5391 status = cli->dispatch(cli,
5392 mem_ctx,
5393 &ndr_table_lsarpc,
5394 NDR_LSA_LOOKUPPRIVNAME,
5395 &r);
5397 if (!NT_STATUS_IS_OK(status)) {
5398 return status;
5401 if (DEBUGLEVEL >= 10) {
5402 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivName, &r);
5405 if (NT_STATUS_IS_ERR(status)) {
5406 return status;
5409 /* Return variables */
5410 *name = *r.out.name;
5412 /* Return result */
5413 return r.out.result;
5416 struct rpccli_lsa_LookupPrivDisplayName_state {
5417 struct lsa_LookupPrivDisplayName orig;
5418 struct lsa_LookupPrivDisplayName tmp;
5419 TALLOC_CTX *out_mem_ctx;
5420 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5423 static void rpccli_lsa_LookupPrivDisplayName_done(struct tevent_req *subreq);
5425 struct tevent_req *rpccli_lsa_LookupPrivDisplayName_send(TALLOC_CTX *mem_ctx,
5426 struct tevent_context *ev,
5427 struct rpc_pipe_client *cli,
5428 struct policy_handle *_handle /* [in] [ref] */,
5429 struct lsa_String *_name /* [in] [ref] */,
5430 uint16_t _language_id /* [in] */,
5431 uint16_t _language_id_sys /* [in] */,
5432 struct lsa_StringLarge **_disp_name /* [out] [ref] */,
5433 uint16_t *_returned_language_id /* [out] [ref] */)
5435 struct tevent_req *req;
5436 struct rpccli_lsa_LookupPrivDisplayName_state *state;
5437 struct tevent_req *subreq;
5439 req = tevent_req_create(mem_ctx, &state,
5440 struct rpccli_lsa_LookupPrivDisplayName_state);
5441 if (req == NULL) {
5442 return NULL;
5444 state->out_mem_ctx = NULL;
5445 state->dispatch_recv = cli->dispatch_recv;
5447 /* In parameters */
5448 state->orig.in.handle = _handle;
5449 state->orig.in.name = _name;
5450 state->orig.in.language_id = _language_id;
5451 state->orig.in.language_id_sys = _language_id_sys;
5453 /* Out parameters */
5454 state->orig.out.disp_name = _disp_name;
5455 state->orig.out.returned_language_id = _returned_language_id;
5457 /* Result */
5458 ZERO_STRUCT(state->orig.out.result);
5460 if (DEBUGLEVEL >= 10) {
5461 NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &state->orig);
5464 state->out_mem_ctx = talloc_named_const(state, 0,
5465 "rpccli_lsa_LookupPrivDisplayName_out_memory");
5466 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5467 return tevent_req_post(req, ev);
5470 /* make a temporary copy, that we pass to the dispatch function */
5471 state->tmp = state->orig;
5473 subreq = cli->dispatch_send(state, ev, cli,
5474 &ndr_table_lsarpc,
5475 NDR_LSA_LOOKUPPRIVDISPLAYNAME,
5476 &state->tmp);
5477 if (tevent_req_nomem(subreq, req)) {
5478 return tevent_req_post(req, ev);
5480 tevent_req_set_callback(subreq, rpccli_lsa_LookupPrivDisplayName_done, req);
5481 return req;
5484 static void rpccli_lsa_LookupPrivDisplayName_done(struct tevent_req *subreq)
5486 struct tevent_req *req = tevent_req_callback_data(
5487 subreq, struct tevent_req);
5488 struct rpccli_lsa_LookupPrivDisplayName_state *state = tevent_req_data(
5489 req, struct rpccli_lsa_LookupPrivDisplayName_state);
5490 NTSTATUS status;
5491 TALLOC_CTX *mem_ctx;
5493 if (state->out_mem_ctx) {
5494 mem_ctx = state->out_mem_ctx;
5495 } else {
5496 mem_ctx = state;
5499 status = state->dispatch_recv(subreq, mem_ctx);
5500 TALLOC_FREE(subreq);
5501 if (!NT_STATUS_IS_OK(status)) {
5502 tevent_req_nterror(req, status);
5503 return;
5506 /* Copy out parameters */
5507 *state->orig.out.disp_name = *state->tmp.out.disp_name;
5508 *state->orig.out.returned_language_id = *state->tmp.out.returned_language_id;
5510 /* Copy result */
5511 state->orig.out.result = state->tmp.out.result;
5513 /* Reset temporary structure */
5514 ZERO_STRUCT(state->tmp);
5516 if (DEBUGLEVEL >= 10) {
5517 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &state->orig);
5520 tevent_req_done(req);
5523 NTSTATUS rpccli_lsa_LookupPrivDisplayName_recv(struct tevent_req *req,
5524 TALLOC_CTX *mem_ctx,
5525 NTSTATUS *result)
5527 struct rpccli_lsa_LookupPrivDisplayName_state *state = tevent_req_data(
5528 req, struct rpccli_lsa_LookupPrivDisplayName_state);
5529 NTSTATUS status;
5531 if (tevent_req_is_nterror(req, &status)) {
5532 tevent_req_received(req);
5533 return status;
5536 /* Steal possbile out parameters to the callers context */
5537 talloc_steal(mem_ctx, state->out_mem_ctx);
5539 /* Return result */
5540 *result = state->orig.out.result;
5542 tevent_req_received(req);
5543 return NT_STATUS_OK;
5546 NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
5547 TALLOC_CTX *mem_ctx,
5548 struct policy_handle *handle /* [in] [ref] */,
5549 struct lsa_String *name /* [in] [ref] */,
5550 uint16_t language_id /* [in] */,
5551 uint16_t language_id_sys /* [in] */,
5552 struct lsa_StringLarge **disp_name /* [out] [ref] */,
5553 uint16_t *returned_language_id /* [out] [ref] */)
5555 struct lsa_LookupPrivDisplayName r;
5556 NTSTATUS status;
5558 /* In parameters */
5559 r.in.handle = handle;
5560 r.in.name = name;
5561 r.in.language_id = language_id;
5562 r.in.language_id_sys = language_id_sys;
5564 if (DEBUGLEVEL >= 10) {
5565 NDR_PRINT_IN_DEBUG(lsa_LookupPrivDisplayName, &r);
5568 status = cli->dispatch(cli,
5569 mem_ctx,
5570 &ndr_table_lsarpc,
5571 NDR_LSA_LOOKUPPRIVDISPLAYNAME,
5572 &r);
5574 if (!NT_STATUS_IS_OK(status)) {
5575 return status;
5578 if (DEBUGLEVEL >= 10) {
5579 NDR_PRINT_OUT_DEBUG(lsa_LookupPrivDisplayName, &r);
5582 if (NT_STATUS_IS_ERR(status)) {
5583 return status;
5586 /* Return variables */
5587 *disp_name = *r.out.disp_name;
5588 *returned_language_id = *r.out.returned_language_id;
5590 /* Return result */
5591 return r.out.result;
5594 struct rpccli_lsa_DeleteObject_state {
5595 struct lsa_DeleteObject orig;
5596 struct lsa_DeleteObject tmp;
5597 TALLOC_CTX *out_mem_ctx;
5598 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5601 static void rpccli_lsa_DeleteObject_done(struct tevent_req *subreq);
5603 struct tevent_req *rpccli_lsa_DeleteObject_send(TALLOC_CTX *mem_ctx,
5604 struct tevent_context *ev,
5605 struct rpc_pipe_client *cli,
5606 struct policy_handle *_handle /* [in,out] [ref] */)
5608 struct tevent_req *req;
5609 struct rpccli_lsa_DeleteObject_state *state;
5610 struct tevent_req *subreq;
5612 req = tevent_req_create(mem_ctx, &state,
5613 struct rpccli_lsa_DeleteObject_state);
5614 if (req == NULL) {
5615 return NULL;
5617 state->out_mem_ctx = NULL;
5618 state->dispatch_recv = cli->dispatch_recv;
5620 /* In parameters */
5621 state->orig.in.handle = _handle;
5623 /* Out parameters */
5624 state->orig.out.handle = _handle;
5626 /* Result */
5627 ZERO_STRUCT(state->orig.out.result);
5629 if (DEBUGLEVEL >= 10) {
5630 NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &state->orig);
5633 state->out_mem_ctx = talloc_named_const(state, 0,
5634 "rpccli_lsa_DeleteObject_out_memory");
5635 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5636 return tevent_req_post(req, ev);
5639 /* make a temporary copy, that we pass to the dispatch function */
5640 state->tmp = state->orig;
5642 subreq = cli->dispatch_send(state, ev, cli,
5643 &ndr_table_lsarpc,
5644 NDR_LSA_DELETEOBJECT,
5645 &state->tmp);
5646 if (tevent_req_nomem(subreq, req)) {
5647 return tevent_req_post(req, ev);
5649 tevent_req_set_callback(subreq, rpccli_lsa_DeleteObject_done, req);
5650 return req;
5653 static void rpccli_lsa_DeleteObject_done(struct tevent_req *subreq)
5655 struct tevent_req *req = tevent_req_callback_data(
5656 subreq, struct tevent_req);
5657 struct rpccli_lsa_DeleteObject_state *state = tevent_req_data(
5658 req, struct rpccli_lsa_DeleteObject_state);
5659 NTSTATUS status;
5660 TALLOC_CTX *mem_ctx;
5662 if (state->out_mem_ctx) {
5663 mem_ctx = state->out_mem_ctx;
5664 } else {
5665 mem_ctx = state;
5668 status = state->dispatch_recv(subreq, mem_ctx);
5669 TALLOC_FREE(subreq);
5670 if (!NT_STATUS_IS_OK(status)) {
5671 tevent_req_nterror(req, status);
5672 return;
5675 /* Copy out parameters */
5676 *state->orig.out.handle = *state->tmp.out.handle;
5678 /* Copy result */
5679 state->orig.out.result = state->tmp.out.result;
5681 /* Reset temporary structure */
5682 ZERO_STRUCT(state->tmp);
5684 if (DEBUGLEVEL >= 10) {
5685 NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &state->orig);
5688 tevent_req_done(req);
5691 NTSTATUS rpccli_lsa_DeleteObject_recv(struct tevent_req *req,
5692 TALLOC_CTX *mem_ctx,
5693 NTSTATUS *result)
5695 struct rpccli_lsa_DeleteObject_state *state = tevent_req_data(
5696 req, struct rpccli_lsa_DeleteObject_state);
5697 NTSTATUS status;
5699 if (tevent_req_is_nterror(req, &status)) {
5700 tevent_req_received(req);
5701 return status;
5704 /* Steal possbile out parameters to the callers context */
5705 talloc_steal(mem_ctx, state->out_mem_ctx);
5707 /* Return result */
5708 *result = state->orig.out.result;
5710 tevent_req_received(req);
5711 return NT_STATUS_OK;
5714 NTSTATUS rpccli_lsa_DeleteObject(struct rpc_pipe_client *cli,
5715 TALLOC_CTX *mem_ctx,
5716 struct policy_handle *handle /* [in,out] [ref] */)
5718 struct lsa_DeleteObject r;
5719 NTSTATUS status;
5721 /* In parameters */
5722 r.in.handle = handle;
5724 if (DEBUGLEVEL >= 10) {
5725 NDR_PRINT_IN_DEBUG(lsa_DeleteObject, &r);
5728 status = cli->dispatch(cli,
5729 mem_ctx,
5730 &ndr_table_lsarpc,
5731 NDR_LSA_DELETEOBJECT,
5732 &r);
5734 if (!NT_STATUS_IS_OK(status)) {
5735 return status;
5738 if (DEBUGLEVEL >= 10) {
5739 NDR_PRINT_OUT_DEBUG(lsa_DeleteObject, &r);
5742 if (NT_STATUS_IS_ERR(status)) {
5743 return status;
5746 /* Return variables */
5747 *handle = *r.out.handle;
5749 /* Return result */
5750 return r.out.result;
5753 struct rpccli_lsa_EnumAccountsWithUserRight_state {
5754 struct lsa_EnumAccountsWithUserRight orig;
5755 struct lsa_EnumAccountsWithUserRight tmp;
5756 TALLOC_CTX *out_mem_ctx;
5757 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5760 static void rpccli_lsa_EnumAccountsWithUserRight_done(struct tevent_req *subreq);
5762 struct tevent_req *rpccli_lsa_EnumAccountsWithUserRight_send(TALLOC_CTX *mem_ctx,
5763 struct tevent_context *ev,
5764 struct rpc_pipe_client *cli,
5765 struct policy_handle *_handle /* [in] [ref] */,
5766 struct lsa_String *_name /* [in] [unique] */,
5767 struct lsa_SidArray *_sids /* [out] [ref] */)
5769 struct tevent_req *req;
5770 struct rpccli_lsa_EnumAccountsWithUserRight_state *state;
5771 struct tevent_req *subreq;
5773 req = tevent_req_create(mem_ctx, &state,
5774 struct rpccli_lsa_EnumAccountsWithUserRight_state);
5775 if (req == NULL) {
5776 return NULL;
5778 state->out_mem_ctx = NULL;
5779 state->dispatch_recv = cli->dispatch_recv;
5781 /* In parameters */
5782 state->orig.in.handle = _handle;
5783 state->orig.in.name = _name;
5785 /* Out parameters */
5786 state->orig.out.sids = _sids;
5788 /* Result */
5789 ZERO_STRUCT(state->orig.out.result);
5791 if (DEBUGLEVEL >= 10) {
5792 NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &state->orig);
5795 state->out_mem_ctx = talloc_named_const(state, 0,
5796 "rpccli_lsa_EnumAccountsWithUserRight_out_memory");
5797 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5798 return tevent_req_post(req, ev);
5801 /* make a temporary copy, that we pass to the dispatch function */
5802 state->tmp = state->orig;
5804 subreq = cli->dispatch_send(state, ev, cli,
5805 &ndr_table_lsarpc,
5806 NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT,
5807 &state->tmp);
5808 if (tevent_req_nomem(subreq, req)) {
5809 return tevent_req_post(req, ev);
5811 tevent_req_set_callback(subreq, rpccli_lsa_EnumAccountsWithUserRight_done, req);
5812 return req;
5815 static void rpccli_lsa_EnumAccountsWithUserRight_done(struct tevent_req *subreq)
5817 struct tevent_req *req = tevent_req_callback_data(
5818 subreq, struct tevent_req);
5819 struct rpccli_lsa_EnumAccountsWithUserRight_state *state = tevent_req_data(
5820 req, struct rpccli_lsa_EnumAccountsWithUserRight_state);
5821 NTSTATUS status;
5822 TALLOC_CTX *mem_ctx;
5824 if (state->out_mem_ctx) {
5825 mem_ctx = state->out_mem_ctx;
5826 } else {
5827 mem_ctx = state;
5830 status = state->dispatch_recv(subreq, mem_ctx);
5831 TALLOC_FREE(subreq);
5832 if (!NT_STATUS_IS_OK(status)) {
5833 tevent_req_nterror(req, status);
5834 return;
5837 /* Copy out parameters */
5838 *state->orig.out.sids = *state->tmp.out.sids;
5840 /* Copy result */
5841 state->orig.out.result = state->tmp.out.result;
5843 /* Reset temporary structure */
5844 ZERO_STRUCT(state->tmp);
5846 if (DEBUGLEVEL >= 10) {
5847 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &state->orig);
5850 tevent_req_done(req);
5853 NTSTATUS rpccli_lsa_EnumAccountsWithUserRight_recv(struct tevent_req *req,
5854 TALLOC_CTX *mem_ctx,
5855 NTSTATUS *result)
5857 struct rpccli_lsa_EnumAccountsWithUserRight_state *state = tevent_req_data(
5858 req, struct rpccli_lsa_EnumAccountsWithUserRight_state);
5859 NTSTATUS status;
5861 if (tevent_req_is_nterror(req, &status)) {
5862 tevent_req_received(req);
5863 return status;
5866 /* Steal possbile out parameters to the callers context */
5867 talloc_steal(mem_ctx, state->out_mem_ctx);
5869 /* Return result */
5870 *result = state->orig.out.result;
5872 tevent_req_received(req);
5873 return NT_STATUS_OK;
5876 NTSTATUS rpccli_lsa_EnumAccountsWithUserRight(struct rpc_pipe_client *cli,
5877 TALLOC_CTX *mem_ctx,
5878 struct policy_handle *handle /* [in] [ref] */,
5879 struct lsa_String *name /* [in] [unique] */,
5880 struct lsa_SidArray *sids /* [out] [ref] */)
5882 struct lsa_EnumAccountsWithUserRight r;
5883 NTSTATUS status;
5885 /* In parameters */
5886 r.in.handle = handle;
5887 r.in.name = name;
5889 if (DEBUGLEVEL >= 10) {
5890 NDR_PRINT_IN_DEBUG(lsa_EnumAccountsWithUserRight, &r);
5893 status = cli->dispatch(cli,
5894 mem_ctx,
5895 &ndr_table_lsarpc,
5896 NDR_LSA_ENUMACCOUNTSWITHUSERRIGHT,
5897 &r);
5899 if (!NT_STATUS_IS_OK(status)) {
5900 return status;
5903 if (DEBUGLEVEL >= 10) {
5904 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountsWithUserRight, &r);
5907 if (NT_STATUS_IS_ERR(status)) {
5908 return status;
5911 /* Return variables */
5912 *sids = *r.out.sids;
5914 /* Return result */
5915 return r.out.result;
5918 struct rpccli_lsa_EnumAccountRights_state {
5919 struct lsa_EnumAccountRights orig;
5920 struct lsa_EnumAccountRights tmp;
5921 TALLOC_CTX *out_mem_ctx;
5922 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5925 static void rpccli_lsa_EnumAccountRights_done(struct tevent_req *subreq);
5927 struct tevent_req *rpccli_lsa_EnumAccountRights_send(TALLOC_CTX *mem_ctx,
5928 struct tevent_context *ev,
5929 struct rpc_pipe_client *cli,
5930 struct policy_handle *_handle /* [in] [ref] */,
5931 struct dom_sid2 *_sid /* [in] [ref] */,
5932 struct lsa_RightSet *_rights /* [out] [ref] */)
5934 struct tevent_req *req;
5935 struct rpccli_lsa_EnumAccountRights_state *state;
5936 struct tevent_req *subreq;
5938 req = tevent_req_create(mem_ctx, &state,
5939 struct rpccli_lsa_EnumAccountRights_state);
5940 if (req == NULL) {
5941 return NULL;
5943 state->out_mem_ctx = NULL;
5944 state->dispatch_recv = cli->dispatch_recv;
5946 /* In parameters */
5947 state->orig.in.handle = _handle;
5948 state->orig.in.sid = _sid;
5950 /* Out parameters */
5951 state->orig.out.rights = _rights;
5953 /* Result */
5954 ZERO_STRUCT(state->orig.out.result);
5956 if (DEBUGLEVEL >= 10) {
5957 NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &state->orig);
5960 state->out_mem_ctx = talloc_named_const(state, 0,
5961 "rpccli_lsa_EnumAccountRights_out_memory");
5962 if (tevent_req_nomem(state->out_mem_ctx, req)) {
5963 return tevent_req_post(req, ev);
5966 /* make a temporary copy, that we pass to the dispatch function */
5967 state->tmp = state->orig;
5969 subreq = cli->dispatch_send(state, ev, cli,
5970 &ndr_table_lsarpc,
5971 NDR_LSA_ENUMACCOUNTRIGHTS,
5972 &state->tmp);
5973 if (tevent_req_nomem(subreq, req)) {
5974 return tevent_req_post(req, ev);
5976 tevent_req_set_callback(subreq, rpccli_lsa_EnumAccountRights_done, req);
5977 return req;
5980 static void rpccli_lsa_EnumAccountRights_done(struct tevent_req *subreq)
5982 struct tevent_req *req = tevent_req_callback_data(
5983 subreq, struct tevent_req);
5984 struct rpccli_lsa_EnumAccountRights_state *state = tevent_req_data(
5985 req, struct rpccli_lsa_EnumAccountRights_state);
5986 NTSTATUS status;
5987 TALLOC_CTX *mem_ctx;
5989 if (state->out_mem_ctx) {
5990 mem_ctx = state->out_mem_ctx;
5991 } else {
5992 mem_ctx = state;
5995 status = state->dispatch_recv(subreq, mem_ctx);
5996 TALLOC_FREE(subreq);
5997 if (!NT_STATUS_IS_OK(status)) {
5998 tevent_req_nterror(req, status);
5999 return;
6002 /* Copy out parameters */
6003 *state->orig.out.rights = *state->tmp.out.rights;
6005 /* Copy result */
6006 state->orig.out.result = state->tmp.out.result;
6008 /* Reset temporary structure */
6009 ZERO_STRUCT(state->tmp);
6011 if (DEBUGLEVEL >= 10) {
6012 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &state->orig);
6015 tevent_req_done(req);
6018 NTSTATUS rpccli_lsa_EnumAccountRights_recv(struct tevent_req *req,
6019 TALLOC_CTX *mem_ctx,
6020 NTSTATUS *result)
6022 struct rpccli_lsa_EnumAccountRights_state *state = tevent_req_data(
6023 req, struct rpccli_lsa_EnumAccountRights_state);
6024 NTSTATUS status;
6026 if (tevent_req_is_nterror(req, &status)) {
6027 tevent_req_received(req);
6028 return status;
6031 /* Steal possbile out parameters to the callers context */
6032 talloc_steal(mem_ctx, state->out_mem_ctx);
6034 /* Return result */
6035 *result = state->orig.out.result;
6037 tevent_req_received(req);
6038 return NT_STATUS_OK;
6041 NTSTATUS rpccli_lsa_EnumAccountRights(struct rpc_pipe_client *cli,
6042 TALLOC_CTX *mem_ctx,
6043 struct policy_handle *handle /* [in] [ref] */,
6044 struct dom_sid2 *sid /* [in] [ref] */,
6045 struct lsa_RightSet *rights /* [out] [ref] */)
6047 struct lsa_EnumAccountRights r;
6048 NTSTATUS status;
6050 /* In parameters */
6051 r.in.handle = handle;
6052 r.in.sid = sid;
6054 if (DEBUGLEVEL >= 10) {
6055 NDR_PRINT_IN_DEBUG(lsa_EnumAccountRights, &r);
6058 status = cli->dispatch(cli,
6059 mem_ctx,
6060 &ndr_table_lsarpc,
6061 NDR_LSA_ENUMACCOUNTRIGHTS,
6062 &r);
6064 if (!NT_STATUS_IS_OK(status)) {
6065 return status;
6068 if (DEBUGLEVEL >= 10) {
6069 NDR_PRINT_OUT_DEBUG(lsa_EnumAccountRights, &r);
6072 if (NT_STATUS_IS_ERR(status)) {
6073 return status;
6076 /* Return variables */
6077 *rights = *r.out.rights;
6079 /* Return result */
6080 return r.out.result;
6083 struct rpccli_lsa_AddAccountRights_state {
6084 struct lsa_AddAccountRights orig;
6085 struct lsa_AddAccountRights tmp;
6086 TALLOC_CTX *out_mem_ctx;
6087 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6090 static void rpccli_lsa_AddAccountRights_done(struct tevent_req *subreq);
6092 struct tevent_req *rpccli_lsa_AddAccountRights_send(TALLOC_CTX *mem_ctx,
6093 struct tevent_context *ev,
6094 struct rpc_pipe_client *cli,
6095 struct policy_handle *_handle /* [in] [ref] */,
6096 struct dom_sid2 *_sid /* [in] [ref] */,
6097 struct lsa_RightSet *_rights /* [in] [ref] */)
6099 struct tevent_req *req;
6100 struct rpccli_lsa_AddAccountRights_state *state;
6101 struct tevent_req *subreq;
6103 req = tevent_req_create(mem_ctx, &state,
6104 struct rpccli_lsa_AddAccountRights_state);
6105 if (req == NULL) {
6106 return NULL;
6108 state->out_mem_ctx = NULL;
6109 state->dispatch_recv = cli->dispatch_recv;
6111 /* In parameters */
6112 state->orig.in.handle = _handle;
6113 state->orig.in.sid = _sid;
6114 state->orig.in.rights = _rights;
6116 /* Out parameters */
6118 /* Result */
6119 ZERO_STRUCT(state->orig.out.result);
6121 if (DEBUGLEVEL >= 10) {
6122 NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &state->orig);
6125 /* make a temporary copy, that we pass to the dispatch function */
6126 state->tmp = state->orig;
6128 subreq = cli->dispatch_send(state, ev, cli,
6129 &ndr_table_lsarpc,
6130 NDR_LSA_ADDACCOUNTRIGHTS,
6131 &state->tmp);
6132 if (tevent_req_nomem(subreq, req)) {
6133 return tevent_req_post(req, ev);
6135 tevent_req_set_callback(subreq, rpccli_lsa_AddAccountRights_done, req);
6136 return req;
6139 static void rpccli_lsa_AddAccountRights_done(struct tevent_req *subreq)
6141 struct tevent_req *req = tevent_req_callback_data(
6142 subreq, struct tevent_req);
6143 struct rpccli_lsa_AddAccountRights_state *state = tevent_req_data(
6144 req, struct rpccli_lsa_AddAccountRights_state);
6145 NTSTATUS status;
6146 TALLOC_CTX *mem_ctx;
6148 if (state->out_mem_ctx) {
6149 mem_ctx = state->out_mem_ctx;
6150 } else {
6151 mem_ctx = state;
6154 status = state->dispatch_recv(subreq, mem_ctx);
6155 TALLOC_FREE(subreq);
6156 if (!NT_STATUS_IS_OK(status)) {
6157 tevent_req_nterror(req, status);
6158 return;
6161 /* Copy out parameters */
6163 /* Copy result */
6164 state->orig.out.result = state->tmp.out.result;
6166 /* Reset temporary structure */
6167 ZERO_STRUCT(state->tmp);
6169 if (DEBUGLEVEL >= 10) {
6170 NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &state->orig);
6173 tevent_req_done(req);
6176 NTSTATUS rpccli_lsa_AddAccountRights_recv(struct tevent_req *req,
6177 TALLOC_CTX *mem_ctx,
6178 NTSTATUS *result)
6180 struct rpccli_lsa_AddAccountRights_state *state = tevent_req_data(
6181 req, struct rpccli_lsa_AddAccountRights_state);
6182 NTSTATUS status;
6184 if (tevent_req_is_nterror(req, &status)) {
6185 tevent_req_received(req);
6186 return status;
6189 /* Steal possbile out parameters to the callers context */
6190 talloc_steal(mem_ctx, state->out_mem_ctx);
6192 /* Return result */
6193 *result = state->orig.out.result;
6195 tevent_req_received(req);
6196 return NT_STATUS_OK;
6199 NTSTATUS rpccli_lsa_AddAccountRights(struct rpc_pipe_client *cli,
6200 TALLOC_CTX *mem_ctx,
6201 struct policy_handle *handle /* [in] [ref] */,
6202 struct dom_sid2 *sid /* [in] [ref] */,
6203 struct lsa_RightSet *rights /* [in] [ref] */)
6205 struct lsa_AddAccountRights r;
6206 NTSTATUS status;
6208 /* In parameters */
6209 r.in.handle = handle;
6210 r.in.sid = sid;
6211 r.in.rights = rights;
6213 if (DEBUGLEVEL >= 10) {
6214 NDR_PRINT_IN_DEBUG(lsa_AddAccountRights, &r);
6217 status = cli->dispatch(cli,
6218 mem_ctx,
6219 &ndr_table_lsarpc,
6220 NDR_LSA_ADDACCOUNTRIGHTS,
6221 &r);
6223 if (!NT_STATUS_IS_OK(status)) {
6224 return status;
6227 if (DEBUGLEVEL >= 10) {
6228 NDR_PRINT_OUT_DEBUG(lsa_AddAccountRights, &r);
6231 if (NT_STATUS_IS_ERR(status)) {
6232 return status;
6235 /* Return variables */
6237 /* Return result */
6238 return r.out.result;
6241 struct rpccli_lsa_RemoveAccountRights_state {
6242 struct lsa_RemoveAccountRights orig;
6243 struct lsa_RemoveAccountRights tmp;
6244 TALLOC_CTX *out_mem_ctx;
6245 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6248 static void rpccli_lsa_RemoveAccountRights_done(struct tevent_req *subreq);
6250 struct tevent_req *rpccli_lsa_RemoveAccountRights_send(TALLOC_CTX *mem_ctx,
6251 struct tevent_context *ev,
6252 struct rpc_pipe_client *cli,
6253 struct policy_handle *_handle /* [in] [ref] */,
6254 struct dom_sid2 *_sid /* [in] [ref] */,
6255 uint8_t _remove_all /* [in] */,
6256 struct lsa_RightSet *_rights /* [in] [ref] */)
6258 struct tevent_req *req;
6259 struct rpccli_lsa_RemoveAccountRights_state *state;
6260 struct tevent_req *subreq;
6262 req = tevent_req_create(mem_ctx, &state,
6263 struct rpccli_lsa_RemoveAccountRights_state);
6264 if (req == NULL) {
6265 return NULL;
6267 state->out_mem_ctx = NULL;
6268 state->dispatch_recv = cli->dispatch_recv;
6270 /* In parameters */
6271 state->orig.in.handle = _handle;
6272 state->orig.in.sid = _sid;
6273 state->orig.in.remove_all = _remove_all;
6274 state->orig.in.rights = _rights;
6276 /* Out parameters */
6278 /* Result */
6279 ZERO_STRUCT(state->orig.out.result);
6281 if (DEBUGLEVEL >= 10) {
6282 NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &state->orig);
6285 /* make a temporary copy, that we pass to the dispatch function */
6286 state->tmp = state->orig;
6288 subreq = cli->dispatch_send(state, ev, cli,
6289 &ndr_table_lsarpc,
6290 NDR_LSA_REMOVEACCOUNTRIGHTS,
6291 &state->tmp);
6292 if (tevent_req_nomem(subreq, req)) {
6293 return tevent_req_post(req, ev);
6295 tevent_req_set_callback(subreq, rpccli_lsa_RemoveAccountRights_done, req);
6296 return req;
6299 static void rpccli_lsa_RemoveAccountRights_done(struct tevent_req *subreq)
6301 struct tevent_req *req = tevent_req_callback_data(
6302 subreq, struct tevent_req);
6303 struct rpccli_lsa_RemoveAccountRights_state *state = tevent_req_data(
6304 req, struct rpccli_lsa_RemoveAccountRights_state);
6305 NTSTATUS status;
6306 TALLOC_CTX *mem_ctx;
6308 if (state->out_mem_ctx) {
6309 mem_ctx = state->out_mem_ctx;
6310 } else {
6311 mem_ctx = state;
6314 status = state->dispatch_recv(subreq, mem_ctx);
6315 TALLOC_FREE(subreq);
6316 if (!NT_STATUS_IS_OK(status)) {
6317 tevent_req_nterror(req, status);
6318 return;
6321 /* Copy out parameters */
6323 /* Copy result */
6324 state->orig.out.result = state->tmp.out.result;
6326 /* Reset temporary structure */
6327 ZERO_STRUCT(state->tmp);
6329 if (DEBUGLEVEL >= 10) {
6330 NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &state->orig);
6333 tevent_req_done(req);
6336 NTSTATUS rpccli_lsa_RemoveAccountRights_recv(struct tevent_req *req,
6337 TALLOC_CTX *mem_ctx,
6338 NTSTATUS *result)
6340 struct rpccli_lsa_RemoveAccountRights_state *state = tevent_req_data(
6341 req, struct rpccli_lsa_RemoveAccountRights_state);
6342 NTSTATUS status;
6344 if (tevent_req_is_nterror(req, &status)) {
6345 tevent_req_received(req);
6346 return status;
6349 /* Steal possbile out parameters to the callers context */
6350 talloc_steal(mem_ctx, state->out_mem_ctx);
6352 /* Return result */
6353 *result = state->orig.out.result;
6355 tevent_req_received(req);
6356 return NT_STATUS_OK;
6359 NTSTATUS rpccli_lsa_RemoveAccountRights(struct rpc_pipe_client *cli,
6360 TALLOC_CTX *mem_ctx,
6361 struct policy_handle *handle /* [in] [ref] */,
6362 struct dom_sid2 *sid /* [in] [ref] */,
6363 uint8_t remove_all /* [in] */,
6364 struct lsa_RightSet *rights /* [in] [ref] */)
6366 struct lsa_RemoveAccountRights r;
6367 NTSTATUS status;
6369 /* In parameters */
6370 r.in.handle = handle;
6371 r.in.sid = sid;
6372 r.in.remove_all = remove_all;
6373 r.in.rights = rights;
6375 if (DEBUGLEVEL >= 10) {
6376 NDR_PRINT_IN_DEBUG(lsa_RemoveAccountRights, &r);
6379 status = cli->dispatch(cli,
6380 mem_ctx,
6381 &ndr_table_lsarpc,
6382 NDR_LSA_REMOVEACCOUNTRIGHTS,
6383 &r);
6385 if (!NT_STATUS_IS_OK(status)) {
6386 return status;
6389 if (DEBUGLEVEL >= 10) {
6390 NDR_PRINT_OUT_DEBUG(lsa_RemoveAccountRights, &r);
6393 if (NT_STATUS_IS_ERR(status)) {
6394 return status;
6397 /* Return variables */
6399 /* Return result */
6400 return r.out.result;
6403 struct rpccli_lsa_QueryTrustedDomainInfoBySid_state {
6404 struct lsa_QueryTrustedDomainInfoBySid orig;
6405 struct lsa_QueryTrustedDomainInfoBySid tmp;
6406 TALLOC_CTX *out_mem_ctx;
6407 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6410 static void rpccli_lsa_QueryTrustedDomainInfoBySid_done(struct tevent_req *subreq);
6412 struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoBySid_send(TALLOC_CTX *mem_ctx,
6413 struct tevent_context *ev,
6414 struct rpc_pipe_client *cli,
6415 struct policy_handle *_handle /* [in] [ref] */,
6416 struct dom_sid2 *_dom_sid /* [in] [ref] */,
6417 enum lsa_TrustDomInfoEnum _level /* [in] */,
6418 union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
6420 struct tevent_req *req;
6421 struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state;
6422 struct tevent_req *subreq;
6424 req = tevent_req_create(mem_ctx, &state,
6425 struct rpccli_lsa_QueryTrustedDomainInfoBySid_state);
6426 if (req == NULL) {
6427 return NULL;
6429 state->out_mem_ctx = NULL;
6430 state->dispatch_recv = cli->dispatch_recv;
6432 /* In parameters */
6433 state->orig.in.handle = _handle;
6434 state->orig.in.dom_sid = _dom_sid;
6435 state->orig.in.level = _level;
6437 /* Out parameters */
6438 state->orig.out.info = _info;
6440 /* Result */
6441 ZERO_STRUCT(state->orig.out.result);
6443 if (DEBUGLEVEL >= 10) {
6444 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &state->orig);
6447 state->out_mem_ctx = talloc_named_const(state, 0,
6448 "rpccli_lsa_QueryTrustedDomainInfoBySid_out_memory");
6449 if (tevent_req_nomem(state->out_mem_ctx, req)) {
6450 return tevent_req_post(req, ev);
6453 /* make a temporary copy, that we pass to the dispatch function */
6454 state->tmp = state->orig;
6456 subreq = cli->dispatch_send(state, ev, cli,
6457 &ndr_table_lsarpc,
6458 NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID,
6459 &state->tmp);
6460 if (tevent_req_nomem(subreq, req)) {
6461 return tevent_req_post(req, ev);
6463 tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfoBySid_done, req);
6464 return req;
6467 static void rpccli_lsa_QueryTrustedDomainInfoBySid_done(struct tevent_req *subreq)
6469 struct tevent_req *req = tevent_req_callback_data(
6470 subreq, struct tevent_req);
6471 struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state = tevent_req_data(
6472 req, struct rpccli_lsa_QueryTrustedDomainInfoBySid_state);
6473 NTSTATUS status;
6474 TALLOC_CTX *mem_ctx;
6476 if (state->out_mem_ctx) {
6477 mem_ctx = state->out_mem_ctx;
6478 } else {
6479 mem_ctx = state;
6482 status = state->dispatch_recv(subreq, mem_ctx);
6483 TALLOC_FREE(subreq);
6484 if (!NT_STATUS_IS_OK(status)) {
6485 tevent_req_nterror(req, status);
6486 return;
6489 /* Copy out parameters */
6490 *state->orig.out.info = *state->tmp.out.info;
6492 /* Copy result */
6493 state->orig.out.result = state->tmp.out.result;
6495 /* Reset temporary structure */
6496 ZERO_STRUCT(state->tmp);
6498 if (DEBUGLEVEL >= 10) {
6499 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &state->orig);
6502 tevent_req_done(req);
6505 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid_recv(struct tevent_req *req,
6506 TALLOC_CTX *mem_ctx,
6507 NTSTATUS *result)
6509 struct rpccli_lsa_QueryTrustedDomainInfoBySid_state *state = tevent_req_data(
6510 req, struct rpccli_lsa_QueryTrustedDomainInfoBySid_state);
6511 NTSTATUS status;
6513 if (tevent_req_is_nterror(req, &status)) {
6514 tevent_req_received(req);
6515 return status;
6518 /* Steal possbile out parameters to the callers context */
6519 talloc_steal(mem_ctx, state->out_mem_ctx);
6521 /* Return result */
6522 *result = state->orig.out.result;
6524 tevent_req_received(req);
6525 return NT_STATUS_OK;
6528 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli,
6529 TALLOC_CTX *mem_ctx,
6530 struct policy_handle *handle /* [in] [ref] */,
6531 struct dom_sid2 *dom_sid /* [in] [ref] */,
6532 enum lsa_TrustDomInfoEnum level /* [in] */,
6533 union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
6535 struct lsa_QueryTrustedDomainInfoBySid r;
6536 NTSTATUS status;
6538 /* In parameters */
6539 r.in.handle = handle;
6540 r.in.dom_sid = dom_sid;
6541 r.in.level = level;
6543 if (DEBUGLEVEL >= 10) {
6544 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
6547 status = cli->dispatch(cli,
6548 mem_ctx,
6549 &ndr_table_lsarpc,
6550 NDR_LSA_QUERYTRUSTEDDOMAININFOBYSID,
6551 &r);
6553 if (!NT_STATUS_IS_OK(status)) {
6554 return status;
6557 if (DEBUGLEVEL >= 10) {
6558 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoBySid, &r);
6561 if (NT_STATUS_IS_ERR(status)) {
6562 return status;
6565 /* Return variables */
6566 *info = *r.out.info;
6568 /* Return result */
6569 return r.out.result;
6572 struct rpccli_lsa_SetTrustedDomainInfo_state {
6573 struct lsa_SetTrustedDomainInfo orig;
6574 struct lsa_SetTrustedDomainInfo tmp;
6575 TALLOC_CTX *out_mem_ctx;
6576 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6579 static void rpccli_lsa_SetTrustedDomainInfo_done(struct tevent_req *subreq);
6581 struct tevent_req *rpccli_lsa_SetTrustedDomainInfo_send(TALLOC_CTX *mem_ctx,
6582 struct tevent_context *ev,
6583 struct rpc_pipe_client *cli,
6584 struct policy_handle *_handle /* [in] [ref] */,
6585 struct dom_sid2 *_dom_sid /* [in] [ref] */,
6586 enum lsa_TrustDomInfoEnum _level /* [in] */,
6587 union lsa_TrustedDomainInfo *_info /* [in] [ref,switch_is(level)] */)
6589 struct tevent_req *req;
6590 struct rpccli_lsa_SetTrustedDomainInfo_state *state;
6591 struct tevent_req *subreq;
6593 req = tevent_req_create(mem_ctx, &state,
6594 struct rpccli_lsa_SetTrustedDomainInfo_state);
6595 if (req == NULL) {
6596 return NULL;
6598 state->out_mem_ctx = NULL;
6599 state->dispatch_recv = cli->dispatch_recv;
6601 /* In parameters */
6602 state->orig.in.handle = _handle;
6603 state->orig.in.dom_sid = _dom_sid;
6604 state->orig.in.level = _level;
6605 state->orig.in.info = _info;
6607 /* Out parameters */
6609 /* Result */
6610 ZERO_STRUCT(state->orig.out.result);
6612 if (DEBUGLEVEL >= 10) {
6613 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &state->orig);
6616 /* make a temporary copy, that we pass to the dispatch function */
6617 state->tmp = state->orig;
6619 subreq = cli->dispatch_send(state, ev, cli,
6620 &ndr_table_lsarpc,
6621 NDR_LSA_SETTRUSTEDDOMAININFO,
6622 &state->tmp);
6623 if (tevent_req_nomem(subreq, req)) {
6624 return tevent_req_post(req, ev);
6626 tevent_req_set_callback(subreq, rpccli_lsa_SetTrustedDomainInfo_done, req);
6627 return req;
6630 static void rpccli_lsa_SetTrustedDomainInfo_done(struct tevent_req *subreq)
6632 struct tevent_req *req = tevent_req_callback_data(
6633 subreq, struct tevent_req);
6634 struct rpccli_lsa_SetTrustedDomainInfo_state *state = tevent_req_data(
6635 req, struct rpccli_lsa_SetTrustedDomainInfo_state);
6636 NTSTATUS status;
6637 TALLOC_CTX *mem_ctx;
6639 if (state->out_mem_ctx) {
6640 mem_ctx = state->out_mem_ctx;
6641 } else {
6642 mem_ctx = state;
6645 status = state->dispatch_recv(subreq, mem_ctx);
6646 TALLOC_FREE(subreq);
6647 if (!NT_STATUS_IS_OK(status)) {
6648 tevent_req_nterror(req, status);
6649 return;
6652 /* Copy out parameters */
6654 /* Copy result */
6655 state->orig.out.result = state->tmp.out.result;
6657 /* Reset temporary structure */
6658 ZERO_STRUCT(state->tmp);
6660 if (DEBUGLEVEL >= 10) {
6661 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &state->orig);
6664 tevent_req_done(req);
6667 NTSTATUS rpccli_lsa_SetTrustedDomainInfo_recv(struct tevent_req *req,
6668 TALLOC_CTX *mem_ctx,
6669 NTSTATUS *result)
6671 struct rpccli_lsa_SetTrustedDomainInfo_state *state = tevent_req_data(
6672 req, struct rpccli_lsa_SetTrustedDomainInfo_state);
6673 NTSTATUS status;
6675 if (tevent_req_is_nterror(req, &status)) {
6676 tevent_req_received(req);
6677 return status;
6680 /* Steal possbile out parameters to the callers context */
6681 talloc_steal(mem_ctx, state->out_mem_ctx);
6683 /* Return result */
6684 *result = state->orig.out.result;
6686 tevent_req_received(req);
6687 return NT_STATUS_OK;
6690 NTSTATUS rpccli_lsa_SetTrustedDomainInfo(struct rpc_pipe_client *cli,
6691 TALLOC_CTX *mem_ctx,
6692 struct policy_handle *handle /* [in] [ref] */,
6693 struct dom_sid2 *dom_sid /* [in] [ref] */,
6694 enum lsa_TrustDomInfoEnum level /* [in] */,
6695 union lsa_TrustedDomainInfo *info /* [in] [ref,switch_is(level)] */)
6697 struct lsa_SetTrustedDomainInfo r;
6698 NTSTATUS status;
6700 /* In parameters */
6701 r.in.handle = handle;
6702 r.in.dom_sid = dom_sid;
6703 r.in.level = level;
6704 r.in.info = info;
6706 if (DEBUGLEVEL >= 10) {
6707 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfo, &r);
6710 status = cli->dispatch(cli,
6711 mem_ctx,
6712 &ndr_table_lsarpc,
6713 NDR_LSA_SETTRUSTEDDOMAININFO,
6714 &r);
6716 if (!NT_STATUS_IS_OK(status)) {
6717 return status;
6720 if (DEBUGLEVEL >= 10) {
6721 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfo, &r);
6724 if (NT_STATUS_IS_ERR(status)) {
6725 return status;
6728 /* Return variables */
6730 /* Return result */
6731 return r.out.result;
6734 struct rpccli_lsa_DeleteTrustedDomain_state {
6735 struct lsa_DeleteTrustedDomain orig;
6736 struct lsa_DeleteTrustedDomain tmp;
6737 TALLOC_CTX *out_mem_ctx;
6738 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6741 static void rpccli_lsa_DeleteTrustedDomain_done(struct tevent_req *subreq);
6743 struct tevent_req *rpccli_lsa_DeleteTrustedDomain_send(TALLOC_CTX *mem_ctx,
6744 struct tevent_context *ev,
6745 struct rpc_pipe_client *cli,
6746 struct policy_handle *_handle /* [in] [ref] */,
6747 struct dom_sid2 *_dom_sid /* [in] [ref] */)
6749 struct tevent_req *req;
6750 struct rpccli_lsa_DeleteTrustedDomain_state *state;
6751 struct tevent_req *subreq;
6753 req = tevent_req_create(mem_ctx, &state,
6754 struct rpccli_lsa_DeleteTrustedDomain_state);
6755 if (req == NULL) {
6756 return NULL;
6758 state->out_mem_ctx = NULL;
6759 state->dispatch_recv = cli->dispatch_recv;
6761 /* In parameters */
6762 state->orig.in.handle = _handle;
6763 state->orig.in.dom_sid = _dom_sid;
6765 /* Out parameters */
6767 /* Result */
6768 ZERO_STRUCT(state->orig.out.result);
6770 if (DEBUGLEVEL >= 10) {
6771 NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &state->orig);
6774 /* make a temporary copy, that we pass to the dispatch function */
6775 state->tmp = state->orig;
6777 subreq = cli->dispatch_send(state, ev, cli,
6778 &ndr_table_lsarpc,
6779 NDR_LSA_DELETETRUSTEDDOMAIN,
6780 &state->tmp);
6781 if (tevent_req_nomem(subreq, req)) {
6782 return tevent_req_post(req, ev);
6784 tevent_req_set_callback(subreq, rpccli_lsa_DeleteTrustedDomain_done, req);
6785 return req;
6788 static void rpccli_lsa_DeleteTrustedDomain_done(struct tevent_req *subreq)
6790 struct tevent_req *req = tevent_req_callback_data(
6791 subreq, struct tevent_req);
6792 struct rpccli_lsa_DeleteTrustedDomain_state *state = tevent_req_data(
6793 req, struct rpccli_lsa_DeleteTrustedDomain_state);
6794 NTSTATUS status;
6795 TALLOC_CTX *mem_ctx;
6797 if (state->out_mem_ctx) {
6798 mem_ctx = state->out_mem_ctx;
6799 } else {
6800 mem_ctx = state;
6803 status = state->dispatch_recv(subreq, mem_ctx);
6804 TALLOC_FREE(subreq);
6805 if (!NT_STATUS_IS_OK(status)) {
6806 tevent_req_nterror(req, status);
6807 return;
6810 /* Copy out parameters */
6812 /* Copy result */
6813 state->orig.out.result = state->tmp.out.result;
6815 /* Reset temporary structure */
6816 ZERO_STRUCT(state->tmp);
6818 if (DEBUGLEVEL >= 10) {
6819 NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &state->orig);
6822 tevent_req_done(req);
6825 NTSTATUS rpccli_lsa_DeleteTrustedDomain_recv(struct tevent_req *req,
6826 TALLOC_CTX *mem_ctx,
6827 NTSTATUS *result)
6829 struct rpccli_lsa_DeleteTrustedDomain_state *state = tevent_req_data(
6830 req, struct rpccli_lsa_DeleteTrustedDomain_state);
6831 NTSTATUS status;
6833 if (tevent_req_is_nterror(req, &status)) {
6834 tevent_req_received(req);
6835 return status;
6838 /* Steal possbile out parameters to the callers context */
6839 talloc_steal(mem_ctx, state->out_mem_ctx);
6841 /* Return result */
6842 *result = state->orig.out.result;
6844 tevent_req_received(req);
6845 return NT_STATUS_OK;
6848 NTSTATUS rpccli_lsa_DeleteTrustedDomain(struct rpc_pipe_client *cli,
6849 TALLOC_CTX *mem_ctx,
6850 struct policy_handle *handle /* [in] [ref] */,
6851 struct dom_sid2 *dom_sid /* [in] [ref] */)
6853 struct lsa_DeleteTrustedDomain r;
6854 NTSTATUS status;
6856 /* In parameters */
6857 r.in.handle = handle;
6858 r.in.dom_sid = dom_sid;
6860 if (DEBUGLEVEL >= 10) {
6861 NDR_PRINT_IN_DEBUG(lsa_DeleteTrustedDomain, &r);
6864 status = cli->dispatch(cli,
6865 mem_ctx,
6866 &ndr_table_lsarpc,
6867 NDR_LSA_DELETETRUSTEDDOMAIN,
6868 &r);
6870 if (!NT_STATUS_IS_OK(status)) {
6871 return status;
6874 if (DEBUGLEVEL >= 10) {
6875 NDR_PRINT_OUT_DEBUG(lsa_DeleteTrustedDomain, &r);
6878 if (NT_STATUS_IS_ERR(status)) {
6879 return status;
6882 /* Return variables */
6884 /* Return result */
6885 return r.out.result;
6888 struct rpccli_lsa_StorePrivateData_state {
6889 struct lsa_StorePrivateData orig;
6890 struct lsa_StorePrivateData tmp;
6891 TALLOC_CTX *out_mem_ctx;
6892 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
6895 static void rpccli_lsa_StorePrivateData_done(struct tevent_req *subreq);
6897 struct tevent_req *rpccli_lsa_StorePrivateData_send(TALLOC_CTX *mem_ctx,
6898 struct tevent_context *ev,
6899 struct rpc_pipe_client *cli,
6900 struct policy_handle *_handle /* [in] [ref] */,
6901 struct lsa_String *_name /* [in] [ref] */,
6902 struct lsa_DATA_BUF *_val /* [in] [unique] */)
6904 struct tevent_req *req;
6905 struct rpccli_lsa_StorePrivateData_state *state;
6906 struct tevent_req *subreq;
6908 req = tevent_req_create(mem_ctx, &state,
6909 struct rpccli_lsa_StorePrivateData_state);
6910 if (req == NULL) {
6911 return NULL;
6913 state->out_mem_ctx = NULL;
6914 state->dispatch_recv = cli->dispatch_recv;
6916 /* In parameters */
6917 state->orig.in.handle = _handle;
6918 state->orig.in.name = _name;
6919 state->orig.in.val = _val;
6921 /* Out parameters */
6923 /* Result */
6924 ZERO_STRUCT(state->orig.out.result);
6926 if (DEBUGLEVEL >= 10) {
6927 NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &state->orig);
6930 /* make a temporary copy, that we pass to the dispatch function */
6931 state->tmp = state->orig;
6933 subreq = cli->dispatch_send(state, ev, cli,
6934 &ndr_table_lsarpc,
6935 NDR_LSA_STOREPRIVATEDATA,
6936 &state->tmp);
6937 if (tevent_req_nomem(subreq, req)) {
6938 return tevent_req_post(req, ev);
6940 tevent_req_set_callback(subreq, rpccli_lsa_StorePrivateData_done, req);
6941 return req;
6944 static void rpccli_lsa_StorePrivateData_done(struct tevent_req *subreq)
6946 struct tevent_req *req = tevent_req_callback_data(
6947 subreq, struct tevent_req);
6948 struct rpccli_lsa_StorePrivateData_state *state = tevent_req_data(
6949 req, struct rpccli_lsa_StorePrivateData_state);
6950 NTSTATUS status;
6951 TALLOC_CTX *mem_ctx;
6953 if (state->out_mem_ctx) {
6954 mem_ctx = state->out_mem_ctx;
6955 } else {
6956 mem_ctx = state;
6959 status = state->dispatch_recv(subreq, mem_ctx);
6960 TALLOC_FREE(subreq);
6961 if (!NT_STATUS_IS_OK(status)) {
6962 tevent_req_nterror(req, status);
6963 return;
6966 /* Copy out parameters */
6968 /* Copy result */
6969 state->orig.out.result = state->tmp.out.result;
6971 /* Reset temporary structure */
6972 ZERO_STRUCT(state->tmp);
6974 if (DEBUGLEVEL >= 10) {
6975 NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &state->orig);
6978 tevent_req_done(req);
6981 NTSTATUS rpccli_lsa_StorePrivateData_recv(struct tevent_req *req,
6982 TALLOC_CTX *mem_ctx,
6983 NTSTATUS *result)
6985 struct rpccli_lsa_StorePrivateData_state *state = tevent_req_data(
6986 req, struct rpccli_lsa_StorePrivateData_state);
6987 NTSTATUS status;
6989 if (tevent_req_is_nterror(req, &status)) {
6990 tevent_req_received(req);
6991 return status;
6994 /* Steal possbile out parameters to the callers context */
6995 talloc_steal(mem_ctx, state->out_mem_ctx);
6997 /* Return result */
6998 *result = state->orig.out.result;
7000 tevent_req_received(req);
7001 return NT_STATUS_OK;
7004 NTSTATUS rpccli_lsa_StorePrivateData(struct rpc_pipe_client *cli,
7005 TALLOC_CTX *mem_ctx,
7006 struct policy_handle *handle /* [in] [ref] */,
7007 struct lsa_String *name /* [in] [ref] */,
7008 struct lsa_DATA_BUF *val /* [in] [unique] */)
7010 struct lsa_StorePrivateData r;
7011 NTSTATUS status;
7013 /* In parameters */
7014 r.in.handle = handle;
7015 r.in.name = name;
7016 r.in.val = val;
7018 if (DEBUGLEVEL >= 10) {
7019 NDR_PRINT_IN_DEBUG(lsa_StorePrivateData, &r);
7022 status = cli->dispatch(cli,
7023 mem_ctx,
7024 &ndr_table_lsarpc,
7025 NDR_LSA_STOREPRIVATEDATA,
7026 &r);
7028 if (!NT_STATUS_IS_OK(status)) {
7029 return status;
7032 if (DEBUGLEVEL >= 10) {
7033 NDR_PRINT_OUT_DEBUG(lsa_StorePrivateData, &r);
7036 if (NT_STATUS_IS_ERR(status)) {
7037 return status;
7040 /* Return variables */
7042 /* Return result */
7043 return r.out.result;
7046 struct rpccli_lsa_RetrievePrivateData_state {
7047 struct lsa_RetrievePrivateData orig;
7048 struct lsa_RetrievePrivateData tmp;
7049 TALLOC_CTX *out_mem_ctx;
7050 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7053 static void rpccli_lsa_RetrievePrivateData_done(struct tevent_req *subreq);
7055 struct tevent_req *rpccli_lsa_RetrievePrivateData_send(TALLOC_CTX *mem_ctx,
7056 struct tevent_context *ev,
7057 struct rpc_pipe_client *cli,
7058 struct policy_handle *_handle /* [in] [ref] */,
7059 struct lsa_String *_name /* [in] [ref] */,
7060 struct lsa_DATA_BUF **_val /* [in,out] [ref] */)
7062 struct tevent_req *req;
7063 struct rpccli_lsa_RetrievePrivateData_state *state;
7064 struct tevent_req *subreq;
7066 req = tevent_req_create(mem_ctx, &state,
7067 struct rpccli_lsa_RetrievePrivateData_state);
7068 if (req == NULL) {
7069 return NULL;
7071 state->out_mem_ctx = NULL;
7072 state->dispatch_recv = cli->dispatch_recv;
7074 /* In parameters */
7075 state->orig.in.handle = _handle;
7076 state->orig.in.name = _name;
7077 state->orig.in.val = _val;
7079 /* Out parameters */
7080 state->orig.out.val = _val;
7082 /* Result */
7083 ZERO_STRUCT(state->orig.out.result);
7085 if (DEBUGLEVEL >= 10) {
7086 NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &state->orig);
7089 state->out_mem_ctx = talloc_named_const(state, 0,
7090 "rpccli_lsa_RetrievePrivateData_out_memory");
7091 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7092 return tevent_req_post(req, ev);
7095 /* make a temporary copy, that we pass to the dispatch function */
7096 state->tmp = state->orig;
7098 subreq = cli->dispatch_send(state, ev, cli,
7099 &ndr_table_lsarpc,
7100 NDR_LSA_RETRIEVEPRIVATEDATA,
7101 &state->tmp);
7102 if (tevent_req_nomem(subreq, req)) {
7103 return tevent_req_post(req, ev);
7105 tevent_req_set_callback(subreq, rpccli_lsa_RetrievePrivateData_done, req);
7106 return req;
7109 static void rpccli_lsa_RetrievePrivateData_done(struct tevent_req *subreq)
7111 struct tevent_req *req = tevent_req_callback_data(
7112 subreq, struct tevent_req);
7113 struct rpccli_lsa_RetrievePrivateData_state *state = tevent_req_data(
7114 req, struct rpccli_lsa_RetrievePrivateData_state);
7115 NTSTATUS status;
7116 TALLOC_CTX *mem_ctx;
7118 if (state->out_mem_ctx) {
7119 mem_ctx = state->out_mem_ctx;
7120 } else {
7121 mem_ctx = state;
7124 status = state->dispatch_recv(subreq, mem_ctx);
7125 TALLOC_FREE(subreq);
7126 if (!NT_STATUS_IS_OK(status)) {
7127 tevent_req_nterror(req, status);
7128 return;
7131 /* Copy out parameters */
7132 *state->orig.out.val = *state->tmp.out.val;
7134 /* Copy result */
7135 state->orig.out.result = state->tmp.out.result;
7137 /* Reset temporary structure */
7138 ZERO_STRUCT(state->tmp);
7140 if (DEBUGLEVEL >= 10) {
7141 NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &state->orig);
7144 tevent_req_done(req);
7147 NTSTATUS rpccli_lsa_RetrievePrivateData_recv(struct tevent_req *req,
7148 TALLOC_CTX *mem_ctx,
7149 NTSTATUS *result)
7151 struct rpccli_lsa_RetrievePrivateData_state *state = tevent_req_data(
7152 req, struct rpccli_lsa_RetrievePrivateData_state);
7153 NTSTATUS status;
7155 if (tevent_req_is_nterror(req, &status)) {
7156 tevent_req_received(req);
7157 return status;
7160 /* Steal possbile out parameters to the callers context */
7161 talloc_steal(mem_ctx, state->out_mem_ctx);
7163 /* Return result */
7164 *result = state->orig.out.result;
7166 tevent_req_received(req);
7167 return NT_STATUS_OK;
7170 NTSTATUS rpccli_lsa_RetrievePrivateData(struct rpc_pipe_client *cli,
7171 TALLOC_CTX *mem_ctx,
7172 struct policy_handle *handle /* [in] [ref] */,
7173 struct lsa_String *name /* [in] [ref] */,
7174 struct lsa_DATA_BUF **val /* [in,out] [ref] */)
7176 struct lsa_RetrievePrivateData r;
7177 NTSTATUS status;
7179 /* In parameters */
7180 r.in.handle = handle;
7181 r.in.name = name;
7182 r.in.val = val;
7184 if (DEBUGLEVEL >= 10) {
7185 NDR_PRINT_IN_DEBUG(lsa_RetrievePrivateData, &r);
7188 status = cli->dispatch(cli,
7189 mem_ctx,
7190 &ndr_table_lsarpc,
7191 NDR_LSA_RETRIEVEPRIVATEDATA,
7192 &r);
7194 if (!NT_STATUS_IS_OK(status)) {
7195 return status;
7198 if (DEBUGLEVEL >= 10) {
7199 NDR_PRINT_OUT_DEBUG(lsa_RetrievePrivateData, &r);
7202 if (NT_STATUS_IS_ERR(status)) {
7203 return status;
7206 /* Return variables */
7207 *val = *r.out.val;
7209 /* Return result */
7210 return r.out.result;
7213 struct rpccli_lsa_OpenPolicy2_state {
7214 struct lsa_OpenPolicy2 orig;
7215 struct lsa_OpenPolicy2 tmp;
7216 TALLOC_CTX *out_mem_ctx;
7217 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7220 static void rpccli_lsa_OpenPolicy2_done(struct tevent_req *subreq);
7222 struct tevent_req *rpccli_lsa_OpenPolicy2_send(TALLOC_CTX *mem_ctx,
7223 struct tevent_context *ev,
7224 struct rpc_pipe_client *cli,
7225 const char *_system_name /* [in] [unique,charset(UTF16)] */,
7226 struct lsa_ObjectAttribute *_attr /* [in] [ref] */,
7227 uint32_t _access_mask /* [in] */,
7228 struct policy_handle *_handle /* [out] [ref] */)
7230 struct tevent_req *req;
7231 struct rpccli_lsa_OpenPolicy2_state *state;
7232 struct tevent_req *subreq;
7234 req = tevent_req_create(mem_ctx, &state,
7235 struct rpccli_lsa_OpenPolicy2_state);
7236 if (req == NULL) {
7237 return NULL;
7239 state->out_mem_ctx = NULL;
7240 state->dispatch_recv = cli->dispatch_recv;
7242 /* In parameters */
7243 state->orig.in.system_name = _system_name;
7244 state->orig.in.attr = _attr;
7245 state->orig.in.access_mask = _access_mask;
7247 /* Out parameters */
7248 state->orig.out.handle = _handle;
7250 /* Result */
7251 ZERO_STRUCT(state->orig.out.result);
7253 if (DEBUGLEVEL >= 10) {
7254 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &state->orig);
7257 state->out_mem_ctx = talloc_named_const(state, 0,
7258 "rpccli_lsa_OpenPolicy2_out_memory");
7259 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7260 return tevent_req_post(req, ev);
7263 /* make a temporary copy, that we pass to the dispatch function */
7264 state->tmp = state->orig;
7266 subreq = cli->dispatch_send(state, ev, cli,
7267 &ndr_table_lsarpc,
7268 NDR_LSA_OPENPOLICY2,
7269 &state->tmp);
7270 if (tevent_req_nomem(subreq, req)) {
7271 return tevent_req_post(req, ev);
7273 tevent_req_set_callback(subreq, rpccli_lsa_OpenPolicy2_done, req);
7274 return req;
7277 static void rpccli_lsa_OpenPolicy2_done(struct tevent_req *subreq)
7279 struct tevent_req *req = tevent_req_callback_data(
7280 subreq, struct tevent_req);
7281 struct rpccli_lsa_OpenPolicy2_state *state = tevent_req_data(
7282 req, struct rpccli_lsa_OpenPolicy2_state);
7283 NTSTATUS status;
7284 TALLOC_CTX *mem_ctx;
7286 if (state->out_mem_ctx) {
7287 mem_ctx = state->out_mem_ctx;
7288 } else {
7289 mem_ctx = state;
7292 status = state->dispatch_recv(subreq, mem_ctx);
7293 TALLOC_FREE(subreq);
7294 if (!NT_STATUS_IS_OK(status)) {
7295 tevent_req_nterror(req, status);
7296 return;
7299 /* Copy out parameters */
7300 *state->orig.out.handle = *state->tmp.out.handle;
7302 /* Copy result */
7303 state->orig.out.result = state->tmp.out.result;
7305 /* Reset temporary structure */
7306 ZERO_STRUCT(state->tmp);
7308 if (DEBUGLEVEL >= 10) {
7309 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &state->orig);
7312 tevent_req_done(req);
7315 NTSTATUS rpccli_lsa_OpenPolicy2_recv(struct tevent_req *req,
7316 TALLOC_CTX *mem_ctx,
7317 NTSTATUS *result)
7319 struct rpccli_lsa_OpenPolicy2_state *state = tevent_req_data(
7320 req, struct rpccli_lsa_OpenPolicy2_state);
7321 NTSTATUS status;
7323 if (tevent_req_is_nterror(req, &status)) {
7324 tevent_req_received(req);
7325 return status;
7328 /* Steal possbile out parameters to the callers context */
7329 talloc_steal(mem_ctx, state->out_mem_ctx);
7331 /* Return result */
7332 *result = state->orig.out.result;
7334 tevent_req_received(req);
7335 return NT_STATUS_OK;
7338 NTSTATUS rpccli_lsa_OpenPolicy2(struct rpc_pipe_client *cli,
7339 TALLOC_CTX *mem_ctx,
7340 const char *system_name /* [in] [unique,charset(UTF16)] */,
7341 struct lsa_ObjectAttribute *attr /* [in] [ref] */,
7342 uint32_t access_mask /* [in] */,
7343 struct policy_handle *handle /* [out] [ref] */)
7345 struct lsa_OpenPolicy2 r;
7346 NTSTATUS status;
7348 /* In parameters */
7349 r.in.system_name = system_name;
7350 r.in.attr = attr;
7351 r.in.access_mask = access_mask;
7353 if (DEBUGLEVEL >= 10) {
7354 NDR_PRINT_IN_DEBUG(lsa_OpenPolicy2, &r);
7357 status = cli->dispatch(cli,
7358 mem_ctx,
7359 &ndr_table_lsarpc,
7360 NDR_LSA_OPENPOLICY2,
7361 &r);
7363 if (!NT_STATUS_IS_OK(status)) {
7364 return status;
7367 if (DEBUGLEVEL >= 10) {
7368 NDR_PRINT_OUT_DEBUG(lsa_OpenPolicy2, &r);
7371 if (NT_STATUS_IS_ERR(status)) {
7372 return status;
7375 /* Return variables */
7376 *handle = *r.out.handle;
7378 /* Return result */
7379 return r.out.result;
7382 struct rpccli_lsa_GetUserName_state {
7383 struct lsa_GetUserName orig;
7384 struct lsa_GetUserName tmp;
7385 TALLOC_CTX *out_mem_ctx;
7386 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7389 static void rpccli_lsa_GetUserName_done(struct tevent_req *subreq);
7391 struct tevent_req *rpccli_lsa_GetUserName_send(TALLOC_CTX *mem_ctx,
7392 struct tevent_context *ev,
7393 struct rpc_pipe_client *cli,
7394 const char *_system_name /* [in] [unique,charset(UTF16)] */,
7395 struct lsa_String **_account_name /* [in,out] [ref] */,
7396 struct lsa_String **_authority_name /* [in,out] [unique] */)
7398 struct tevent_req *req;
7399 struct rpccli_lsa_GetUserName_state *state;
7400 struct tevent_req *subreq;
7402 req = tevent_req_create(mem_ctx, &state,
7403 struct rpccli_lsa_GetUserName_state);
7404 if (req == NULL) {
7405 return NULL;
7407 state->out_mem_ctx = NULL;
7408 state->dispatch_recv = cli->dispatch_recv;
7410 /* In parameters */
7411 state->orig.in.system_name = _system_name;
7412 state->orig.in.account_name = _account_name;
7413 state->orig.in.authority_name = _authority_name;
7415 /* Out parameters */
7416 state->orig.out.account_name = _account_name;
7417 state->orig.out.authority_name = _authority_name;
7419 /* Result */
7420 ZERO_STRUCT(state->orig.out.result);
7422 if (DEBUGLEVEL >= 10) {
7423 NDR_PRINT_IN_DEBUG(lsa_GetUserName, &state->orig);
7426 state->out_mem_ctx = talloc_named_const(state, 0,
7427 "rpccli_lsa_GetUserName_out_memory");
7428 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7429 return tevent_req_post(req, ev);
7432 /* make a temporary copy, that we pass to the dispatch function */
7433 state->tmp = state->orig;
7435 subreq = cli->dispatch_send(state, ev, cli,
7436 &ndr_table_lsarpc,
7437 NDR_LSA_GETUSERNAME,
7438 &state->tmp);
7439 if (tevent_req_nomem(subreq, req)) {
7440 return tevent_req_post(req, ev);
7442 tevent_req_set_callback(subreq, rpccli_lsa_GetUserName_done, req);
7443 return req;
7446 static void rpccli_lsa_GetUserName_done(struct tevent_req *subreq)
7448 struct tevent_req *req = tevent_req_callback_data(
7449 subreq, struct tevent_req);
7450 struct rpccli_lsa_GetUserName_state *state = tevent_req_data(
7451 req, struct rpccli_lsa_GetUserName_state);
7452 NTSTATUS status;
7453 TALLOC_CTX *mem_ctx;
7455 if (state->out_mem_ctx) {
7456 mem_ctx = state->out_mem_ctx;
7457 } else {
7458 mem_ctx = state;
7461 status = state->dispatch_recv(subreq, mem_ctx);
7462 TALLOC_FREE(subreq);
7463 if (!NT_STATUS_IS_OK(status)) {
7464 tevent_req_nterror(req, status);
7465 return;
7468 /* Copy out parameters */
7469 *state->orig.out.account_name = *state->tmp.out.account_name;
7470 if (state->orig.out.authority_name && state->tmp.out.authority_name) {
7471 *state->orig.out.authority_name = *state->tmp.out.authority_name;
7474 /* Copy result */
7475 state->orig.out.result = state->tmp.out.result;
7477 /* Reset temporary structure */
7478 ZERO_STRUCT(state->tmp);
7480 if (DEBUGLEVEL >= 10) {
7481 NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &state->orig);
7484 tevent_req_done(req);
7487 NTSTATUS rpccli_lsa_GetUserName_recv(struct tevent_req *req,
7488 TALLOC_CTX *mem_ctx,
7489 NTSTATUS *result)
7491 struct rpccli_lsa_GetUserName_state *state = tevent_req_data(
7492 req, struct rpccli_lsa_GetUserName_state);
7493 NTSTATUS status;
7495 if (tevent_req_is_nterror(req, &status)) {
7496 tevent_req_received(req);
7497 return status;
7500 /* Steal possbile out parameters to the callers context */
7501 talloc_steal(mem_ctx, state->out_mem_ctx);
7503 /* Return result */
7504 *result = state->orig.out.result;
7506 tevent_req_received(req);
7507 return NT_STATUS_OK;
7510 NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli,
7511 TALLOC_CTX *mem_ctx,
7512 const char *system_name /* [in] [unique,charset(UTF16)] */,
7513 struct lsa_String **account_name /* [in,out] [ref] */,
7514 struct lsa_String **authority_name /* [in,out] [unique] */)
7516 struct lsa_GetUserName r;
7517 NTSTATUS status;
7519 /* In parameters */
7520 r.in.system_name = system_name;
7521 r.in.account_name = account_name;
7522 r.in.authority_name = authority_name;
7524 if (DEBUGLEVEL >= 10) {
7525 NDR_PRINT_IN_DEBUG(lsa_GetUserName, &r);
7528 status = cli->dispatch(cli,
7529 mem_ctx,
7530 &ndr_table_lsarpc,
7531 NDR_LSA_GETUSERNAME,
7532 &r);
7534 if (!NT_STATUS_IS_OK(status)) {
7535 return status;
7538 if (DEBUGLEVEL >= 10) {
7539 NDR_PRINT_OUT_DEBUG(lsa_GetUserName, &r);
7542 if (NT_STATUS_IS_ERR(status)) {
7543 return status;
7546 /* Return variables */
7547 *account_name = *r.out.account_name;
7548 if (authority_name && r.out.authority_name) {
7549 *authority_name = *r.out.authority_name;
7552 /* Return result */
7553 return r.out.result;
7556 struct rpccli_lsa_QueryInfoPolicy2_state {
7557 struct lsa_QueryInfoPolicy2 orig;
7558 struct lsa_QueryInfoPolicy2 tmp;
7559 TALLOC_CTX *out_mem_ctx;
7560 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7563 static void rpccli_lsa_QueryInfoPolicy2_done(struct tevent_req *subreq);
7565 struct tevent_req *rpccli_lsa_QueryInfoPolicy2_send(TALLOC_CTX *mem_ctx,
7566 struct tevent_context *ev,
7567 struct rpc_pipe_client *cli,
7568 struct policy_handle *_handle /* [in] [ref] */,
7569 enum lsa_PolicyInfo _level /* [in] */,
7570 union lsa_PolicyInformation **_info /* [out] [ref,switch_is(level)] */)
7572 struct tevent_req *req;
7573 struct rpccli_lsa_QueryInfoPolicy2_state *state;
7574 struct tevent_req *subreq;
7576 req = tevent_req_create(mem_ctx, &state,
7577 struct rpccli_lsa_QueryInfoPolicy2_state);
7578 if (req == NULL) {
7579 return NULL;
7581 state->out_mem_ctx = NULL;
7582 state->dispatch_recv = cli->dispatch_recv;
7584 /* In parameters */
7585 state->orig.in.handle = _handle;
7586 state->orig.in.level = _level;
7588 /* Out parameters */
7589 state->orig.out.info = _info;
7591 /* Result */
7592 ZERO_STRUCT(state->orig.out.result);
7594 if (DEBUGLEVEL >= 10) {
7595 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &state->orig);
7598 state->out_mem_ctx = talloc_named_const(state, 0,
7599 "rpccli_lsa_QueryInfoPolicy2_out_memory");
7600 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7601 return tevent_req_post(req, ev);
7604 /* make a temporary copy, that we pass to the dispatch function */
7605 state->tmp = state->orig;
7607 subreq = cli->dispatch_send(state, ev, cli,
7608 &ndr_table_lsarpc,
7609 NDR_LSA_QUERYINFOPOLICY2,
7610 &state->tmp);
7611 if (tevent_req_nomem(subreq, req)) {
7612 return tevent_req_post(req, ev);
7614 tevent_req_set_callback(subreq, rpccli_lsa_QueryInfoPolicy2_done, req);
7615 return req;
7618 static void rpccli_lsa_QueryInfoPolicy2_done(struct tevent_req *subreq)
7620 struct tevent_req *req = tevent_req_callback_data(
7621 subreq, struct tevent_req);
7622 struct rpccli_lsa_QueryInfoPolicy2_state *state = tevent_req_data(
7623 req, struct rpccli_lsa_QueryInfoPolicy2_state);
7624 NTSTATUS status;
7625 TALLOC_CTX *mem_ctx;
7627 if (state->out_mem_ctx) {
7628 mem_ctx = state->out_mem_ctx;
7629 } else {
7630 mem_ctx = state;
7633 status = state->dispatch_recv(subreq, mem_ctx);
7634 TALLOC_FREE(subreq);
7635 if (!NT_STATUS_IS_OK(status)) {
7636 tevent_req_nterror(req, status);
7637 return;
7640 /* Copy out parameters */
7641 *state->orig.out.info = *state->tmp.out.info;
7643 /* Copy result */
7644 state->orig.out.result = state->tmp.out.result;
7646 /* Reset temporary structure */
7647 ZERO_STRUCT(state->tmp);
7649 if (DEBUGLEVEL >= 10) {
7650 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &state->orig);
7653 tevent_req_done(req);
7656 NTSTATUS rpccli_lsa_QueryInfoPolicy2_recv(struct tevent_req *req,
7657 TALLOC_CTX *mem_ctx,
7658 NTSTATUS *result)
7660 struct rpccli_lsa_QueryInfoPolicy2_state *state = tevent_req_data(
7661 req, struct rpccli_lsa_QueryInfoPolicy2_state);
7662 NTSTATUS status;
7664 if (tevent_req_is_nterror(req, &status)) {
7665 tevent_req_received(req);
7666 return status;
7669 /* Steal possbile out parameters to the callers context */
7670 talloc_steal(mem_ctx, state->out_mem_ctx);
7672 /* Return result */
7673 *result = state->orig.out.result;
7675 tevent_req_received(req);
7676 return NT_STATUS_OK;
7679 NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli,
7680 TALLOC_CTX *mem_ctx,
7681 struct policy_handle *handle /* [in] [ref] */,
7682 enum lsa_PolicyInfo level /* [in] */,
7683 union lsa_PolicyInformation **info /* [out] [ref,switch_is(level)] */)
7685 struct lsa_QueryInfoPolicy2 r;
7686 NTSTATUS status;
7688 /* In parameters */
7689 r.in.handle = handle;
7690 r.in.level = level;
7692 if (DEBUGLEVEL >= 10) {
7693 NDR_PRINT_IN_DEBUG(lsa_QueryInfoPolicy2, &r);
7696 status = cli->dispatch(cli,
7697 mem_ctx,
7698 &ndr_table_lsarpc,
7699 NDR_LSA_QUERYINFOPOLICY2,
7700 &r);
7702 if (!NT_STATUS_IS_OK(status)) {
7703 return status;
7706 if (DEBUGLEVEL >= 10) {
7707 NDR_PRINT_OUT_DEBUG(lsa_QueryInfoPolicy2, &r);
7710 if (NT_STATUS_IS_ERR(status)) {
7711 return status;
7714 /* Return variables */
7715 *info = *r.out.info;
7717 /* Return result */
7718 return r.out.result;
7721 struct rpccli_lsa_SetInfoPolicy2_state {
7722 struct lsa_SetInfoPolicy2 orig;
7723 struct lsa_SetInfoPolicy2 tmp;
7724 TALLOC_CTX *out_mem_ctx;
7725 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7728 static void rpccli_lsa_SetInfoPolicy2_done(struct tevent_req *subreq);
7730 struct tevent_req *rpccli_lsa_SetInfoPolicy2_send(TALLOC_CTX *mem_ctx,
7731 struct tevent_context *ev,
7732 struct rpc_pipe_client *cli,
7733 struct policy_handle *_handle /* [in] [ref] */,
7734 enum lsa_PolicyInfo _level /* [in] */,
7735 union lsa_PolicyInformation *_info /* [in] [ref,switch_is(level)] */)
7737 struct tevent_req *req;
7738 struct rpccli_lsa_SetInfoPolicy2_state *state;
7739 struct tevent_req *subreq;
7741 req = tevent_req_create(mem_ctx, &state,
7742 struct rpccli_lsa_SetInfoPolicy2_state);
7743 if (req == NULL) {
7744 return NULL;
7746 state->out_mem_ctx = NULL;
7747 state->dispatch_recv = cli->dispatch_recv;
7749 /* In parameters */
7750 state->orig.in.handle = _handle;
7751 state->orig.in.level = _level;
7752 state->orig.in.info = _info;
7754 /* Out parameters */
7756 /* Result */
7757 ZERO_STRUCT(state->orig.out.result);
7759 if (DEBUGLEVEL >= 10) {
7760 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &state->orig);
7763 /* make a temporary copy, that we pass to the dispatch function */
7764 state->tmp = state->orig;
7766 subreq = cli->dispatch_send(state, ev, cli,
7767 &ndr_table_lsarpc,
7768 NDR_LSA_SETINFOPOLICY2,
7769 &state->tmp);
7770 if (tevent_req_nomem(subreq, req)) {
7771 return tevent_req_post(req, ev);
7773 tevent_req_set_callback(subreq, rpccli_lsa_SetInfoPolicy2_done, req);
7774 return req;
7777 static void rpccli_lsa_SetInfoPolicy2_done(struct tevent_req *subreq)
7779 struct tevent_req *req = tevent_req_callback_data(
7780 subreq, struct tevent_req);
7781 struct rpccli_lsa_SetInfoPolicy2_state *state = tevent_req_data(
7782 req, struct rpccli_lsa_SetInfoPolicy2_state);
7783 NTSTATUS status;
7784 TALLOC_CTX *mem_ctx;
7786 if (state->out_mem_ctx) {
7787 mem_ctx = state->out_mem_ctx;
7788 } else {
7789 mem_ctx = state;
7792 status = state->dispatch_recv(subreq, mem_ctx);
7793 TALLOC_FREE(subreq);
7794 if (!NT_STATUS_IS_OK(status)) {
7795 tevent_req_nterror(req, status);
7796 return;
7799 /* Copy out parameters */
7801 /* Copy result */
7802 state->orig.out.result = state->tmp.out.result;
7804 /* Reset temporary structure */
7805 ZERO_STRUCT(state->tmp);
7807 if (DEBUGLEVEL >= 10) {
7808 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &state->orig);
7811 tevent_req_done(req);
7814 NTSTATUS rpccli_lsa_SetInfoPolicy2_recv(struct tevent_req *req,
7815 TALLOC_CTX *mem_ctx,
7816 NTSTATUS *result)
7818 struct rpccli_lsa_SetInfoPolicy2_state *state = tevent_req_data(
7819 req, struct rpccli_lsa_SetInfoPolicy2_state);
7820 NTSTATUS status;
7822 if (tevent_req_is_nterror(req, &status)) {
7823 tevent_req_received(req);
7824 return status;
7827 /* Steal possbile out parameters to the callers context */
7828 talloc_steal(mem_ctx, state->out_mem_ctx);
7830 /* Return result */
7831 *result = state->orig.out.result;
7833 tevent_req_received(req);
7834 return NT_STATUS_OK;
7837 NTSTATUS rpccli_lsa_SetInfoPolicy2(struct rpc_pipe_client *cli,
7838 TALLOC_CTX *mem_ctx,
7839 struct policy_handle *handle /* [in] [ref] */,
7840 enum lsa_PolicyInfo level /* [in] */,
7841 union lsa_PolicyInformation *info /* [in] [ref,switch_is(level)] */)
7843 struct lsa_SetInfoPolicy2 r;
7844 NTSTATUS status;
7846 /* In parameters */
7847 r.in.handle = handle;
7848 r.in.level = level;
7849 r.in.info = info;
7851 if (DEBUGLEVEL >= 10) {
7852 NDR_PRINT_IN_DEBUG(lsa_SetInfoPolicy2, &r);
7855 status = cli->dispatch(cli,
7856 mem_ctx,
7857 &ndr_table_lsarpc,
7858 NDR_LSA_SETINFOPOLICY2,
7859 &r);
7861 if (!NT_STATUS_IS_OK(status)) {
7862 return status;
7865 if (DEBUGLEVEL >= 10) {
7866 NDR_PRINT_OUT_DEBUG(lsa_SetInfoPolicy2, &r);
7869 if (NT_STATUS_IS_ERR(status)) {
7870 return status;
7873 /* Return variables */
7875 /* Return result */
7876 return r.out.result;
7879 struct rpccli_lsa_QueryTrustedDomainInfoByName_state {
7880 struct lsa_QueryTrustedDomainInfoByName orig;
7881 struct lsa_QueryTrustedDomainInfoByName tmp;
7882 TALLOC_CTX *out_mem_ctx;
7883 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
7886 static void rpccli_lsa_QueryTrustedDomainInfoByName_done(struct tevent_req *subreq);
7888 struct tevent_req *rpccli_lsa_QueryTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
7889 struct tevent_context *ev,
7890 struct rpc_pipe_client *cli,
7891 struct policy_handle *_handle /* [in] [ref] */,
7892 struct lsa_String *_trusted_domain /* [in] [ref] */,
7893 enum lsa_TrustDomInfoEnum _level /* [in] */,
7894 union lsa_TrustedDomainInfo **_info /* [out] [ref,switch_is(level)] */)
7896 struct tevent_req *req;
7897 struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state;
7898 struct tevent_req *subreq;
7900 req = tevent_req_create(mem_ctx, &state,
7901 struct rpccli_lsa_QueryTrustedDomainInfoByName_state);
7902 if (req == NULL) {
7903 return NULL;
7905 state->out_mem_ctx = NULL;
7906 state->dispatch_recv = cli->dispatch_recv;
7908 /* In parameters */
7909 state->orig.in.handle = _handle;
7910 state->orig.in.trusted_domain = _trusted_domain;
7911 state->orig.in.level = _level;
7913 /* Out parameters */
7914 state->orig.out.info = _info;
7916 /* Result */
7917 ZERO_STRUCT(state->orig.out.result);
7919 if (DEBUGLEVEL >= 10) {
7920 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &state->orig);
7923 state->out_mem_ctx = talloc_named_const(state, 0,
7924 "rpccli_lsa_QueryTrustedDomainInfoByName_out_memory");
7925 if (tevent_req_nomem(state->out_mem_ctx, req)) {
7926 return tevent_req_post(req, ev);
7929 /* make a temporary copy, that we pass to the dispatch function */
7930 state->tmp = state->orig;
7932 subreq = cli->dispatch_send(state, ev, cli,
7933 &ndr_table_lsarpc,
7934 NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME,
7935 &state->tmp);
7936 if (tevent_req_nomem(subreq, req)) {
7937 return tevent_req_post(req, ev);
7939 tevent_req_set_callback(subreq, rpccli_lsa_QueryTrustedDomainInfoByName_done, req);
7940 return req;
7943 static void rpccli_lsa_QueryTrustedDomainInfoByName_done(struct tevent_req *subreq)
7945 struct tevent_req *req = tevent_req_callback_data(
7946 subreq, struct tevent_req);
7947 struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state = tevent_req_data(
7948 req, struct rpccli_lsa_QueryTrustedDomainInfoByName_state);
7949 NTSTATUS status;
7950 TALLOC_CTX *mem_ctx;
7952 if (state->out_mem_ctx) {
7953 mem_ctx = state->out_mem_ctx;
7954 } else {
7955 mem_ctx = state;
7958 status = state->dispatch_recv(subreq, mem_ctx);
7959 TALLOC_FREE(subreq);
7960 if (!NT_STATUS_IS_OK(status)) {
7961 tevent_req_nterror(req, status);
7962 return;
7965 /* Copy out parameters */
7966 *state->orig.out.info = *state->tmp.out.info;
7968 /* Copy result */
7969 state->orig.out.result = state->tmp.out.result;
7971 /* Reset temporary structure */
7972 ZERO_STRUCT(state->tmp);
7974 if (DEBUGLEVEL >= 10) {
7975 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &state->orig);
7978 tevent_req_done(req);
7981 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName_recv(struct tevent_req *req,
7982 TALLOC_CTX *mem_ctx,
7983 NTSTATUS *result)
7985 struct rpccli_lsa_QueryTrustedDomainInfoByName_state *state = tevent_req_data(
7986 req, struct rpccli_lsa_QueryTrustedDomainInfoByName_state);
7987 NTSTATUS status;
7989 if (tevent_req_is_nterror(req, &status)) {
7990 tevent_req_received(req);
7991 return status;
7994 /* Steal possbile out parameters to the callers context */
7995 talloc_steal(mem_ctx, state->out_mem_ctx);
7997 /* Return result */
7998 *result = state->orig.out.result;
8000 tevent_req_received(req);
8001 return NT_STATUS_OK;
8004 NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli,
8005 TALLOC_CTX *mem_ctx,
8006 struct policy_handle *handle /* [in] [ref] */,
8007 struct lsa_String *trusted_domain /* [in] [ref] */,
8008 enum lsa_TrustDomInfoEnum level /* [in] */,
8009 union lsa_TrustedDomainInfo **info /* [out] [ref,switch_is(level)] */)
8011 struct lsa_QueryTrustedDomainInfoByName r;
8012 NTSTATUS status;
8014 /* In parameters */
8015 r.in.handle = handle;
8016 r.in.trusted_domain = trusted_domain;
8017 r.in.level = level;
8019 if (DEBUGLEVEL >= 10) {
8020 NDR_PRINT_IN_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
8023 status = cli->dispatch(cli,
8024 mem_ctx,
8025 &ndr_table_lsarpc,
8026 NDR_LSA_QUERYTRUSTEDDOMAININFOBYNAME,
8027 &r);
8029 if (!NT_STATUS_IS_OK(status)) {
8030 return status;
8033 if (DEBUGLEVEL >= 10) {
8034 NDR_PRINT_OUT_DEBUG(lsa_QueryTrustedDomainInfoByName, &r);
8037 if (NT_STATUS_IS_ERR(status)) {
8038 return status;
8041 /* Return variables */
8042 *info = *r.out.info;
8044 /* Return result */
8045 return r.out.result;
8048 struct rpccli_lsa_SetTrustedDomainInfoByName_state {
8049 struct lsa_SetTrustedDomainInfoByName orig;
8050 struct lsa_SetTrustedDomainInfoByName tmp;
8051 TALLOC_CTX *out_mem_ctx;
8052 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8055 static void rpccli_lsa_SetTrustedDomainInfoByName_done(struct tevent_req *subreq);
8057 struct tevent_req *rpccli_lsa_SetTrustedDomainInfoByName_send(TALLOC_CTX *mem_ctx,
8058 struct tevent_context *ev,
8059 struct rpc_pipe_client *cli,
8060 struct policy_handle *_handle /* [in] [ref] */,
8061 struct lsa_String _trusted_domain /* [in] */,
8062 enum lsa_TrustDomInfoEnum _level /* [in] */,
8063 union lsa_TrustedDomainInfo *_info /* [in] [unique,switch_is(level)] */)
8065 struct tevent_req *req;
8066 struct rpccli_lsa_SetTrustedDomainInfoByName_state *state;
8067 struct tevent_req *subreq;
8069 req = tevent_req_create(mem_ctx, &state,
8070 struct rpccli_lsa_SetTrustedDomainInfoByName_state);
8071 if (req == NULL) {
8072 return NULL;
8074 state->out_mem_ctx = NULL;
8075 state->dispatch_recv = cli->dispatch_recv;
8077 /* In parameters */
8078 state->orig.in.handle = _handle;
8079 state->orig.in.trusted_domain = _trusted_domain;
8080 state->orig.in.level = _level;
8081 state->orig.in.info = _info;
8083 /* Out parameters */
8085 /* Result */
8086 ZERO_STRUCT(state->orig.out.result);
8088 if (DEBUGLEVEL >= 10) {
8089 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &state->orig);
8092 /* make a temporary copy, that we pass to the dispatch function */
8093 state->tmp = state->orig;
8095 subreq = cli->dispatch_send(state, ev, cli,
8096 &ndr_table_lsarpc,
8097 NDR_LSA_SETTRUSTEDDOMAININFOBYNAME,
8098 &state->tmp);
8099 if (tevent_req_nomem(subreq, req)) {
8100 return tevent_req_post(req, ev);
8102 tevent_req_set_callback(subreq, rpccli_lsa_SetTrustedDomainInfoByName_done, req);
8103 return req;
8106 static void rpccli_lsa_SetTrustedDomainInfoByName_done(struct tevent_req *subreq)
8108 struct tevent_req *req = tevent_req_callback_data(
8109 subreq, struct tevent_req);
8110 struct rpccli_lsa_SetTrustedDomainInfoByName_state *state = tevent_req_data(
8111 req, struct rpccli_lsa_SetTrustedDomainInfoByName_state);
8112 NTSTATUS status;
8113 TALLOC_CTX *mem_ctx;
8115 if (state->out_mem_ctx) {
8116 mem_ctx = state->out_mem_ctx;
8117 } else {
8118 mem_ctx = state;
8121 status = state->dispatch_recv(subreq, mem_ctx);
8122 TALLOC_FREE(subreq);
8123 if (!NT_STATUS_IS_OK(status)) {
8124 tevent_req_nterror(req, status);
8125 return;
8128 /* Copy out parameters */
8130 /* Copy result */
8131 state->orig.out.result = state->tmp.out.result;
8133 /* Reset temporary structure */
8134 ZERO_STRUCT(state->tmp);
8136 if (DEBUGLEVEL >= 10) {
8137 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &state->orig);
8140 tevent_req_done(req);
8143 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName_recv(struct tevent_req *req,
8144 TALLOC_CTX *mem_ctx,
8145 NTSTATUS *result)
8147 struct rpccli_lsa_SetTrustedDomainInfoByName_state *state = tevent_req_data(
8148 req, struct rpccli_lsa_SetTrustedDomainInfoByName_state);
8149 NTSTATUS status;
8151 if (tevent_req_is_nterror(req, &status)) {
8152 tevent_req_received(req);
8153 return status;
8156 /* Steal possbile out parameters to the callers context */
8157 talloc_steal(mem_ctx, state->out_mem_ctx);
8159 /* Return result */
8160 *result = state->orig.out.result;
8162 tevent_req_received(req);
8163 return NT_STATUS_OK;
8166 NTSTATUS rpccli_lsa_SetTrustedDomainInfoByName(struct rpc_pipe_client *cli,
8167 TALLOC_CTX *mem_ctx,
8168 struct policy_handle *handle /* [in] [ref] */,
8169 struct lsa_String trusted_domain /* [in] */,
8170 enum lsa_TrustDomInfoEnum level /* [in] */,
8171 union lsa_TrustedDomainInfo *info /* [in] [unique,switch_is(level)] */)
8173 struct lsa_SetTrustedDomainInfoByName r;
8174 NTSTATUS status;
8176 /* In parameters */
8177 r.in.handle = handle;
8178 r.in.trusted_domain = trusted_domain;
8179 r.in.level = level;
8180 r.in.info = info;
8182 if (DEBUGLEVEL >= 10) {
8183 NDR_PRINT_IN_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
8186 status = cli->dispatch(cli,
8187 mem_ctx,
8188 &ndr_table_lsarpc,
8189 NDR_LSA_SETTRUSTEDDOMAININFOBYNAME,
8190 &r);
8192 if (!NT_STATUS_IS_OK(status)) {
8193 return status;
8196 if (DEBUGLEVEL >= 10) {
8197 NDR_PRINT_OUT_DEBUG(lsa_SetTrustedDomainInfoByName, &r);
8200 if (NT_STATUS_IS_ERR(status)) {
8201 return status;
8204 /* Return variables */
8206 /* Return result */
8207 return r.out.result;
8210 struct rpccli_lsa_EnumTrustedDomainsEx_state {
8211 struct lsa_EnumTrustedDomainsEx orig;
8212 struct lsa_EnumTrustedDomainsEx tmp;
8213 TALLOC_CTX *out_mem_ctx;
8214 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8217 static void rpccli_lsa_EnumTrustedDomainsEx_done(struct tevent_req *subreq);
8219 struct tevent_req *rpccli_lsa_EnumTrustedDomainsEx_send(TALLOC_CTX *mem_ctx,
8220 struct tevent_context *ev,
8221 struct rpc_pipe_client *cli,
8222 struct policy_handle *_handle /* [in] [ref] */,
8223 uint32_t *_resume_handle /* [in,out] [ref] */,
8224 struct lsa_DomainListEx *_domains /* [out] [ref] */,
8225 uint32_t _max_size /* [in] */)
8227 struct tevent_req *req;
8228 struct rpccli_lsa_EnumTrustedDomainsEx_state *state;
8229 struct tevent_req *subreq;
8231 req = tevent_req_create(mem_ctx, &state,
8232 struct rpccli_lsa_EnumTrustedDomainsEx_state);
8233 if (req == NULL) {
8234 return NULL;
8236 state->out_mem_ctx = NULL;
8237 state->dispatch_recv = cli->dispatch_recv;
8239 /* In parameters */
8240 state->orig.in.handle = _handle;
8241 state->orig.in.resume_handle = _resume_handle;
8242 state->orig.in.max_size = _max_size;
8244 /* Out parameters */
8245 state->orig.out.resume_handle = _resume_handle;
8246 state->orig.out.domains = _domains;
8248 /* Result */
8249 ZERO_STRUCT(state->orig.out.result);
8251 if (DEBUGLEVEL >= 10) {
8252 NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &state->orig);
8255 state->out_mem_ctx = talloc_named_const(state, 0,
8256 "rpccli_lsa_EnumTrustedDomainsEx_out_memory");
8257 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8258 return tevent_req_post(req, ev);
8261 /* make a temporary copy, that we pass to the dispatch function */
8262 state->tmp = state->orig;
8264 subreq = cli->dispatch_send(state, ev, cli,
8265 &ndr_table_lsarpc,
8266 NDR_LSA_ENUMTRUSTEDDOMAINSEX,
8267 &state->tmp);
8268 if (tevent_req_nomem(subreq, req)) {
8269 return tevent_req_post(req, ev);
8271 tevent_req_set_callback(subreq, rpccli_lsa_EnumTrustedDomainsEx_done, req);
8272 return req;
8275 static void rpccli_lsa_EnumTrustedDomainsEx_done(struct tevent_req *subreq)
8277 struct tevent_req *req = tevent_req_callback_data(
8278 subreq, struct tevent_req);
8279 struct rpccli_lsa_EnumTrustedDomainsEx_state *state = tevent_req_data(
8280 req, struct rpccli_lsa_EnumTrustedDomainsEx_state);
8281 NTSTATUS status;
8282 TALLOC_CTX *mem_ctx;
8284 if (state->out_mem_ctx) {
8285 mem_ctx = state->out_mem_ctx;
8286 } else {
8287 mem_ctx = state;
8290 status = state->dispatch_recv(subreq, mem_ctx);
8291 TALLOC_FREE(subreq);
8292 if (!NT_STATUS_IS_OK(status)) {
8293 tevent_req_nterror(req, status);
8294 return;
8297 /* Copy out parameters */
8298 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
8299 *state->orig.out.domains = *state->tmp.out.domains;
8301 /* Copy result */
8302 state->orig.out.result = state->tmp.out.result;
8304 /* Reset temporary structure */
8305 ZERO_STRUCT(state->tmp);
8307 if (DEBUGLEVEL >= 10) {
8308 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &state->orig);
8311 tevent_req_done(req);
8314 NTSTATUS rpccli_lsa_EnumTrustedDomainsEx_recv(struct tevent_req *req,
8315 TALLOC_CTX *mem_ctx,
8316 NTSTATUS *result)
8318 struct rpccli_lsa_EnumTrustedDomainsEx_state *state = tevent_req_data(
8319 req, struct rpccli_lsa_EnumTrustedDomainsEx_state);
8320 NTSTATUS status;
8322 if (tevent_req_is_nterror(req, &status)) {
8323 tevent_req_received(req);
8324 return status;
8327 /* Steal possbile out parameters to the callers context */
8328 talloc_steal(mem_ctx, state->out_mem_ctx);
8330 /* Return result */
8331 *result = state->orig.out.result;
8333 tevent_req_received(req);
8334 return NT_STATUS_OK;
8337 NTSTATUS rpccli_lsa_EnumTrustedDomainsEx(struct rpc_pipe_client *cli,
8338 TALLOC_CTX *mem_ctx,
8339 struct policy_handle *handle /* [in] [ref] */,
8340 uint32_t *resume_handle /* [in,out] [ref] */,
8341 struct lsa_DomainListEx *domains /* [out] [ref] */,
8342 uint32_t max_size /* [in] */)
8344 struct lsa_EnumTrustedDomainsEx r;
8345 NTSTATUS status;
8347 /* In parameters */
8348 r.in.handle = handle;
8349 r.in.resume_handle = resume_handle;
8350 r.in.max_size = max_size;
8352 if (DEBUGLEVEL >= 10) {
8353 NDR_PRINT_IN_DEBUG(lsa_EnumTrustedDomainsEx, &r);
8356 status = cli->dispatch(cli,
8357 mem_ctx,
8358 &ndr_table_lsarpc,
8359 NDR_LSA_ENUMTRUSTEDDOMAINSEX,
8360 &r);
8362 if (!NT_STATUS_IS_OK(status)) {
8363 return status;
8366 if (DEBUGLEVEL >= 10) {
8367 NDR_PRINT_OUT_DEBUG(lsa_EnumTrustedDomainsEx, &r);
8370 if (NT_STATUS_IS_ERR(status)) {
8371 return status;
8374 /* Return variables */
8375 *resume_handle = *r.out.resume_handle;
8376 *domains = *r.out.domains;
8378 /* Return result */
8379 return r.out.result;
8382 struct rpccli_lsa_CreateTrustedDomainEx_state {
8383 struct lsa_CreateTrustedDomainEx orig;
8384 struct lsa_CreateTrustedDomainEx tmp;
8385 TALLOC_CTX *out_mem_ctx;
8386 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8389 static void rpccli_lsa_CreateTrustedDomainEx_done(struct tevent_req *subreq);
8391 struct tevent_req *rpccli_lsa_CreateTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
8392 struct tevent_context *ev,
8393 struct rpc_pipe_client *cli,
8394 struct policy_handle *_policy_handle /* [in] [ref] */,
8395 struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
8396 struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
8397 uint32_t _access_mask /* [in] */,
8398 struct policy_handle *_trustdom_handle /* [out] [ref] */)
8400 struct tevent_req *req;
8401 struct rpccli_lsa_CreateTrustedDomainEx_state *state;
8402 struct tevent_req *subreq;
8404 req = tevent_req_create(mem_ctx, &state,
8405 struct rpccli_lsa_CreateTrustedDomainEx_state);
8406 if (req == NULL) {
8407 return NULL;
8409 state->out_mem_ctx = NULL;
8410 state->dispatch_recv = cli->dispatch_recv;
8412 /* In parameters */
8413 state->orig.in.policy_handle = _policy_handle;
8414 state->orig.in.info = _info;
8415 state->orig.in.auth_info = _auth_info;
8416 state->orig.in.access_mask = _access_mask;
8418 /* Out parameters */
8419 state->orig.out.trustdom_handle = _trustdom_handle;
8421 /* Result */
8422 ZERO_STRUCT(state->orig.out.result);
8424 if (DEBUGLEVEL >= 10) {
8425 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &state->orig);
8428 state->out_mem_ctx = talloc_named_const(state, 0,
8429 "rpccli_lsa_CreateTrustedDomainEx_out_memory");
8430 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8431 return tevent_req_post(req, ev);
8434 /* make a temporary copy, that we pass to the dispatch function */
8435 state->tmp = state->orig;
8437 subreq = cli->dispatch_send(state, ev, cli,
8438 &ndr_table_lsarpc,
8439 NDR_LSA_CREATETRUSTEDDOMAINEX,
8440 &state->tmp);
8441 if (tevent_req_nomem(subreq, req)) {
8442 return tevent_req_post(req, ev);
8444 tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomainEx_done, req);
8445 return req;
8448 static void rpccli_lsa_CreateTrustedDomainEx_done(struct tevent_req *subreq)
8450 struct tevent_req *req = tevent_req_callback_data(
8451 subreq, struct tevent_req);
8452 struct rpccli_lsa_CreateTrustedDomainEx_state *state = tevent_req_data(
8453 req, struct rpccli_lsa_CreateTrustedDomainEx_state);
8454 NTSTATUS status;
8455 TALLOC_CTX *mem_ctx;
8457 if (state->out_mem_ctx) {
8458 mem_ctx = state->out_mem_ctx;
8459 } else {
8460 mem_ctx = state;
8463 status = state->dispatch_recv(subreq, mem_ctx);
8464 TALLOC_FREE(subreq);
8465 if (!NT_STATUS_IS_OK(status)) {
8466 tevent_req_nterror(req, status);
8467 return;
8470 /* Copy out parameters */
8471 *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
8473 /* Copy result */
8474 state->orig.out.result = state->tmp.out.result;
8476 /* Reset temporary structure */
8477 ZERO_STRUCT(state->tmp);
8479 if (DEBUGLEVEL >= 10) {
8480 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &state->orig);
8483 tevent_req_done(req);
8486 NTSTATUS rpccli_lsa_CreateTrustedDomainEx_recv(struct tevent_req *req,
8487 TALLOC_CTX *mem_ctx,
8488 NTSTATUS *result)
8490 struct rpccli_lsa_CreateTrustedDomainEx_state *state = tevent_req_data(
8491 req, struct rpccli_lsa_CreateTrustedDomainEx_state);
8492 NTSTATUS status;
8494 if (tevent_req_is_nterror(req, &status)) {
8495 tevent_req_received(req);
8496 return status;
8499 /* Steal possbile out parameters to the callers context */
8500 talloc_steal(mem_ctx, state->out_mem_ctx);
8502 /* Return result */
8503 *result = state->orig.out.result;
8505 tevent_req_received(req);
8506 return NT_STATUS_OK;
8509 NTSTATUS rpccli_lsa_CreateTrustedDomainEx(struct rpc_pipe_client *cli,
8510 TALLOC_CTX *mem_ctx,
8511 struct policy_handle *policy_handle /* [in] [ref] */,
8512 struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
8513 struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
8514 uint32_t access_mask /* [in] */,
8515 struct policy_handle *trustdom_handle /* [out] [ref] */)
8517 struct lsa_CreateTrustedDomainEx r;
8518 NTSTATUS status;
8520 /* In parameters */
8521 r.in.policy_handle = policy_handle;
8522 r.in.info = info;
8523 r.in.auth_info = auth_info;
8524 r.in.access_mask = access_mask;
8526 if (DEBUGLEVEL >= 10) {
8527 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx, &r);
8530 status = cli->dispatch(cli,
8531 mem_ctx,
8532 &ndr_table_lsarpc,
8533 NDR_LSA_CREATETRUSTEDDOMAINEX,
8534 &r);
8536 if (!NT_STATUS_IS_OK(status)) {
8537 return status;
8540 if (DEBUGLEVEL >= 10) {
8541 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx, &r);
8544 if (NT_STATUS_IS_ERR(status)) {
8545 return status;
8548 /* Return variables */
8549 *trustdom_handle = *r.out.trustdom_handle;
8551 /* Return result */
8552 return r.out.result;
8555 struct rpccli_lsa_CloseTrustedDomainEx_state {
8556 struct lsa_CloseTrustedDomainEx orig;
8557 struct lsa_CloseTrustedDomainEx tmp;
8558 TALLOC_CTX *out_mem_ctx;
8559 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8562 static void rpccli_lsa_CloseTrustedDomainEx_done(struct tevent_req *subreq);
8564 struct tevent_req *rpccli_lsa_CloseTrustedDomainEx_send(TALLOC_CTX *mem_ctx,
8565 struct tevent_context *ev,
8566 struct rpc_pipe_client *cli,
8567 struct policy_handle *_handle /* [in,out] [ref] */)
8569 struct tevent_req *req;
8570 struct rpccli_lsa_CloseTrustedDomainEx_state *state;
8571 struct tevent_req *subreq;
8573 req = tevent_req_create(mem_ctx, &state,
8574 struct rpccli_lsa_CloseTrustedDomainEx_state);
8575 if (req == NULL) {
8576 return NULL;
8578 state->out_mem_ctx = NULL;
8579 state->dispatch_recv = cli->dispatch_recv;
8581 /* In parameters */
8582 state->orig.in.handle = _handle;
8584 /* Out parameters */
8585 state->orig.out.handle = _handle;
8587 /* Result */
8588 ZERO_STRUCT(state->orig.out.result);
8590 if (DEBUGLEVEL >= 10) {
8591 NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &state->orig);
8594 state->out_mem_ctx = talloc_named_const(state, 0,
8595 "rpccli_lsa_CloseTrustedDomainEx_out_memory");
8596 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8597 return tevent_req_post(req, ev);
8600 /* make a temporary copy, that we pass to the dispatch function */
8601 state->tmp = state->orig;
8603 subreq = cli->dispatch_send(state, ev, cli,
8604 &ndr_table_lsarpc,
8605 NDR_LSA_CLOSETRUSTEDDOMAINEX,
8606 &state->tmp);
8607 if (tevent_req_nomem(subreq, req)) {
8608 return tevent_req_post(req, ev);
8610 tevent_req_set_callback(subreq, rpccli_lsa_CloseTrustedDomainEx_done, req);
8611 return req;
8614 static void rpccli_lsa_CloseTrustedDomainEx_done(struct tevent_req *subreq)
8616 struct tevent_req *req = tevent_req_callback_data(
8617 subreq, struct tevent_req);
8618 struct rpccli_lsa_CloseTrustedDomainEx_state *state = tevent_req_data(
8619 req, struct rpccli_lsa_CloseTrustedDomainEx_state);
8620 NTSTATUS status;
8621 TALLOC_CTX *mem_ctx;
8623 if (state->out_mem_ctx) {
8624 mem_ctx = state->out_mem_ctx;
8625 } else {
8626 mem_ctx = state;
8629 status = state->dispatch_recv(subreq, mem_ctx);
8630 TALLOC_FREE(subreq);
8631 if (!NT_STATUS_IS_OK(status)) {
8632 tevent_req_nterror(req, status);
8633 return;
8636 /* Copy out parameters */
8637 *state->orig.out.handle = *state->tmp.out.handle;
8639 /* Copy result */
8640 state->orig.out.result = state->tmp.out.result;
8642 /* Reset temporary structure */
8643 ZERO_STRUCT(state->tmp);
8645 if (DEBUGLEVEL >= 10) {
8646 NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &state->orig);
8649 tevent_req_done(req);
8652 NTSTATUS rpccli_lsa_CloseTrustedDomainEx_recv(struct tevent_req *req,
8653 TALLOC_CTX *mem_ctx,
8654 NTSTATUS *result)
8656 struct rpccli_lsa_CloseTrustedDomainEx_state *state = tevent_req_data(
8657 req, struct rpccli_lsa_CloseTrustedDomainEx_state);
8658 NTSTATUS status;
8660 if (tevent_req_is_nterror(req, &status)) {
8661 tevent_req_received(req);
8662 return status;
8665 /* Steal possbile out parameters to the callers context */
8666 talloc_steal(mem_ctx, state->out_mem_ctx);
8668 /* Return result */
8669 *result = state->orig.out.result;
8671 tevent_req_received(req);
8672 return NT_STATUS_OK;
8675 NTSTATUS rpccli_lsa_CloseTrustedDomainEx(struct rpc_pipe_client *cli,
8676 TALLOC_CTX *mem_ctx,
8677 struct policy_handle *handle /* [in,out] [ref] */)
8679 struct lsa_CloseTrustedDomainEx r;
8680 NTSTATUS status;
8682 /* In parameters */
8683 r.in.handle = handle;
8685 if (DEBUGLEVEL >= 10) {
8686 NDR_PRINT_IN_DEBUG(lsa_CloseTrustedDomainEx, &r);
8689 status = cli->dispatch(cli,
8690 mem_ctx,
8691 &ndr_table_lsarpc,
8692 NDR_LSA_CLOSETRUSTEDDOMAINEX,
8693 &r);
8695 if (!NT_STATUS_IS_OK(status)) {
8696 return status;
8699 if (DEBUGLEVEL >= 10) {
8700 NDR_PRINT_OUT_DEBUG(lsa_CloseTrustedDomainEx, &r);
8703 if (NT_STATUS_IS_ERR(status)) {
8704 return status;
8707 /* Return variables */
8708 *handle = *r.out.handle;
8710 /* Return result */
8711 return r.out.result;
8714 struct rpccli_lsa_QueryDomainInformationPolicy_state {
8715 struct lsa_QueryDomainInformationPolicy orig;
8716 struct lsa_QueryDomainInformationPolicy tmp;
8717 TALLOC_CTX *out_mem_ctx;
8718 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8721 static void rpccli_lsa_QueryDomainInformationPolicy_done(struct tevent_req *subreq);
8723 struct tevent_req *rpccli_lsa_QueryDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
8724 struct tevent_context *ev,
8725 struct rpc_pipe_client *cli,
8726 struct policy_handle *_handle /* [in] [ref] */,
8727 uint16_t _level /* [in] */,
8728 union lsa_DomainInformationPolicy **_info /* [out] [ref,switch_is(level)] */)
8730 struct tevent_req *req;
8731 struct rpccli_lsa_QueryDomainInformationPolicy_state *state;
8732 struct tevent_req *subreq;
8734 req = tevent_req_create(mem_ctx, &state,
8735 struct rpccli_lsa_QueryDomainInformationPolicy_state);
8736 if (req == NULL) {
8737 return NULL;
8739 state->out_mem_ctx = NULL;
8740 state->dispatch_recv = cli->dispatch_recv;
8742 /* In parameters */
8743 state->orig.in.handle = _handle;
8744 state->orig.in.level = _level;
8746 /* Out parameters */
8747 state->orig.out.info = _info;
8749 /* Result */
8750 ZERO_STRUCT(state->orig.out.result);
8752 if (DEBUGLEVEL >= 10) {
8753 NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &state->orig);
8756 state->out_mem_ctx = talloc_named_const(state, 0,
8757 "rpccli_lsa_QueryDomainInformationPolicy_out_memory");
8758 if (tevent_req_nomem(state->out_mem_ctx, req)) {
8759 return tevent_req_post(req, ev);
8762 /* make a temporary copy, that we pass to the dispatch function */
8763 state->tmp = state->orig;
8765 subreq = cli->dispatch_send(state, ev, cli,
8766 &ndr_table_lsarpc,
8767 NDR_LSA_QUERYDOMAININFORMATIONPOLICY,
8768 &state->tmp);
8769 if (tevent_req_nomem(subreq, req)) {
8770 return tevent_req_post(req, ev);
8772 tevent_req_set_callback(subreq, rpccli_lsa_QueryDomainInformationPolicy_done, req);
8773 return req;
8776 static void rpccli_lsa_QueryDomainInformationPolicy_done(struct tevent_req *subreq)
8778 struct tevent_req *req = tevent_req_callback_data(
8779 subreq, struct tevent_req);
8780 struct rpccli_lsa_QueryDomainInformationPolicy_state *state = tevent_req_data(
8781 req, struct rpccli_lsa_QueryDomainInformationPolicy_state);
8782 NTSTATUS status;
8783 TALLOC_CTX *mem_ctx;
8785 if (state->out_mem_ctx) {
8786 mem_ctx = state->out_mem_ctx;
8787 } else {
8788 mem_ctx = state;
8791 status = state->dispatch_recv(subreq, mem_ctx);
8792 TALLOC_FREE(subreq);
8793 if (!NT_STATUS_IS_OK(status)) {
8794 tevent_req_nterror(req, status);
8795 return;
8798 /* Copy out parameters */
8799 *state->orig.out.info = *state->tmp.out.info;
8801 /* Copy result */
8802 state->orig.out.result = state->tmp.out.result;
8804 /* Reset temporary structure */
8805 ZERO_STRUCT(state->tmp);
8807 if (DEBUGLEVEL >= 10) {
8808 NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &state->orig);
8811 tevent_req_done(req);
8814 NTSTATUS rpccli_lsa_QueryDomainInformationPolicy_recv(struct tevent_req *req,
8815 TALLOC_CTX *mem_ctx,
8816 NTSTATUS *result)
8818 struct rpccli_lsa_QueryDomainInformationPolicy_state *state = tevent_req_data(
8819 req, struct rpccli_lsa_QueryDomainInformationPolicy_state);
8820 NTSTATUS status;
8822 if (tevent_req_is_nterror(req, &status)) {
8823 tevent_req_received(req);
8824 return status;
8827 /* Steal possbile out parameters to the callers context */
8828 talloc_steal(mem_ctx, state->out_mem_ctx);
8830 /* Return result */
8831 *result = state->orig.out.result;
8833 tevent_req_received(req);
8834 return NT_STATUS_OK;
8837 NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli,
8838 TALLOC_CTX *mem_ctx,
8839 struct policy_handle *handle /* [in] [ref] */,
8840 uint16_t level /* [in] */,
8841 union lsa_DomainInformationPolicy **info /* [out] [ref,switch_is(level)] */)
8843 struct lsa_QueryDomainInformationPolicy r;
8844 NTSTATUS status;
8846 /* In parameters */
8847 r.in.handle = handle;
8848 r.in.level = level;
8850 if (DEBUGLEVEL >= 10) {
8851 NDR_PRINT_IN_DEBUG(lsa_QueryDomainInformationPolicy, &r);
8854 status = cli->dispatch(cli,
8855 mem_ctx,
8856 &ndr_table_lsarpc,
8857 NDR_LSA_QUERYDOMAININFORMATIONPOLICY,
8858 &r);
8860 if (!NT_STATUS_IS_OK(status)) {
8861 return status;
8864 if (DEBUGLEVEL >= 10) {
8865 NDR_PRINT_OUT_DEBUG(lsa_QueryDomainInformationPolicy, &r);
8868 if (NT_STATUS_IS_ERR(status)) {
8869 return status;
8872 /* Return variables */
8873 *info = *r.out.info;
8875 /* Return result */
8876 return r.out.result;
8879 struct rpccli_lsa_SetDomainInformationPolicy_state {
8880 struct lsa_SetDomainInformationPolicy orig;
8881 struct lsa_SetDomainInformationPolicy tmp;
8882 TALLOC_CTX *out_mem_ctx;
8883 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
8886 static void rpccli_lsa_SetDomainInformationPolicy_done(struct tevent_req *subreq);
8888 struct tevent_req *rpccli_lsa_SetDomainInformationPolicy_send(TALLOC_CTX *mem_ctx,
8889 struct tevent_context *ev,
8890 struct rpc_pipe_client *cli,
8891 struct policy_handle *_handle /* [in] [ref] */,
8892 uint16_t _level /* [in] */,
8893 union lsa_DomainInformationPolicy *_info /* [in] [unique,switch_is(level)] */)
8895 struct tevent_req *req;
8896 struct rpccli_lsa_SetDomainInformationPolicy_state *state;
8897 struct tevent_req *subreq;
8899 req = tevent_req_create(mem_ctx, &state,
8900 struct rpccli_lsa_SetDomainInformationPolicy_state);
8901 if (req == NULL) {
8902 return NULL;
8904 state->out_mem_ctx = NULL;
8905 state->dispatch_recv = cli->dispatch_recv;
8907 /* In parameters */
8908 state->orig.in.handle = _handle;
8909 state->orig.in.level = _level;
8910 state->orig.in.info = _info;
8912 /* Out parameters */
8914 /* Result */
8915 ZERO_STRUCT(state->orig.out.result);
8917 if (DEBUGLEVEL >= 10) {
8918 NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &state->orig);
8921 /* make a temporary copy, that we pass to the dispatch function */
8922 state->tmp = state->orig;
8924 subreq = cli->dispatch_send(state, ev, cli,
8925 &ndr_table_lsarpc,
8926 NDR_LSA_SETDOMAININFORMATIONPOLICY,
8927 &state->tmp);
8928 if (tevent_req_nomem(subreq, req)) {
8929 return tevent_req_post(req, ev);
8931 tevent_req_set_callback(subreq, rpccli_lsa_SetDomainInformationPolicy_done, req);
8932 return req;
8935 static void rpccli_lsa_SetDomainInformationPolicy_done(struct tevent_req *subreq)
8937 struct tevent_req *req = tevent_req_callback_data(
8938 subreq, struct tevent_req);
8939 struct rpccli_lsa_SetDomainInformationPolicy_state *state = tevent_req_data(
8940 req, struct rpccli_lsa_SetDomainInformationPolicy_state);
8941 NTSTATUS status;
8942 TALLOC_CTX *mem_ctx;
8944 if (state->out_mem_ctx) {
8945 mem_ctx = state->out_mem_ctx;
8946 } else {
8947 mem_ctx = state;
8950 status = state->dispatch_recv(subreq, mem_ctx);
8951 TALLOC_FREE(subreq);
8952 if (!NT_STATUS_IS_OK(status)) {
8953 tevent_req_nterror(req, status);
8954 return;
8957 /* Copy out parameters */
8959 /* Copy result */
8960 state->orig.out.result = state->tmp.out.result;
8962 /* Reset temporary structure */
8963 ZERO_STRUCT(state->tmp);
8965 if (DEBUGLEVEL >= 10) {
8966 NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &state->orig);
8969 tevent_req_done(req);
8972 NTSTATUS rpccli_lsa_SetDomainInformationPolicy_recv(struct tevent_req *req,
8973 TALLOC_CTX *mem_ctx,
8974 NTSTATUS *result)
8976 struct rpccli_lsa_SetDomainInformationPolicy_state *state = tevent_req_data(
8977 req, struct rpccli_lsa_SetDomainInformationPolicy_state);
8978 NTSTATUS status;
8980 if (tevent_req_is_nterror(req, &status)) {
8981 tevent_req_received(req);
8982 return status;
8985 /* Steal possbile out parameters to the callers context */
8986 talloc_steal(mem_ctx, state->out_mem_ctx);
8988 /* Return result */
8989 *result = state->orig.out.result;
8991 tevent_req_received(req);
8992 return NT_STATUS_OK;
8995 NTSTATUS rpccli_lsa_SetDomainInformationPolicy(struct rpc_pipe_client *cli,
8996 TALLOC_CTX *mem_ctx,
8997 struct policy_handle *handle /* [in] [ref] */,
8998 uint16_t level /* [in] */,
8999 union lsa_DomainInformationPolicy *info /* [in] [unique,switch_is(level)] */)
9001 struct lsa_SetDomainInformationPolicy r;
9002 NTSTATUS status;
9004 /* In parameters */
9005 r.in.handle = handle;
9006 r.in.level = level;
9007 r.in.info = info;
9009 if (DEBUGLEVEL >= 10) {
9010 NDR_PRINT_IN_DEBUG(lsa_SetDomainInformationPolicy, &r);
9013 status = cli->dispatch(cli,
9014 mem_ctx,
9015 &ndr_table_lsarpc,
9016 NDR_LSA_SETDOMAININFORMATIONPOLICY,
9017 &r);
9019 if (!NT_STATUS_IS_OK(status)) {
9020 return status;
9023 if (DEBUGLEVEL >= 10) {
9024 NDR_PRINT_OUT_DEBUG(lsa_SetDomainInformationPolicy, &r);
9027 if (NT_STATUS_IS_ERR(status)) {
9028 return status;
9031 /* Return variables */
9033 /* Return result */
9034 return r.out.result;
9037 struct rpccli_lsa_OpenTrustedDomainByName_state {
9038 struct lsa_OpenTrustedDomainByName orig;
9039 struct lsa_OpenTrustedDomainByName tmp;
9040 TALLOC_CTX *out_mem_ctx;
9041 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9044 static void rpccli_lsa_OpenTrustedDomainByName_done(struct tevent_req *subreq);
9046 struct tevent_req *rpccli_lsa_OpenTrustedDomainByName_send(TALLOC_CTX *mem_ctx,
9047 struct tevent_context *ev,
9048 struct rpc_pipe_client *cli,
9049 struct policy_handle *_handle /* [in] [ref] */,
9050 struct lsa_String _name /* [in] */,
9051 uint32_t _access_mask /* [in] */,
9052 struct policy_handle *_trustdom_handle /* [out] [ref] */)
9054 struct tevent_req *req;
9055 struct rpccli_lsa_OpenTrustedDomainByName_state *state;
9056 struct tevent_req *subreq;
9058 req = tevent_req_create(mem_ctx, &state,
9059 struct rpccli_lsa_OpenTrustedDomainByName_state);
9060 if (req == NULL) {
9061 return NULL;
9063 state->out_mem_ctx = NULL;
9064 state->dispatch_recv = cli->dispatch_recv;
9066 /* In parameters */
9067 state->orig.in.handle = _handle;
9068 state->orig.in.name = _name;
9069 state->orig.in.access_mask = _access_mask;
9071 /* Out parameters */
9072 state->orig.out.trustdom_handle = _trustdom_handle;
9074 /* Result */
9075 ZERO_STRUCT(state->orig.out.result);
9077 if (DEBUGLEVEL >= 10) {
9078 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &state->orig);
9081 state->out_mem_ctx = talloc_named_const(state, 0,
9082 "rpccli_lsa_OpenTrustedDomainByName_out_memory");
9083 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9084 return tevent_req_post(req, ev);
9087 /* make a temporary copy, that we pass to the dispatch function */
9088 state->tmp = state->orig;
9090 subreq = cli->dispatch_send(state, ev, cli,
9091 &ndr_table_lsarpc,
9092 NDR_LSA_OPENTRUSTEDDOMAINBYNAME,
9093 &state->tmp);
9094 if (tevent_req_nomem(subreq, req)) {
9095 return tevent_req_post(req, ev);
9097 tevent_req_set_callback(subreq, rpccli_lsa_OpenTrustedDomainByName_done, req);
9098 return req;
9101 static void rpccli_lsa_OpenTrustedDomainByName_done(struct tevent_req *subreq)
9103 struct tevent_req *req = tevent_req_callback_data(
9104 subreq, struct tevent_req);
9105 struct rpccli_lsa_OpenTrustedDomainByName_state *state = tevent_req_data(
9106 req, struct rpccli_lsa_OpenTrustedDomainByName_state);
9107 NTSTATUS status;
9108 TALLOC_CTX *mem_ctx;
9110 if (state->out_mem_ctx) {
9111 mem_ctx = state->out_mem_ctx;
9112 } else {
9113 mem_ctx = state;
9116 status = state->dispatch_recv(subreq, mem_ctx);
9117 TALLOC_FREE(subreq);
9118 if (!NT_STATUS_IS_OK(status)) {
9119 tevent_req_nterror(req, status);
9120 return;
9123 /* Copy out parameters */
9124 *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
9126 /* Copy result */
9127 state->orig.out.result = state->tmp.out.result;
9129 /* Reset temporary structure */
9130 ZERO_STRUCT(state->tmp);
9132 if (DEBUGLEVEL >= 10) {
9133 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &state->orig);
9136 tevent_req_done(req);
9139 NTSTATUS rpccli_lsa_OpenTrustedDomainByName_recv(struct tevent_req *req,
9140 TALLOC_CTX *mem_ctx,
9141 NTSTATUS *result)
9143 struct rpccli_lsa_OpenTrustedDomainByName_state *state = tevent_req_data(
9144 req, struct rpccli_lsa_OpenTrustedDomainByName_state);
9145 NTSTATUS status;
9147 if (tevent_req_is_nterror(req, &status)) {
9148 tevent_req_received(req);
9149 return status;
9152 /* Steal possbile out parameters to the callers context */
9153 talloc_steal(mem_ctx, state->out_mem_ctx);
9155 /* Return result */
9156 *result = state->orig.out.result;
9158 tevent_req_received(req);
9159 return NT_STATUS_OK;
9162 NTSTATUS rpccli_lsa_OpenTrustedDomainByName(struct rpc_pipe_client *cli,
9163 TALLOC_CTX *mem_ctx,
9164 struct policy_handle *handle /* [in] [ref] */,
9165 struct lsa_String name /* [in] */,
9166 uint32_t access_mask /* [in] */,
9167 struct policy_handle *trustdom_handle /* [out] [ref] */)
9169 struct lsa_OpenTrustedDomainByName r;
9170 NTSTATUS status;
9172 /* In parameters */
9173 r.in.handle = handle;
9174 r.in.name = name;
9175 r.in.access_mask = access_mask;
9177 if (DEBUGLEVEL >= 10) {
9178 NDR_PRINT_IN_DEBUG(lsa_OpenTrustedDomainByName, &r);
9181 status = cli->dispatch(cli,
9182 mem_ctx,
9183 &ndr_table_lsarpc,
9184 NDR_LSA_OPENTRUSTEDDOMAINBYNAME,
9185 &r);
9187 if (!NT_STATUS_IS_OK(status)) {
9188 return status;
9191 if (DEBUGLEVEL >= 10) {
9192 NDR_PRINT_OUT_DEBUG(lsa_OpenTrustedDomainByName, &r);
9195 if (NT_STATUS_IS_ERR(status)) {
9196 return status;
9199 /* Return variables */
9200 *trustdom_handle = *r.out.trustdom_handle;
9202 /* Return result */
9203 return r.out.result;
9206 struct rpccli_lsa_TestCall_state {
9207 struct lsa_TestCall orig;
9208 struct lsa_TestCall tmp;
9209 TALLOC_CTX *out_mem_ctx;
9210 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9213 static void rpccli_lsa_TestCall_done(struct tevent_req *subreq);
9215 struct tevent_req *rpccli_lsa_TestCall_send(TALLOC_CTX *mem_ctx,
9216 struct tevent_context *ev,
9217 struct rpc_pipe_client *cli)
9219 struct tevent_req *req;
9220 struct rpccli_lsa_TestCall_state *state;
9221 struct tevent_req *subreq;
9223 req = tevent_req_create(mem_ctx, &state,
9224 struct rpccli_lsa_TestCall_state);
9225 if (req == NULL) {
9226 return NULL;
9228 state->out_mem_ctx = NULL;
9229 state->dispatch_recv = cli->dispatch_recv;
9231 /* In parameters */
9233 /* Out parameters */
9235 /* Result */
9236 ZERO_STRUCT(state->orig.out.result);
9238 if (DEBUGLEVEL >= 10) {
9239 NDR_PRINT_IN_DEBUG(lsa_TestCall, &state->orig);
9242 /* make a temporary copy, that we pass to the dispatch function */
9243 state->tmp = state->orig;
9245 subreq = cli->dispatch_send(state, ev, cli,
9246 &ndr_table_lsarpc,
9247 NDR_LSA_TESTCALL,
9248 &state->tmp);
9249 if (tevent_req_nomem(subreq, req)) {
9250 return tevent_req_post(req, ev);
9252 tevent_req_set_callback(subreq, rpccli_lsa_TestCall_done, req);
9253 return req;
9256 static void rpccli_lsa_TestCall_done(struct tevent_req *subreq)
9258 struct tevent_req *req = tevent_req_callback_data(
9259 subreq, struct tevent_req);
9260 struct rpccli_lsa_TestCall_state *state = tevent_req_data(
9261 req, struct rpccli_lsa_TestCall_state);
9262 NTSTATUS status;
9263 TALLOC_CTX *mem_ctx;
9265 if (state->out_mem_ctx) {
9266 mem_ctx = state->out_mem_ctx;
9267 } else {
9268 mem_ctx = state;
9271 status = state->dispatch_recv(subreq, mem_ctx);
9272 TALLOC_FREE(subreq);
9273 if (!NT_STATUS_IS_OK(status)) {
9274 tevent_req_nterror(req, status);
9275 return;
9278 /* Copy out parameters */
9280 /* Copy result */
9281 state->orig.out.result = state->tmp.out.result;
9283 /* Reset temporary structure */
9284 ZERO_STRUCT(state->tmp);
9286 if (DEBUGLEVEL >= 10) {
9287 NDR_PRINT_OUT_DEBUG(lsa_TestCall, &state->orig);
9290 tevent_req_done(req);
9293 NTSTATUS rpccli_lsa_TestCall_recv(struct tevent_req *req,
9294 TALLOC_CTX *mem_ctx,
9295 NTSTATUS *result)
9297 struct rpccli_lsa_TestCall_state *state = tevent_req_data(
9298 req, struct rpccli_lsa_TestCall_state);
9299 NTSTATUS status;
9301 if (tevent_req_is_nterror(req, &status)) {
9302 tevent_req_received(req);
9303 return status;
9306 /* Steal possbile out parameters to the callers context */
9307 talloc_steal(mem_ctx, state->out_mem_ctx);
9309 /* Return result */
9310 *result = state->orig.out.result;
9312 tevent_req_received(req);
9313 return NT_STATUS_OK;
9316 NTSTATUS rpccli_lsa_TestCall(struct rpc_pipe_client *cli,
9317 TALLOC_CTX *mem_ctx)
9319 struct lsa_TestCall r;
9320 NTSTATUS status;
9322 /* In parameters */
9324 if (DEBUGLEVEL >= 10) {
9325 NDR_PRINT_IN_DEBUG(lsa_TestCall, &r);
9328 status = cli->dispatch(cli,
9329 mem_ctx,
9330 &ndr_table_lsarpc,
9331 NDR_LSA_TESTCALL,
9332 &r);
9334 if (!NT_STATUS_IS_OK(status)) {
9335 return status;
9338 if (DEBUGLEVEL >= 10) {
9339 NDR_PRINT_OUT_DEBUG(lsa_TestCall, &r);
9342 if (NT_STATUS_IS_ERR(status)) {
9343 return status;
9346 /* Return variables */
9348 /* Return result */
9349 return r.out.result;
9352 struct rpccli_lsa_LookupSids2_state {
9353 struct lsa_LookupSids2 orig;
9354 struct lsa_LookupSids2 tmp;
9355 TALLOC_CTX *out_mem_ctx;
9356 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9359 static void rpccli_lsa_LookupSids2_done(struct tevent_req *subreq);
9361 struct tevent_req *rpccli_lsa_LookupSids2_send(TALLOC_CTX *mem_ctx,
9362 struct tevent_context *ev,
9363 struct rpc_pipe_client *cli,
9364 struct policy_handle *_handle /* [in] [ref] */,
9365 struct lsa_SidArray *_sids /* [in] [ref] */,
9366 struct lsa_RefDomainList **_domains /* [out] [ref] */,
9367 struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
9368 uint16_t _level /* [in] */,
9369 uint32_t *_count /* [in,out] [ref] */,
9370 uint32_t _unknown1 /* [in] */,
9371 uint32_t _unknown2 /* [in] */)
9373 struct tevent_req *req;
9374 struct rpccli_lsa_LookupSids2_state *state;
9375 struct tevent_req *subreq;
9377 req = tevent_req_create(mem_ctx, &state,
9378 struct rpccli_lsa_LookupSids2_state);
9379 if (req == NULL) {
9380 return NULL;
9382 state->out_mem_ctx = NULL;
9383 state->dispatch_recv = cli->dispatch_recv;
9385 /* In parameters */
9386 state->orig.in.handle = _handle;
9387 state->orig.in.sids = _sids;
9388 state->orig.in.names = _names;
9389 state->orig.in.level = _level;
9390 state->orig.in.count = _count;
9391 state->orig.in.unknown1 = _unknown1;
9392 state->orig.in.unknown2 = _unknown2;
9394 /* Out parameters */
9395 state->orig.out.domains = _domains;
9396 state->orig.out.names = _names;
9397 state->orig.out.count = _count;
9399 /* Result */
9400 ZERO_STRUCT(state->orig.out.result);
9402 if (DEBUGLEVEL >= 10) {
9403 NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &state->orig);
9406 state->out_mem_ctx = talloc_named_const(state, 0,
9407 "rpccli_lsa_LookupSids2_out_memory");
9408 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9409 return tevent_req_post(req, ev);
9412 /* make a temporary copy, that we pass to the dispatch function */
9413 state->tmp = state->orig;
9415 subreq = cli->dispatch_send(state, ev, cli,
9416 &ndr_table_lsarpc,
9417 NDR_LSA_LOOKUPSIDS2,
9418 &state->tmp);
9419 if (tevent_req_nomem(subreq, req)) {
9420 return tevent_req_post(req, ev);
9422 tevent_req_set_callback(subreq, rpccli_lsa_LookupSids2_done, req);
9423 return req;
9426 static void rpccli_lsa_LookupSids2_done(struct tevent_req *subreq)
9428 struct tevent_req *req = tevent_req_callback_data(
9429 subreq, struct tevent_req);
9430 struct rpccli_lsa_LookupSids2_state *state = tevent_req_data(
9431 req, struct rpccli_lsa_LookupSids2_state);
9432 NTSTATUS status;
9433 TALLOC_CTX *mem_ctx;
9435 if (state->out_mem_ctx) {
9436 mem_ctx = state->out_mem_ctx;
9437 } else {
9438 mem_ctx = state;
9441 status = state->dispatch_recv(subreq, mem_ctx);
9442 TALLOC_FREE(subreq);
9443 if (!NT_STATUS_IS_OK(status)) {
9444 tevent_req_nterror(req, status);
9445 return;
9448 /* Copy out parameters */
9449 *state->orig.out.domains = *state->tmp.out.domains;
9450 *state->orig.out.names = *state->tmp.out.names;
9451 *state->orig.out.count = *state->tmp.out.count;
9453 /* Copy result */
9454 state->orig.out.result = state->tmp.out.result;
9456 /* Reset temporary structure */
9457 ZERO_STRUCT(state->tmp);
9459 if (DEBUGLEVEL >= 10) {
9460 NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &state->orig);
9463 tevent_req_done(req);
9466 NTSTATUS rpccli_lsa_LookupSids2_recv(struct tevent_req *req,
9467 TALLOC_CTX *mem_ctx,
9468 NTSTATUS *result)
9470 struct rpccli_lsa_LookupSids2_state *state = tevent_req_data(
9471 req, struct rpccli_lsa_LookupSids2_state);
9472 NTSTATUS status;
9474 if (tevent_req_is_nterror(req, &status)) {
9475 tevent_req_received(req);
9476 return status;
9479 /* Steal possbile out parameters to the callers context */
9480 talloc_steal(mem_ctx, state->out_mem_ctx);
9482 /* Return result */
9483 *result = state->orig.out.result;
9485 tevent_req_received(req);
9486 return NT_STATUS_OK;
9489 NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli,
9490 TALLOC_CTX *mem_ctx,
9491 struct policy_handle *handle /* [in] [ref] */,
9492 struct lsa_SidArray *sids /* [in] [ref] */,
9493 struct lsa_RefDomainList **domains /* [out] [ref] */,
9494 struct lsa_TransNameArray2 *names /* [in,out] [ref] */,
9495 uint16_t level /* [in] */,
9496 uint32_t *count /* [in,out] [ref] */,
9497 uint32_t unknown1 /* [in] */,
9498 uint32_t unknown2 /* [in] */)
9500 struct lsa_LookupSids2 r;
9501 NTSTATUS status;
9503 /* In parameters */
9504 r.in.handle = handle;
9505 r.in.sids = sids;
9506 r.in.names = names;
9507 r.in.level = level;
9508 r.in.count = count;
9509 r.in.unknown1 = unknown1;
9510 r.in.unknown2 = unknown2;
9512 if (DEBUGLEVEL >= 10) {
9513 NDR_PRINT_IN_DEBUG(lsa_LookupSids2, &r);
9516 status = cli->dispatch(cli,
9517 mem_ctx,
9518 &ndr_table_lsarpc,
9519 NDR_LSA_LOOKUPSIDS2,
9520 &r);
9522 if (!NT_STATUS_IS_OK(status)) {
9523 return status;
9526 if (DEBUGLEVEL >= 10) {
9527 NDR_PRINT_OUT_DEBUG(lsa_LookupSids2, &r);
9530 if (NT_STATUS_IS_ERR(status)) {
9531 return status;
9534 /* Return variables */
9535 *domains = *r.out.domains;
9536 *names = *r.out.names;
9537 *count = *r.out.count;
9539 /* Return result */
9540 return r.out.result;
9543 struct rpccli_lsa_LookupNames2_state {
9544 struct lsa_LookupNames2 orig;
9545 struct lsa_LookupNames2 tmp;
9546 TALLOC_CTX *out_mem_ctx;
9547 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9550 static void rpccli_lsa_LookupNames2_done(struct tevent_req *subreq);
9552 struct tevent_req *rpccli_lsa_LookupNames2_send(TALLOC_CTX *mem_ctx,
9553 struct tevent_context *ev,
9554 struct rpc_pipe_client *cli,
9555 struct policy_handle *_handle /* [in] [ref] */,
9556 uint32_t _num_names /* [in] [range(0,1000)] */,
9557 struct lsa_String *_names /* [in] [size_is(num_names)] */,
9558 struct lsa_RefDomainList **_domains /* [out] [ref] */,
9559 struct lsa_TransSidArray2 *_sids /* [in,out] [ref] */,
9560 enum lsa_LookupNamesLevel _level /* [in] */,
9561 uint32_t *_count /* [in,out] [ref] */,
9562 uint32_t _lookup_options /* [in] */,
9563 uint32_t _client_revision /* [in] */)
9565 struct tevent_req *req;
9566 struct rpccli_lsa_LookupNames2_state *state;
9567 struct tevent_req *subreq;
9569 req = tevent_req_create(mem_ctx, &state,
9570 struct rpccli_lsa_LookupNames2_state);
9571 if (req == NULL) {
9572 return NULL;
9574 state->out_mem_ctx = NULL;
9575 state->dispatch_recv = cli->dispatch_recv;
9577 /* In parameters */
9578 state->orig.in.handle = _handle;
9579 state->orig.in.num_names = _num_names;
9580 state->orig.in.names = _names;
9581 state->orig.in.sids = _sids;
9582 state->orig.in.level = _level;
9583 state->orig.in.count = _count;
9584 state->orig.in.lookup_options = _lookup_options;
9585 state->orig.in.client_revision = _client_revision;
9587 /* Out parameters */
9588 state->orig.out.domains = _domains;
9589 state->orig.out.sids = _sids;
9590 state->orig.out.count = _count;
9592 /* Result */
9593 ZERO_STRUCT(state->orig.out.result);
9595 if (DEBUGLEVEL >= 10) {
9596 NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &state->orig);
9599 state->out_mem_ctx = talloc_named_const(state, 0,
9600 "rpccli_lsa_LookupNames2_out_memory");
9601 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9602 return tevent_req_post(req, ev);
9605 /* make a temporary copy, that we pass to the dispatch function */
9606 state->tmp = state->orig;
9608 subreq = cli->dispatch_send(state, ev, cli,
9609 &ndr_table_lsarpc,
9610 NDR_LSA_LOOKUPNAMES2,
9611 &state->tmp);
9612 if (tevent_req_nomem(subreq, req)) {
9613 return tevent_req_post(req, ev);
9615 tevent_req_set_callback(subreq, rpccli_lsa_LookupNames2_done, req);
9616 return req;
9619 static void rpccli_lsa_LookupNames2_done(struct tevent_req *subreq)
9621 struct tevent_req *req = tevent_req_callback_data(
9622 subreq, struct tevent_req);
9623 struct rpccli_lsa_LookupNames2_state *state = tevent_req_data(
9624 req, struct rpccli_lsa_LookupNames2_state);
9625 NTSTATUS status;
9626 TALLOC_CTX *mem_ctx;
9628 if (state->out_mem_ctx) {
9629 mem_ctx = state->out_mem_ctx;
9630 } else {
9631 mem_ctx = state;
9634 status = state->dispatch_recv(subreq, mem_ctx);
9635 TALLOC_FREE(subreq);
9636 if (!NT_STATUS_IS_OK(status)) {
9637 tevent_req_nterror(req, status);
9638 return;
9641 /* Copy out parameters */
9642 *state->orig.out.domains = *state->tmp.out.domains;
9643 *state->orig.out.sids = *state->tmp.out.sids;
9644 *state->orig.out.count = *state->tmp.out.count;
9646 /* Copy result */
9647 state->orig.out.result = state->tmp.out.result;
9649 /* Reset temporary structure */
9650 ZERO_STRUCT(state->tmp);
9652 if (DEBUGLEVEL >= 10) {
9653 NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &state->orig);
9656 tevent_req_done(req);
9659 NTSTATUS rpccli_lsa_LookupNames2_recv(struct tevent_req *req,
9660 TALLOC_CTX *mem_ctx,
9661 NTSTATUS *result)
9663 struct rpccli_lsa_LookupNames2_state *state = tevent_req_data(
9664 req, struct rpccli_lsa_LookupNames2_state);
9665 NTSTATUS status;
9667 if (tevent_req_is_nterror(req, &status)) {
9668 tevent_req_received(req);
9669 return status;
9672 /* Steal possbile out parameters to the callers context */
9673 talloc_steal(mem_ctx, state->out_mem_ctx);
9675 /* Return result */
9676 *result = state->orig.out.result;
9678 tevent_req_received(req);
9679 return NT_STATUS_OK;
9682 NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli,
9683 TALLOC_CTX *mem_ctx,
9684 struct policy_handle *handle /* [in] [ref] */,
9685 uint32_t num_names /* [in] [range(0,1000)] */,
9686 struct lsa_String *names /* [in] [size_is(num_names)] */,
9687 struct lsa_RefDomainList **domains /* [out] [ref] */,
9688 struct lsa_TransSidArray2 *sids /* [in,out] [ref] */,
9689 enum lsa_LookupNamesLevel level /* [in] */,
9690 uint32_t *count /* [in,out] [ref] */,
9691 uint32_t lookup_options /* [in] */,
9692 uint32_t client_revision /* [in] */)
9694 struct lsa_LookupNames2 r;
9695 NTSTATUS status;
9697 /* In parameters */
9698 r.in.handle = handle;
9699 r.in.num_names = num_names;
9700 r.in.names = names;
9701 r.in.sids = sids;
9702 r.in.level = level;
9703 r.in.count = count;
9704 r.in.lookup_options = lookup_options;
9705 r.in.client_revision = client_revision;
9707 if (DEBUGLEVEL >= 10) {
9708 NDR_PRINT_IN_DEBUG(lsa_LookupNames2, &r);
9711 status = cli->dispatch(cli,
9712 mem_ctx,
9713 &ndr_table_lsarpc,
9714 NDR_LSA_LOOKUPNAMES2,
9715 &r);
9717 if (!NT_STATUS_IS_OK(status)) {
9718 return status;
9721 if (DEBUGLEVEL >= 10) {
9722 NDR_PRINT_OUT_DEBUG(lsa_LookupNames2, &r);
9725 if (NT_STATUS_IS_ERR(status)) {
9726 return status;
9729 /* Return variables */
9730 *domains = *r.out.domains;
9731 *sids = *r.out.sids;
9732 *count = *r.out.count;
9734 /* Return result */
9735 return r.out.result;
9738 struct rpccli_lsa_CreateTrustedDomainEx2_state {
9739 struct lsa_CreateTrustedDomainEx2 orig;
9740 struct lsa_CreateTrustedDomainEx2 tmp;
9741 TALLOC_CTX *out_mem_ctx;
9742 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9745 static void rpccli_lsa_CreateTrustedDomainEx2_done(struct tevent_req *subreq);
9747 struct tevent_req *rpccli_lsa_CreateTrustedDomainEx2_send(TALLOC_CTX *mem_ctx,
9748 struct tevent_context *ev,
9749 struct rpc_pipe_client *cli,
9750 struct policy_handle *_policy_handle /* [in] [ref] */,
9751 struct lsa_TrustDomainInfoInfoEx *_info /* [in] [ref] */,
9752 struct lsa_TrustDomainInfoAuthInfoInternal *_auth_info /* [in] [ref] */,
9753 uint32_t _access_mask /* [in] */,
9754 struct policy_handle *_trustdom_handle /* [out] [ref] */)
9756 struct tevent_req *req;
9757 struct rpccli_lsa_CreateTrustedDomainEx2_state *state;
9758 struct tevent_req *subreq;
9760 req = tevent_req_create(mem_ctx, &state,
9761 struct rpccli_lsa_CreateTrustedDomainEx2_state);
9762 if (req == NULL) {
9763 return NULL;
9765 state->out_mem_ctx = NULL;
9766 state->dispatch_recv = cli->dispatch_recv;
9768 /* In parameters */
9769 state->orig.in.policy_handle = _policy_handle;
9770 state->orig.in.info = _info;
9771 state->orig.in.auth_info = _auth_info;
9772 state->orig.in.access_mask = _access_mask;
9774 /* Out parameters */
9775 state->orig.out.trustdom_handle = _trustdom_handle;
9777 /* Result */
9778 ZERO_STRUCT(state->orig.out.result);
9780 if (DEBUGLEVEL >= 10) {
9781 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &state->orig);
9784 state->out_mem_ctx = talloc_named_const(state, 0,
9785 "rpccli_lsa_CreateTrustedDomainEx2_out_memory");
9786 if (tevent_req_nomem(state->out_mem_ctx, req)) {
9787 return tevent_req_post(req, ev);
9790 /* make a temporary copy, that we pass to the dispatch function */
9791 state->tmp = state->orig;
9793 subreq = cli->dispatch_send(state, ev, cli,
9794 &ndr_table_lsarpc,
9795 NDR_LSA_CREATETRUSTEDDOMAINEX2,
9796 &state->tmp);
9797 if (tevent_req_nomem(subreq, req)) {
9798 return tevent_req_post(req, ev);
9800 tevent_req_set_callback(subreq, rpccli_lsa_CreateTrustedDomainEx2_done, req);
9801 return req;
9804 static void rpccli_lsa_CreateTrustedDomainEx2_done(struct tevent_req *subreq)
9806 struct tevent_req *req = tevent_req_callback_data(
9807 subreq, struct tevent_req);
9808 struct rpccli_lsa_CreateTrustedDomainEx2_state *state = tevent_req_data(
9809 req, struct rpccli_lsa_CreateTrustedDomainEx2_state);
9810 NTSTATUS status;
9811 TALLOC_CTX *mem_ctx;
9813 if (state->out_mem_ctx) {
9814 mem_ctx = state->out_mem_ctx;
9815 } else {
9816 mem_ctx = state;
9819 status = state->dispatch_recv(subreq, mem_ctx);
9820 TALLOC_FREE(subreq);
9821 if (!NT_STATUS_IS_OK(status)) {
9822 tevent_req_nterror(req, status);
9823 return;
9826 /* Copy out parameters */
9827 *state->orig.out.trustdom_handle = *state->tmp.out.trustdom_handle;
9829 /* Copy result */
9830 state->orig.out.result = state->tmp.out.result;
9832 /* Reset temporary structure */
9833 ZERO_STRUCT(state->tmp);
9835 if (DEBUGLEVEL >= 10) {
9836 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &state->orig);
9839 tevent_req_done(req);
9842 NTSTATUS rpccli_lsa_CreateTrustedDomainEx2_recv(struct tevent_req *req,
9843 TALLOC_CTX *mem_ctx,
9844 NTSTATUS *result)
9846 struct rpccli_lsa_CreateTrustedDomainEx2_state *state = tevent_req_data(
9847 req, struct rpccli_lsa_CreateTrustedDomainEx2_state);
9848 NTSTATUS status;
9850 if (tevent_req_is_nterror(req, &status)) {
9851 tevent_req_received(req);
9852 return status;
9855 /* Steal possbile out parameters to the callers context */
9856 talloc_steal(mem_ctx, state->out_mem_ctx);
9858 /* Return result */
9859 *result = state->orig.out.result;
9861 tevent_req_received(req);
9862 return NT_STATUS_OK;
9865 NTSTATUS rpccli_lsa_CreateTrustedDomainEx2(struct rpc_pipe_client *cli,
9866 TALLOC_CTX *mem_ctx,
9867 struct policy_handle *policy_handle /* [in] [ref] */,
9868 struct lsa_TrustDomainInfoInfoEx *info /* [in] [ref] */,
9869 struct lsa_TrustDomainInfoAuthInfoInternal *auth_info /* [in] [ref] */,
9870 uint32_t access_mask /* [in] */,
9871 struct policy_handle *trustdom_handle /* [out] [ref] */)
9873 struct lsa_CreateTrustedDomainEx2 r;
9874 NTSTATUS status;
9876 /* In parameters */
9877 r.in.policy_handle = policy_handle;
9878 r.in.info = info;
9879 r.in.auth_info = auth_info;
9880 r.in.access_mask = access_mask;
9882 if (DEBUGLEVEL >= 10) {
9883 NDR_PRINT_IN_DEBUG(lsa_CreateTrustedDomainEx2, &r);
9886 status = cli->dispatch(cli,
9887 mem_ctx,
9888 &ndr_table_lsarpc,
9889 NDR_LSA_CREATETRUSTEDDOMAINEX2,
9890 &r);
9892 if (!NT_STATUS_IS_OK(status)) {
9893 return status;
9896 if (DEBUGLEVEL >= 10) {
9897 NDR_PRINT_OUT_DEBUG(lsa_CreateTrustedDomainEx2, &r);
9900 if (NT_STATUS_IS_ERR(status)) {
9901 return status;
9904 /* Return variables */
9905 *trustdom_handle = *r.out.trustdom_handle;
9907 /* Return result */
9908 return r.out.result;
9911 struct rpccli_lsa_CREDRWRITE_state {
9912 struct lsa_CREDRWRITE orig;
9913 struct lsa_CREDRWRITE tmp;
9914 TALLOC_CTX *out_mem_ctx;
9915 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
9918 static void rpccli_lsa_CREDRWRITE_done(struct tevent_req *subreq);
9920 struct tevent_req *rpccli_lsa_CREDRWRITE_send(TALLOC_CTX *mem_ctx,
9921 struct tevent_context *ev,
9922 struct rpc_pipe_client *cli)
9924 struct tevent_req *req;
9925 struct rpccli_lsa_CREDRWRITE_state *state;
9926 struct tevent_req *subreq;
9928 req = tevent_req_create(mem_ctx, &state,
9929 struct rpccli_lsa_CREDRWRITE_state);
9930 if (req == NULL) {
9931 return NULL;
9933 state->out_mem_ctx = NULL;
9934 state->dispatch_recv = cli->dispatch_recv;
9936 /* In parameters */
9938 /* Out parameters */
9940 /* Result */
9941 ZERO_STRUCT(state->orig.out.result);
9943 if (DEBUGLEVEL >= 10) {
9944 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &state->orig);
9947 /* make a temporary copy, that we pass to the dispatch function */
9948 state->tmp = state->orig;
9950 subreq = cli->dispatch_send(state, ev, cli,
9951 &ndr_table_lsarpc,
9952 NDR_LSA_CREDRWRITE,
9953 &state->tmp);
9954 if (tevent_req_nomem(subreq, req)) {
9955 return tevent_req_post(req, ev);
9957 tevent_req_set_callback(subreq, rpccli_lsa_CREDRWRITE_done, req);
9958 return req;
9961 static void rpccli_lsa_CREDRWRITE_done(struct tevent_req *subreq)
9963 struct tevent_req *req = tevent_req_callback_data(
9964 subreq, struct tevent_req);
9965 struct rpccli_lsa_CREDRWRITE_state *state = tevent_req_data(
9966 req, struct rpccli_lsa_CREDRWRITE_state);
9967 NTSTATUS status;
9968 TALLOC_CTX *mem_ctx;
9970 if (state->out_mem_ctx) {
9971 mem_ctx = state->out_mem_ctx;
9972 } else {
9973 mem_ctx = state;
9976 status = state->dispatch_recv(subreq, mem_ctx);
9977 TALLOC_FREE(subreq);
9978 if (!NT_STATUS_IS_OK(status)) {
9979 tevent_req_nterror(req, status);
9980 return;
9983 /* Copy out parameters */
9985 /* Copy result */
9986 state->orig.out.result = state->tmp.out.result;
9988 /* Reset temporary structure */
9989 ZERO_STRUCT(state->tmp);
9991 if (DEBUGLEVEL >= 10) {
9992 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &state->orig);
9995 tevent_req_done(req);
9998 NTSTATUS rpccli_lsa_CREDRWRITE_recv(struct tevent_req *req,
9999 TALLOC_CTX *mem_ctx,
10000 NTSTATUS *result)
10002 struct rpccli_lsa_CREDRWRITE_state *state = tevent_req_data(
10003 req, struct rpccli_lsa_CREDRWRITE_state);
10004 NTSTATUS status;
10006 if (tevent_req_is_nterror(req, &status)) {
10007 tevent_req_received(req);
10008 return status;
10011 /* Steal possbile out parameters to the callers context */
10012 talloc_steal(mem_ctx, state->out_mem_ctx);
10014 /* Return result */
10015 *result = state->orig.out.result;
10017 tevent_req_received(req);
10018 return NT_STATUS_OK;
10021 NTSTATUS rpccli_lsa_CREDRWRITE(struct rpc_pipe_client *cli,
10022 TALLOC_CTX *mem_ctx)
10024 struct lsa_CREDRWRITE r;
10025 NTSTATUS status;
10027 /* In parameters */
10029 if (DEBUGLEVEL >= 10) {
10030 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITE, &r);
10033 status = cli->dispatch(cli,
10034 mem_ctx,
10035 &ndr_table_lsarpc,
10036 NDR_LSA_CREDRWRITE,
10037 &r);
10039 if (!NT_STATUS_IS_OK(status)) {
10040 return status;
10043 if (DEBUGLEVEL >= 10) {
10044 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITE, &r);
10047 if (NT_STATUS_IS_ERR(status)) {
10048 return status;
10051 /* Return variables */
10053 /* Return result */
10054 return r.out.result;
10057 struct rpccli_lsa_CREDRREAD_state {
10058 struct lsa_CREDRREAD orig;
10059 struct lsa_CREDRREAD tmp;
10060 TALLOC_CTX *out_mem_ctx;
10061 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10064 static void rpccli_lsa_CREDRREAD_done(struct tevent_req *subreq);
10066 struct tevent_req *rpccli_lsa_CREDRREAD_send(TALLOC_CTX *mem_ctx,
10067 struct tevent_context *ev,
10068 struct rpc_pipe_client *cli)
10070 struct tevent_req *req;
10071 struct rpccli_lsa_CREDRREAD_state *state;
10072 struct tevent_req *subreq;
10074 req = tevent_req_create(mem_ctx, &state,
10075 struct rpccli_lsa_CREDRREAD_state);
10076 if (req == NULL) {
10077 return NULL;
10079 state->out_mem_ctx = NULL;
10080 state->dispatch_recv = cli->dispatch_recv;
10082 /* In parameters */
10084 /* Out parameters */
10086 /* Result */
10087 ZERO_STRUCT(state->orig.out.result);
10089 if (DEBUGLEVEL >= 10) {
10090 NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &state->orig);
10093 /* make a temporary copy, that we pass to the dispatch function */
10094 state->tmp = state->orig;
10096 subreq = cli->dispatch_send(state, ev, cli,
10097 &ndr_table_lsarpc,
10098 NDR_LSA_CREDRREAD,
10099 &state->tmp);
10100 if (tevent_req_nomem(subreq, req)) {
10101 return tevent_req_post(req, ev);
10103 tevent_req_set_callback(subreq, rpccli_lsa_CREDRREAD_done, req);
10104 return req;
10107 static void rpccli_lsa_CREDRREAD_done(struct tevent_req *subreq)
10109 struct tevent_req *req = tevent_req_callback_data(
10110 subreq, struct tevent_req);
10111 struct rpccli_lsa_CREDRREAD_state *state = tevent_req_data(
10112 req, struct rpccli_lsa_CREDRREAD_state);
10113 NTSTATUS status;
10114 TALLOC_CTX *mem_ctx;
10116 if (state->out_mem_ctx) {
10117 mem_ctx = state->out_mem_ctx;
10118 } else {
10119 mem_ctx = state;
10122 status = state->dispatch_recv(subreq, mem_ctx);
10123 TALLOC_FREE(subreq);
10124 if (!NT_STATUS_IS_OK(status)) {
10125 tevent_req_nterror(req, status);
10126 return;
10129 /* Copy out parameters */
10131 /* Copy result */
10132 state->orig.out.result = state->tmp.out.result;
10134 /* Reset temporary structure */
10135 ZERO_STRUCT(state->tmp);
10137 if (DEBUGLEVEL >= 10) {
10138 NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &state->orig);
10141 tevent_req_done(req);
10144 NTSTATUS rpccli_lsa_CREDRREAD_recv(struct tevent_req *req,
10145 TALLOC_CTX *mem_ctx,
10146 NTSTATUS *result)
10148 struct rpccli_lsa_CREDRREAD_state *state = tevent_req_data(
10149 req, struct rpccli_lsa_CREDRREAD_state);
10150 NTSTATUS status;
10152 if (tevent_req_is_nterror(req, &status)) {
10153 tevent_req_received(req);
10154 return status;
10157 /* Steal possbile out parameters to the callers context */
10158 talloc_steal(mem_ctx, state->out_mem_ctx);
10160 /* Return result */
10161 *result = state->orig.out.result;
10163 tevent_req_received(req);
10164 return NT_STATUS_OK;
10167 NTSTATUS rpccli_lsa_CREDRREAD(struct rpc_pipe_client *cli,
10168 TALLOC_CTX *mem_ctx)
10170 struct lsa_CREDRREAD r;
10171 NTSTATUS status;
10173 /* In parameters */
10175 if (DEBUGLEVEL >= 10) {
10176 NDR_PRINT_IN_DEBUG(lsa_CREDRREAD, &r);
10179 status = cli->dispatch(cli,
10180 mem_ctx,
10181 &ndr_table_lsarpc,
10182 NDR_LSA_CREDRREAD,
10183 &r);
10185 if (!NT_STATUS_IS_OK(status)) {
10186 return status;
10189 if (DEBUGLEVEL >= 10) {
10190 NDR_PRINT_OUT_DEBUG(lsa_CREDRREAD, &r);
10193 if (NT_STATUS_IS_ERR(status)) {
10194 return status;
10197 /* Return variables */
10199 /* Return result */
10200 return r.out.result;
10203 struct rpccli_lsa_CREDRENUMERATE_state {
10204 struct lsa_CREDRENUMERATE orig;
10205 struct lsa_CREDRENUMERATE tmp;
10206 TALLOC_CTX *out_mem_ctx;
10207 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10210 static void rpccli_lsa_CREDRENUMERATE_done(struct tevent_req *subreq);
10212 struct tevent_req *rpccli_lsa_CREDRENUMERATE_send(TALLOC_CTX *mem_ctx,
10213 struct tevent_context *ev,
10214 struct rpc_pipe_client *cli)
10216 struct tevent_req *req;
10217 struct rpccli_lsa_CREDRENUMERATE_state *state;
10218 struct tevent_req *subreq;
10220 req = tevent_req_create(mem_ctx, &state,
10221 struct rpccli_lsa_CREDRENUMERATE_state);
10222 if (req == NULL) {
10223 return NULL;
10225 state->out_mem_ctx = NULL;
10226 state->dispatch_recv = cli->dispatch_recv;
10228 /* In parameters */
10230 /* Out parameters */
10232 /* Result */
10233 ZERO_STRUCT(state->orig.out.result);
10235 if (DEBUGLEVEL >= 10) {
10236 NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &state->orig);
10239 /* make a temporary copy, that we pass to the dispatch function */
10240 state->tmp = state->orig;
10242 subreq = cli->dispatch_send(state, ev, cli,
10243 &ndr_table_lsarpc,
10244 NDR_LSA_CREDRENUMERATE,
10245 &state->tmp);
10246 if (tevent_req_nomem(subreq, req)) {
10247 return tevent_req_post(req, ev);
10249 tevent_req_set_callback(subreq, rpccli_lsa_CREDRENUMERATE_done, req);
10250 return req;
10253 static void rpccli_lsa_CREDRENUMERATE_done(struct tevent_req *subreq)
10255 struct tevent_req *req = tevent_req_callback_data(
10256 subreq, struct tevent_req);
10257 struct rpccli_lsa_CREDRENUMERATE_state *state = tevent_req_data(
10258 req, struct rpccli_lsa_CREDRENUMERATE_state);
10259 NTSTATUS status;
10260 TALLOC_CTX *mem_ctx;
10262 if (state->out_mem_ctx) {
10263 mem_ctx = state->out_mem_ctx;
10264 } else {
10265 mem_ctx = state;
10268 status = state->dispatch_recv(subreq, mem_ctx);
10269 TALLOC_FREE(subreq);
10270 if (!NT_STATUS_IS_OK(status)) {
10271 tevent_req_nterror(req, status);
10272 return;
10275 /* Copy out parameters */
10277 /* Copy result */
10278 state->orig.out.result = state->tmp.out.result;
10280 /* Reset temporary structure */
10281 ZERO_STRUCT(state->tmp);
10283 if (DEBUGLEVEL >= 10) {
10284 NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &state->orig);
10287 tevent_req_done(req);
10290 NTSTATUS rpccli_lsa_CREDRENUMERATE_recv(struct tevent_req *req,
10291 TALLOC_CTX *mem_ctx,
10292 NTSTATUS *result)
10294 struct rpccli_lsa_CREDRENUMERATE_state *state = tevent_req_data(
10295 req, struct rpccli_lsa_CREDRENUMERATE_state);
10296 NTSTATUS status;
10298 if (tevent_req_is_nterror(req, &status)) {
10299 tevent_req_received(req);
10300 return status;
10303 /* Steal possbile out parameters to the callers context */
10304 talloc_steal(mem_ctx, state->out_mem_ctx);
10306 /* Return result */
10307 *result = state->orig.out.result;
10309 tevent_req_received(req);
10310 return NT_STATUS_OK;
10313 NTSTATUS rpccli_lsa_CREDRENUMERATE(struct rpc_pipe_client *cli,
10314 TALLOC_CTX *mem_ctx)
10316 struct lsa_CREDRENUMERATE r;
10317 NTSTATUS status;
10319 /* In parameters */
10321 if (DEBUGLEVEL >= 10) {
10322 NDR_PRINT_IN_DEBUG(lsa_CREDRENUMERATE, &r);
10325 status = cli->dispatch(cli,
10326 mem_ctx,
10327 &ndr_table_lsarpc,
10328 NDR_LSA_CREDRENUMERATE,
10329 &r);
10331 if (!NT_STATUS_IS_OK(status)) {
10332 return status;
10335 if (DEBUGLEVEL >= 10) {
10336 NDR_PRINT_OUT_DEBUG(lsa_CREDRENUMERATE, &r);
10339 if (NT_STATUS_IS_ERR(status)) {
10340 return status;
10343 /* Return variables */
10345 /* Return result */
10346 return r.out.result;
10349 struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state {
10350 struct lsa_CREDRWRITEDOMAINCREDENTIALS orig;
10351 struct lsa_CREDRWRITEDOMAINCREDENTIALS tmp;
10352 TALLOC_CTX *out_mem_ctx;
10353 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10356 static void rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done(struct tevent_req *subreq);
10358 struct tevent_req *rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
10359 struct tevent_context *ev,
10360 struct rpc_pipe_client *cli)
10362 struct tevent_req *req;
10363 struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state;
10364 struct tevent_req *subreq;
10366 req = tevent_req_create(mem_ctx, &state,
10367 struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
10368 if (req == NULL) {
10369 return NULL;
10371 state->out_mem_ctx = NULL;
10372 state->dispatch_recv = cli->dispatch_recv;
10374 /* In parameters */
10376 /* Out parameters */
10378 /* Result */
10379 ZERO_STRUCT(state->orig.out.result);
10381 if (DEBUGLEVEL >= 10) {
10382 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &state->orig);
10385 /* make a temporary copy, that we pass to the dispatch function */
10386 state->tmp = state->orig;
10388 subreq = cli->dispatch_send(state, ev, cli,
10389 &ndr_table_lsarpc,
10390 NDR_LSA_CREDRWRITEDOMAINCREDENTIALS,
10391 &state->tmp);
10392 if (tevent_req_nomem(subreq, req)) {
10393 return tevent_req_post(req, ev);
10395 tevent_req_set_callback(subreq, rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done, req);
10396 return req;
10399 static void rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_done(struct tevent_req *subreq)
10401 struct tevent_req *req = tevent_req_callback_data(
10402 subreq, struct tevent_req);
10403 struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state = tevent_req_data(
10404 req, struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
10405 NTSTATUS status;
10406 TALLOC_CTX *mem_ctx;
10408 if (state->out_mem_ctx) {
10409 mem_ctx = state->out_mem_ctx;
10410 } else {
10411 mem_ctx = state;
10414 status = state->dispatch_recv(subreq, mem_ctx);
10415 TALLOC_FREE(subreq);
10416 if (!NT_STATUS_IS_OK(status)) {
10417 tevent_req_nterror(req, status);
10418 return;
10421 /* Copy out parameters */
10423 /* Copy result */
10424 state->orig.out.result = state->tmp.out.result;
10426 /* Reset temporary structure */
10427 ZERO_STRUCT(state->tmp);
10429 if (DEBUGLEVEL >= 10) {
10430 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &state->orig);
10433 tevent_req_done(req);
10436 NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_recv(struct tevent_req *req,
10437 TALLOC_CTX *mem_ctx,
10438 NTSTATUS *result)
10440 struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state *state = tevent_req_data(
10441 req, struct rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS_state);
10442 NTSTATUS status;
10444 if (tevent_req_is_nterror(req, &status)) {
10445 tevent_req_received(req);
10446 return status;
10449 /* Steal possbile out parameters to the callers context */
10450 talloc_steal(mem_ctx, state->out_mem_ctx);
10452 /* Return result */
10453 *result = state->orig.out.result;
10455 tevent_req_received(req);
10456 return NT_STATUS_OK;
10459 NTSTATUS rpccli_lsa_CREDRWRITEDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
10460 TALLOC_CTX *mem_ctx)
10462 struct lsa_CREDRWRITEDOMAINCREDENTIALS r;
10463 NTSTATUS status;
10465 /* In parameters */
10467 if (DEBUGLEVEL >= 10) {
10468 NDR_PRINT_IN_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
10471 status = cli->dispatch(cli,
10472 mem_ctx,
10473 &ndr_table_lsarpc,
10474 NDR_LSA_CREDRWRITEDOMAINCREDENTIALS,
10475 &r);
10477 if (!NT_STATUS_IS_OK(status)) {
10478 return status;
10481 if (DEBUGLEVEL >= 10) {
10482 NDR_PRINT_OUT_DEBUG(lsa_CREDRWRITEDOMAINCREDENTIALS, &r);
10485 if (NT_STATUS_IS_ERR(status)) {
10486 return status;
10489 /* Return variables */
10491 /* Return result */
10492 return r.out.result;
10495 struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state {
10496 struct lsa_CREDRREADDOMAINCREDENTIALS orig;
10497 struct lsa_CREDRREADDOMAINCREDENTIALS tmp;
10498 TALLOC_CTX *out_mem_ctx;
10499 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10502 static void rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done(struct tevent_req *subreq);
10504 struct tevent_req *rpccli_lsa_CREDRREADDOMAINCREDENTIALS_send(TALLOC_CTX *mem_ctx,
10505 struct tevent_context *ev,
10506 struct rpc_pipe_client *cli)
10508 struct tevent_req *req;
10509 struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state;
10510 struct tevent_req *subreq;
10512 req = tevent_req_create(mem_ctx, &state,
10513 struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state);
10514 if (req == NULL) {
10515 return NULL;
10517 state->out_mem_ctx = NULL;
10518 state->dispatch_recv = cli->dispatch_recv;
10520 /* In parameters */
10522 /* Out parameters */
10524 /* Result */
10525 ZERO_STRUCT(state->orig.out.result);
10527 if (DEBUGLEVEL >= 10) {
10528 NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &state->orig);
10531 /* make a temporary copy, that we pass to the dispatch function */
10532 state->tmp = state->orig;
10534 subreq = cli->dispatch_send(state, ev, cli,
10535 &ndr_table_lsarpc,
10536 NDR_LSA_CREDRREADDOMAINCREDENTIALS,
10537 &state->tmp);
10538 if (tevent_req_nomem(subreq, req)) {
10539 return tevent_req_post(req, ev);
10541 tevent_req_set_callback(subreq, rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done, req);
10542 return req;
10545 static void rpccli_lsa_CREDRREADDOMAINCREDENTIALS_done(struct tevent_req *subreq)
10547 struct tevent_req *req = tevent_req_callback_data(
10548 subreq, struct tevent_req);
10549 struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state = tevent_req_data(
10550 req, struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state);
10551 NTSTATUS status;
10552 TALLOC_CTX *mem_ctx;
10554 if (state->out_mem_ctx) {
10555 mem_ctx = state->out_mem_ctx;
10556 } else {
10557 mem_ctx = state;
10560 status = state->dispatch_recv(subreq, mem_ctx);
10561 TALLOC_FREE(subreq);
10562 if (!NT_STATUS_IS_OK(status)) {
10563 tevent_req_nterror(req, status);
10564 return;
10567 /* Copy out parameters */
10569 /* Copy result */
10570 state->orig.out.result = state->tmp.out.result;
10572 /* Reset temporary structure */
10573 ZERO_STRUCT(state->tmp);
10575 if (DEBUGLEVEL >= 10) {
10576 NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &state->orig);
10579 tevent_req_done(req);
10582 NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS_recv(struct tevent_req *req,
10583 TALLOC_CTX *mem_ctx,
10584 NTSTATUS *result)
10586 struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state *state = tevent_req_data(
10587 req, struct rpccli_lsa_CREDRREADDOMAINCREDENTIALS_state);
10588 NTSTATUS status;
10590 if (tevent_req_is_nterror(req, &status)) {
10591 tevent_req_received(req);
10592 return status;
10595 /* Steal possbile out parameters to the callers context */
10596 talloc_steal(mem_ctx, state->out_mem_ctx);
10598 /* Return result */
10599 *result = state->orig.out.result;
10601 tevent_req_received(req);
10602 return NT_STATUS_OK;
10605 NTSTATUS rpccli_lsa_CREDRREADDOMAINCREDENTIALS(struct rpc_pipe_client *cli,
10606 TALLOC_CTX *mem_ctx)
10608 struct lsa_CREDRREADDOMAINCREDENTIALS r;
10609 NTSTATUS status;
10611 /* In parameters */
10613 if (DEBUGLEVEL >= 10) {
10614 NDR_PRINT_IN_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
10617 status = cli->dispatch(cli,
10618 mem_ctx,
10619 &ndr_table_lsarpc,
10620 NDR_LSA_CREDRREADDOMAINCREDENTIALS,
10621 &r);
10623 if (!NT_STATUS_IS_OK(status)) {
10624 return status;
10627 if (DEBUGLEVEL >= 10) {
10628 NDR_PRINT_OUT_DEBUG(lsa_CREDRREADDOMAINCREDENTIALS, &r);
10631 if (NT_STATUS_IS_ERR(status)) {
10632 return status;
10635 /* Return variables */
10637 /* Return result */
10638 return r.out.result;
10641 struct rpccli_lsa_CREDRDELETE_state {
10642 struct lsa_CREDRDELETE orig;
10643 struct lsa_CREDRDELETE tmp;
10644 TALLOC_CTX *out_mem_ctx;
10645 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10648 static void rpccli_lsa_CREDRDELETE_done(struct tevent_req *subreq);
10650 struct tevent_req *rpccli_lsa_CREDRDELETE_send(TALLOC_CTX *mem_ctx,
10651 struct tevent_context *ev,
10652 struct rpc_pipe_client *cli)
10654 struct tevent_req *req;
10655 struct rpccli_lsa_CREDRDELETE_state *state;
10656 struct tevent_req *subreq;
10658 req = tevent_req_create(mem_ctx, &state,
10659 struct rpccli_lsa_CREDRDELETE_state);
10660 if (req == NULL) {
10661 return NULL;
10663 state->out_mem_ctx = NULL;
10664 state->dispatch_recv = cli->dispatch_recv;
10666 /* In parameters */
10668 /* Out parameters */
10670 /* Result */
10671 ZERO_STRUCT(state->orig.out.result);
10673 if (DEBUGLEVEL >= 10) {
10674 NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &state->orig);
10677 /* make a temporary copy, that we pass to the dispatch function */
10678 state->tmp = state->orig;
10680 subreq = cli->dispatch_send(state, ev, cli,
10681 &ndr_table_lsarpc,
10682 NDR_LSA_CREDRDELETE,
10683 &state->tmp);
10684 if (tevent_req_nomem(subreq, req)) {
10685 return tevent_req_post(req, ev);
10687 tevent_req_set_callback(subreq, rpccli_lsa_CREDRDELETE_done, req);
10688 return req;
10691 static void rpccli_lsa_CREDRDELETE_done(struct tevent_req *subreq)
10693 struct tevent_req *req = tevent_req_callback_data(
10694 subreq, struct tevent_req);
10695 struct rpccli_lsa_CREDRDELETE_state *state = tevent_req_data(
10696 req, struct rpccli_lsa_CREDRDELETE_state);
10697 NTSTATUS status;
10698 TALLOC_CTX *mem_ctx;
10700 if (state->out_mem_ctx) {
10701 mem_ctx = state->out_mem_ctx;
10702 } else {
10703 mem_ctx = state;
10706 status = state->dispatch_recv(subreq, mem_ctx);
10707 TALLOC_FREE(subreq);
10708 if (!NT_STATUS_IS_OK(status)) {
10709 tevent_req_nterror(req, status);
10710 return;
10713 /* Copy out parameters */
10715 /* Copy result */
10716 state->orig.out.result = state->tmp.out.result;
10718 /* Reset temporary structure */
10719 ZERO_STRUCT(state->tmp);
10721 if (DEBUGLEVEL >= 10) {
10722 NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &state->orig);
10725 tevent_req_done(req);
10728 NTSTATUS rpccli_lsa_CREDRDELETE_recv(struct tevent_req *req,
10729 TALLOC_CTX *mem_ctx,
10730 NTSTATUS *result)
10732 struct rpccli_lsa_CREDRDELETE_state *state = tevent_req_data(
10733 req, struct rpccli_lsa_CREDRDELETE_state);
10734 NTSTATUS status;
10736 if (tevent_req_is_nterror(req, &status)) {
10737 tevent_req_received(req);
10738 return status;
10741 /* Steal possbile out parameters to the callers context */
10742 talloc_steal(mem_ctx, state->out_mem_ctx);
10744 /* Return result */
10745 *result = state->orig.out.result;
10747 tevent_req_received(req);
10748 return NT_STATUS_OK;
10751 NTSTATUS rpccli_lsa_CREDRDELETE(struct rpc_pipe_client *cli,
10752 TALLOC_CTX *mem_ctx)
10754 struct lsa_CREDRDELETE r;
10755 NTSTATUS status;
10757 /* In parameters */
10759 if (DEBUGLEVEL >= 10) {
10760 NDR_PRINT_IN_DEBUG(lsa_CREDRDELETE, &r);
10763 status = cli->dispatch(cli,
10764 mem_ctx,
10765 &ndr_table_lsarpc,
10766 NDR_LSA_CREDRDELETE,
10767 &r);
10769 if (!NT_STATUS_IS_OK(status)) {
10770 return status;
10773 if (DEBUGLEVEL >= 10) {
10774 NDR_PRINT_OUT_DEBUG(lsa_CREDRDELETE, &r);
10777 if (NT_STATUS_IS_ERR(status)) {
10778 return status;
10781 /* Return variables */
10783 /* Return result */
10784 return r.out.result;
10787 struct rpccli_lsa_CREDRGETTARGETINFO_state {
10788 struct lsa_CREDRGETTARGETINFO orig;
10789 struct lsa_CREDRGETTARGETINFO tmp;
10790 TALLOC_CTX *out_mem_ctx;
10791 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10794 static void rpccli_lsa_CREDRGETTARGETINFO_done(struct tevent_req *subreq);
10796 struct tevent_req *rpccli_lsa_CREDRGETTARGETINFO_send(TALLOC_CTX *mem_ctx,
10797 struct tevent_context *ev,
10798 struct rpc_pipe_client *cli)
10800 struct tevent_req *req;
10801 struct rpccli_lsa_CREDRGETTARGETINFO_state *state;
10802 struct tevent_req *subreq;
10804 req = tevent_req_create(mem_ctx, &state,
10805 struct rpccli_lsa_CREDRGETTARGETINFO_state);
10806 if (req == NULL) {
10807 return NULL;
10809 state->out_mem_ctx = NULL;
10810 state->dispatch_recv = cli->dispatch_recv;
10812 /* In parameters */
10814 /* Out parameters */
10816 /* Result */
10817 ZERO_STRUCT(state->orig.out.result);
10819 if (DEBUGLEVEL >= 10) {
10820 NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &state->orig);
10823 /* make a temporary copy, that we pass to the dispatch function */
10824 state->tmp = state->orig;
10826 subreq = cli->dispatch_send(state, ev, cli,
10827 &ndr_table_lsarpc,
10828 NDR_LSA_CREDRGETTARGETINFO,
10829 &state->tmp);
10830 if (tevent_req_nomem(subreq, req)) {
10831 return tevent_req_post(req, ev);
10833 tevent_req_set_callback(subreq, rpccli_lsa_CREDRGETTARGETINFO_done, req);
10834 return req;
10837 static void rpccli_lsa_CREDRGETTARGETINFO_done(struct tevent_req *subreq)
10839 struct tevent_req *req = tevent_req_callback_data(
10840 subreq, struct tevent_req);
10841 struct rpccli_lsa_CREDRGETTARGETINFO_state *state = tevent_req_data(
10842 req, struct rpccli_lsa_CREDRGETTARGETINFO_state);
10843 NTSTATUS status;
10844 TALLOC_CTX *mem_ctx;
10846 if (state->out_mem_ctx) {
10847 mem_ctx = state->out_mem_ctx;
10848 } else {
10849 mem_ctx = state;
10852 status = state->dispatch_recv(subreq, mem_ctx);
10853 TALLOC_FREE(subreq);
10854 if (!NT_STATUS_IS_OK(status)) {
10855 tevent_req_nterror(req, status);
10856 return;
10859 /* Copy out parameters */
10861 /* Copy result */
10862 state->orig.out.result = state->tmp.out.result;
10864 /* Reset temporary structure */
10865 ZERO_STRUCT(state->tmp);
10867 if (DEBUGLEVEL >= 10) {
10868 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &state->orig);
10871 tevent_req_done(req);
10874 NTSTATUS rpccli_lsa_CREDRGETTARGETINFO_recv(struct tevent_req *req,
10875 TALLOC_CTX *mem_ctx,
10876 NTSTATUS *result)
10878 struct rpccli_lsa_CREDRGETTARGETINFO_state *state = tevent_req_data(
10879 req, struct rpccli_lsa_CREDRGETTARGETINFO_state);
10880 NTSTATUS status;
10882 if (tevent_req_is_nterror(req, &status)) {
10883 tevent_req_received(req);
10884 return status;
10887 /* Steal possbile out parameters to the callers context */
10888 talloc_steal(mem_ctx, state->out_mem_ctx);
10890 /* Return result */
10891 *result = state->orig.out.result;
10893 tevent_req_received(req);
10894 return NT_STATUS_OK;
10897 NTSTATUS rpccli_lsa_CREDRGETTARGETINFO(struct rpc_pipe_client *cli,
10898 TALLOC_CTX *mem_ctx)
10900 struct lsa_CREDRGETTARGETINFO r;
10901 NTSTATUS status;
10903 /* In parameters */
10905 if (DEBUGLEVEL >= 10) {
10906 NDR_PRINT_IN_DEBUG(lsa_CREDRGETTARGETINFO, &r);
10909 status = cli->dispatch(cli,
10910 mem_ctx,
10911 &ndr_table_lsarpc,
10912 NDR_LSA_CREDRGETTARGETINFO,
10913 &r);
10915 if (!NT_STATUS_IS_OK(status)) {
10916 return status;
10919 if (DEBUGLEVEL >= 10) {
10920 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETTARGETINFO, &r);
10923 if (NT_STATUS_IS_ERR(status)) {
10924 return status;
10927 /* Return variables */
10929 /* Return result */
10930 return r.out.result;
10933 struct rpccli_lsa_CREDRPROFILELOADED_state {
10934 struct lsa_CREDRPROFILELOADED orig;
10935 struct lsa_CREDRPROFILELOADED tmp;
10936 TALLOC_CTX *out_mem_ctx;
10937 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
10940 static void rpccli_lsa_CREDRPROFILELOADED_done(struct tevent_req *subreq);
10942 struct tevent_req *rpccli_lsa_CREDRPROFILELOADED_send(TALLOC_CTX *mem_ctx,
10943 struct tevent_context *ev,
10944 struct rpc_pipe_client *cli)
10946 struct tevent_req *req;
10947 struct rpccli_lsa_CREDRPROFILELOADED_state *state;
10948 struct tevent_req *subreq;
10950 req = tevent_req_create(mem_ctx, &state,
10951 struct rpccli_lsa_CREDRPROFILELOADED_state);
10952 if (req == NULL) {
10953 return NULL;
10955 state->out_mem_ctx = NULL;
10956 state->dispatch_recv = cli->dispatch_recv;
10958 /* In parameters */
10960 /* Out parameters */
10962 /* Result */
10963 ZERO_STRUCT(state->orig.out.result);
10965 if (DEBUGLEVEL >= 10) {
10966 NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &state->orig);
10969 /* make a temporary copy, that we pass to the dispatch function */
10970 state->tmp = state->orig;
10972 subreq = cli->dispatch_send(state, ev, cli,
10973 &ndr_table_lsarpc,
10974 NDR_LSA_CREDRPROFILELOADED,
10975 &state->tmp);
10976 if (tevent_req_nomem(subreq, req)) {
10977 return tevent_req_post(req, ev);
10979 tevent_req_set_callback(subreq, rpccli_lsa_CREDRPROFILELOADED_done, req);
10980 return req;
10983 static void rpccli_lsa_CREDRPROFILELOADED_done(struct tevent_req *subreq)
10985 struct tevent_req *req = tevent_req_callback_data(
10986 subreq, struct tevent_req);
10987 struct rpccli_lsa_CREDRPROFILELOADED_state *state = tevent_req_data(
10988 req, struct rpccli_lsa_CREDRPROFILELOADED_state);
10989 NTSTATUS status;
10990 TALLOC_CTX *mem_ctx;
10992 if (state->out_mem_ctx) {
10993 mem_ctx = state->out_mem_ctx;
10994 } else {
10995 mem_ctx = state;
10998 status = state->dispatch_recv(subreq, mem_ctx);
10999 TALLOC_FREE(subreq);
11000 if (!NT_STATUS_IS_OK(status)) {
11001 tevent_req_nterror(req, status);
11002 return;
11005 /* Copy out parameters */
11007 /* Copy result */
11008 state->orig.out.result = state->tmp.out.result;
11010 /* Reset temporary structure */
11011 ZERO_STRUCT(state->tmp);
11013 if (DEBUGLEVEL >= 10) {
11014 NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &state->orig);
11017 tevent_req_done(req);
11020 NTSTATUS rpccli_lsa_CREDRPROFILELOADED_recv(struct tevent_req *req,
11021 TALLOC_CTX *mem_ctx,
11022 NTSTATUS *result)
11024 struct rpccli_lsa_CREDRPROFILELOADED_state *state = tevent_req_data(
11025 req, struct rpccli_lsa_CREDRPROFILELOADED_state);
11026 NTSTATUS status;
11028 if (tevent_req_is_nterror(req, &status)) {
11029 tevent_req_received(req);
11030 return status;
11033 /* Steal possbile out parameters to the callers context */
11034 talloc_steal(mem_ctx, state->out_mem_ctx);
11036 /* Return result */
11037 *result = state->orig.out.result;
11039 tevent_req_received(req);
11040 return NT_STATUS_OK;
11043 NTSTATUS rpccli_lsa_CREDRPROFILELOADED(struct rpc_pipe_client *cli,
11044 TALLOC_CTX *mem_ctx)
11046 struct lsa_CREDRPROFILELOADED r;
11047 NTSTATUS status;
11049 /* In parameters */
11051 if (DEBUGLEVEL >= 10) {
11052 NDR_PRINT_IN_DEBUG(lsa_CREDRPROFILELOADED, &r);
11055 status = cli->dispatch(cli,
11056 mem_ctx,
11057 &ndr_table_lsarpc,
11058 NDR_LSA_CREDRPROFILELOADED,
11059 &r);
11061 if (!NT_STATUS_IS_OK(status)) {
11062 return status;
11065 if (DEBUGLEVEL >= 10) {
11066 NDR_PRINT_OUT_DEBUG(lsa_CREDRPROFILELOADED, &r);
11069 if (NT_STATUS_IS_ERR(status)) {
11070 return status;
11073 /* Return variables */
11075 /* Return result */
11076 return r.out.result;
11079 struct rpccli_lsa_LookupNames3_state {
11080 struct lsa_LookupNames3 orig;
11081 struct lsa_LookupNames3 tmp;
11082 TALLOC_CTX *out_mem_ctx;
11083 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11086 static void rpccli_lsa_LookupNames3_done(struct tevent_req *subreq);
11088 struct tevent_req *rpccli_lsa_LookupNames3_send(TALLOC_CTX *mem_ctx,
11089 struct tevent_context *ev,
11090 struct rpc_pipe_client *cli,
11091 struct policy_handle *_handle /* [in] [ref] */,
11092 uint32_t _num_names /* [in] [range(0,1000)] */,
11093 struct lsa_String *_names /* [in] [size_is(num_names)] */,
11094 struct lsa_RefDomainList **_domains /* [out] [ref] */,
11095 struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
11096 enum lsa_LookupNamesLevel _level /* [in] */,
11097 uint32_t *_count /* [in,out] [ref] */,
11098 uint32_t _lookup_options /* [in] */,
11099 uint32_t _client_revision /* [in] */)
11101 struct tevent_req *req;
11102 struct rpccli_lsa_LookupNames3_state *state;
11103 struct tevent_req *subreq;
11105 req = tevent_req_create(mem_ctx, &state,
11106 struct rpccli_lsa_LookupNames3_state);
11107 if (req == NULL) {
11108 return NULL;
11110 state->out_mem_ctx = NULL;
11111 state->dispatch_recv = cli->dispatch_recv;
11113 /* In parameters */
11114 state->orig.in.handle = _handle;
11115 state->orig.in.num_names = _num_names;
11116 state->orig.in.names = _names;
11117 state->orig.in.sids = _sids;
11118 state->orig.in.level = _level;
11119 state->orig.in.count = _count;
11120 state->orig.in.lookup_options = _lookup_options;
11121 state->orig.in.client_revision = _client_revision;
11123 /* Out parameters */
11124 state->orig.out.domains = _domains;
11125 state->orig.out.sids = _sids;
11126 state->orig.out.count = _count;
11128 /* Result */
11129 ZERO_STRUCT(state->orig.out.result);
11131 if (DEBUGLEVEL >= 10) {
11132 NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &state->orig);
11135 state->out_mem_ctx = talloc_named_const(state, 0,
11136 "rpccli_lsa_LookupNames3_out_memory");
11137 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11138 return tevent_req_post(req, ev);
11141 /* make a temporary copy, that we pass to the dispatch function */
11142 state->tmp = state->orig;
11144 subreq = cli->dispatch_send(state, ev, cli,
11145 &ndr_table_lsarpc,
11146 NDR_LSA_LOOKUPNAMES3,
11147 &state->tmp);
11148 if (tevent_req_nomem(subreq, req)) {
11149 return tevent_req_post(req, ev);
11151 tevent_req_set_callback(subreq, rpccli_lsa_LookupNames3_done, req);
11152 return req;
11155 static void rpccli_lsa_LookupNames3_done(struct tevent_req *subreq)
11157 struct tevent_req *req = tevent_req_callback_data(
11158 subreq, struct tevent_req);
11159 struct rpccli_lsa_LookupNames3_state *state = tevent_req_data(
11160 req, struct rpccli_lsa_LookupNames3_state);
11161 NTSTATUS status;
11162 TALLOC_CTX *mem_ctx;
11164 if (state->out_mem_ctx) {
11165 mem_ctx = state->out_mem_ctx;
11166 } else {
11167 mem_ctx = state;
11170 status = state->dispatch_recv(subreq, mem_ctx);
11171 TALLOC_FREE(subreq);
11172 if (!NT_STATUS_IS_OK(status)) {
11173 tevent_req_nterror(req, status);
11174 return;
11177 /* Copy out parameters */
11178 *state->orig.out.domains = *state->tmp.out.domains;
11179 *state->orig.out.sids = *state->tmp.out.sids;
11180 *state->orig.out.count = *state->tmp.out.count;
11182 /* Copy result */
11183 state->orig.out.result = state->tmp.out.result;
11185 /* Reset temporary structure */
11186 ZERO_STRUCT(state->tmp);
11188 if (DEBUGLEVEL >= 10) {
11189 NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &state->orig);
11192 tevent_req_done(req);
11195 NTSTATUS rpccli_lsa_LookupNames3_recv(struct tevent_req *req,
11196 TALLOC_CTX *mem_ctx,
11197 NTSTATUS *result)
11199 struct rpccli_lsa_LookupNames3_state *state = tevent_req_data(
11200 req, struct rpccli_lsa_LookupNames3_state);
11201 NTSTATUS status;
11203 if (tevent_req_is_nterror(req, &status)) {
11204 tevent_req_received(req);
11205 return status;
11208 /* Steal possbile out parameters to the callers context */
11209 talloc_steal(mem_ctx, state->out_mem_ctx);
11211 /* Return result */
11212 *result = state->orig.out.result;
11214 tevent_req_received(req);
11215 return NT_STATUS_OK;
11218 NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli,
11219 TALLOC_CTX *mem_ctx,
11220 struct policy_handle *handle /* [in] [ref] */,
11221 uint32_t num_names /* [in] [range(0,1000)] */,
11222 struct lsa_String *names /* [in] [size_is(num_names)] */,
11223 struct lsa_RefDomainList **domains /* [out] [ref] */,
11224 struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
11225 enum lsa_LookupNamesLevel level /* [in] */,
11226 uint32_t *count /* [in,out] [ref] */,
11227 uint32_t lookup_options /* [in] */,
11228 uint32_t client_revision /* [in] */)
11230 struct lsa_LookupNames3 r;
11231 NTSTATUS status;
11233 /* In parameters */
11234 r.in.handle = handle;
11235 r.in.num_names = num_names;
11236 r.in.names = names;
11237 r.in.sids = sids;
11238 r.in.level = level;
11239 r.in.count = count;
11240 r.in.lookup_options = lookup_options;
11241 r.in.client_revision = client_revision;
11243 if (DEBUGLEVEL >= 10) {
11244 NDR_PRINT_IN_DEBUG(lsa_LookupNames3, &r);
11247 status = cli->dispatch(cli,
11248 mem_ctx,
11249 &ndr_table_lsarpc,
11250 NDR_LSA_LOOKUPNAMES3,
11251 &r);
11253 if (!NT_STATUS_IS_OK(status)) {
11254 return status;
11257 if (DEBUGLEVEL >= 10) {
11258 NDR_PRINT_OUT_DEBUG(lsa_LookupNames3, &r);
11261 if (NT_STATUS_IS_ERR(status)) {
11262 return status;
11265 /* Return variables */
11266 *domains = *r.out.domains;
11267 *sids = *r.out.sids;
11268 *count = *r.out.count;
11270 /* Return result */
11271 return r.out.result;
11274 struct rpccli_lsa_CREDRGETSESSIONTYPES_state {
11275 struct lsa_CREDRGETSESSIONTYPES orig;
11276 struct lsa_CREDRGETSESSIONTYPES tmp;
11277 TALLOC_CTX *out_mem_ctx;
11278 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11281 static void rpccli_lsa_CREDRGETSESSIONTYPES_done(struct tevent_req *subreq);
11283 struct tevent_req *rpccli_lsa_CREDRGETSESSIONTYPES_send(TALLOC_CTX *mem_ctx,
11284 struct tevent_context *ev,
11285 struct rpc_pipe_client *cli)
11287 struct tevent_req *req;
11288 struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state;
11289 struct tevent_req *subreq;
11291 req = tevent_req_create(mem_ctx, &state,
11292 struct rpccli_lsa_CREDRGETSESSIONTYPES_state);
11293 if (req == NULL) {
11294 return NULL;
11296 state->out_mem_ctx = NULL;
11297 state->dispatch_recv = cli->dispatch_recv;
11299 /* In parameters */
11301 /* Out parameters */
11303 /* Result */
11304 ZERO_STRUCT(state->orig.out.result);
11306 if (DEBUGLEVEL >= 10) {
11307 NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &state->orig);
11310 /* make a temporary copy, that we pass to the dispatch function */
11311 state->tmp = state->orig;
11313 subreq = cli->dispatch_send(state, ev, cli,
11314 &ndr_table_lsarpc,
11315 NDR_LSA_CREDRGETSESSIONTYPES,
11316 &state->tmp);
11317 if (tevent_req_nomem(subreq, req)) {
11318 return tevent_req_post(req, ev);
11320 tevent_req_set_callback(subreq, rpccli_lsa_CREDRGETSESSIONTYPES_done, req);
11321 return req;
11324 static void rpccli_lsa_CREDRGETSESSIONTYPES_done(struct tevent_req *subreq)
11326 struct tevent_req *req = tevent_req_callback_data(
11327 subreq, struct tevent_req);
11328 struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state = tevent_req_data(
11329 req, struct rpccli_lsa_CREDRGETSESSIONTYPES_state);
11330 NTSTATUS status;
11331 TALLOC_CTX *mem_ctx;
11333 if (state->out_mem_ctx) {
11334 mem_ctx = state->out_mem_ctx;
11335 } else {
11336 mem_ctx = state;
11339 status = state->dispatch_recv(subreq, mem_ctx);
11340 TALLOC_FREE(subreq);
11341 if (!NT_STATUS_IS_OK(status)) {
11342 tevent_req_nterror(req, status);
11343 return;
11346 /* Copy out parameters */
11348 /* Copy result */
11349 state->orig.out.result = state->tmp.out.result;
11351 /* Reset temporary structure */
11352 ZERO_STRUCT(state->tmp);
11354 if (DEBUGLEVEL >= 10) {
11355 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &state->orig);
11358 tevent_req_done(req);
11361 NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES_recv(struct tevent_req *req,
11362 TALLOC_CTX *mem_ctx,
11363 NTSTATUS *result)
11365 struct rpccli_lsa_CREDRGETSESSIONTYPES_state *state = tevent_req_data(
11366 req, struct rpccli_lsa_CREDRGETSESSIONTYPES_state);
11367 NTSTATUS status;
11369 if (tevent_req_is_nterror(req, &status)) {
11370 tevent_req_received(req);
11371 return status;
11374 /* Steal possbile out parameters to the callers context */
11375 talloc_steal(mem_ctx, state->out_mem_ctx);
11377 /* Return result */
11378 *result = state->orig.out.result;
11380 tevent_req_received(req);
11381 return NT_STATUS_OK;
11384 NTSTATUS rpccli_lsa_CREDRGETSESSIONTYPES(struct rpc_pipe_client *cli,
11385 TALLOC_CTX *mem_ctx)
11387 struct lsa_CREDRGETSESSIONTYPES r;
11388 NTSTATUS status;
11390 /* In parameters */
11392 if (DEBUGLEVEL >= 10) {
11393 NDR_PRINT_IN_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
11396 status = cli->dispatch(cli,
11397 mem_ctx,
11398 &ndr_table_lsarpc,
11399 NDR_LSA_CREDRGETSESSIONTYPES,
11400 &r);
11402 if (!NT_STATUS_IS_OK(status)) {
11403 return status;
11406 if (DEBUGLEVEL >= 10) {
11407 NDR_PRINT_OUT_DEBUG(lsa_CREDRGETSESSIONTYPES, &r);
11410 if (NT_STATUS_IS_ERR(status)) {
11411 return status;
11414 /* Return variables */
11416 /* Return result */
11417 return r.out.result;
11420 struct rpccli_lsa_LSARREGISTERAUDITEVENT_state {
11421 struct lsa_LSARREGISTERAUDITEVENT orig;
11422 struct lsa_LSARREGISTERAUDITEVENT tmp;
11423 TALLOC_CTX *out_mem_ctx;
11424 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11427 static void rpccli_lsa_LSARREGISTERAUDITEVENT_done(struct tevent_req *subreq);
11429 struct tevent_req *rpccli_lsa_LSARREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
11430 struct tevent_context *ev,
11431 struct rpc_pipe_client *cli)
11433 struct tevent_req *req;
11434 struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state;
11435 struct tevent_req *subreq;
11437 req = tevent_req_create(mem_ctx, &state,
11438 struct rpccli_lsa_LSARREGISTERAUDITEVENT_state);
11439 if (req == NULL) {
11440 return NULL;
11442 state->out_mem_ctx = NULL;
11443 state->dispatch_recv = cli->dispatch_recv;
11445 /* In parameters */
11447 /* Out parameters */
11449 /* Result */
11450 ZERO_STRUCT(state->orig.out.result);
11452 if (DEBUGLEVEL >= 10) {
11453 NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &state->orig);
11456 /* make a temporary copy, that we pass to the dispatch function */
11457 state->tmp = state->orig;
11459 subreq = cli->dispatch_send(state, ev, cli,
11460 &ndr_table_lsarpc,
11461 NDR_LSA_LSARREGISTERAUDITEVENT,
11462 &state->tmp);
11463 if (tevent_req_nomem(subreq, req)) {
11464 return tevent_req_post(req, ev);
11466 tevent_req_set_callback(subreq, rpccli_lsa_LSARREGISTERAUDITEVENT_done, req);
11467 return req;
11470 static void rpccli_lsa_LSARREGISTERAUDITEVENT_done(struct tevent_req *subreq)
11472 struct tevent_req *req = tevent_req_callback_data(
11473 subreq, struct tevent_req);
11474 struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state = tevent_req_data(
11475 req, struct rpccli_lsa_LSARREGISTERAUDITEVENT_state);
11476 NTSTATUS status;
11477 TALLOC_CTX *mem_ctx;
11479 if (state->out_mem_ctx) {
11480 mem_ctx = state->out_mem_ctx;
11481 } else {
11482 mem_ctx = state;
11485 status = state->dispatch_recv(subreq, mem_ctx);
11486 TALLOC_FREE(subreq);
11487 if (!NT_STATUS_IS_OK(status)) {
11488 tevent_req_nterror(req, status);
11489 return;
11492 /* Copy out parameters */
11494 /* Copy result */
11495 state->orig.out.result = state->tmp.out.result;
11497 /* Reset temporary structure */
11498 ZERO_STRUCT(state->tmp);
11500 if (DEBUGLEVEL >= 10) {
11501 NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &state->orig);
11504 tevent_req_done(req);
11507 NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT_recv(struct tevent_req *req,
11508 TALLOC_CTX *mem_ctx,
11509 NTSTATUS *result)
11511 struct rpccli_lsa_LSARREGISTERAUDITEVENT_state *state = tevent_req_data(
11512 req, struct rpccli_lsa_LSARREGISTERAUDITEVENT_state);
11513 NTSTATUS status;
11515 if (tevent_req_is_nterror(req, &status)) {
11516 tevent_req_received(req);
11517 return status;
11520 /* Steal possbile out parameters to the callers context */
11521 talloc_steal(mem_ctx, state->out_mem_ctx);
11523 /* Return result */
11524 *result = state->orig.out.result;
11526 tevent_req_received(req);
11527 return NT_STATUS_OK;
11530 NTSTATUS rpccli_lsa_LSARREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
11531 TALLOC_CTX *mem_ctx)
11533 struct lsa_LSARREGISTERAUDITEVENT r;
11534 NTSTATUS status;
11536 /* In parameters */
11538 if (DEBUGLEVEL >= 10) {
11539 NDR_PRINT_IN_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
11542 status = cli->dispatch(cli,
11543 mem_ctx,
11544 &ndr_table_lsarpc,
11545 NDR_LSA_LSARREGISTERAUDITEVENT,
11546 &r);
11548 if (!NT_STATUS_IS_OK(status)) {
11549 return status;
11552 if (DEBUGLEVEL >= 10) {
11553 NDR_PRINT_OUT_DEBUG(lsa_LSARREGISTERAUDITEVENT, &r);
11556 if (NT_STATUS_IS_ERR(status)) {
11557 return status;
11560 /* Return variables */
11562 /* Return result */
11563 return r.out.result;
11566 struct rpccli_lsa_LSARGENAUDITEVENT_state {
11567 struct lsa_LSARGENAUDITEVENT orig;
11568 struct lsa_LSARGENAUDITEVENT tmp;
11569 TALLOC_CTX *out_mem_ctx;
11570 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11573 static void rpccli_lsa_LSARGENAUDITEVENT_done(struct tevent_req *subreq);
11575 struct tevent_req *rpccli_lsa_LSARGENAUDITEVENT_send(TALLOC_CTX *mem_ctx,
11576 struct tevent_context *ev,
11577 struct rpc_pipe_client *cli)
11579 struct tevent_req *req;
11580 struct rpccli_lsa_LSARGENAUDITEVENT_state *state;
11581 struct tevent_req *subreq;
11583 req = tevent_req_create(mem_ctx, &state,
11584 struct rpccli_lsa_LSARGENAUDITEVENT_state);
11585 if (req == NULL) {
11586 return NULL;
11588 state->out_mem_ctx = NULL;
11589 state->dispatch_recv = cli->dispatch_recv;
11591 /* In parameters */
11593 /* Out parameters */
11595 /* Result */
11596 ZERO_STRUCT(state->orig.out.result);
11598 if (DEBUGLEVEL >= 10) {
11599 NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &state->orig);
11602 /* make a temporary copy, that we pass to the dispatch function */
11603 state->tmp = state->orig;
11605 subreq = cli->dispatch_send(state, ev, cli,
11606 &ndr_table_lsarpc,
11607 NDR_LSA_LSARGENAUDITEVENT,
11608 &state->tmp);
11609 if (tevent_req_nomem(subreq, req)) {
11610 return tevent_req_post(req, ev);
11612 tevent_req_set_callback(subreq, rpccli_lsa_LSARGENAUDITEVENT_done, req);
11613 return req;
11616 static void rpccli_lsa_LSARGENAUDITEVENT_done(struct tevent_req *subreq)
11618 struct tevent_req *req = tevent_req_callback_data(
11619 subreq, struct tevent_req);
11620 struct rpccli_lsa_LSARGENAUDITEVENT_state *state = tevent_req_data(
11621 req, struct rpccli_lsa_LSARGENAUDITEVENT_state);
11622 NTSTATUS status;
11623 TALLOC_CTX *mem_ctx;
11625 if (state->out_mem_ctx) {
11626 mem_ctx = state->out_mem_ctx;
11627 } else {
11628 mem_ctx = state;
11631 status = state->dispatch_recv(subreq, mem_ctx);
11632 TALLOC_FREE(subreq);
11633 if (!NT_STATUS_IS_OK(status)) {
11634 tevent_req_nterror(req, status);
11635 return;
11638 /* Copy out parameters */
11640 /* Copy result */
11641 state->orig.out.result = state->tmp.out.result;
11643 /* Reset temporary structure */
11644 ZERO_STRUCT(state->tmp);
11646 if (DEBUGLEVEL >= 10) {
11647 NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &state->orig);
11650 tevent_req_done(req);
11653 NTSTATUS rpccli_lsa_LSARGENAUDITEVENT_recv(struct tevent_req *req,
11654 TALLOC_CTX *mem_ctx,
11655 NTSTATUS *result)
11657 struct rpccli_lsa_LSARGENAUDITEVENT_state *state = tevent_req_data(
11658 req, struct rpccli_lsa_LSARGENAUDITEVENT_state);
11659 NTSTATUS status;
11661 if (tevent_req_is_nterror(req, &status)) {
11662 tevent_req_received(req);
11663 return status;
11666 /* Steal possbile out parameters to the callers context */
11667 talloc_steal(mem_ctx, state->out_mem_ctx);
11669 /* Return result */
11670 *result = state->orig.out.result;
11672 tevent_req_received(req);
11673 return NT_STATUS_OK;
11676 NTSTATUS rpccli_lsa_LSARGENAUDITEVENT(struct rpc_pipe_client *cli,
11677 TALLOC_CTX *mem_ctx)
11679 struct lsa_LSARGENAUDITEVENT r;
11680 NTSTATUS status;
11682 /* In parameters */
11684 if (DEBUGLEVEL >= 10) {
11685 NDR_PRINT_IN_DEBUG(lsa_LSARGENAUDITEVENT, &r);
11688 status = cli->dispatch(cli,
11689 mem_ctx,
11690 &ndr_table_lsarpc,
11691 NDR_LSA_LSARGENAUDITEVENT,
11692 &r);
11694 if (!NT_STATUS_IS_OK(status)) {
11695 return status;
11698 if (DEBUGLEVEL >= 10) {
11699 NDR_PRINT_OUT_DEBUG(lsa_LSARGENAUDITEVENT, &r);
11702 if (NT_STATUS_IS_ERR(status)) {
11703 return status;
11706 /* Return variables */
11708 /* Return result */
11709 return r.out.result;
11712 struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state {
11713 struct lsa_LSARUNREGISTERAUDITEVENT orig;
11714 struct lsa_LSARUNREGISTERAUDITEVENT tmp;
11715 TALLOC_CTX *out_mem_ctx;
11716 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11719 static void rpccli_lsa_LSARUNREGISTERAUDITEVENT_done(struct tevent_req *subreq);
11721 struct tevent_req *rpccli_lsa_LSARUNREGISTERAUDITEVENT_send(TALLOC_CTX *mem_ctx,
11722 struct tevent_context *ev,
11723 struct rpc_pipe_client *cli)
11725 struct tevent_req *req;
11726 struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state;
11727 struct tevent_req *subreq;
11729 req = tevent_req_create(mem_ctx, &state,
11730 struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state);
11731 if (req == NULL) {
11732 return NULL;
11734 state->out_mem_ctx = NULL;
11735 state->dispatch_recv = cli->dispatch_recv;
11737 /* In parameters */
11739 /* Out parameters */
11741 /* Result */
11742 ZERO_STRUCT(state->orig.out.result);
11744 if (DEBUGLEVEL >= 10) {
11745 NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &state->orig);
11748 /* make a temporary copy, that we pass to the dispatch function */
11749 state->tmp = state->orig;
11751 subreq = cli->dispatch_send(state, ev, cli,
11752 &ndr_table_lsarpc,
11753 NDR_LSA_LSARUNREGISTERAUDITEVENT,
11754 &state->tmp);
11755 if (tevent_req_nomem(subreq, req)) {
11756 return tevent_req_post(req, ev);
11758 tevent_req_set_callback(subreq, rpccli_lsa_LSARUNREGISTERAUDITEVENT_done, req);
11759 return req;
11762 static void rpccli_lsa_LSARUNREGISTERAUDITEVENT_done(struct tevent_req *subreq)
11764 struct tevent_req *req = tevent_req_callback_data(
11765 subreq, struct tevent_req);
11766 struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state = tevent_req_data(
11767 req, struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state);
11768 NTSTATUS status;
11769 TALLOC_CTX *mem_ctx;
11771 if (state->out_mem_ctx) {
11772 mem_ctx = state->out_mem_ctx;
11773 } else {
11774 mem_ctx = state;
11777 status = state->dispatch_recv(subreq, mem_ctx);
11778 TALLOC_FREE(subreq);
11779 if (!NT_STATUS_IS_OK(status)) {
11780 tevent_req_nterror(req, status);
11781 return;
11784 /* Copy out parameters */
11786 /* Copy result */
11787 state->orig.out.result = state->tmp.out.result;
11789 /* Reset temporary structure */
11790 ZERO_STRUCT(state->tmp);
11792 if (DEBUGLEVEL >= 10) {
11793 NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &state->orig);
11796 tevent_req_done(req);
11799 NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT_recv(struct tevent_req *req,
11800 TALLOC_CTX *mem_ctx,
11801 NTSTATUS *result)
11803 struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state *state = tevent_req_data(
11804 req, struct rpccli_lsa_LSARUNREGISTERAUDITEVENT_state);
11805 NTSTATUS status;
11807 if (tevent_req_is_nterror(req, &status)) {
11808 tevent_req_received(req);
11809 return status;
11812 /* Steal possbile out parameters to the callers context */
11813 talloc_steal(mem_ctx, state->out_mem_ctx);
11815 /* Return result */
11816 *result = state->orig.out.result;
11818 tevent_req_received(req);
11819 return NT_STATUS_OK;
11822 NTSTATUS rpccli_lsa_LSARUNREGISTERAUDITEVENT(struct rpc_pipe_client *cli,
11823 TALLOC_CTX *mem_ctx)
11825 struct lsa_LSARUNREGISTERAUDITEVENT r;
11826 NTSTATUS status;
11828 /* In parameters */
11830 if (DEBUGLEVEL >= 10) {
11831 NDR_PRINT_IN_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
11834 status = cli->dispatch(cli,
11835 mem_ctx,
11836 &ndr_table_lsarpc,
11837 NDR_LSA_LSARUNREGISTERAUDITEVENT,
11838 &r);
11840 if (!NT_STATUS_IS_OK(status)) {
11841 return status;
11844 if (DEBUGLEVEL >= 10) {
11845 NDR_PRINT_OUT_DEBUG(lsa_LSARUNREGISTERAUDITEVENT, &r);
11848 if (NT_STATUS_IS_ERR(status)) {
11849 return status;
11852 /* Return variables */
11854 /* Return result */
11855 return r.out.result;
11858 struct rpccli_lsa_lsaRQueryForestTrustInformation_state {
11859 struct lsa_lsaRQueryForestTrustInformation orig;
11860 struct lsa_lsaRQueryForestTrustInformation tmp;
11861 TALLOC_CTX *out_mem_ctx;
11862 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
11865 static void rpccli_lsa_lsaRQueryForestTrustInformation_done(struct tevent_req *subreq);
11867 struct tevent_req *rpccli_lsa_lsaRQueryForestTrustInformation_send(TALLOC_CTX *mem_ctx,
11868 struct tevent_context *ev,
11869 struct rpc_pipe_client *cli,
11870 struct policy_handle *_handle /* [in] [ref] */,
11871 struct lsa_String *_trusted_domain_name /* [in] [ref] */,
11872 uint16_t _unknown /* [in] */,
11873 struct lsa_ForestTrustInformation **_forest_trust_info /* [out] [ref] */)
11875 struct tevent_req *req;
11876 struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state;
11877 struct tevent_req *subreq;
11879 req = tevent_req_create(mem_ctx, &state,
11880 struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
11881 if (req == NULL) {
11882 return NULL;
11884 state->out_mem_ctx = NULL;
11885 state->dispatch_recv = cli->dispatch_recv;
11887 /* In parameters */
11888 state->orig.in.handle = _handle;
11889 state->orig.in.trusted_domain_name = _trusted_domain_name;
11890 state->orig.in.unknown = _unknown;
11892 /* Out parameters */
11893 state->orig.out.forest_trust_info = _forest_trust_info;
11895 /* Result */
11896 ZERO_STRUCT(state->orig.out.result);
11898 if (DEBUGLEVEL >= 10) {
11899 NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &state->orig);
11902 state->out_mem_ctx = talloc_named_const(state, 0,
11903 "rpccli_lsa_lsaRQueryForestTrustInformation_out_memory");
11904 if (tevent_req_nomem(state->out_mem_ctx, req)) {
11905 return tevent_req_post(req, ev);
11908 /* make a temporary copy, that we pass to the dispatch function */
11909 state->tmp = state->orig;
11911 subreq = cli->dispatch_send(state, ev, cli,
11912 &ndr_table_lsarpc,
11913 NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION,
11914 &state->tmp);
11915 if (tevent_req_nomem(subreq, req)) {
11916 return tevent_req_post(req, ev);
11918 tevent_req_set_callback(subreq, rpccli_lsa_lsaRQueryForestTrustInformation_done, req);
11919 return req;
11922 static void rpccli_lsa_lsaRQueryForestTrustInformation_done(struct tevent_req *subreq)
11924 struct tevent_req *req = tevent_req_callback_data(
11925 subreq, struct tevent_req);
11926 struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state = tevent_req_data(
11927 req, struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
11928 NTSTATUS status;
11929 TALLOC_CTX *mem_ctx;
11931 if (state->out_mem_ctx) {
11932 mem_ctx = state->out_mem_ctx;
11933 } else {
11934 mem_ctx = state;
11937 status = state->dispatch_recv(subreq, mem_ctx);
11938 TALLOC_FREE(subreq);
11939 if (!NT_STATUS_IS_OK(status)) {
11940 tevent_req_nterror(req, status);
11941 return;
11944 /* Copy out parameters */
11945 *state->orig.out.forest_trust_info = *state->tmp.out.forest_trust_info;
11947 /* Copy result */
11948 state->orig.out.result = state->tmp.out.result;
11950 /* Reset temporary structure */
11951 ZERO_STRUCT(state->tmp);
11953 if (DEBUGLEVEL >= 10) {
11954 NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &state->orig);
11957 tevent_req_done(req);
11960 NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation_recv(struct tevent_req *req,
11961 TALLOC_CTX *mem_ctx,
11962 NTSTATUS *result)
11964 struct rpccli_lsa_lsaRQueryForestTrustInformation_state *state = tevent_req_data(
11965 req, struct rpccli_lsa_lsaRQueryForestTrustInformation_state);
11966 NTSTATUS status;
11968 if (tevent_req_is_nterror(req, &status)) {
11969 tevent_req_received(req);
11970 return status;
11973 /* Steal possbile out parameters to the callers context */
11974 talloc_steal(mem_ctx, state->out_mem_ctx);
11976 /* Return result */
11977 *result = state->orig.out.result;
11979 tevent_req_received(req);
11980 return NT_STATUS_OK;
11983 NTSTATUS rpccli_lsa_lsaRQueryForestTrustInformation(struct rpc_pipe_client *cli,
11984 TALLOC_CTX *mem_ctx,
11985 struct policy_handle *handle /* [in] [ref] */,
11986 struct lsa_String *trusted_domain_name /* [in] [ref] */,
11987 uint16_t unknown /* [in] */,
11988 struct lsa_ForestTrustInformation **forest_trust_info /* [out] [ref] */)
11990 struct lsa_lsaRQueryForestTrustInformation r;
11991 NTSTATUS status;
11993 /* In parameters */
11994 r.in.handle = handle;
11995 r.in.trusted_domain_name = trusted_domain_name;
11996 r.in.unknown = unknown;
11998 if (DEBUGLEVEL >= 10) {
11999 NDR_PRINT_IN_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
12002 status = cli->dispatch(cli,
12003 mem_ctx,
12004 &ndr_table_lsarpc,
12005 NDR_LSA_LSARQUERYFORESTTRUSTINFORMATION,
12006 &r);
12008 if (!NT_STATUS_IS_OK(status)) {
12009 return status;
12012 if (DEBUGLEVEL >= 10) {
12013 NDR_PRINT_OUT_DEBUG(lsa_lsaRQueryForestTrustInformation, &r);
12016 if (NT_STATUS_IS_ERR(status)) {
12017 return status;
12020 /* Return variables */
12021 *forest_trust_info = *r.out.forest_trust_info;
12023 /* Return result */
12024 return r.out.result;
12027 struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state {
12028 struct lsa_LSARSETFORESTTRUSTINFORMATION orig;
12029 struct lsa_LSARSETFORESTTRUSTINFORMATION tmp;
12030 TALLOC_CTX *out_mem_ctx;
12031 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12034 static void rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done(struct tevent_req *subreq);
12036 struct tevent_req *rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_send(TALLOC_CTX *mem_ctx,
12037 struct tevent_context *ev,
12038 struct rpc_pipe_client *cli)
12040 struct tevent_req *req;
12041 struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state;
12042 struct tevent_req *subreq;
12044 req = tevent_req_create(mem_ctx, &state,
12045 struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
12046 if (req == NULL) {
12047 return NULL;
12049 state->out_mem_ctx = NULL;
12050 state->dispatch_recv = cli->dispatch_recv;
12052 /* In parameters */
12054 /* Out parameters */
12056 /* Result */
12057 ZERO_STRUCT(state->orig.out.result);
12059 if (DEBUGLEVEL >= 10) {
12060 NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &state->orig);
12063 /* make a temporary copy, that we pass to the dispatch function */
12064 state->tmp = state->orig;
12066 subreq = cli->dispatch_send(state, ev, cli,
12067 &ndr_table_lsarpc,
12068 NDR_LSA_LSARSETFORESTTRUSTINFORMATION,
12069 &state->tmp);
12070 if (tevent_req_nomem(subreq, req)) {
12071 return tevent_req_post(req, ev);
12073 tevent_req_set_callback(subreq, rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done, req);
12074 return req;
12077 static void rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_done(struct tevent_req *subreq)
12079 struct tevent_req *req = tevent_req_callback_data(
12080 subreq, struct tevent_req);
12081 struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state = tevent_req_data(
12082 req, struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
12083 NTSTATUS status;
12084 TALLOC_CTX *mem_ctx;
12086 if (state->out_mem_ctx) {
12087 mem_ctx = state->out_mem_ctx;
12088 } else {
12089 mem_ctx = state;
12092 status = state->dispatch_recv(subreq, mem_ctx);
12093 TALLOC_FREE(subreq);
12094 if (!NT_STATUS_IS_OK(status)) {
12095 tevent_req_nterror(req, status);
12096 return;
12099 /* Copy out parameters */
12101 /* Copy result */
12102 state->orig.out.result = state->tmp.out.result;
12104 /* Reset temporary structure */
12105 ZERO_STRUCT(state->tmp);
12107 if (DEBUGLEVEL >= 10) {
12108 NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &state->orig);
12111 tevent_req_done(req);
12114 NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_recv(struct tevent_req *req,
12115 TALLOC_CTX *mem_ctx,
12116 NTSTATUS *result)
12118 struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state *state = tevent_req_data(
12119 req, struct rpccli_lsa_LSARSETFORESTTRUSTINFORMATION_state);
12120 NTSTATUS status;
12122 if (tevent_req_is_nterror(req, &status)) {
12123 tevent_req_received(req);
12124 return status;
12127 /* Steal possbile out parameters to the callers context */
12128 talloc_steal(mem_ctx, state->out_mem_ctx);
12130 /* Return result */
12131 *result = state->orig.out.result;
12133 tevent_req_received(req);
12134 return NT_STATUS_OK;
12137 NTSTATUS rpccli_lsa_LSARSETFORESTTRUSTINFORMATION(struct rpc_pipe_client *cli,
12138 TALLOC_CTX *mem_ctx)
12140 struct lsa_LSARSETFORESTTRUSTINFORMATION r;
12141 NTSTATUS status;
12143 /* In parameters */
12145 if (DEBUGLEVEL >= 10) {
12146 NDR_PRINT_IN_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
12149 status = cli->dispatch(cli,
12150 mem_ctx,
12151 &ndr_table_lsarpc,
12152 NDR_LSA_LSARSETFORESTTRUSTINFORMATION,
12153 &r);
12155 if (!NT_STATUS_IS_OK(status)) {
12156 return status;
12159 if (DEBUGLEVEL >= 10) {
12160 NDR_PRINT_OUT_DEBUG(lsa_LSARSETFORESTTRUSTINFORMATION, &r);
12163 if (NT_STATUS_IS_ERR(status)) {
12164 return status;
12167 /* Return variables */
12169 /* Return result */
12170 return r.out.result;
12173 struct rpccli_lsa_CREDRRENAME_state {
12174 struct lsa_CREDRRENAME orig;
12175 struct lsa_CREDRRENAME tmp;
12176 TALLOC_CTX *out_mem_ctx;
12177 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12180 static void rpccli_lsa_CREDRRENAME_done(struct tevent_req *subreq);
12182 struct tevent_req *rpccli_lsa_CREDRRENAME_send(TALLOC_CTX *mem_ctx,
12183 struct tevent_context *ev,
12184 struct rpc_pipe_client *cli)
12186 struct tevent_req *req;
12187 struct rpccli_lsa_CREDRRENAME_state *state;
12188 struct tevent_req *subreq;
12190 req = tevent_req_create(mem_ctx, &state,
12191 struct rpccli_lsa_CREDRRENAME_state);
12192 if (req == NULL) {
12193 return NULL;
12195 state->out_mem_ctx = NULL;
12196 state->dispatch_recv = cli->dispatch_recv;
12198 /* In parameters */
12200 /* Out parameters */
12202 /* Result */
12203 ZERO_STRUCT(state->orig.out.result);
12205 if (DEBUGLEVEL >= 10) {
12206 NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &state->orig);
12209 /* make a temporary copy, that we pass to the dispatch function */
12210 state->tmp = state->orig;
12212 subreq = cli->dispatch_send(state, ev, cli,
12213 &ndr_table_lsarpc,
12214 NDR_LSA_CREDRRENAME,
12215 &state->tmp);
12216 if (tevent_req_nomem(subreq, req)) {
12217 return tevent_req_post(req, ev);
12219 tevent_req_set_callback(subreq, rpccli_lsa_CREDRRENAME_done, req);
12220 return req;
12223 static void rpccli_lsa_CREDRRENAME_done(struct tevent_req *subreq)
12225 struct tevent_req *req = tevent_req_callback_data(
12226 subreq, struct tevent_req);
12227 struct rpccli_lsa_CREDRRENAME_state *state = tevent_req_data(
12228 req, struct rpccli_lsa_CREDRRENAME_state);
12229 NTSTATUS status;
12230 TALLOC_CTX *mem_ctx;
12232 if (state->out_mem_ctx) {
12233 mem_ctx = state->out_mem_ctx;
12234 } else {
12235 mem_ctx = state;
12238 status = state->dispatch_recv(subreq, mem_ctx);
12239 TALLOC_FREE(subreq);
12240 if (!NT_STATUS_IS_OK(status)) {
12241 tevent_req_nterror(req, status);
12242 return;
12245 /* Copy out parameters */
12247 /* Copy result */
12248 state->orig.out.result = state->tmp.out.result;
12250 /* Reset temporary structure */
12251 ZERO_STRUCT(state->tmp);
12253 if (DEBUGLEVEL >= 10) {
12254 NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &state->orig);
12257 tevent_req_done(req);
12260 NTSTATUS rpccli_lsa_CREDRRENAME_recv(struct tevent_req *req,
12261 TALLOC_CTX *mem_ctx,
12262 NTSTATUS *result)
12264 struct rpccli_lsa_CREDRRENAME_state *state = tevent_req_data(
12265 req, struct rpccli_lsa_CREDRRENAME_state);
12266 NTSTATUS status;
12268 if (tevent_req_is_nterror(req, &status)) {
12269 tevent_req_received(req);
12270 return status;
12273 /* Steal possbile out parameters to the callers context */
12274 talloc_steal(mem_ctx, state->out_mem_ctx);
12276 /* Return result */
12277 *result = state->orig.out.result;
12279 tevent_req_received(req);
12280 return NT_STATUS_OK;
12283 NTSTATUS rpccli_lsa_CREDRRENAME(struct rpc_pipe_client *cli,
12284 TALLOC_CTX *mem_ctx)
12286 struct lsa_CREDRRENAME r;
12287 NTSTATUS status;
12289 /* In parameters */
12291 if (DEBUGLEVEL >= 10) {
12292 NDR_PRINT_IN_DEBUG(lsa_CREDRRENAME, &r);
12295 status = cli->dispatch(cli,
12296 mem_ctx,
12297 &ndr_table_lsarpc,
12298 NDR_LSA_CREDRRENAME,
12299 &r);
12301 if (!NT_STATUS_IS_OK(status)) {
12302 return status;
12305 if (DEBUGLEVEL >= 10) {
12306 NDR_PRINT_OUT_DEBUG(lsa_CREDRRENAME, &r);
12309 if (NT_STATUS_IS_ERR(status)) {
12310 return status;
12313 /* Return variables */
12315 /* Return result */
12316 return r.out.result;
12319 struct rpccli_lsa_LookupSids3_state {
12320 struct lsa_LookupSids3 orig;
12321 struct lsa_LookupSids3 tmp;
12322 TALLOC_CTX *out_mem_ctx;
12323 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12326 static void rpccli_lsa_LookupSids3_done(struct tevent_req *subreq);
12328 struct tevent_req *rpccli_lsa_LookupSids3_send(TALLOC_CTX *mem_ctx,
12329 struct tevent_context *ev,
12330 struct rpc_pipe_client *cli,
12331 struct lsa_SidArray *_sids /* [in] [ref] */,
12332 struct lsa_RefDomainList **_domains /* [out] [ref] */,
12333 struct lsa_TransNameArray2 *_names /* [in,out] [ref] */,
12334 uint16_t _level /* [in] */,
12335 uint32_t *_count /* [in,out] [ref] */,
12336 uint32_t _unknown1 /* [in] */,
12337 uint32_t _unknown2 /* [in] */)
12339 struct tevent_req *req;
12340 struct rpccli_lsa_LookupSids3_state *state;
12341 struct tevent_req *subreq;
12343 req = tevent_req_create(mem_ctx, &state,
12344 struct rpccli_lsa_LookupSids3_state);
12345 if (req == NULL) {
12346 return NULL;
12348 state->out_mem_ctx = NULL;
12349 state->dispatch_recv = cli->dispatch_recv;
12351 /* In parameters */
12352 state->orig.in.sids = _sids;
12353 state->orig.in.names = _names;
12354 state->orig.in.level = _level;
12355 state->orig.in.count = _count;
12356 state->orig.in.unknown1 = _unknown1;
12357 state->orig.in.unknown2 = _unknown2;
12359 /* Out parameters */
12360 state->orig.out.domains = _domains;
12361 state->orig.out.names = _names;
12362 state->orig.out.count = _count;
12364 /* Result */
12365 ZERO_STRUCT(state->orig.out.result);
12367 if (DEBUGLEVEL >= 10) {
12368 NDR_PRINT_IN_DEBUG(lsa_LookupSids3, &state->orig);
12371 state->out_mem_ctx = talloc_named_const(state, 0,
12372 "rpccli_lsa_LookupSids3_out_memory");
12373 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12374 return tevent_req_post(req, ev);
12377 /* make a temporary copy, that we pass to the dispatch function */
12378 state->tmp = state->orig;
12380 subreq = cli->dispatch_send(state, ev, cli,
12381 &ndr_table_lsarpc,
12382 NDR_LSA_LOOKUPSIDS3,
12383 &state->tmp);
12384 if (tevent_req_nomem(subreq, req)) {
12385 return tevent_req_post(req, ev);
12387 tevent_req_set_callback(subreq, rpccli_lsa_LookupSids3_done, req);
12388 return req;
12391 static void rpccli_lsa_LookupSids3_done(struct tevent_req *subreq)
12393 struct tevent_req *req = tevent_req_callback_data(
12394 subreq, struct tevent_req);
12395 struct rpccli_lsa_LookupSids3_state *state = tevent_req_data(
12396 req, struct rpccli_lsa_LookupSids3_state);
12397 NTSTATUS status;
12398 TALLOC_CTX *mem_ctx;
12400 if (state->out_mem_ctx) {
12401 mem_ctx = state->out_mem_ctx;
12402 } else {
12403 mem_ctx = state;
12406 status = state->dispatch_recv(subreq, mem_ctx);
12407 TALLOC_FREE(subreq);
12408 if (!NT_STATUS_IS_OK(status)) {
12409 tevent_req_nterror(req, status);
12410 return;
12413 /* Copy out parameters */
12414 *state->orig.out.domains = *state->tmp.out.domains;
12415 *state->orig.out.names = *state->tmp.out.names;
12416 *state->orig.out.count = *state->tmp.out.count;
12418 /* Copy result */
12419 state->orig.out.result = state->tmp.out.result;
12421 /* Reset temporary structure */
12422 ZERO_STRUCT(state->tmp);
12424 if (DEBUGLEVEL >= 10) {
12425 NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &state->orig);
12428 tevent_req_done(req);
12431 NTSTATUS rpccli_lsa_LookupSids3_recv(struct tevent_req *req,
12432 TALLOC_CTX *mem_ctx,
12433 NTSTATUS *result)
12435 struct rpccli_lsa_LookupSids3_state *state = tevent_req_data(
12436 req, struct rpccli_lsa_LookupSids3_state);
12437 NTSTATUS status;
12439 if (tevent_req_is_nterror(req, &status)) {
12440 tevent_req_received(req);
12441 return status;
12444 /* Steal possbile out parameters to the callers context */
12445 talloc_steal(mem_ctx, state->out_mem_ctx);
12447 /* Return result */
12448 *result = state->orig.out.result;
12450 tevent_req_received(req);
12451 return NT_STATUS_OK;
12454 NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli,
12455 TALLOC_CTX *mem_ctx,
12456 struct lsa_SidArray *sids /* [in] [ref] */,
12457 struct lsa_RefDomainList **domains /* [out] [ref] */,
12458 struct lsa_TransNameArray2 *names /* [in,out] [ref] */,
12459 uint16_t level /* [in] */,
12460 uint32_t *count /* [in,out] [ref] */,
12461 uint32_t unknown1 /* [in] */,
12462 uint32_t unknown2 /* [in] */)
12464 struct lsa_LookupSids3 r;
12465 NTSTATUS status;
12467 /* In parameters */
12468 r.in.sids = sids;
12469 r.in.names = names;
12470 r.in.level = level;
12471 r.in.count = count;
12472 r.in.unknown1 = unknown1;
12473 r.in.unknown2 = unknown2;
12475 if (DEBUGLEVEL >= 10) {
12476 NDR_PRINT_IN_DEBUG(lsa_LookupSids3, &r);
12479 status = cli->dispatch(cli,
12480 mem_ctx,
12481 &ndr_table_lsarpc,
12482 NDR_LSA_LOOKUPSIDS3,
12483 &r);
12485 if (!NT_STATUS_IS_OK(status)) {
12486 return status;
12489 if (DEBUGLEVEL >= 10) {
12490 NDR_PRINT_OUT_DEBUG(lsa_LookupSids3, &r);
12493 if (NT_STATUS_IS_ERR(status)) {
12494 return status;
12497 /* Return variables */
12498 *domains = *r.out.domains;
12499 *names = *r.out.names;
12500 *count = *r.out.count;
12502 /* Return result */
12503 return r.out.result;
12506 struct rpccli_lsa_LookupNames4_state {
12507 struct lsa_LookupNames4 orig;
12508 struct lsa_LookupNames4 tmp;
12509 TALLOC_CTX *out_mem_ctx;
12510 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12513 static void rpccli_lsa_LookupNames4_done(struct tevent_req *subreq);
12515 struct tevent_req *rpccli_lsa_LookupNames4_send(TALLOC_CTX *mem_ctx,
12516 struct tevent_context *ev,
12517 struct rpc_pipe_client *cli,
12518 uint32_t _num_names /* [in] [range(0,1000)] */,
12519 struct lsa_String *_names /* [in] [size_is(num_names)] */,
12520 struct lsa_RefDomainList **_domains /* [out] [ref] */,
12521 struct lsa_TransSidArray3 *_sids /* [in,out] [ref] */,
12522 enum lsa_LookupNamesLevel _level /* [in] */,
12523 uint32_t *_count /* [in,out] [ref] */,
12524 uint32_t _lookup_options /* [in] */,
12525 uint32_t _client_revision /* [in] */)
12527 struct tevent_req *req;
12528 struct rpccli_lsa_LookupNames4_state *state;
12529 struct tevent_req *subreq;
12531 req = tevent_req_create(mem_ctx, &state,
12532 struct rpccli_lsa_LookupNames4_state);
12533 if (req == NULL) {
12534 return NULL;
12536 state->out_mem_ctx = NULL;
12537 state->dispatch_recv = cli->dispatch_recv;
12539 /* In parameters */
12540 state->orig.in.num_names = _num_names;
12541 state->orig.in.names = _names;
12542 state->orig.in.sids = _sids;
12543 state->orig.in.level = _level;
12544 state->orig.in.count = _count;
12545 state->orig.in.lookup_options = _lookup_options;
12546 state->orig.in.client_revision = _client_revision;
12548 /* Out parameters */
12549 state->orig.out.domains = _domains;
12550 state->orig.out.sids = _sids;
12551 state->orig.out.count = _count;
12553 /* Result */
12554 ZERO_STRUCT(state->orig.out.result);
12556 if (DEBUGLEVEL >= 10) {
12557 NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &state->orig);
12560 state->out_mem_ctx = talloc_named_const(state, 0,
12561 "rpccli_lsa_LookupNames4_out_memory");
12562 if (tevent_req_nomem(state->out_mem_ctx, req)) {
12563 return tevent_req_post(req, ev);
12566 /* make a temporary copy, that we pass to the dispatch function */
12567 state->tmp = state->orig;
12569 subreq = cli->dispatch_send(state, ev, cli,
12570 &ndr_table_lsarpc,
12571 NDR_LSA_LOOKUPNAMES4,
12572 &state->tmp);
12573 if (tevent_req_nomem(subreq, req)) {
12574 return tevent_req_post(req, ev);
12576 tevent_req_set_callback(subreq, rpccli_lsa_LookupNames4_done, req);
12577 return req;
12580 static void rpccli_lsa_LookupNames4_done(struct tevent_req *subreq)
12582 struct tevent_req *req = tevent_req_callback_data(
12583 subreq, struct tevent_req);
12584 struct rpccli_lsa_LookupNames4_state *state = tevent_req_data(
12585 req, struct rpccli_lsa_LookupNames4_state);
12586 NTSTATUS status;
12587 TALLOC_CTX *mem_ctx;
12589 if (state->out_mem_ctx) {
12590 mem_ctx = state->out_mem_ctx;
12591 } else {
12592 mem_ctx = state;
12595 status = state->dispatch_recv(subreq, mem_ctx);
12596 TALLOC_FREE(subreq);
12597 if (!NT_STATUS_IS_OK(status)) {
12598 tevent_req_nterror(req, status);
12599 return;
12602 /* Copy out parameters */
12603 *state->orig.out.domains = *state->tmp.out.domains;
12604 *state->orig.out.sids = *state->tmp.out.sids;
12605 *state->orig.out.count = *state->tmp.out.count;
12607 /* Copy result */
12608 state->orig.out.result = state->tmp.out.result;
12610 /* Reset temporary structure */
12611 ZERO_STRUCT(state->tmp);
12613 if (DEBUGLEVEL >= 10) {
12614 NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &state->orig);
12617 tevent_req_done(req);
12620 NTSTATUS rpccli_lsa_LookupNames4_recv(struct tevent_req *req,
12621 TALLOC_CTX *mem_ctx,
12622 NTSTATUS *result)
12624 struct rpccli_lsa_LookupNames4_state *state = tevent_req_data(
12625 req, struct rpccli_lsa_LookupNames4_state);
12626 NTSTATUS status;
12628 if (tevent_req_is_nterror(req, &status)) {
12629 tevent_req_received(req);
12630 return status;
12633 /* Steal possbile out parameters to the callers context */
12634 talloc_steal(mem_ctx, state->out_mem_ctx);
12636 /* Return result */
12637 *result = state->orig.out.result;
12639 tevent_req_received(req);
12640 return NT_STATUS_OK;
12643 NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli,
12644 TALLOC_CTX *mem_ctx,
12645 uint32_t num_names /* [in] [range(0,1000)] */,
12646 struct lsa_String *names /* [in] [size_is(num_names)] */,
12647 struct lsa_RefDomainList **domains /* [out] [ref] */,
12648 struct lsa_TransSidArray3 *sids /* [in,out] [ref] */,
12649 enum lsa_LookupNamesLevel level /* [in] */,
12650 uint32_t *count /* [in,out] [ref] */,
12651 uint32_t lookup_options /* [in] */,
12652 uint32_t client_revision /* [in] */)
12654 struct lsa_LookupNames4 r;
12655 NTSTATUS status;
12657 /* In parameters */
12658 r.in.num_names = num_names;
12659 r.in.names = names;
12660 r.in.sids = sids;
12661 r.in.level = level;
12662 r.in.count = count;
12663 r.in.lookup_options = lookup_options;
12664 r.in.client_revision = client_revision;
12666 if (DEBUGLEVEL >= 10) {
12667 NDR_PRINT_IN_DEBUG(lsa_LookupNames4, &r);
12670 status = cli->dispatch(cli,
12671 mem_ctx,
12672 &ndr_table_lsarpc,
12673 NDR_LSA_LOOKUPNAMES4,
12674 &r);
12676 if (!NT_STATUS_IS_OK(status)) {
12677 return status;
12680 if (DEBUGLEVEL >= 10) {
12681 NDR_PRINT_OUT_DEBUG(lsa_LookupNames4, &r);
12684 if (NT_STATUS_IS_ERR(status)) {
12685 return status;
12688 /* Return variables */
12689 *domains = *r.out.domains;
12690 *sids = *r.out.sids;
12691 *count = *r.out.count;
12693 /* Return result */
12694 return r.out.result;
12697 struct rpccli_lsa_LSAROPENPOLICYSCE_state {
12698 struct lsa_LSAROPENPOLICYSCE orig;
12699 struct lsa_LSAROPENPOLICYSCE tmp;
12700 TALLOC_CTX *out_mem_ctx;
12701 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12704 static void rpccli_lsa_LSAROPENPOLICYSCE_done(struct tevent_req *subreq);
12706 struct tevent_req *rpccli_lsa_LSAROPENPOLICYSCE_send(TALLOC_CTX *mem_ctx,
12707 struct tevent_context *ev,
12708 struct rpc_pipe_client *cli)
12710 struct tevent_req *req;
12711 struct rpccli_lsa_LSAROPENPOLICYSCE_state *state;
12712 struct tevent_req *subreq;
12714 req = tevent_req_create(mem_ctx, &state,
12715 struct rpccli_lsa_LSAROPENPOLICYSCE_state);
12716 if (req == NULL) {
12717 return NULL;
12719 state->out_mem_ctx = NULL;
12720 state->dispatch_recv = cli->dispatch_recv;
12722 /* In parameters */
12724 /* Out parameters */
12726 /* Result */
12727 ZERO_STRUCT(state->orig.out.result);
12729 if (DEBUGLEVEL >= 10) {
12730 NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, &state->orig);
12733 /* make a temporary copy, that we pass to the dispatch function */
12734 state->tmp = state->orig;
12736 subreq = cli->dispatch_send(state, ev, cli,
12737 &ndr_table_lsarpc,
12738 NDR_LSA_LSAROPENPOLICYSCE,
12739 &state->tmp);
12740 if (tevent_req_nomem(subreq, req)) {
12741 return tevent_req_post(req, ev);
12743 tevent_req_set_callback(subreq, rpccli_lsa_LSAROPENPOLICYSCE_done, req);
12744 return req;
12747 static void rpccli_lsa_LSAROPENPOLICYSCE_done(struct tevent_req *subreq)
12749 struct tevent_req *req = tevent_req_callback_data(
12750 subreq, struct tevent_req);
12751 struct rpccli_lsa_LSAROPENPOLICYSCE_state *state = tevent_req_data(
12752 req, struct rpccli_lsa_LSAROPENPOLICYSCE_state);
12753 NTSTATUS status;
12754 TALLOC_CTX *mem_ctx;
12756 if (state->out_mem_ctx) {
12757 mem_ctx = state->out_mem_ctx;
12758 } else {
12759 mem_ctx = state;
12762 status = state->dispatch_recv(subreq, mem_ctx);
12763 TALLOC_FREE(subreq);
12764 if (!NT_STATUS_IS_OK(status)) {
12765 tevent_req_nterror(req, status);
12766 return;
12769 /* Copy out parameters */
12771 /* Copy result */
12772 state->orig.out.result = state->tmp.out.result;
12774 /* Reset temporary structure */
12775 ZERO_STRUCT(state->tmp);
12777 if (DEBUGLEVEL >= 10) {
12778 NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &state->orig);
12781 tevent_req_done(req);
12784 NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE_recv(struct tevent_req *req,
12785 TALLOC_CTX *mem_ctx,
12786 NTSTATUS *result)
12788 struct rpccli_lsa_LSAROPENPOLICYSCE_state *state = tevent_req_data(
12789 req, struct rpccli_lsa_LSAROPENPOLICYSCE_state);
12790 NTSTATUS status;
12792 if (tevent_req_is_nterror(req, &status)) {
12793 tevent_req_received(req);
12794 return status;
12797 /* Steal possbile out parameters to the callers context */
12798 talloc_steal(mem_ctx, state->out_mem_ctx);
12800 /* Return result */
12801 *result = state->orig.out.result;
12803 tevent_req_received(req);
12804 return NT_STATUS_OK;
12807 NTSTATUS rpccli_lsa_LSAROPENPOLICYSCE(struct rpc_pipe_client *cli,
12808 TALLOC_CTX *mem_ctx)
12810 struct lsa_LSAROPENPOLICYSCE r;
12811 NTSTATUS status;
12813 /* In parameters */
12815 if (DEBUGLEVEL >= 10) {
12816 NDR_PRINT_IN_DEBUG(lsa_LSAROPENPOLICYSCE, &r);
12819 status = cli->dispatch(cli,
12820 mem_ctx,
12821 &ndr_table_lsarpc,
12822 NDR_LSA_LSAROPENPOLICYSCE,
12823 &r);
12825 if (!NT_STATUS_IS_OK(status)) {
12826 return status;
12829 if (DEBUGLEVEL >= 10) {
12830 NDR_PRINT_OUT_DEBUG(lsa_LSAROPENPOLICYSCE, &r);
12833 if (NT_STATUS_IS_ERR(status)) {
12834 return status;
12837 /* Return variables */
12839 /* Return result */
12840 return r.out.result;
12843 struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state {
12844 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE orig;
12845 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE tmp;
12846 TALLOC_CTX *out_mem_ctx;
12847 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12850 static void rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq);
12852 struct tevent_req *rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
12853 struct tevent_context *ev,
12854 struct rpc_pipe_client *cli)
12856 struct tevent_req *req;
12857 struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state;
12858 struct tevent_req *subreq;
12860 req = tevent_req_create(mem_ctx, &state,
12861 struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state);
12862 if (req == NULL) {
12863 return NULL;
12865 state->out_mem_ctx = NULL;
12866 state->dispatch_recv = cli->dispatch_recv;
12868 /* In parameters */
12870 /* Out parameters */
12872 /* Result */
12873 ZERO_STRUCT(state->orig.out.result);
12875 if (DEBUGLEVEL >= 10) {
12876 NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &state->orig);
12879 /* make a temporary copy, that we pass to the dispatch function */
12880 state->tmp = state->orig;
12882 subreq = cli->dispatch_send(state, ev, cli,
12883 &ndr_table_lsarpc,
12884 NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE,
12885 &state->tmp);
12886 if (tevent_req_nomem(subreq, req)) {
12887 return tevent_req_post(req, ev);
12889 tevent_req_set_callback(subreq, rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done, req);
12890 return req;
12893 static void rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq)
12895 struct tevent_req *req = tevent_req_callback_data(
12896 subreq, struct tevent_req);
12897 struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
12898 req, struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state);
12899 NTSTATUS status;
12900 TALLOC_CTX *mem_ctx;
12902 if (state->out_mem_ctx) {
12903 mem_ctx = state->out_mem_ctx;
12904 } else {
12905 mem_ctx = state;
12908 status = state->dispatch_recv(subreq, mem_ctx);
12909 TALLOC_FREE(subreq);
12910 if (!NT_STATUS_IS_OK(status)) {
12911 tevent_req_nterror(req, status);
12912 return;
12915 /* Copy out parameters */
12917 /* Copy result */
12918 state->orig.out.result = state->tmp.out.result;
12920 /* Reset temporary structure */
12921 ZERO_STRUCT(state->tmp);
12923 if (DEBUGLEVEL >= 10) {
12924 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &state->orig);
12927 tevent_req_done(req);
12930 NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
12931 TALLOC_CTX *mem_ctx,
12932 NTSTATUS *result)
12934 struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
12935 req, struct rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE_state);
12936 NTSTATUS status;
12938 if (tevent_req_is_nterror(req, &status)) {
12939 tevent_req_received(req);
12940 return status;
12943 /* Steal possbile out parameters to the callers context */
12944 talloc_steal(mem_ctx, state->out_mem_ctx);
12946 /* Return result */
12947 *result = state->orig.out.result;
12949 tevent_req_received(req);
12950 return NT_STATUS_OK;
12953 NTSTATUS rpccli_lsa_LSARADTREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
12954 TALLOC_CTX *mem_ctx)
12956 struct lsa_LSARADTREGISTERSECURITYEVENTSOURCE r;
12957 NTSTATUS status;
12959 /* In parameters */
12961 if (DEBUGLEVEL >= 10) {
12962 NDR_PRINT_IN_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r);
12965 status = cli->dispatch(cli,
12966 mem_ctx,
12967 &ndr_table_lsarpc,
12968 NDR_LSA_LSARADTREGISTERSECURITYEVENTSOURCE,
12969 &r);
12971 if (!NT_STATUS_IS_OK(status)) {
12972 return status;
12975 if (DEBUGLEVEL >= 10) {
12976 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREGISTERSECURITYEVENTSOURCE, &r);
12979 if (NT_STATUS_IS_ERR(status)) {
12980 return status;
12983 /* Return variables */
12985 /* Return result */
12986 return r.out.result;
12989 struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state {
12990 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE orig;
12991 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE tmp;
12992 TALLOC_CTX *out_mem_ctx;
12993 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
12996 static void rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq);
12998 struct tevent_req *rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_send(TALLOC_CTX *mem_ctx,
12999 struct tevent_context *ev,
13000 struct rpc_pipe_client *cli)
13002 struct tevent_req *req;
13003 struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state;
13004 struct tevent_req *subreq;
13006 req = tevent_req_create(mem_ctx, &state,
13007 struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state);
13008 if (req == NULL) {
13009 return NULL;
13011 state->out_mem_ctx = NULL;
13012 state->dispatch_recv = cli->dispatch_recv;
13014 /* In parameters */
13016 /* Out parameters */
13018 /* Result */
13019 ZERO_STRUCT(state->orig.out.result);
13021 if (DEBUGLEVEL >= 10) {
13022 NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &state->orig);
13025 /* make a temporary copy, that we pass to the dispatch function */
13026 state->tmp = state->orig;
13028 subreq = cli->dispatch_send(state, ev, cli,
13029 &ndr_table_lsarpc,
13030 NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE,
13031 &state->tmp);
13032 if (tevent_req_nomem(subreq, req)) {
13033 return tevent_req_post(req, ev);
13035 tevent_req_set_callback(subreq, rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done, req);
13036 return req;
13039 static void rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_done(struct tevent_req *subreq)
13041 struct tevent_req *req = tevent_req_callback_data(
13042 subreq, struct tevent_req);
13043 struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
13044 req, struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state);
13045 NTSTATUS status;
13046 TALLOC_CTX *mem_ctx;
13048 if (state->out_mem_ctx) {
13049 mem_ctx = state->out_mem_ctx;
13050 } else {
13051 mem_ctx = state;
13054 status = state->dispatch_recv(subreq, mem_ctx);
13055 TALLOC_FREE(subreq);
13056 if (!NT_STATUS_IS_OK(status)) {
13057 tevent_req_nterror(req, status);
13058 return;
13061 /* Copy out parameters */
13063 /* Copy result */
13064 state->orig.out.result = state->tmp.out.result;
13066 /* Reset temporary structure */
13067 ZERO_STRUCT(state->tmp);
13069 if (DEBUGLEVEL >= 10) {
13070 NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &state->orig);
13073 tevent_req_done(req);
13076 NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_recv(struct tevent_req *req,
13077 TALLOC_CTX *mem_ctx,
13078 NTSTATUS *result)
13080 struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state *state = tevent_req_data(
13081 req, struct rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE_state);
13082 NTSTATUS status;
13084 if (tevent_req_is_nterror(req, &status)) {
13085 tevent_req_received(req);
13086 return status;
13089 /* Steal possbile out parameters to the callers context */
13090 talloc_steal(mem_ctx, state->out_mem_ctx);
13092 /* Return result */
13093 *result = state->orig.out.result;
13095 tevent_req_received(req);
13096 return NT_STATUS_OK;
13099 NTSTATUS rpccli_lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE(struct rpc_pipe_client *cli,
13100 TALLOC_CTX *mem_ctx)
13102 struct lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE r;
13103 NTSTATUS status;
13105 /* In parameters */
13107 if (DEBUGLEVEL >= 10) {
13108 NDR_PRINT_IN_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r);
13111 status = cli->dispatch(cli,
13112 mem_ctx,
13113 &ndr_table_lsarpc,
13114 NDR_LSA_LSARADTUNREGISTERSECURITYEVENTSOURCE,
13115 &r);
13117 if (!NT_STATUS_IS_OK(status)) {
13118 return status;
13121 if (DEBUGLEVEL >= 10) {
13122 NDR_PRINT_OUT_DEBUG(lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE, &r);
13125 if (NT_STATUS_IS_ERR(status)) {
13126 return status;
13129 /* Return variables */
13131 /* Return result */
13132 return r.out.result;
13135 struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state {
13136 struct lsa_LSARADTREPORTSECURITYEVENT orig;
13137 struct lsa_LSARADTREPORTSECURITYEVENT tmp;
13138 TALLOC_CTX *out_mem_ctx;
13139 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
13142 static void rpccli_lsa_LSARADTREPORTSECURITYEVENT_done(struct tevent_req *subreq);
13144 struct tevent_req *rpccli_lsa_LSARADTREPORTSECURITYEVENT_send(TALLOC_CTX *mem_ctx,
13145 struct tevent_context *ev,
13146 struct rpc_pipe_client *cli)
13148 struct tevent_req *req;
13149 struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state;
13150 struct tevent_req *subreq;
13152 req = tevent_req_create(mem_ctx, &state,
13153 struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state);
13154 if (req == NULL) {
13155 return NULL;
13157 state->out_mem_ctx = NULL;
13158 state->dispatch_recv = cli->dispatch_recv;
13160 /* In parameters */
13162 /* Out parameters */
13164 /* Result */
13165 ZERO_STRUCT(state->orig.out.result);
13167 if (DEBUGLEVEL >= 10) {
13168 NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &state->orig);
13171 /* make a temporary copy, that we pass to the dispatch function */
13172 state->tmp = state->orig;
13174 subreq = cli->dispatch_send(state, ev, cli,
13175 &ndr_table_lsarpc,
13176 NDR_LSA_LSARADTREPORTSECURITYEVENT,
13177 &state->tmp);
13178 if (tevent_req_nomem(subreq, req)) {
13179 return tevent_req_post(req, ev);
13181 tevent_req_set_callback(subreq, rpccli_lsa_LSARADTREPORTSECURITYEVENT_done, req);
13182 return req;
13185 static void rpccli_lsa_LSARADTREPORTSECURITYEVENT_done(struct tevent_req *subreq)
13187 struct tevent_req *req = tevent_req_callback_data(
13188 subreq, struct tevent_req);
13189 struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state = tevent_req_data(
13190 req, struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state);
13191 NTSTATUS status;
13192 TALLOC_CTX *mem_ctx;
13194 if (state->out_mem_ctx) {
13195 mem_ctx = state->out_mem_ctx;
13196 } else {
13197 mem_ctx = state;
13200 status = state->dispatch_recv(subreq, mem_ctx);
13201 TALLOC_FREE(subreq);
13202 if (!NT_STATUS_IS_OK(status)) {
13203 tevent_req_nterror(req, status);
13204 return;
13207 /* Copy out parameters */
13209 /* Copy result */
13210 state->orig.out.result = state->tmp.out.result;
13212 /* Reset temporary structure */
13213 ZERO_STRUCT(state->tmp);
13215 if (DEBUGLEVEL >= 10) {
13216 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &state->orig);
13219 tevent_req_done(req);
13222 NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT_recv(struct tevent_req *req,
13223 TALLOC_CTX *mem_ctx,
13224 NTSTATUS *result)
13226 struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state *state = tevent_req_data(
13227 req, struct rpccli_lsa_LSARADTREPORTSECURITYEVENT_state);
13228 NTSTATUS status;
13230 if (tevent_req_is_nterror(req, &status)) {
13231 tevent_req_received(req);
13232 return status;
13235 /* Steal possbile out parameters to the callers context */
13236 talloc_steal(mem_ctx, state->out_mem_ctx);
13238 /* Return result */
13239 *result = state->orig.out.result;
13241 tevent_req_received(req);
13242 return NT_STATUS_OK;
13245 NTSTATUS rpccli_lsa_LSARADTREPORTSECURITYEVENT(struct rpc_pipe_client *cli,
13246 TALLOC_CTX *mem_ctx)
13248 struct lsa_LSARADTREPORTSECURITYEVENT r;
13249 NTSTATUS status;
13251 /* In parameters */
13253 if (DEBUGLEVEL >= 10) {
13254 NDR_PRINT_IN_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r);
13257 status = cli->dispatch(cli,
13258 mem_ctx,
13259 &ndr_table_lsarpc,
13260 NDR_LSA_LSARADTREPORTSECURITYEVENT,
13261 &r);
13263 if (!NT_STATUS_IS_OK(status)) {
13264 return status;
13267 if (DEBUGLEVEL >= 10) {
13268 NDR_PRINT_OUT_DEBUG(lsa_LSARADTREPORTSECURITYEVENT, &r);
13271 if (NT_STATUS_IS_ERR(status)) {
13272 return status;
13275 /* Return variables */
13277 /* Return result */
13278 return r.out.result;