2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
7 #include "../librpc/gen_ndr/cli_samr.h"
9 struct rpccli_samr_Connect_state
{
10 struct samr_Connect orig
;
11 struct samr_Connect tmp
;
12 TALLOC_CTX
*out_mem_ctx
;
13 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16 static void rpccli_samr_Connect_done(struct tevent_req
*subreq
);
18 struct tevent_req
*rpccli_samr_Connect_send(TALLOC_CTX
*mem_ctx
,
19 struct tevent_context
*ev
,
20 struct rpc_pipe_client
*cli
,
21 uint16_t *_system_name
/* [in] [unique] */,
22 uint32_t _access_mask
/* [in] */,
23 struct policy_handle
*_connect_handle
/* [out] [ref] */)
25 struct tevent_req
*req
;
26 struct rpccli_samr_Connect_state
*state
;
27 struct tevent_req
*subreq
;
29 req
= tevent_req_create(mem_ctx
, &state
,
30 struct rpccli_samr_Connect_state
);
34 state
->out_mem_ctx
= NULL
;
35 state
->dispatch_recv
= cli
->dispatch_recv
;
38 state
->orig
.in
.system_name
= _system_name
;
39 state
->orig
.in
.access_mask
= _access_mask
;
42 state
->orig
.out
.connect_handle
= _connect_handle
;
45 ZERO_STRUCT(state
->orig
.out
.result
);
47 if (DEBUGLEVEL
>= 10) {
48 NDR_PRINT_IN_DEBUG(samr_Connect
, &state
->orig
);
51 state
->out_mem_ctx
= talloc_named_const(state
, 0,
52 "rpccli_samr_Connect_out_memory");
53 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
54 return tevent_req_post(req
, ev
);
57 /* make a temporary copy, that we pass to the dispatch function */
58 state
->tmp
= state
->orig
;
60 subreq
= cli
->dispatch_send(state
, ev
, cli
,
64 if (tevent_req_nomem(subreq
, req
)) {
65 return tevent_req_post(req
, ev
);
67 tevent_req_set_callback(subreq
, rpccli_samr_Connect_done
, req
);
71 static void rpccli_samr_Connect_done(struct tevent_req
*subreq
)
73 struct tevent_req
*req
= tevent_req_callback_data(
74 subreq
, struct tevent_req
);
75 struct rpccli_samr_Connect_state
*state
= tevent_req_data(
76 req
, struct rpccli_samr_Connect_state
);
80 if (state
->out_mem_ctx
) {
81 mem_ctx
= state
->out_mem_ctx
;
86 status
= state
->dispatch_recv(subreq
, mem_ctx
);
88 if (!NT_STATUS_IS_OK(status
)) {
89 tevent_req_nterror(req
, status
);
93 /* Copy out parameters */
94 *state
->orig
.out
.connect_handle
= *state
->tmp
.out
.connect_handle
;
97 state
->orig
.out
.result
= state
->tmp
.out
.result
;
99 /* Reset temporary structure */
100 ZERO_STRUCT(state
->tmp
);
102 if (DEBUGLEVEL
>= 10) {
103 NDR_PRINT_OUT_DEBUG(samr_Connect
, &state
->orig
);
106 tevent_req_done(req
);
109 NTSTATUS
rpccli_samr_Connect_recv(struct tevent_req
*req
,
113 struct rpccli_samr_Connect_state
*state
= tevent_req_data(
114 req
, struct rpccli_samr_Connect_state
);
117 if (tevent_req_is_nterror(req
, &status
)) {
118 tevent_req_received(req
);
122 /* Steal possbile out parameters to the callers context */
123 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
126 *result
= state
->orig
.out
.result
;
128 tevent_req_received(req
);
132 NTSTATUS
rpccli_samr_Connect(struct rpc_pipe_client
*cli
,
134 uint16_t *system_name
/* [in] [unique] */,
135 uint32_t access_mask
/* [in] */,
136 struct policy_handle
*connect_handle
/* [out] [ref] */)
138 struct samr_Connect r
;
142 r
.in
.system_name
= system_name
;
143 r
.in
.access_mask
= access_mask
;
145 if (DEBUGLEVEL
>= 10) {
146 NDR_PRINT_IN_DEBUG(samr_Connect
, &r
);
149 status
= cli
->dispatch(cli
,
155 if (!NT_STATUS_IS_OK(status
)) {
159 if (DEBUGLEVEL
>= 10) {
160 NDR_PRINT_OUT_DEBUG(samr_Connect
, &r
);
163 if (NT_STATUS_IS_ERR(status
)) {
167 /* Return variables */
168 *connect_handle
= *r
.out
.connect_handle
;
174 struct rpccli_samr_Close_state
{
175 struct samr_Close orig
;
176 struct samr_Close tmp
;
177 TALLOC_CTX
*out_mem_ctx
;
178 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
181 static void rpccli_samr_Close_done(struct tevent_req
*subreq
);
183 struct tevent_req
*rpccli_samr_Close_send(TALLOC_CTX
*mem_ctx
,
184 struct tevent_context
*ev
,
185 struct rpc_pipe_client
*cli
,
186 struct policy_handle
*_handle
/* [in,out] [ref] */)
188 struct tevent_req
*req
;
189 struct rpccli_samr_Close_state
*state
;
190 struct tevent_req
*subreq
;
192 req
= tevent_req_create(mem_ctx
, &state
,
193 struct rpccli_samr_Close_state
);
197 state
->out_mem_ctx
= NULL
;
198 state
->dispatch_recv
= cli
->dispatch_recv
;
201 state
->orig
.in
.handle
= _handle
;
204 state
->orig
.out
.handle
= _handle
;
207 ZERO_STRUCT(state
->orig
.out
.result
);
209 if (DEBUGLEVEL
>= 10) {
210 NDR_PRINT_IN_DEBUG(samr_Close
, &state
->orig
);
213 state
->out_mem_ctx
= talloc_named_const(state
, 0,
214 "rpccli_samr_Close_out_memory");
215 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
216 return tevent_req_post(req
, ev
);
219 /* make a temporary copy, that we pass to the dispatch function */
220 state
->tmp
= state
->orig
;
222 subreq
= cli
->dispatch_send(state
, ev
, cli
,
226 if (tevent_req_nomem(subreq
, req
)) {
227 return tevent_req_post(req
, ev
);
229 tevent_req_set_callback(subreq
, rpccli_samr_Close_done
, req
);
233 static void rpccli_samr_Close_done(struct tevent_req
*subreq
)
235 struct tevent_req
*req
= tevent_req_callback_data(
236 subreq
, struct tevent_req
);
237 struct rpccli_samr_Close_state
*state
= tevent_req_data(
238 req
, struct rpccli_samr_Close_state
);
242 if (state
->out_mem_ctx
) {
243 mem_ctx
= state
->out_mem_ctx
;
248 status
= state
->dispatch_recv(subreq
, mem_ctx
);
250 if (!NT_STATUS_IS_OK(status
)) {
251 tevent_req_nterror(req
, status
);
255 /* Copy out parameters */
256 *state
->orig
.out
.handle
= *state
->tmp
.out
.handle
;
259 state
->orig
.out
.result
= state
->tmp
.out
.result
;
261 /* Reset temporary structure */
262 ZERO_STRUCT(state
->tmp
);
264 if (DEBUGLEVEL
>= 10) {
265 NDR_PRINT_OUT_DEBUG(samr_Close
, &state
->orig
);
268 tevent_req_done(req
);
271 NTSTATUS
rpccli_samr_Close_recv(struct tevent_req
*req
,
275 struct rpccli_samr_Close_state
*state
= tevent_req_data(
276 req
, struct rpccli_samr_Close_state
);
279 if (tevent_req_is_nterror(req
, &status
)) {
280 tevent_req_received(req
);
284 /* Steal possbile out parameters to the callers context */
285 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
288 *result
= state
->orig
.out
.result
;
290 tevent_req_received(req
);
294 NTSTATUS
rpccli_samr_Close(struct rpc_pipe_client
*cli
,
296 struct policy_handle
*handle
/* [in,out] [ref] */)
302 r
.in
.handle
= handle
;
304 if (DEBUGLEVEL
>= 10) {
305 NDR_PRINT_IN_DEBUG(samr_Close
, &r
);
308 status
= cli
->dispatch(cli
,
314 if (!NT_STATUS_IS_OK(status
)) {
318 if (DEBUGLEVEL
>= 10) {
319 NDR_PRINT_OUT_DEBUG(samr_Close
, &r
);
322 if (NT_STATUS_IS_ERR(status
)) {
326 /* Return variables */
327 *handle
= *r
.out
.handle
;
333 struct rpccli_samr_SetSecurity_state
{
334 struct samr_SetSecurity orig
;
335 struct samr_SetSecurity tmp
;
336 TALLOC_CTX
*out_mem_ctx
;
337 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
340 static void rpccli_samr_SetSecurity_done(struct tevent_req
*subreq
);
342 struct tevent_req
*rpccli_samr_SetSecurity_send(TALLOC_CTX
*mem_ctx
,
343 struct tevent_context
*ev
,
344 struct rpc_pipe_client
*cli
,
345 struct policy_handle
*_handle
/* [in] [ref] */,
346 uint32_t _sec_info
/* [in] */,
347 struct sec_desc_buf
*_sdbuf
/* [in] [ref] */)
349 struct tevent_req
*req
;
350 struct rpccli_samr_SetSecurity_state
*state
;
351 struct tevent_req
*subreq
;
353 req
= tevent_req_create(mem_ctx
, &state
,
354 struct rpccli_samr_SetSecurity_state
);
358 state
->out_mem_ctx
= NULL
;
359 state
->dispatch_recv
= cli
->dispatch_recv
;
362 state
->orig
.in
.handle
= _handle
;
363 state
->orig
.in
.sec_info
= _sec_info
;
364 state
->orig
.in
.sdbuf
= _sdbuf
;
369 ZERO_STRUCT(state
->orig
.out
.result
);
371 if (DEBUGLEVEL
>= 10) {
372 NDR_PRINT_IN_DEBUG(samr_SetSecurity
, &state
->orig
);
375 /* make a temporary copy, that we pass to the dispatch function */
376 state
->tmp
= state
->orig
;
378 subreq
= cli
->dispatch_send(state
, ev
, cli
,
380 NDR_SAMR_SETSECURITY
,
382 if (tevent_req_nomem(subreq
, req
)) {
383 return tevent_req_post(req
, ev
);
385 tevent_req_set_callback(subreq
, rpccli_samr_SetSecurity_done
, req
);
389 static void rpccli_samr_SetSecurity_done(struct tevent_req
*subreq
)
391 struct tevent_req
*req
= tevent_req_callback_data(
392 subreq
, struct tevent_req
);
393 struct rpccli_samr_SetSecurity_state
*state
= tevent_req_data(
394 req
, struct rpccli_samr_SetSecurity_state
);
398 if (state
->out_mem_ctx
) {
399 mem_ctx
= state
->out_mem_ctx
;
404 status
= state
->dispatch_recv(subreq
, mem_ctx
);
406 if (!NT_STATUS_IS_OK(status
)) {
407 tevent_req_nterror(req
, status
);
411 /* Copy out parameters */
414 state
->orig
.out
.result
= state
->tmp
.out
.result
;
416 /* Reset temporary structure */
417 ZERO_STRUCT(state
->tmp
);
419 if (DEBUGLEVEL
>= 10) {
420 NDR_PRINT_OUT_DEBUG(samr_SetSecurity
, &state
->orig
);
423 tevent_req_done(req
);
426 NTSTATUS
rpccli_samr_SetSecurity_recv(struct tevent_req
*req
,
430 struct rpccli_samr_SetSecurity_state
*state
= tevent_req_data(
431 req
, struct rpccli_samr_SetSecurity_state
);
434 if (tevent_req_is_nterror(req
, &status
)) {
435 tevent_req_received(req
);
439 /* Steal possbile out parameters to the callers context */
440 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
443 *result
= state
->orig
.out
.result
;
445 tevent_req_received(req
);
449 NTSTATUS
rpccli_samr_SetSecurity(struct rpc_pipe_client
*cli
,
451 struct policy_handle
*handle
/* [in] [ref] */,
452 uint32_t sec_info
/* [in] */,
453 struct sec_desc_buf
*sdbuf
/* [in] [ref] */)
455 struct samr_SetSecurity r
;
459 r
.in
.handle
= handle
;
460 r
.in
.sec_info
= sec_info
;
463 if (DEBUGLEVEL
>= 10) {
464 NDR_PRINT_IN_DEBUG(samr_SetSecurity
, &r
);
467 status
= cli
->dispatch(cli
,
470 NDR_SAMR_SETSECURITY
,
473 if (!NT_STATUS_IS_OK(status
)) {
477 if (DEBUGLEVEL
>= 10) {
478 NDR_PRINT_OUT_DEBUG(samr_SetSecurity
, &r
);
481 if (NT_STATUS_IS_ERR(status
)) {
485 /* Return variables */
491 struct rpccli_samr_QuerySecurity_state
{
492 struct samr_QuerySecurity orig
;
493 struct samr_QuerySecurity tmp
;
494 TALLOC_CTX
*out_mem_ctx
;
495 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
498 static void rpccli_samr_QuerySecurity_done(struct tevent_req
*subreq
);
500 struct tevent_req
*rpccli_samr_QuerySecurity_send(TALLOC_CTX
*mem_ctx
,
501 struct tevent_context
*ev
,
502 struct rpc_pipe_client
*cli
,
503 struct policy_handle
*_handle
/* [in] [ref] */,
504 uint32_t _sec_info
/* [in] */,
505 struct sec_desc_buf
**_sdbuf
/* [out] [ref] */)
507 struct tevent_req
*req
;
508 struct rpccli_samr_QuerySecurity_state
*state
;
509 struct tevent_req
*subreq
;
511 req
= tevent_req_create(mem_ctx
, &state
,
512 struct rpccli_samr_QuerySecurity_state
);
516 state
->out_mem_ctx
= NULL
;
517 state
->dispatch_recv
= cli
->dispatch_recv
;
520 state
->orig
.in
.handle
= _handle
;
521 state
->orig
.in
.sec_info
= _sec_info
;
524 state
->orig
.out
.sdbuf
= _sdbuf
;
527 ZERO_STRUCT(state
->orig
.out
.result
);
529 if (DEBUGLEVEL
>= 10) {
530 NDR_PRINT_IN_DEBUG(samr_QuerySecurity
, &state
->orig
);
533 state
->out_mem_ctx
= talloc_named_const(state
, 0,
534 "rpccli_samr_QuerySecurity_out_memory");
535 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
536 return tevent_req_post(req
, ev
);
539 /* make a temporary copy, that we pass to the dispatch function */
540 state
->tmp
= state
->orig
;
542 subreq
= cli
->dispatch_send(state
, ev
, cli
,
544 NDR_SAMR_QUERYSECURITY
,
546 if (tevent_req_nomem(subreq
, req
)) {
547 return tevent_req_post(req
, ev
);
549 tevent_req_set_callback(subreq
, rpccli_samr_QuerySecurity_done
, req
);
553 static void rpccli_samr_QuerySecurity_done(struct tevent_req
*subreq
)
555 struct tevent_req
*req
= tevent_req_callback_data(
556 subreq
, struct tevent_req
);
557 struct rpccli_samr_QuerySecurity_state
*state
= tevent_req_data(
558 req
, struct rpccli_samr_QuerySecurity_state
);
562 if (state
->out_mem_ctx
) {
563 mem_ctx
= state
->out_mem_ctx
;
568 status
= state
->dispatch_recv(subreq
, mem_ctx
);
570 if (!NT_STATUS_IS_OK(status
)) {
571 tevent_req_nterror(req
, status
);
575 /* Copy out parameters */
576 *state
->orig
.out
.sdbuf
= *state
->tmp
.out
.sdbuf
;
579 state
->orig
.out
.result
= state
->tmp
.out
.result
;
581 /* Reset temporary structure */
582 ZERO_STRUCT(state
->tmp
);
584 if (DEBUGLEVEL
>= 10) {
585 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity
, &state
->orig
);
588 tevent_req_done(req
);
591 NTSTATUS
rpccli_samr_QuerySecurity_recv(struct tevent_req
*req
,
595 struct rpccli_samr_QuerySecurity_state
*state
= tevent_req_data(
596 req
, struct rpccli_samr_QuerySecurity_state
);
599 if (tevent_req_is_nterror(req
, &status
)) {
600 tevent_req_received(req
);
604 /* Steal possbile out parameters to the callers context */
605 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
608 *result
= state
->orig
.out
.result
;
610 tevent_req_received(req
);
614 NTSTATUS
rpccli_samr_QuerySecurity(struct rpc_pipe_client
*cli
,
616 struct policy_handle
*handle
/* [in] [ref] */,
617 uint32_t sec_info
/* [in] */,
618 struct sec_desc_buf
**sdbuf
/* [out] [ref] */)
620 struct samr_QuerySecurity r
;
624 r
.in
.handle
= handle
;
625 r
.in
.sec_info
= sec_info
;
627 if (DEBUGLEVEL
>= 10) {
628 NDR_PRINT_IN_DEBUG(samr_QuerySecurity
, &r
);
631 status
= cli
->dispatch(cli
,
634 NDR_SAMR_QUERYSECURITY
,
637 if (!NT_STATUS_IS_OK(status
)) {
641 if (DEBUGLEVEL
>= 10) {
642 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity
, &r
);
645 if (NT_STATUS_IS_ERR(status
)) {
649 /* Return variables */
650 *sdbuf
= *r
.out
.sdbuf
;
656 struct rpccli_samr_Shutdown_state
{
657 struct samr_Shutdown orig
;
658 struct samr_Shutdown tmp
;
659 TALLOC_CTX
*out_mem_ctx
;
660 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
663 static void rpccli_samr_Shutdown_done(struct tevent_req
*subreq
);
665 struct tevent_req
*rpccli_samr_Shutdown_send(TALLOC_CTX
*mem_ctx
,
666 struct tevent_context
*ev
,
667 struct rpc_pipe_client
*cli
,
668 struct policy_handle
*_connect_handle
/* [in] [ref] */)
670 struct tevent_req
*req
;
671 struct rpccli_samr_Shutdown_state
*state
;
672 struct tevent_req
*subreq
;
674 req
= tevent_req_create(mem_ctx
, &state
,
675 struct rpccli_samr_Shutdown_state
);
679 state
->out_mem_ctx
= NULL
;
680 state
->dispatch_recv
= cli
->dispatch_recv
;
683 state
->orig
.in
.connect_handle
= _connect_handle
;
688 ZERO_STRUCT(state
->orig
.out
.result
);
690 if (DEBUGLEVEL
>= 10) {
691 NDR_PRINT_IN_DEBUG(samr_Shutdown
, &state
->orig
);
694 /* make a temporary copy, that we pass to the dispatch function */
695 state
->tmp
= state
->orig
;
697 subreq
= cli
->dispatch_send(state
, ev
, cli
,
701 if (tevent_req_nomem(subreq
, req
)) {
702 return tevent_req_post(req
, ev
);
704 tevent_req_set_callback(subreq
, rpccli_samr_Shutdown_done
, req
);
708 static void rpccli_samr_Shutdown_done(struct tevent_req
*subreq
)
710 struct tevent_req
*req
= tevent_req_callback_data(
711 subreq
, struct tevent_req
);
712 struct rpccli_samr_Shutdown_state
*state
= tevent_req_data(
713 req
, struct rpccli_samr_Shutdown_state
);
717 if (state
->out_mem_ctx
) {
718 mem_ctx
= state
->out_mem_ctx
;
723 status
= state
->dispatch_recv(subreq
, mem_ctx
);
725 if (!NT_STATUS_IS_OK(status
)) {
726 tevent_req_nterror(req
, status
);
730 /* Copy out parameters */
733 state
->orig
.out
.result
= state
->tmp
.out
.result
;
735 /* Reset temporary structure */
736 ZERO_STRUCT(state
->tmp
);
738 if (DEBUGLEVEL
>= 10) {
739 NDR_PRINT_OUT_DEBUG(samr_Shutdown
, &state
->orig
);
742 tevent_req_done(req
);
745 NTSTATUS
rpccli_samr_Shutdown_recv(struct tevent_req
*req
,
749 struct rpccli_samr_Shutdown_state
*state
= tevent_req_data(
750 req
, struct rpccli_samr_Shutdown_state
);
753 if (tevent_req_is_nterror(req
, &status
)) {
754 tevent_req_received(req
);
758 /* Steal possbile out parameters to the callers context */
759 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
762 *result
= state
->orig
.out
.result
;
764 tevent_req_received(req
);
768 NTSTATUS
rpccli_samr_Shutdown(struct rpc_pipe_client
*cli
,
770 struct policy_handle
*connect_handle
/* [in] [ref] */)
772 struct samr_Shutdown r
;
776 r
.in
.connect_handle
= connect_handle
;
778 if (DEBUGLEVEL
>= 10) {
779 NDR_PRINT_IN_DEBUG(samr_Shutdown
, &r
);
782 status
= cli
->dispatch(cli
,
788 if (!NT_STATUS_IS_OK(status
)) {
792 if (DEBUGLEVEL
>= 10) {
793 NDR_PRINT_OUT_DEBUG(samr_Shutdown
, &r
);
796 if (NT_STATUS_IS_ERR(status
)) {
800 /* Return variables */
806 struct rpccli_samr_LookupDomain_state
{
807 struct samr_LookupDomain orig
;
808 struct samr_LookupDomain tmp
;
809 TALLOC_CTX
*out_mem_ctx
;
810 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
813 static void rpccli_samr_LookupDomain_done(struct tevent_req
*subreq
);
815 struct tevent_req
*rpccli_samr_LookupDomain_send(TALLOC_CTX
*mem_ctx
,
816 struct tevent_context
*ev
,
817 struct rpc_pipe_client
*cli
,
818 struct policy_handle
*_connect_handle
/* [in] [ref] */,
819 struct lsa_String
*_domain_name
/* [in] [ref] */,
820 struct dom_sid2
**_sid
/* [out] [ref] */)
822 struct tevent_req
*req
;
823 struct rpccli_samr_LookupDomain_state
*state
;
824 struct tevent_req
*subreq
;
826 req
= tevent_req_create(mem_ctx
, &state
,
827 struct rpccli_samr_LookupDomain_state
);
831 state
->out_mem_ctx
= NULL
;
832 state
->dispatch_recv
= cli
->dispatch_recv
;
835 state
->orig
.in
.connect_handle
= _connect_handle
;
836 state
->orig
.in
.domain_name
= _domain_name
;
839 state
->orig
.out
.sid
= _sid
;
842 ZERO_STRUCT(state
->orig
.out
.result
);
844 if (DEBUGLEVEL
>= 10) {
845 NDR_PRINT_IN_DEBUG(samr_LookupDomain
, &state
->orig
);
848 state
->out_mem_ctx
= talloc_named_const(state
, 0,
849 "rpccli_samr_LookupDomain_out_memory");
850 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
851 return tevent_req_post(req
, ev
);
854 /* make a temporary copy, that we pass to the dispatch function */
855 state
->tmp
= state
->orig
;
857 subreq
= cli
->dispatch_send(state
, ev
, cli
,
859 NDR_SAMR_LOOKUPDOMAIN
,
861 if (tevent_req_nomem(subreq
, req
)) {
862 return tevent_req_post(req
, ev
);
864 tevent_req_set_callback(subreq
, rpccli_samr_LookupDomain_done
, req
);
868 static void rpccli_samr_LookupDomain_done(struct tevent_req
*subreq
)
870 struct tevent_req
*req
= tevent_req_callback_data(
871 subreq
, struct tevent_req
);
872 struct rpccli_samr_LookupDomain_state
*state
= tevent_req_data(
873 req
, struct rpccli_samr_LookupDomain_state
);
877 if (state
->out_mem_ctx
) {
878 mem_ctx
= state
->out_mem_ctx
;
883 status
= state
->dispatch_recv(subreq
, mem_ctx
);
885 if (!NT_STATUS_IS_OK(status
)) {
886 tevent_req_nterror(req
, status
);
890 /* Copy out parameters */
891 *state
->orig
.out
.sid
= *state
->tmp
.out
.sid
;
894 state
->orig
.out
.result
= state
->tmp
.out
.result
;
896 /* Reset temporary structure */
897 ZERO_STRUCT(state
->tmp
);
899 if (DEBUGLEVEL
>= 10) {
900 NDR_PRINT_OUT_DEBUG(samr_LookupDomain
, &state
->orig
);
903 tevent_req_done(req
);
906 NTSTATUS
rpccli_samr_LookupDomain_recv(struct tevent_req
*req
,
910 struct rpccli_samr_LookupDomain_state
*state
= tevent_req_data(
911 req
, struct rpccli_samr_LookupDomain_state
);
914 if (tevent_req_is_nterror(req
, &status
)) {
915 tevent_req_received(req
);
919 /* Steal possbile out parameters to the callers context */
920 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
923 *result
= state
->orig
.out
.result
;
925 tevent_req_received(req
);
929 NTSTATUS
rpccli_samr_LookupDomain(struct rpc_pipe_client
*cli
,
931 struct policy_handle
*connect_handle
/* [in] [ref] */,
932 struct lsa_String
*domain_name
/* [in] [ref] */,
933 struct dom_sid2
**sid
/* [out] [ref] */)
935 struct samr_LookupDomain r
;
939 r
.in
.connect_handle
= connect_handle
;
940 r
.in
.domain_name
= domain_name
;
942 if (DEBUGLEVEL
>= 10) {
943 NDR_PRINT_IN_DEBUG(samr_LookupDomain
, &r
);
946 status
= cli
->dispatch(cli
,
949 NDR_SAMR_LOOKUPDOMAIN
,
952 if (!NT_STATUS_IS_OK(status
)) {
956 if (DEBUGLEVEL
>= 10) {
957 NDR_PRINT_OUT_DEBUG(samr_LookupDomain
, &r
);
960 if (NT_STATUS_IS_ERR(status
)) {
964 /* Return variables */
971 struct rpccli_samr_EnumDomains_state
{
972 struct samr_EnumDomains orig
;
973 struct samr_EnumDomains tmp
;
974 TALLOC_CTX
*out_mem_ctx
;
975 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
978 static void rpccli_samr_EnumDomains_done(struct tevent_req
*subreq
);
980 struct tevent_req
*rpccli_samr_EnumDomains_send(TALLOC_CTX
*mem_ctx
,
981 struct tevent_context
*ev
,
982 struct rpc_pipe_client
*cli
,
983 struct policy_handle
*_connect_handle
/* [in] [ref] */,
984 uint32_t *_resume_handle
/* [in,out] [ref] */,
985 struct samr_SamArray
**_sam
/* [out] [ref] */,
986 uint32_t _buf_size
/* [in] */,
987 uint32_t *_num_entries
/* [out] [ref] */)
989 struct tevent_req
*req
;
990 struct rpccli_samr_EnumDomains_state
*state
;
991 struct tevent_req
*subreq
;
993 req
= tevent_req_create(mem_ctx
, &state
,
994 struct rpccli_samr_EnumDomains_state
);
998 state
->out_mem_ctx
= NULL
;
999 state
->dispatch_recv
= cli
->dispatch_recv
;
1002 state
->orig
.in
.connect_handle
= _connect_handle
;
1003 state
->orig
.in
.resume_handle
= _resume_handle
;
1004 state
->orig
.in
.buf_size
= _buf_size
;
1006 /* Out parameters */
1007 state
->orig
.out
.resume_handle
= _resume_handle
;
1008 state
->orig
.out
.sam
= _sam
;
1009 state
->orig
.out
.num_entries
= _num_entries
;
1012 ZERO_STRUCT(state
->orig
.out
.result
);
1014 if (DEBUGLEVEL
>= 10) {
1015 NDR_PRINT_IN_DEBUG(samr_EnumDomains
, &state
->orig
);
1018 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1019 "rpccli_samr_EnumDomains_out_memory");
1020 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1021 return tevent_req_post(req
, ev
);
1024 /* make a temporary copy, that we pass to the dispatch function */
1025 state
->tmp
= state
->orig
;
1027 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1029 NDR_SAMR_ENUMDOMAINS
,
1031 if (tevent_req_nomem(subreq
, req
)) {
1032 return tevent_req_post(req
, ev
);
1034 tevent_req_set_callback(subreq
, rpccli_samr_EnumDomains_done
, req
);
1038 static void rpccli_samr_EnumDomains_done(struct tevent_req
*subreq
)
1040 struct tevent_req
*req
= tevent_req_callback_data(
1041 subreq
, struct tevent_req
);
1042 struct rpccli_samr_EnumDomains_state
*state
= tevent_req_data(
1043 req
, struct rpccli_samr_EnumDomains_state
);
1045 TALLOC_CTX
*mem_ctx
;
1047 if (state
->out_mem_ctx
) {
1048 mem_ctx
= state
->out_mem_ctx
;
1053 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1054 TALLOC_FREE(subreq
);
1055 if (!NT_STATUS_IS_OK(status
)) {
1056 tevent_req_nterror(req
, status
);
1060 /* Copy out parameters */
1061 *state
->orig
.out
.resume_handle
= *state
->tmp
.out
.resume_handle
;
1062 *state
->orig
.out
.sam
= *state
->tmp
.out
.sam
;
1063 *state
->orig
.out
.num_entries
= *state
->tmp
.out
.num_entries
;
1066 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1068 /* Reset temporary structure */
1069 ZERO_STRUCT(state
->tmp
);
1071 if (DEBUGLEVEL
>= 10) {
1072 NDR_PRINT_OUT_DEBUG(samr_EnumDomains
, &state
->orig
);
1075 tevent_req_done(req
);
1078 NTSTATUS
rpccli_samr_EnumDomains_recv(struct tevent_req
*req
,
1079 TALLOC_CTX
*mem_ctx
,
1082 struct rpccli_samr_EnumDomains_state
*state
= tevent_req_data(
1083 req
, struct rpccli_samr_EnumDomains_state
);
1086 if (tevent_req_is_nterror(req
, &status
)) {
1087 tevent_req_received(req
);
1091 /* Steal possbile out parameters to the callers context */
1092 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1095 *result
= state
->orig
.out
.result
;
1097 tevent_req_received(req
);
1098 return NT_STATUS_OK
;
1101 NTSTATUS
rpccli_samr_EnumDomains(struct rpc_pipe_client
*cli
,
1102 TALLOC_CTX
*mem_ctx
,
1103 struct policy_handle
*connect_handle
/* [in] [ref] */,
1104 uint32_t *resume_handle
/* [in,out] [ref] */,
1105 struct samr_SamArray
**sam
/* [out] [ref] */,
1106 uint32_t buf_size
/* [in] */,
1107 uint32_t *num_entries
/* [out] [ref] */)
1109 struct samr_EnumDomains r
;
1113 r
.in
.connect_handle
= connect_handle
;
1114 r
.in
.resume_handle
= resume_handle
;
1115 r
.in
.buf_size
= buf_size
;
1117 if (DEBUGLEVEL
>= 10) {
1118 NDR_PRINT_IN_DEBUG(samr_EnumDomains
, &r
);
1121 status
= cli
->dispatch(cli
,
1124 NDR_SAMR_ENUMDOMAINS
,
1127 if (!NT_STATUS_IS_OK(status
)) {
1131 if (DEBUGLEVEL
>= 10) {
1132 NDR_PRINT_OUT_DEBUG(samr_EnumDomains
, &r
);
1135 if (NT_STATUS_IS_ERR(status
)) {
1139 /* Return variables */
1140 *resume_handle
= *r
.out
.resume_handle
;
1142 *num_entries
= *r
.out
.num_entries
;
1145 return r
.out
.result
;
1148 struct rpccli_samr_OpenDomain_state
{
1149 struct samr_OpenDomain orig
;
1150 struct samr_OpenDomain tmp
;
1151 TALLOC_CTX
*out_mem_ctx
;
1152 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1155 static void rpccli_samr_OpenDomain_done(struct tevent_req
*subreq
);
1157 struct tevent_req
*rpccli_samr_OpenDomain_send(TALLOC_CTX
*mem_ctx
,
1158 struct tevent_context
*ev
,
1159 struct rpc_pipe_client
*cli
,
1160 struct policy_handle
*_connect_handle
/* [in] [ref] */,
1161 uint32_t _access_mask
/* [in] */,
1162 struct dom_sid2
*_sid
/* [in] [ref] */,
1163 struct policy_handle
*_domain_handle
/* [out] [ref] */)
1165 struct tevent_req
*req
;
1166 struct rpccli_samr_OpenDomain_state
*state
;
1167 struct tevent_req
*subreq
;
1169 req
= tevent_req_create(mem_ctx
, &state
,
1170 struct rpccli_samr_OpenDomain_state
);
1174 state
->out_mem_ctx
= NULL
;
1175 state
->dispatch_recv
= cli
->dispatch_recv
;
1178 state
->orig
.in
.connect_handle
= _connect_handle
;
1179 state
->orig
.in
.access_mask
= _access_mask
;
1180 state
->orig
.in
.sid
= _sid
;
1182 /* Out parameters */
1183 state
->orig
.out
.domain_handle
= _domain_handle
;
1186 ZERO_STRUCT(state
->orig
.out
.result
);
1188 if (DEBUGLEVEL
>= 10) {
1189 NDR_PRINT_IN_DEBUG(samr_OpenDomain
, &state
->orig
);
1192 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1193 "rpccli_samr_OpenDomain_out_memory");
1194 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1195 return tevent_req_post(req
, ev
);
1198 /* make a temporary copy, that we pass to the dispatch function */
1199 state
->tmp
= state
->orig
;
1201 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1203 NDR_SAMR_OPENDOMAIN
,
1205 if (tevent_req_nomem(subreq
, req
)) {
1206 return tevent_req_post(req
, ev
);
1208 tevent_req_set_callback(subreq
, rpccli_samr_OpenDomain_done
, req
);
1212 static void rpccli_samr_OpenDomain_done(struct tevent_req
*subreq
)
1214 struct tevent_req
*req
= tevent_req_callback_data(
1215 subreq
, struct tevent_req
);
1216 struct rpccli_samr_OpenDomain_state
*state
= tevent_req_data(
1217 req
, struct rpccli_samr_OpenDomain_state
);
1219 TALLOC_CTX
*mem_ctx
;
1221 if (state
->out_mem_ctx
) {
1222 mem_ctx
= state
->out_mem_ctx
;
1227 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1228 TALLOC_FREE(subreq
);
1229 if (!NT_STATUS_IS_OK(status
)) {
1230 tevent_req_nterror(req
, status
);
1234 /* Copy out parameters */
1235 *state
->orig
.out
.domain_handle
= *state
->tmp
.out
.domain_handle
;
1238 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1240 /* Reset temporary structure */
1241 ZERO_STRUCT(state
->tmp
);
1243 if (DEBUGLEVEL
>= 10) {
1244 NDR_PRINT_OUT_DEBUG(samr_OpenDomain
, &state
->orig
);
1247 tevent_req_done(req
);
1250 NTSTATUS
rpccli_samr_OpenDomain_recv(struct tevent_req
*req
,
1251 TALLOC_CTX
*mem_ctx
,
1254 struct rpccli_samr_OpenDomain_state
*state
= tevent_req_data(
1255 req
, struct rpccli_samr_OpenDomain_state
);
1258 if (tevent_req_is_nterror(req
, &status
)) {
1259 tevent_req_received(req
);
1263 /* Steal possbile out parameters to the callers context */
1264 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1267 *result
= state
->orig
.out
.result
;
1269 tevent_req_received(req
);
1270 return NT_STATUS_OK
;
1273 NTSTATUS
rpccli_samr_OpenDomain(struct rpc_pipe_client
*cli
,
1274 TALLOC_CTX
*mem_ctx
,
1275 struct policy_handle
*connect_handle
/* [in] [ref] */,
1276 uint32_t access_mask
/* [in] */,
1277 struct dom_sid2
*sid
/* [in] [ref] */,
1278 struct policy_handle
*domain_handle
/* [out] [ref] */)
1280 struct samr_OpenDomain r
;
1284 r
.in
.connect_handle
= connect_handle
;
1285 r
.in
.access_mask
= access_mask
;
1288 if (DEBUGLEVEL
>= 10) {
1289 NDR_PRINT_IN_DEBUG(samr_OpenDomain
, &r
);
1292 status
= cli
->dispatch(cli
,
1295 NDR_SAMR_OPENDOMAIN
,
1298 if (!NT_STATUS_IS_OK(status
)) {
1302 if (DEBUGLEVEL
>= 10) {
1303 NDR_PRINT_OUT_DEBUG(samr_OpenDomain
, &r
);
1306 if (NT_STATUS_IS_ERR(status
)) {
1310 /* Return variables */
1311 *domain_handle
= *r
.out
.domain_handle
;
1314 return r
.out
.result
;
1317 struct rpccli_samr_QueryDomainInfo_state
{
1318 struct samr_QueryDomainInfo orig
;
1319 struct samr_QueryDomainInfo tmp
;
1320 TALLOC_CTX
*out_mem_ctx
;
1321 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1324 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req
*subreq
);
1326 struct tevent_req
*rpccli_samr_QueryDomainInfo_send(TALLOC_CTX
*mem_ctx
,
1327 struct tevent_context
*ev
,
1328 struct rpc_pipe_client
*cli
,
1329 struct policy_handle
*_domain_handle
/* [in] [ref] */,
1330 enum samr_DomainInfoClass _level
/* [in] */,
1331 union samr_DomainInfo
**_info
/* [out] [ref,switch_is(level)] */)
1333 struct tevent_req
*req
;
1334 struct rpccli_samr_QueryDomainInfo_state
*state
;
1335 struct tevent_req
*subreq
;
1337 req
= tevent_req_create(mem_ctx
, &state
,
1338 struct rpccli_samr_QueryDomainInfo_state
);
1342 state
->out_mem_ctx
= NULL
;
1343 state
->dispatch_recv
= cli
->dispatch_recv
;
1346 state
->orig
.in
.domain_handle
= _domain_handle
;
1347 state
->orig
.in
.level
= _level
;
1349 /* Out parameters */
1350 state
->orig
.out
.info
= _info
;
1353 ZERO_STRUCT(state
->orig
.out
.result
);
1355 if (DEBUGLEVEL
>= 10) {
1356 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo
, &state
->orig
);
1359 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1360 "rpccli_samr_QueryDomainInfo_out_memory");
1361 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1362 return tevent_req_post(req
, ev
);
1365 /* make a temporary copy, that we pass to the dispatch function */
1366 state
->tmp
= state
->orig
;
1368 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1370 NDR_SAMR_QUERYDOMAININFO
,
1372 if (tevent_req_nomem(subreq
, req
)) {
1373 return tevent_req_post(req
, ev
);
1375 tevent_req_set_callback(subreq
, rpccli_samr_QueryDomainInfo_done
, req
);
1379 static void rpccli_samr_QueryDomainInfo_done(struct tevent_req
*subreq
)
1381 struct tevent_req
*req
= tevent_req_callback_data(
1382 subreq
, struct tevent_req
);
1383 struct rpccli_samr_QueryDomainInfo_state
*state
= tevent_req_data(
1384 req
, struct rpccli_samr_QueryDomainInfo_state
);
1386 TALLOC_CTX
*mem_ctx
;
1388 if (state
->out_mem_ctx
) {
1389 mem_ctx
= state
->out_mem_ctx
;
1394 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1395 TALLOC_FREE(subreq
);
1396 if (!NT_STATUS_IS_OK(status
)) {
1397 tevent_req_nterror(req
, status
);
1401 /* Copy out parameters */
1402 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
1405 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1407 /* Reset temporary structure */
1408 ZERO_STRUCT(state
->tmp
);
1410 if (DEBUGLEVEL
>= 10) {
1411 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo
, &state
->orig
);
1414 tevent_req_done(req
);
1417 NTSTATUS
rpccli_samr_QueryDomainInfo_recv(struct tevent_req
*req
,
1418 TALLOC_CTX
*mem_ctx
,
1421 struct rpccli_samr_QueryDomainInfo_state
*state
= tevent_req_data(
1422 req
, struct rpccli_samr_QueryDomainInfo_state
);
1425 if (tevent_req_is_nterror(req
, &status
)) {
1426 tevent_req_received(req
);
1430 /* Steal possbile out parameters to the callers context */
1431 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1434 *result
= state
->orig
.out
.result
;
1436 tevent_req_received(req
);
1437 return NT_STATUS_OK
;
1440 NTSTATUS
rpccli_samr_QueryDomainInfo(struct rpc_pipe_client
*cli
,
1441 TALLOC_CTX
*mem_ctx
,
1442 struct policy_handle
*domain_handle
/* [in] [ref] */,
1443 enum samr_DomainInfoClass level
/* [in] */,
1444 union samr_DomainInfo
**info
/* [out] [ref,switch_is(level)] */)
1446 struct samr_QueryDomainInfo r
;
1450 r
.in
.domain_handle
= domain_handle
;
1453 if (DEBUGLEVEL
>= 10) {
1454 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo
, &r
);
1457 status
= cli
->dispatch(cli
,
1460 NDR_SAMR_QUERYDOMAININFO
,
1463 if (!NT_STATUS_IS_OK(status
)) {
1467 if (DEBUGLEVEL
>= 10) {
1468 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo
, &r
);
1471 if (NT_STATUS_IS_ERR(status
)) {
1475 /* Return variables */
1476 *info
= *r
.out
.info
;
1479 return r
.out
.result
;
1482 struct rpccli_samr_SetDomainInfo_state
{
1483 struct samr_SetDomainInfo orig
;
1484 struct samr_SetDomainInfo tmp
;
1485 TALLOC_CTX
*out_mem_ctx
;
1486 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1489 static void rpccli_samr_SetDomainInfo_done(struct tevent_req
*subreq
);
1491 struct tevent_req
*rpccli_samr_SetDomainInfo_send(TALLOC_CTX
*mem_ctx
,
1492 struct tevent_context
*ev
,
1493 struct rpc_pipe_client
*cli
,
1494 struct policy_handle
*_domain_handle
/* [in] [ref] */,
1495 enum samr_DomainInfoClass _level
/* [in] */,
1496 union samr_DomainInfo
*_info
/* [in] [ref,switch_is(level)] */)
1498 struct tevent_req
*req
;
1499 struct rpccli_samr_SetDomainInfo_state
*state
;
1500 struct tevent_req
*subreq
;
1502 req
= tevent_req_create(mem_ctx
, &state
,
1503 struct rpccli_samr_SetDomainInfo_state
);
1507 state
->out_mem_ctx
= NULL
;
1508 state
->dispatch_recv
= cli
->dispatch_recv
;
1511 state
->orig
.in
.domain_handle
= _domain_handle
;
1512 state
->orig
.in
.level
= _level
;
1513 state
->orig
.in
.info
= _info
;
1515 /* Out parameters */
1518 ZERO_STRUCT(state
->orig
.out
.result
);
1520 if (DEBUGLEVEL
>= 10) {
1521 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo
, &state
->orig
);
1524 /* make a temporary copy, that we pass to the dispatch function */
1525 state
->tmp
= state
->orig
;
1527 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1529 NDR_SAMR_SETDOMAININFO
,
1531 if (tevent_req_nomem(subreq
, req
)) {
1532 return tevent_req_post(req
, ev
);
1534 tevent_req_set_callback(subreq
, rpccli_samr_SetDomainInfo_done
, req
);
1538 static void rpccli_samr_SetDomainInfo_done(struct tevent_req
*subreq
)
1540 struct tevent_req
*req
= tevent_req_callback_data(
1541 subreq
, struct tevent_req
);
1542 struct rpccli_samr_SetDomainInfo_state
*state
= tevent_req_data(
1543 req
, struct rpccli_samr_SetDomainInfo_state
);
1545 TALLOC_CTX
*mem_ctx
;
1547 if (state
->out_mem_ctx
) {
1548 mem_ctx
= state
->out_mem_ctx
;
1553 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1554 TALLOC_FREE(subreq
);
1555 if (!NT_STATUS_IS_OK(status
)) {
1556 tevent_req_nterror(req
, status
);
1560 /* Copy out parameters */
1563 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1565 /* Reset temporary structure */
1566 ZERO_STRUCT(state
->tmp
);
1568 if (DEBUGLEVEL
>= 10) {
1569 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo
, &state
->orig
);
1572 tevent_req_done(req
);
1575 NTSTATUS
rpccli_samr_SetDomainInfo_recv(struct tevent_req
*req
,
1576 TALLOC_CTX
*mem_ctx
,
1579 struct rpccli_samr_SetDomainInfo_state
*state
= tevent_req_data(
1580 req
, struct rpccli_samr_SetDomainInfo_state
);
1583 if (tevent_req_is_nterror(req
, &status
)) {
1584 tevent_req_received(req
);
1588 /* Steal possbile out parameters to the callers context */
1589 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1592 *result
= state
->orig
.out
.result
;
1594 tevent_req_received(req
);
1595 return NT_STATUS_OK
;
1598 NTSTATUS
rpccli_samr_SetDomainInfo(struct rpc_pipe_client
*cli
,
1599 TALLOC_CTX
*mem_ctx
,
1600 struct policy_handle
*domain_handle
/* [in] [ref] */,
1601 enum samr_DomainInfoClass level
/* [in] */,
1602 union samr_DomainInfo
*info
/* [in] [ref,switch_is(level)] */)
1604 struct samr_SetDomainInfo r
;
1608 r
.in
.domain_handle
= domain_handle
;
1612 if (DEBUGLEVEL
>= 10) {
1613 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo
, &r
);
1616 status
= cli
->dispatch(cli
,
1619 NDR_SAMR_SETDOMAININFO
,
1622 if (!NT_STATUS_IS_OK(status
)) {
1626 if (DEBUGLEVEL
>= 10) {
1627 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo
, &r
);
1630 if (NT_STATUS_IS_ERR(status
)) {
1634 /* Return variables */
1637 return r
.out
.result
;
1640 struct rpccli_samr_CreateDomainGroup_state
{
1641 struct samr_CreateDomainGroup orig
;
1642 struct samr_CreateDomainGroup tmp
;
1643 TALLOC_CTX
*out_mem_ctx
;
1644 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1647 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req
*subreq
);
1649 struct tevent_req
*rpccli_samr_CreateDomainGroup_send(TALLOC_CTX
*mem_ctx
,
1650 struct tevent_context
*ev
,
1651 struct rpc_pipe_client
*cli
,
1652 struct policy_handle
*_domain_handle
/* [in] [ref] */,
1653 struct lsa_String
*_name
/* [in] [ref] */,
1654 uint32_t _access_mask
/* [in] */,
1655 struct policy_handle
*_group_handle
/* [out] [ref] */,
1656 uint32_t *_rid
/* [out] [ref] */)
1658 struct tevent_req
*req
;
1659 struct rpccli_samr_CreateDomainGroup_state
*state
;
1660 struct tevent_req
*subreq
;
1662 req
= tevent_req_create(mem_ctx
, &state
,
1663 struct rpccli_samr_CreateDomainGroup_state
);
1667 state
->out_mem_ctx
= NULL
;
1668 state
->dispatch_recv
= cli
->dispatch_recv
;
1671 state
->orig
.in
.domain_handle
= _domain_handle
;
1672 state
->orig
.in
.name
= _name
;
1673 state
->orig
.in
.access_mask
= _access_mask
;
1675 /* Out parameters */
1676 state
->orig
.out
.group_handle
= _group_handle
;
1677 state
->orig
.out
.rid
= _rid
;
1680 ZERO_STRUCT(state
->orig
.out
.result
);
1682 if (DEBUGLEVEL
>= 10) {
1683 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup
, &state
->orig
);
1686 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1687 "rpccli_samr_CreateDomainGroup_out_memory");
1688 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1689 return tevent_req_post(req
, ev
);
1692 /* make a temporary copy, that we pass to the dispatch function */
1693 state
->tmp
= state
->orig
;
1695 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1697 NDR_SAMR_CREATEDOMAINGROUP
,
1699 if (tevent_req_nomem(subreq
, req
)) {
1700 return tevent_req_post(req
, ev
);
1702 tevent_req_set_callback(subreq
, rpccli_samr_CreateDomainGroup_done
, req
);
1706 static void rpccli_samr_CreateDomainGroup_done(struct tevent_req
*subreq
)
1708 struct tevent_req
*req
= tevent_req_callback_data(
1709 subreq
, struct tevent_req
);
1710 struct rpccli_samr_CreateDomainGroup_state
*state
= tevent_req_data(
1711 req
, struct rpccli_samr_CreateDomainGroup_state
);
1713 TALLOC_CTX
*mem_ctx
;
1715 if (state
->out_mem_ctx
) {
1716 mem_ctx
= state
->out_mem_ctx
;
1721 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1722 TALLOC_FREE(subreq
);
1723 if (!NT_STATUS_IS_OK(status
)) {
1724 tevent_req_nterror(req
, status
);
1728 /* Copy out parameters */
1729 *state
->orig
.out
.group_handle
= *state
->tmp
.out
.group_handle
;
1730 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
1733 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1735 /* Reset temporary structure */
1736 ZERO_STRUCT(state
->tmp
);
1738 if (DEBUGLEVEL
>= 10) {
1739 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup
, &state
->orig
);
1742 tevent_req_done(req
);
1745 NTSTATUS
rpccli_samr_CreateDomainGroup_recv(struct tevent_req
*req
,
1746 TALLOC_CTX
*mem_ctx
,
1749 struct rpccli_samr_CreateDomainGroup_state
*state
= tevent_req_data(
1750 req
, struct rpccli_samr_CreateDomainGroup_state
);
1753 if (tevent_req_is_nterror(req
, &status
)) {
1754 tevent_req_received(req
);
1758 /* Steal possbile out parameters to the callers context */
1759 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1762 *result
= state
->orig
.out
.result
;
1764 tevent_req_received(req
);
1765 return NT_STATUS_OK
;
1768 NTSTATUS
rpccli_samr_CreateDomainGroup(struct rpc_pipe_client
*cli
,
1769 TALLOC_CTX
*mem_ctx
,
1770 struct policy_handle
*domain_handle
/* [in] [ref] */,
1771 struct lsa_String
*name
/* [in] [ref] */,
1772 uint32_t access_mask
/* [in] */,
1773 struct policy_handle
*group_handle
/* [out] [ref] */,
1774 uint32_t *rid
/* [out] [ref] */)
1776 struct samr_CreateDomainGroup r
;
1780 r
.in
.domain_handle
= domain_handle
;
1782 r
.in
.access_mask
= access_mask
;
1784 if (DEBUGLEVEL
>= 10) {
1785 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup
, &r
);
1788 status
= cli
->dispatch(cli
,
1791 NDR_SAMR_CREATEDOMAINGROUP
,
1794 if (!NT_STATUS_IS_OK(status
)) {
1798 if (DEBUGLEVEL
>= 10) {
1799 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup
, &r
);
1802 if (NT_STATUS_IS_ERR(status
)) {
1806 /* Return variables */
1807 *group_handle
= *r
.out
.group_handle
;
1811 return r
.out
.result
;
1814 struct rpccli_samr_EnumDomainGroups_state
{
1815 struct samr_EnumDomainGroups orig
;
1816 struct samr_EnumDomainGroups tmp
;
1817 TALLOC_CTX
*out_mem_ctx
;
1818 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1821 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req
*subreq
);
1823 struct tevent_req
*rpccli_samr_EnumDomainGroups_send(TALLOC_CTX
*mem_ctx
,
1824 struct tevent_context
*ev
,
1825 struct rpc_pipe_client
*cli
,
1826 struct policy_handle
*_domain_handle
/* [in] [ref] */,
1827 uint32_t *_resume_handle
/* [in,out] [ref] */,
1828 struct samr_SamArray
**_sam
/* [out] [ref] */,
1829 uint32_t _max_size
/* [in] */,
1830 uint32_t *_num_entries
/* [out] [ref] */)
1832 struct tevent_req
*req
;
1833 struct rpccli_samr_EnumDomainGroups_state
*state
;
1834 struct tevent_req
*subreq
;
1836 req
= tevent_req_create(mem_ctx
, &state
,
1837 struct rpccli_samr_EnumDomainGroups_state
);
1841 state
->out_mem_ctx
= NULL
;
1842 state
->dispatch_recv
= cli
->dispatch_recv
;
1845 state
->orig
.in
.domain_handle
= _domain_handle
;
1846 state
->orig
.in
.resume_handle
= _resume_handle
;
1847 state
->orig
.in
.max_size
= _max_size
;
1849 /* Out parameters */
1850 state
->orig
.out
.resume_handle
= _resume_handle
;
1851 state
->orig
.out
.sam
= _sam
;
1852 state
->orig
.out
.num_entries
= _num_entries
;
1855 ZERO_STRUCT(state
->orig
.out
.result
);
1857 if (DEBUGLEVEL
>= 10) {
1858 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups
, &state
->orig
);
1861 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1862 "rpccli_samr_EnumDomainGroups_out_memory");
1863 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1864 return tevent_req_post(req
, ev
);
1867 /* make a temporary copy, that we pass to the dispatch function */
1868 state
->tmp
= state
->orig
;
1870 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1872 NDR_SAMR_ENUMDOMAINGROUPS
,
1874 if (tevent_req_nomem(subreq
, req
)) {
1875 return tevent_req_post(req
, ev
);
1877 tevent_req_set_callback(subreq
, rpccli_samr_EnumDomainGroups_done
, req
);
1881 static void rpccli_samr_EnumDomainGroups_done(struct tevent_req
*subreq
)
1883 struct tevent_req
*req
= tevent_req_callback_data(
1884 subreq
, struct tevent_req
);
1885 struct rpccli_samr_EnumDomainGroups_state
*state
= tevent_req_data(
1886 req
, struct rpccli_samr_EnumDomainGroups_state
);
1888 TALLOC_CTX
*mem_ctx
;
1890 if (state
->out_mem_ctx
) {
1891 mem_ctx
= state
->out_mem_ctx
;
1896 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1897 TALLOC_FREE(subreq
);
1898 if (!NT_STATUS_IS_OK(status
)) {
1899 tevent_req_nterror(req
, status
);
1903 /* Copy out parameters */
1904 *state
->orig
.out
.resume_handle
= *state
->tmp
.out
.resume_handle
;
1905 *state
->orig
.out
.sam
= *state
->tmp
.out
.sam
;
1906 *state
->orig
.out
.num_entries
= *state
->tmp
.out
.num_entries
;
1909 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1911 /* Reset temporary structure */
1912 ZERO_STRUCT(state
->tmp
);
1914 if (DEBUGLEVEL
>= 10) {
1915 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups
, &state
->orig
);
1918 tevent_req_done(req
);
1921 NTSTATUS
rpccli_samr_EnumDomainGroups_recv(struct tevent_req
*req
,
1922 TALLOC_CTX
*mem_ctx
,
1925 struct rpccli_samr_EnumDomainGroups_state
*state
= tevent_req_data(
1926 req
, struct rpccli_samr_EnumDomainGroups_state
);
1929 if (tevent_req_is_nterror(req
, &status
)) {
1930 tevent_req_received(req
);
1934 /* Steal possbile out parameters to the callers context */
1935 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1938 *result
= state
->orig
.out
.result
;
1940 tevent_req_received(req
);
1941 return NT_STATUS_OK
;
1944 NTSTATUS
rpccli_samr_EnumDomainGroups(struct rpc_pipe_client
*cli
,
1945 TALLOC_CTX
*mem_ctx
,
1946 struct policy_handle
*domain_handle
/* [in] [ref] */,
1947 uint32_t *resume_handle
/* [in,out] [ref] */,
1948 struct samr_SamArray
**sam
/* [out] [ref] */,
1949 uint32_t max_size
/* [in] */,
1950 uint32_t *num_entries
/* [out] [ref] */)
1952 struct samr_EnumDomainGroups r
;
1956 r
.in
.domain_handle
= domain_handle
;
1957 r
.in
.resume_handle
= resume_handle
;
1958 r
.in
.max_size
= max_size
;
1960 if (DEBUGLEVEL
>= 10) {
1961 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups
, &r
);
1964 status
= cli
->dispatch(cli
,
1967 NDR_SAMR_ENUMDOMAINGROUPS
,
1970 if (!NT_STATUS_IS_OK(status
)) {
1974 if (DEBUGLEVEL
>= 10) {
1975 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups
, &r
);
1978 if (NT_STATUS_IS_ERR(status
)) {
1982 /* Return variables */
1983 *resume_handle
= *r
.out
.resume_handle
;
1985 *num_entries
= *r
.out
.num_entries
;
1988 return r
.out
.result
;
1991 struct rpccli_samr_CreateUser_state
{
1992 struct samr_CreateUser orig
;
1993 struct samr_CreateUser tmp
;
1994 TALLOC_CTX
*out_mem_ctx
;
1995 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1998 static void rpccli_samr_CreateUser_done(struct tevent_req
*subreq
);
2000 struct tevent_req
*rpccli_samr_CreateUser_send(TALLOC_CTX
*mem_ctx
,
2001 struct tevent_context
*ev
,
2002 struct rpc_pipe_client
*cli
,
2003 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2004 struct lsa_String
*_account_name
/* [in] [ref] */,
2005 uint32_t _access_mask
/* [in] */,
2006 struct policy_handle
*_user_handle
/* [out] [ref] */,
2007 uint32_t *_rid
/* [out] [ref] */)
2009 struct tevent_req
*req
;
2010 struct rpccli_samr_CreateUser_state
*state
;
2011 struct tevent_req
*subreq
;
2013 req
= tevent_req_create(mem_ctx
, &state
,
2014 struct rpccli_samr_CreateUser_state
);
2018 state
->out_mem_ctx
= NULL
;
2019 state
->dispatch_recv
= cli
->dispatch_recv
;
2022 state
->orig
.in
.domain_handle
= _domain_handle
;
2023 state
->orig
.in
.account_name
= _account_name
;
2024 state
->orig
.in
.access_mask
= _access_mask
;
2026 /* Out parameters */
2027 state
->orig
.out
.user_handle
= _user_handle
;
2028 state
->orig
.out
.rid
= _rid
;
2031 ZERO_STRUCT(state
->orig
.out
.result
);
2033 if (DEBUGLEVEL
>= 10) {
2034 NDR_PRINT_IN_DEBUG(samr_CreateUser
, &state
->orig
);
2037 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2038 "rpccli_samr_CreateUser_out_memory");
2039 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2040 return tevent_req_post(req
, ev
);
2043 /* make a temporary copy, that we pass to the dispatch function */
2044 state
->tmp
= state
->orig
;
2046 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2048 NDR_SAMR_CREATEUSER
,
2050 if (tevent_req_nomem(subreq
, req
)) {
2051 return tevent_req_post(req
, ev
);
2053 tevent_req_set_callback(subreq
, rpccli_samr_CreateUser_done
, req
);
2057 static void rpccli_samr_CreateUser_done(struct tevent_req
*subreq
)
2059 struct tevent_req
*req
= tevent_req_callback_data(
2060 subreq
, struct tevent_req
);
2061 struct rpccli_samr_CreateUser_state
*state
= tevent_req_data(
2062 req
, struct rpccli_samr_CreateUser_state
);
2064 TALLOC_CTX
*mem_ctx
;
2066 if (state
->out_mem_ctx
) {
2067 mem_ctx
= state
->out_mem_ctx
;
2072 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2073 TALLOC_FREE(subreq
);
2074 if (!NT_STATUS_IS_OK(status
)) {
2075 tevent_req_nterror(req
, status
);
2079 /* Copy out parameters */
2080 *state
->orig
.out
.user_handle
= *state
->tmp
.out
.user_handle
;
2081 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
2084 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2086 /* Reset temporary structure */
2087 ZERO_STRUCT(state
->tmp
);
2089 if (DEBUGLEVEL
>= 10) {
2090 NDR_PRINT_OUT_DEBUG(samr_CreateUser
, &state
->orig
);
2093 tevent_req_done(req
);
2096 NTSTATUS
rpccli_samr_CreateUser_recv(struct tevent_req
*req
,
2097 TALLOC_CTX
*mem_ctx
,
2100 struct rpccli_samr_CreateUser_state
*state
= tevent_req_data(
2101 req
, struct rpccli_samr_CreateUser_state
);
2104 if (tevent_req_is_nterror(req
, &status
)) {
2105 tevent_req_received(req
);
2109 /* Steal possbile out parameters to the callers context */
2110 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2113 *result
= state
->orig
.out
.result
;
2115 tevent_req_received(req
);
2116 return NT_STATUS_OK
;
2119 NTSTATUS
rpccli_samr_CreateUser(struct rpc_pipe_client
*cli
,
2120 TALLOC_CTX
*mem_ctx
,
2121 struct policy_handle
*domain_handle
/* [in] [ref] */,
2122 struct lsa_String
*account_name
/* [in] [ref] */,
2123 uint32_t access_mask
/* [in] */,
2124 struct policy_handle
*user_handle
/* [out] [ref] */,
2125 uint32_t *rid
/* [out] [ref] */)
2127 struct samr_CreateUser r
;
2131 r
.in
.domain_handle
= domain_handle
;
2132 r
.in
.account_name
= account_name
;
2133 r
.in
.access_mask
= access_mask
;
2135 if (DEBUGLEVEL
>= 10) {
2136 NDR_PRINT_IN_DEBUG(samr_CreateUser
, &r
);
2139 status
= cli
->dispatch(cli
,
2142 NDR_SAMR_CREATEUSER
,
2145 if (!NT_STATUS_IS_OK(status
)) {
2149 if (DEBUGLEVEL
>= 10) {
2150 NDR_PRINT_OUT_DEBUG(samr_CreateUser
, &r
);
2153 if (NT_STATUS_IS_ERR(status
)) {
2157 /* Return variables */
2158 *user_handle
= *r
.out
.user_handle
;
2162 return r
.out
.result
;
2165 struct rpccli_samr_EnumDomainUsers_state
{
2166 struct samr_EnumDomainUsers orig
;
2167 struct samr_EnumDomainUsers tmp
;
2168 TALLOC_CTX
*out_mem_ctx
;
2169 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2172 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req
*subreq
);
2174 struct tevent_req
*rpccli_samr_EnumDomainUsers_send(TALLOC_CTX
*mem_ctx
,
2175 struct tevent_context
*ev
,
2176 struct rpc_pipe_client
*cli
,
2177 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2178 uint32_t *_resume_handle
/* [in,out] [ref] */,
2179 uint32_t _acct_flags
/* [in] */,
2180 struct samr_SamArray
**_sam
/* [out] [ref] */,
2181 uint32_t _max_size
/* [in] */,
2182 uint32_t *_num_entries
/* [out] [ref] */)
2184 struct tevent_req
*req
;
2185 struct rpccli_samr_EnumDomainUsers_state
*state
;
2186 struct tevent_req
*subreq
;
2188 req
= tevent_req_create(mem_ctx
, &state
,
2189 struct rpccli_samr_EnumDomainUsers_state
);
2193 state
->out_mem_ctx
= NULL
;
2194 state
->dispatch_recv
= cli
->dispatch_recv
;
2197 state
->orig
.in
.domain_handle
= _domain_handle
;
2198 state
->orig
.in
.resume_handle
= _resume_handle
;
2199 state
->orig
.in
.acct_flags
= _acct_flags
;
2200 state
->orig
.in
.max_size
= _max_size
;
2202 /* Out parameters */
2203 state
->orig
.out
.resume_handle
= _resume_handle
;
2204 state
->orig
.out
.sam
= _sam
;
2205 state
->orig
.out
.num_entries
= _num_entries
;
2208 ZERO_STRUCT(state
->orig
.out
.result
);
2210 if (DEBUGLEVEL
>= 10) {
2211 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers
, &state
->orig
);
2214 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2215 "rpccli_samr_EnumDomainUsers_out_memory");
2216 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2217 return tevent_req_post(req
, ev
);
2220 /* make a temporary copy, that we pass to the dispatch function */
2221 state
->tmp
= state
->orig
;
2223 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2225 NDR_SAMR_ENUMDOMAINUSERS
,
2227 if (tevent_req_nomem(subreq
, req
)) {
2228 return tevent_req_post(req
, ev
);
2230 tevent_req_set_callback(subreq
, rpccli_samr_EnumDomainUsers_done
, req
);
2234 static void rpccli_samr_EnumDomainUsers_done(struct tevent_req
*subreq
)
2236 struct tevent_req
*req
= tevent_req_callback_data(
2237 subreq
, struct tevent_req
);
2238 struct rpccli_samr_EnumDomainUsers_state
*state
= tevent_req_data(
2239 req
, struct rpccli_samr_EnumDomainUsers_state
);
2241 TALLOC_CTX
*mem_ctx
;
2243 if (state
->out_mem_ctx
) {
2244 mem_ctx
= state
->out_mem_ctx
;
2249 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2250 TALLOC_FREE(subreq
);
2251 if (!NT_STATUS_IS_OK(status
)) {
2252 tevent_req_nterror(req
, status
);
2256 /* Copy out parameters */
2257 *state
->orig
.out
.resume_handle
= *state
->tmp
.out
.resume_handle
;
2258 *state
->orig
.out
.sam
= *state
->tmp
.out
.sam
;
2259 *state
->orig
.out
.num_entries
= *state
->tmp
.out
.num_entries
;
2262 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2264 /* Reset temporary structure */
2265 ZERO_STRUCT(state
->tmp
);
2267 if (DEBUGLEVEL
>= 10) {
2268 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers
, &state
->orig
);
2271 tevent_req_done(req
);
2274 NTSTATUS
rpccli_samr_EnumDomainUsers_recv(struct tevent_req
*req
,
2275 TALLOC_CTX
*mem_ctx
,
2278 struct rpccli_samr_EnumDomainUsers_state
*state
= tevent_req_data(
2279 req
, struct rpccli_samr_EnumDomainUsers_state
);
2282 if (tevent_req_is_nterror(req
, &status
)) {
2283 tevent_req_received(req
);
2287 /* Steal possbile out parameters to the callers context */
2288 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2291 *result
= state
->orig
.out
.result
;
2293 tevent_req_received(req
);
2294 return NT_STATUS_OK
;
2297 NTSTATUS
rpccli_samr_EnumDomainUsers(struct rpc_pipe_client
*cli
,
2298 TALLOC_CTX
*mem_ctx
,
2299 struct policy_handle
*domain_handle
/* [in] [ref] */,
2300 uint32_t *resume_handle
/* [in,out] [ref] */,
2301 uint32_t acct_flags
/* [in] */,
2302 struct samr_SamArray
**sam
/* [out] [ref] */,
2303 uint32_t max_size
/* [in] */,
2304 uint32_t *num_entries
/* [out] [ref] */)
2306 struct samr_EnumDomainUsers r
;
2310 r
.in
.domain_handle
= domain_handle
;
2311 r
.in
.resume_handle
= resume_handle
;
2312 r
.in
.acct_flags
= acct_flags
;
2313 r
.in
.max_size
= max_size
;
2315 if (DEBUGLEVEL
>= 10) {
2316 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers
, &r
);
2319 status
= cli
->dispatch(cli
,
2322 NDR_SAMR_ENUMDOMAINUSERS
,
2325 if (!NT_STATUS_IS_OK(status
)) {
2329 if (DEBUGLEVEL
>= 10) {
2330 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers
, &r
);
2333 if (NT_STATUS_IS_ERR(status
)) {
2337 /* Return variables */
2338 *resume_handle
= *r
.out
.resume_handle
;
2340 *num_entries
= *r
.out
.num_entries
;
2343 return r
.out
.result
;
2346 struct rpccli_samr_CreateDomAlias_state
{
2347 struct samr_CreateDomAlias orig
;
2348 struct samr_CreateDomAlias tmp
;
2349 TALLOC_CTX
*out_mem_ctx
;
2350 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2353 static void rpccli_samr_CreateDomAlias_done(struct tevent_req
*subreq
);
2355 struct tevent_req
*rpccli_samr_CreateDomAlias_send(TALLOC_CTX
*mem_ctx
,
2356 struct tevent_context
*ev
,
2357 struct rpc_pipe_client
*cli
,
2358 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2359 struct lsa_String
*_alias_name
/* [in] [ref] */,
2360 uint32_t _access_mask
/* [in] */,
2361 struct policy_handle
*_alias_handle
/* [out] [ref] */,
2362 uint32_t *_rid
/* [out] [ref] */)
2364 struct tevent_req
*req
;
2365 struct rpccli_samr_CreateDomAlias_state
*state
;
2366 struct tevent_req
*subreq
;
2368 req
= tevent_req_create(mem_ctx
, &state
,
2369 struct rpccli_samr_CreateDomAlias_state
);
2373 state
->out_mem_ctx
= NULL
;
2374 state
->dispatch_recv
= cli
->dispatch_recv
;
2377 state
->orig
.in
.domain_handle
= _domain_handle
;
2378 state
->orig
.in
.alias_name
= _alias_name
;
2379 state
->orig
.in
.access_mask
= _access_mask
;
2381 /* Out parameters */
2382 state
->orig
.out
.alias_handle
= _alias_handle
;
2383 state
->orig
.out
.rid
= _rid
;
2386 ZERO_STRUCT(state
->orig
.out
.result
);
2388 if (DEBUGLEVEL
>= 10) {
2389 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias
, &state
->orig
);
2392 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2393 "rpccli_samr_CreateDomAlias_out_memory");
2394 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2395 return tevent_req_post(req
, ev
);
2398 /* make a temporary copy, that we pass to the dispatch function */
2399 state
->tmp
= state
->orig
;
2401 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2403 NDR_SAMR_CREATEDOMALIAS
,
2405 if (tevent_req_nomem(subreq
, req
)) {
2406 return tevent_req_post(req
, ev
);
2408 tevent_req_set_callback(subreq
, rpccli_samr_CreateDomAlias_done
, req
);
2412 static void rpccli_samr_CreateDomAlias_done(struct tevent_req
*subreq
)
2414 struct tevent_req
*req
= tevent_req_callback_data(
2415 subreq
, struct tevent_req
);
2416 struct rpccli_samr_CreateDomAlias_state
*state
= tevent_req_data(
2417 req
, struct rpccli_samr_CreateDomAlias_state
);
2419 TALLOC_CTX
*mem_ctx
;
2421 if (state
->out_mem_ctx
) {
2422 mem_ctx
= state
->out_mem_ctx
;
2427 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2428 TALLOC_FREE(subreq
);
2429 if (!NT_STATUS_IS_OK(status
)) {
2430 tevent_req_nterror(req
, status
);
2434 /* Copy out parameters */
2435 *state
->orig
.out
.alias_handle
= *state
->tmp
.out
.alias_handle
;
2436 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
2439 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2441 /* Reset temporary structure */
2442 ZERO_STRUCT(state
->tmp
);
2444 if (DEBUGLEVEL
>= 10) {
2445 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias
, &state
->orig
);
2448 tevent_req_done(req
);
2451 NTSTATUS
rpccli_samr_CreateDomAlias_recv(struct tevent_req
*req
,
2452 TALLOC_CTX
*mem_ctx
,
2455 struct rpccli_samr_CreateDomAlias_state
*state
= tevent_req_data(
2456 req
, struct rpccli_samr_CreateDomAlias_state
);
2459 if (tevent_req_is_nterror(req
, &status
)) {
2460 tevent_req_received(req
);
2464 /* Steal possbile out parameters to the callers context */
2465 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2468 *result
= state
->orig
.out
.result
;
2470 tevent_req_received(req
);
2471 return NT_STATUS_OK
;
2474 NTSTATUS
rpccli_samr_CreateDomAlias(struct rpc_pipe_client
*cli
,
2475 TALLOC_CTX
*mem_ctx
,
2476 struct policy_handle
*domain_handle
/* [in] [ref] */,
2477 struct lsa_String
*alias_name
/* [in] [ref] */,
2478 uint32_t access_mask
/* [in] */,
2479 struct policy_handle
*alias_handle
/* [out] [ref] */,
2480 uint32_t *rid
/* [out] [ref] */)
2482 struct samr_CreateDomAlias r
;
2486 r
.in
.domain_handle
= domain_handle
;
2487 r
.in
.alias_name
= alias_name
;
2488 r
.in
.access_mask
= access_mask
;
2490 if (DEBUGLEVEL
>= 10) {
2491 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias
, &r
);
2494 status
= cli
->dispatch(cli
,
2497 NDR_SAMR_CREATEDOMALIAS
,
2500 if (!NT_STATUS_IS_OK(status
)) {
2504 if (DEBUGLEVEL
>= 10) {
2505 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias
, &r
);
2508 if (NT_STATUS_IS_ERR(status
)) {
2512 /* Return variables */
2513 *alias_handle
= *r
.out
.alias_handle
;
2517 return r
.out
.result
;
2520 struct rpccli_samr_EnumDomainAliases_state
{
2521 struct samr_EnumDomainAliases orig
;
2522 struct samr_EnumDomainAliases tmp
;
2523 TALLOC_CTX
*out_mem_ctx
;
2524 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2527 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req
*subreq
);
2529 struct tevent_req
*rpccli_samr_EnumDomainAliases_send(TALLOC_CTX
*mem_ctx
,
2530 struct tevent_context
*ev
,
2531 struct rpc_pipe_client
*cli
,
2532 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2533 uint32_t *_resume_handle
/* [in,out] [ref] */,
2534 struct samr_SamArray
**_sam
/* [out] [ref] */,
2535 uint32_t _max_size
/* [in] */,
2536 uint32_t *_num_entries
/* [out] [ref] */)
2538 struct tevent_req
*req
;
2539 struct rpccli_samr_EnumDomainAliases_state
*state
;
2540 struct tevent_req
*subreq
;
2542 req
= tevent_req_create(mem_ctx
, &state
,
2543 struct rpccli_samr_EnumDomainAliases_state
);
2547 state
->out_mem_ctx
= NULL
;
2548 state
->dispatch_recv
= cli
->dispatch_recv
;
2551 state
->orig
.in
.domain_handle
= _domain_handle
;
2552 state
->orig
.in
.resume_handle
= _resume_handle
;
2553 state
->orig
.in
.max_size
= _max_size
;
2555 /* Out parameters */
2556 state
->orig
.out
.resume_handle
= _resume_handle
;
2557 state
->orig
.out
.sam
= _sam
;
2558 state
->orig
.out
.num_entries
= _num_entries
;
2561 ZERO_STRUCT(state
->orig
.out
.result
);
2563 if (DEBUGLEVEL
>= 10) {
2564 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases
, &state
->orig
);
2567 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2568 "rpccli_samr_EnumDomainAliases_out_memory");
2569 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2570 return tevent_req_post(req
, ev
);
2573 /* make a temporary copy, that we pass to the dispatch function */
2574 state
->tmp
= state
->orig
;
2576 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2578 NDR_SAMR_ENUMDOMAINALIASES
,
2580 if (tevent_req_nomem(subreq
, req
)) {
2581 return tevent_req_post(req
, ev
);
2583 tevent_req_set_callback(subreq
, rpccli_samr_EnumDomainAliases_done
, req
);
2587 static void rpccli_samr_EnumDomainAliases_done(struct tevent_req
*subreq
)
2589 struct tevent_req
*req
= tevent_req_callback_data(
2590 subreq
, struct tevent_req
);
2591 struct rpccli_samr_EnumDomainAliases_state
*state
= tevent_req_data(
2592 req
, struct rpccli_samr_EnumDomainAliases_state
);
2594 TALLOC_CTX
*mem_ctx
;
2596 if (state
->out_mem_ctx
) {
2597 mem_ctx
= state
->out_mem_ctx
;
2602 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2603 TALLOC_FREE(subreq
);
2604 if (!NT_STATUS_IS_OK(status
)) {
2605 tevent_req_nterror(req
, status
);
2609 /* Copy out parameters */
2610 *state
->orig
.out
.resume_handle
= *state
->tmp
.out
.resume_handle
;
2611 *state
->orig
.out
.sam
= *state
->tmp
.out
.sam
;
2612 *state
->orig
.out
.num_entries
= *state
->tmp
.out
.num_entries
;
2615 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2617 /* Reset temporary structure */
2618 ZERO_STRUCT(state
->tmp
);
2620 if (DEBUGLEVEL
>= 10) {
2621 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases
, &state
->orig
);
2624 tevent_req_done(req
);
2627 NTSTATUS
rpccli_samr_EnumDomainAliases_recv(struct tevent_req
*req
,
2628 TALLOC_CTX
*mem_ctx
,
2631 struct rpccli_samr_EnumDomainAliases_state
*state
= tevent_req_data(
2632 req
, struct rpccli_samr_EnumDomainAliases_state
);
2635 if (tevent_req_is_nterror(req
, &status
)) {
2636 tevent_req_received(req
);
2640 /* Steal possbile out parameters to the callers context */
2641 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2644 *result
= state
->orig
.out
.result
;
2646 tevent_req_received(req
);
2647 return NT_STATUS_OK
;
2650 NTSTATUS
rpccli_samr_EnumDomainAliases(struct rpc_pipe_client
*cli
,
2651 TALLOC_CTX
*mem_ctx
,
2652 struct policy_handle
*domain_handle
/* [in] [ref] */,
2653 uint32_t *resume_handle
/* [in,out] [ref] */,
2654 struct samr_SamArray
**sam
/* [out] [ref] */,
2655 uint32_t max_size
/* [in] */,
2656 uint32_t *num_entries
/* [out] [ref] */)
2658 struct samr_EnumDomainAliases r
;
2662 r
.in
.domain_handle
= domain_handle
;
2663 r
.in
.resume_handle
= resume_handle
;
2664 r
.in
.max_size
= max_size
;
2666 if (DEBUGLEVEL
>= 10) {
2667 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases
, &r
);
2670 status
= cli
->dispatch(cli
,
2673 NDR_SAMR_ENUMDOMAINALIASES
,
2676 if (!NT_STATUS_IS_OK(status
)) {
2680 if (DEBUGLEVEL
>= 10) {
2681 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases
, &r
);
2684 if (NT_STATUS_IS_ERR(status
)) {
2688 /* Return variables */
2689 *resume_handle
= *r
.out
.resume_handle
;
2691 *num_entries
= *r
.out
.num_entries
;
2694 return r
.out
.result
;
2697 struct rpccli_samr_GetAliasMembership_state
{
2698 struct samr_GetAliasMembership orig
;
2699 struct samr_GetAliasMembership tmp
;
2700 TALLOC_CTX
*out_mem_ctx
;
2701 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2704 static void rpccli_samr_GetAliasMembership_done(struct tevent_req
*subreq
);
2706 struct tevent_req
*rpccli_samr_GetAliasMembership_send(TALLOC_CTX
*mem_ctx
,
2707 struct tevent_context
*ev
,
2708 struct rpc_pipe_client
*cli
,
2709 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2710 struct lsa_SidArray
*_sids
/* [in] [ref] */,
2711 struct samr_Ids
*_rids
/* [out] [ref] */)
2713 struct tevent_req
*req
;
2714 struct rpccli_samr_GetAliasMembership_state
*state
;
2715 struct tevent_req
*subreq
;
2717 req
= tevent_req_create(mem_ctx
, &state
,
2718 struct rpccli_samr_GetAliasMembership_state
);
2722 state
->out_mem_ctx
= NULL
;
2723 state
->dispatch_recv
= cli
->dispatch_recv
;
2726 state
->orig
.in
.domain_handle
= _domain_handle
;
2727 state
->orig
.in
.sids
= _sids
;
2729 /* Out parameters */
2730 state
->orig
.out
.rids
= _rids
;
2733 ZERO_STRUCT(state
->orig
.out
.result
);
2735 if (DEBUGLEVEL
>= 10) {
2736 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership
, &state
->orig
);
2739 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2740 "rpccli_samr_GetAliasMembership_out_memory");
2741 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2742 return tevent_req_post(req
, ev
);
2745 /* make a temporary copy, that we pass to the dispatch function */
2746 state
->tmp
= state
->orig
;
2748 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2750 NDR_SAMR_GETALIASMEMBERSHIP
,
2752 if (tevent_req_nomem(subreq
, req
)) {
2753 return tevent_req_post(req
, ev
);
2755 tevent_req_set_callback(subreq
, rpccli_samr_GetAliasMembership_done
, req
);
2759 static void rpccli_samr_GetAliasMembership_done(struct tevent_req
*subreq
)
2761 struct tevent_req
*req
= tevent_req_callback_data(
2762 subreq
, struct tevent_req
);
2763 struct rpccli_samr_GetAliasMembership_state
*state
= tevent_req_data(
2764 req
, struct rpccli_samr_GetAliasMembership_state
);
2766 TALLOC_CTX
*mem_ctx
;
2768 if (state
->out_mem_ctx
) {
2769 mem_ctx
= state
->out_mem_ctx
;
2774 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2775 TALLOC_FREE(subreq
);
2776 if (!NT_STATUS_IS_OK(status
)) {
2777 tevent_req_nterror(req
, status
);
2781 /* Copy out parameters */
2782 *state
->orig
.out
.rids
= *state
->tmp
.out
.rids
;
2785 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2787 /* Reset temporary structure */
2788 ZERO_STRUCT(state
->tmp
);
2790 if (DEBUGLEVEL
>= 10) {
2791 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership
, &state
->orig
);
2794 tevent_req_done(req
);
2797 NTSTATUS
rpccli_samr_GetAliasMembership_recv(struct tevent_req
*req
,
2798 TALLOC_CTX
*mem_ctx
,
2801 struct rpccli_samr_GetAliasMembership_state
*state
= tevent_req_data(
2802 req
, struct rpccli_samr_GetAliasMembership_state
);
2805 if (tevent_req_is_nterror(req
, &status
)) {
2806 tevent_req_received(req
);
2810 /* Steal possbile out parameters to the callers context */
2811 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2814 *result
= state
->orig
.out
.result
;
2816 tevent_req_received(req
);
2817 return NT_STATUS_OK
;
2820 NTSTATUS
rpccli_samr_GetAliasMembership(struct rpc_pipe_client
*cli
,
2821 TALLOC_CTX
*mem_ctx
,
2822 struct policy_handle
*domain_handle
/* [in] [ref] */,
2823 struct lsa_SidArray
*sids
/* [in] [ref] */,
2824 struct samr_Ids
*rids
/* [out] [ref] */)
2826 struct samr_GetAliasMembership r
;
2830 r
.in
.domain_handle
= domain_handle
;
2833 if (DEBUGLEVEL
>= 10) {
2834 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership
, &r
);
2837 status
= cli
->dispatch(cli
,
2840 NDR_SAMR_GETALIASMEMBERSHIP
,
2843 if (!NT_STATUS_IS_OK(status
)) {
2847 if (DEBUGLEVEL
>= 10) {
2848 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership
, &r
);
2851 if (NT_STATUS_IS_ERR(status
)) {
2855 /* Return variables */
2856 *rids
= *r
.out
.rids
;
2859 return r
.out
.result
;
2862 struct rpccli_samr_LookupNames_state
{
2863 struct samr_LookupNames orig
;
2864 struct samr_LookupNames tmp
;
2865 TALLOC_CTX
*out_mem_ctx
;
2866 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2869 static void rpccli_samr_LookupNames_done(struct tevent_req
*subreq
);
2871 struct tevent_req
*rpccli_samr_LookupNames_send(TALLOC_CTX
*mem_ctx
,
2872 struct tevent_context
*ev
,
2873 struct rpc_pipe_client
*cli
,
2874 struct policy_handle
*_domain_handle
/* [in] [ref] */,
2875 uint32_t _num_names
/* [in] [range(0,1000)] */,
2876 struct lsa_String
*_names
/* [in] [length_is(num_names),size_is(1000)] */,
2877 struct samr_Ids
*_rids
/* [out] [ref] */,
2878 struct samr_Ids
*_types
/* [out] [ref] */)
2880 struct tevent_req
*req
;
2881 struct rpccli_samr_LookupNames_state
*state
;
2882 struct tevent_req
*subreq
;
2884 req
= tevent_req_create(mem_ctx
, &state
,
2885 struct rpccli_samr_LookupNames_state
);
2889 state
->out_mem_ctx
= NULL
;
2890 state
->dispatch_recv
= cli
->dispatch_recv
;
2893 state
->orig
.in
.domain_handle
= _domain_handle
;
2894 state
->orig
.in
.num_names
= _num_names
;
2895 state
->orig
.in
.names
= _names
;
2897 /* Out parameters */
2898 state
->orig
.out
.rids
= _rids
;
2899 state
->orig
.out
.types
= _types
;
2902 ZERO_STRUCT(state
->orig
.out
.result
);
2904 if (DEBUGLEVEL
>= 10) {
2905 NDR_PRINT_IN_DEBUG(samr_LookupNames
, &state
->orig
);
2908 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2909 "rpccli_samr_LookupNames_out_memory");
2910 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2911 return tevent_req_post(req
, ev
);
2914 /* make a temporary copy, that we pass to the dispatch function */
2915 state
->tmp
= state
->orig
;
2917 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2919 NDR_SAMR_LOOKUPNAMES
,
2921 if (tevent_req_nomem(subreq
, req
)) {
2922 return tevent_req_post(req
, ev
);
2924 tevent_req_set_callback(subreq
, rpccli_samr_LookupNames_done
, req
);
2928 static void rpccli_samr_LookupNames_done(struct tevent_req
*subreq
)
2930 struct tevent_req
*req
= tevent_req_callback_data(
2931 subreq
, struct tevent_req
);
2932 struct rpccli_samr_LookupNames_state
*state
= tevent_req_data(
2933 req
, struct rpccli_samr_LookupNames_state
);
2935 TALLOC_CTX
*mem_ctx
;
2937 if (state
->out_mem_ctx
) {
2938 mem_ctx
= state
->out_mem_ctx
;
2943 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2944 TALLOC_FREE(subreq
);
2945 if (!NT_STATUS_IS_OK(status
)) {
2946 tevent_req_nterror(req
, status
);
2950 /* Copy out parameters */
2951 *state
->orig
.out
.rids
= *state
->tmp
.out
.rids
;
2952 *state
->orig
.out
.types
= *state
->tmp
.out
.types
;
2955 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2957 /* Reset temporary structure */
2958 ZERO_STRUCT(state
->tmp
);
2960 if (DEBUGLEVEL
>= 10) {
2961 NDR_PRINT_OUT_DEBUG(samr_LookupNames
, &state
->orig
);
2964 tevent_req_done(req
);
2967 NTSTATUS
rpccli_samr_LookupNames_recv(struct tevent_req
*req
,
2968 TALLOC_CTX
*mem_ctx
,
2971 struct rpccli_samr_LookupNames_state
*state
= tevent_req_data(
2972 req
, struct rpccli_samr_LookupNames_state
);
2975 if (tevent_req_is_nterror(req
, &status
)) {
2976 tevent_req_received(req
);
2980 /* Steal possbile out parameters to the callers context */
2981 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2984 *result
= state
->orig
.out
.result
;
2986 tevent_req_received(req
);
2987 return NT_STATUS_OK
;
2990 NTSTATUS
rpccli_samr_LookupNames(struct rpc_pipe_client
*cli
,
2991 TALLOC_CTX
*mem_ctx
,
2992 struct policy_handle
*domain_handle
/* [in] [ref] */,
2993 uint32_t num_names
/* [in] [range(0,1000)] */,
2994 struct lsa_String
*names
/* [in] [length_is(num_names),size_is(1000)] */,
2995 struct samr_Ids
*rids
/* [out] [ref] */,
2996 struct samr_Ids
*types
/* [out] [ref] */)
2998 struct samr_LookupNames r
;
3002 r
.in
.domain_handle
= domain_handle
;
3003 r
.in
.num_names
= num_names
;
3006 if (DEBUGLEVEL
>= 10) {
3007 NDR_PRINT_IN_DEBUG(samr_LookupNames
, &r
);
3010 status
= cli
->dispatch(cli
,
3013 NDR_SAMR_LOOKUPNAMES
,
3016 if (!NT_STATUS_IS_OK(status
)) {
3020 if (DEBUGLEVEL
>= 10) {
3021 NDR_PRINT_OUT_DEBUG(samr_LookupNames
, &r
);
3024 if (NT_STATUS_IS_ERR(status
)) {
3028 /* Return variables */
3029 *rids
= *r
.out
.rids
;
3030 *types
= *r
.out
.types
;
3033 return r
.out
.result
;
3036 struct rpccli_samr_LookupRids_state
{
3037 struct samr_LookupRids orig
;
3038 struct samr_LookupRids tmp
;
3039 TALLOC_CTX
*out_mem_ctx
;
3040 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3043 static void rpccli_samr_LookupRids_done(struct tevent_req
*subreq
);
3045 struct tevent_req
*rpccli_samr_LookupRids_send(TALLOC_CTX
*mem_ctx
,
3046 struct tevent_context
*ev
,
3047 struct rpc_pipe_client
*cli
,
3048 struct policy_handle
*_domain_handle
/* [in] [ref] */,
3049 uint32_t _num_rids
/* [in] [range(0,1000)] */,
3050 uint32_t *_rids
/* [in] [length_is(num_rids),size_is(1000)] */,
3051 struct lsa_Strings
*_names
/* [out] [ref] */,
3052 struct samr_Ids
*_types
/* [out] [ref] */)
3054 struct tevent_req
*req
;
3055 struct rpccli_samr_LookupRids_state
*state
;
3056 struct tevent_req
*subreq
;
3058 req
= tevent_req_create(mem_ctx
, &state
,
3059 struct rpccli_samr_LookupRids_state
);
3063 state
->out_mem_ctx
= NULL
;
3064 state
->dispatch_recv
= cli
->dispatch_recv
;
3067 state
->orig
.in
.domain_handle
= _domain_handle
;
3068 state
->orig
.in
.num_rids
= _num_rids
;
3069 state
->orig
.in
.rids
= _rids
;
3071 /* Out parameters */
3072 state
->orig
.out
.names
= _names
;
3073 state
->orig
.out
.types
= _types
;
3076 ZERO_STRUCT(state
->orig
.out
.result
);
3078 if (DEBUGLEVEL
>= 10) {
3079 NDR_PRINT_IN_DEBUG(samr_LookupRids
, &state
->orig
);
3082 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3083 "rpccli_samr_LookupRids_out_memory");
3084 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3085 return tevent_req_post(req
, ev
);
3088 /* make a temporary copy, that we pass to the dispatch function */
3089 state
->tmp
= state
->orig
;
3091 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3093 NDR_SAMR_LOOKUPRIDS
,
3095 if (tevent_req_nomem(subreq
, req
)) {
3096 return tevent_req_post(req
, ev
);
3098 tevent_req_set_callback(subreq
, rpccli_samr_LookupRids_done
, req
);
3102 static void rpccli_samr_LookupRids_done(struct tevent_req
*subreq
)
3104 struct tevent_req
*req
= tevent_req_callback_data(
3105 subreq
, struct tevent_req
);
3106 struct rpccli_samr_LookupRids_state
*state
= tevent_req_data(
3107 req
, struct rpccli_samr_LookupRids_state
);
3109 TALLOC_CTX
*mem_ctx
;
3111 if (state
->out_mem_ctx
) {
3112 mem_ctx
= state
->out_mem_ctx
;
3117 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3118 TALLOC_FREE(subreq
);
3119 if (!NT_STATUS_IS_OK(status
)) {
3120 tevent_req_nterror(req
, status
);
3124 /* Copy out parameters */
3125 *state
->orig
.out
.names
= *state
->tmp
.out
.names
;
3126 *state
->orig
.out
.types
= *state
->tmp
.out
.types
;
3129 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3131 /* Reset temporary structure */
3132 ZERO_STRUCT(state
->tmp
);
3134 if (DEBUGLEVEL
>= 10) {
3135 NDR_PRINT_OUT_DEBUG(samr_LookupRids
, &state
->orig
);
3138 tevent_req_done(req
);
3141 NTSTATUS
rpccli_samr_LookupRids_recv(struct tevent_req
*req
,
3142 TALLOC_CTX
*mem_ctx
,
3145 struct rpccli_samr_LookupRids_state
*state
= tevent_req_data(
3146 req
, struct rpccli_samr_LookupRids_state
);
3149 if (tevent_req_is_nterror(req
, &status
)) {
3150 tevent_req_received(req
);
3154 /* Steal possbile out parameters to the callers context */
3155 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3158 *result
= state
->orig
.out
.result
;
3160 tevent_req_received(req
);
3161 return NT_STATUS_OK
;
3164 NTSTATUS
rpccli_samr_LookupRids(struct rpc_pipe_client
*cli
,
3165 TALLOC_CTX
*mem_ctx
,
3166 struct policy_handle
*domain_handle
/* [in] [ref] */,
3167 uint32_t num_rids
/* [in] [range(0,1000)] */,
3168 uint32_t *rids
/* [in] [length_is(num_rids),size_is(1000)] */,
3169 struct lsa_Strings
*names
/* [out] [ref] */,
3170 struct samr_Ids
*types
/* [out] [ref] */)
3172 struct samr_LookupRids r
;
3176 r
.in
.domain_handle
= domain_handle
;
3177 r
.in
.num_rids
= num_rids
;
3180 if (DEBUGLEVEL
>= 10) {
3181 NDR_PRINT_IN_DEBUG(samr_LookupRids
, &r
);
3184 status
= cli
->dispatch(cli
,
3187 NDR_SAMR_LOOKUPRIDS
,
3190 if (!NT_STATUS_IS_OK(status
)) {
3194 if (DEBUGLEVEL
>= 10) {
3195 NDR_PRINT_OUT_DEBUG(samr_LookupRids
, &r
);
3198 if (NT_STATUS_IS_ERR(status
)) {
3202 /* Return variables */
3203 *names
= *r
.out
.names
;
3204 *types
= *r
.out
.types
;
3207 return r
.out
.result
;
3210 struct rpccli_samr_OpenGroup_state
{
3211 struct samr_OpenGroup orig
;
3212 struct samr_OpenGroup tmp
;
3213 TALLOC_CTX
*out_mem_ctx
;
3214 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3217 static void rpccli_samr_OpenGroup_done(struct tevent_req
*subreq
);
3219 struct tevent_req
*rpccli_samr_OpenGroup_send(TALLOC_CTX
*mem_ctx
,
3220 struct tevent_context
*ev
,
3221 struct rpc_pipe_client
*cli
,
3222 struct policy_handle
*_domain_handle
/* [in] [ref] */,
3223 uint32_t _access_mask
/* [in] */,
3224 uint32_t _rid
/* [in] */,
3225 struct policy_handle
*_group_handle
/* [out] [ref] */)
3227 struct tevent_req
*req
;
3228 struct rpccli_samr_OpenGroup_state
*state
;
3229 struct tevent_req
*subreq
;
3231 req
= tevent_req_create(mem_ctx
, &state
,
3232 struct rpccli_samr_OpenGroup_state
);
3236 state
->out_mem_ctx
= NULL
;
3237 state
->dispatch_recv
= cli
->dispatch_recv
;
3240 state
->orig
.in
.domain_handle
= _domain_handle
;
3241 state
->orig
.in
.access_mask
= _access_mask
;
3242 state
->orig
.in
.rid
= _rid
;
3244 /* Out parameters */
3245 state
->orig
.out
.group_handle
= _group_handle
;
3248 ZERO_STRUCT(state
->orig
.out
.result
);
3250 if (DEBUGLEVEL
>= 10) {
3251 NDR_PRINT_IN_DEBUG(samr_OpenGroup
, &state
->orig
);
3254 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3255 "rpccli_samr_OpenGroup_out_memory");
3256 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3257 return tevent_req_post(req
, ev
);
3260 /* make a temporary copy, that we pass to the dispatch function */
3261 state
->tmp
= state
->orig
;
3263 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3267 if (tevent_req_nomem(subreq
, req
)) {
3268 return tevent_req_post(req
, ev
);
3270 tevent_req_set_callback(subreq
, rpccli_samr_OpenGroup_done
, req
);
3274 static void rpccli_samr_OpenGroup_done(struct tevent_req
*subreq
)
3276 struct tevent_req
*req
= tevent_req_callback_data(
3277 subreq
, struct tevent_req
);
3278 struct rpccli_samr_OpenGroup_state
*state
= tevent_req_data(
3279 req
, struct rpccli_samr_OpenGroup_state
);
3281 TALLOC_CTX
*mem_ctx
;
3283 if (state
->out_mem_ctx
) {
3284 mem_ctx
= state
->out_mem_ctx
;
3289 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3290 TALLOC_FREE(subreq
);
3291 if (!NT_STATUS_IS_OK(status
)) {
3292 tevent_req_nterror(req
, status
);
3296 /* Copy out parameters */
3297 *state
->orig
.out
.group_handle
= *state
->tmp
.out
.group_handle
;
3300 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3302 /* Reset temporary structure */
3303 ZERO_STRUCT(state
->tmp
);
3305 if (DEBUGLEVEL
>= 10) {
3306 NDR_PRINT_OUT_DEBUG(samr_OpenGroup
, &state
->orig
);
3309 tevent_req_done(req
);
3312 NTSTATUS
rpccli_samr_OpenGroup_recv(struct tevent_req
*req
,
3313 TALLOC_CTX
*mem_ctx
,
3316 struct rpccli_samr_OpenGroup_state
*state
= tevent_req_data(
3317 req
, struct rpccli_samr_OpenGroup_state
);
3320 if (tevent_req_is_nterror(req
, &status
)) {
3321 tevent_req_received(req
);
3325 /* Steal possbile out parameters to the callers context */
3326 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3329 *result
= state
->orig
.out
.result
;
3331 tevent_req_received(req
);
3332 return NT_STATUS_OK
;
3335 NTSTATUS
rpccli_samr_OpenGroup(struct rpc_pipe_client
*cli
,
3336 TALLOC_CTX
*mem_ctx
,
3337 struct policy_handle
*domain_handle
/* [in] [ref] */,
3338 uint32_t access_mask
/* [in] */,
3339 uint32_t rid
/* [in] */,
3340 struct policy_handle
*group_handle
/* [out] [ref] */)
3342 struct samr_OpenGroup r
;
3346 r
.in
.domain_handle
= domain_handle
;
3347 r
.in
.access_mask
= access_mask
;
3350 if (DEBUGLEVEL
>= 10) {
3351 NDR_PRINT_IN_DEBUG(samr_OpenGroup
, &r
);
3354 status
= cli
->dispatch(cli
,
3360 if (!NT_STATUS_IS_OK(status
)) {
3364 if (DEBUGLEVEL
>= 10) {
3365 NDR_PRINT_OUT_DEBUG(samr_OpenGroup
, &r
);
3368 if (NT_STATUS_IS_ERR(status
)) {
3372 /* Return variables */
3373 *group_handle
= *r
.out
.group_handle
;
3376 return r
.out
.result
;
3379 struct rpccli_samr_QueryGroupInfo_state
{
3380 struct samr_QueryGroupInfo orig
;
3381 struct samr_QueryGroupInfo tmp
;
3382 TALLOC_CTX
*out_mem_ctx
;
3383 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3386 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req
*subreq
);
3388 struct tevent_req
*rpccli_samr_QueryGroupInfo_send(TALLOC_CTX
*mem_ctx
,
3389 struct tevent_context
*ev
,
3390 struct rpc_pipe_client
*cli
,
3391 struct policy_handle
*_group_handle
/* [in] [ref] */,
3392 enum samr_GroupInfoEnum _level
/* [in] */,
3393 union samr_GroupInfo
**_info
/* [out] [ref,switch_is(level)] */)
3395 struct tevent_req
*req
;
3396 struct rpccli_samr_QueryGroupInfo_state
*state
;
3397 struct tevent_req
*subreq
;
3399 req
= tevent_req_create(mem_ctx
, &state
,
3400 struct rpccli_samr_QueryGroupInfo_state
);
3404 state
->out_mem_ctx
= NULL
;
3405 state
->dispatch_recv
= cli
->dispatch_recv
;
3408 state
->orig
.in
.group_handle
= _group_handle
;
3409 state
->orig
.in
.level
= _level
;
3411 /* Out parameters */
3412 state
->orig
.out
.info
= _info
;
3415 ZERO_STRUCT(state
->orig
.out
.result
);
3417 if (DEBUGLEVEL
>= 10) {
3418 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo
, &state
->orig
);
3421 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3422 "rpccli_samr_QueryGroupInfo_out_memory");
3423 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3424 return tevent_req_post(req
, ev
);
3427 /* make a temporary copy, that we pass to the dispatch function */
3428 state
->tmp
= state
->orig
;
3430 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3432 NDR_SAMR_QUERYGROUPINFO
,
3434 if (tevent_req_nomem(subreq
, req
)) {
3435 return tevent_req_post(req
, ev
);
3437 tevent_req_set_callback(subreq
, rpccli_samr_QueryGroupInfo_done
, req
);
3441 static void rpccli_samr_QueryGroupInfo_done(struct tevent_req
*subreq
)
3443 struct tevent_req
*req
= tevent_req_callback_data(
3444 subreq
, struct tevent_req
);
3445 struct rpccli_samr_QueryGroupInfo_state
*state
= tevent_req_data(
3446 req
, struct rpccli_samr_QueryGroupInfo_state
);
3448 TALLOC_CTX
*mem_ctx
;
3450 if (state
->out_mem_ctx
) {
3451 mem_ctx
= state
->out_mem_ctx
;
3456 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3457 TALLOC_FREE(subreq
);
3458 if (!NT_STATUS_IS_OK(status
)) {
3459 tevent_req_nterror(req
, status
);
3463 /* Copy out parameters */
3464 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
3467 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3469 /* Reset temporary structure */
3470 ZERO_STRUCT(state
->tmp
);
3472 if (DEBUGLEVEL
>= 10) {
3473 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo
, &state
->orig
);
3476 tevent_req_done(req
);
3479 NTSTATUS
rpccli_samr_QueryGroupInfo_recv(struct tevent_req
*req
,
3480 TALLOC_CTX
*mem_ctx
,
3483 struct rpccli_samr_QueryGroupInfo_state
*state
= tevent_req_data(
3484 req
, struct rpccli_samr_QueryGroupInfo_state
);
3487 if (tevent_req_is_nterror(req
, &status
)) {
3488 tevent_req_received(req
);
3492 /* Steal possbile out parameters to the callers context */
3493 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3496 *result
= state
->orig
.out
.result
;
3498 tevent_req_received(req
);
3499 return NT_STATUS_OK
;
3502 NTSTATUS
rpccli_samr_QueryGroupInfo(struct rpc_pipe_client
*cli
,
3503 TALLOC_CTX
*mem_ctx
,
3504 struct policy_handle
*group_handle
/* [in] [ref] */,
3505 enum samr_GroupInfoEnum level
/* [in] */,
3506 union samr_GroupInfo
**info
/* [out] [ref,switch_is(level)] */)
3508 struct samr_QueryGroupInfo r
;
3512 r
.in
.group_handle
= group_handle
;
3515 if (DEBUGLEVEL
>= 10) {
3516 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo
, &r
);
3519 status
= cli
->dispatch(cli
,
3522 NDR_SAMR_QUERYGROUPINFO
,
3525 if (!NT_STATUS_IS_OK(status
)) {
3529 if (DEBUGLEVEL
>= 10) {
3530 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo
, &r
);
3533 if (NT_STATUS_IS_ERR(status
)) {
3537 /* Return variables */
3538 *info
= *r
.out
.info
;
3541 return r
.out
.result
;
3544 struct rpccli_samr_SetGroupInfo_state
{
3545 struct samr_SetGroupInfo orig
;
3546 struct samr_SetGroupInfo tmp
;
3547 TALLOC_CTX
*out_mem_ctx
;
3548 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3551 static void rpccli_samr_SetGroupInfo_done(struct tevent_req
*subreq
);
3553 struct tevent_req
*rpccli_samr_SetGroupInfo_send(TALLOC_CTX
*mem_ctx
,
3554 struct tevent_context
*ev
,
3555 struct rpc_pipe_client
*cli
,
3556 struct policy_handle
*_group_handle
/* [in] [ref] */,
3557 enum samr_GroupInfoEnum _level
/* [in] */,
3558 union samr_GroupInfo
*_info
/* [in] [ref,switch_is(level)] */)
3560 struct tevent_req
*req
;
3561 struct rpccli_samr_SetGroupInfo_state
*state
;
3562 struct tevent_req
*subreq
;
3564 req
= tevent_req_create(mem_ctx
, &state
,
3565 struct rpccli_samr_SetGroupInfo_state
);
3569 state
->out_mem_ctx
= NULL
;
3570 state
->dispatch_recv
= cli
->dispatch_recv
;
3573 state
->orig
.in
.group_handle
= _group_handle
;
3574 state
->orig
.in
.level
= _level
;
3575 state
->orig
.in
.info
= _info
;
3577 /* Out parameters */
3580 ZERO_STRUCT(state
->orig
.out
.result
);
3582 if (DEBUGLEVEL
>= 10) {
3583 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo
, &state
->orig
);
3586 /* make a temporary copy, that we pass to the dispatch function */
3587 state
->tmp
= state
->orig
;
3589 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3591 NDR_SAMR_SETGROUPINFO
,
3593 if (tevent_req_nomem(subreq
, req
)) {
3594 return tevent_req_post(req
, ev
);
3596 tevent_req_set_callback(subreq
, rpccli_samr_SetGroupInfo_done
, req
);
3600 static void rpccli_samr_SetGroupInfo_done(struct tevent_req
*subreq
)
3602 struct tevent_req
*req
= tevent_req_callback_data(
3603 subreq
, struct tevent_req
);
3604 struct rpccli_samr_SetGroupInfo_state
*state
= tevent_req_data(
3605 req
, struct rpccli_samr_SetGroupInfo_state
);
3607 TALLOC_CTX
*mem_ctx
;
3609 if (state
->out_mem_ctx
) {
3610 mem_ctx
= state
->out_mem_ctx
;
3615 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3616 TALLOC_FREE(subreq
);
3617 if (!NT_STATUS_IS_OK(status
)) {
3618 tevent_req_nterror(req
, status
);
3622 /* Copy out parameters */
3625 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3627 /* Reset temporary structure */
3628 ZERO_STRUCT(state
->tmp
);
3630 if (DEBUGLEVEL
>= 10) {
3631 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo
, &state
->orig
);
3634 tevent_req_done(req
);
3637 NTSTATUS
rpccli_samr_SetGroupInfo_recv(struct tevent_req
*req
,
3638 TALLOC_CTX
*mem_ctx
,
3641 struct rpccli_samr_SetGroupInfo_state
*state
= tevent_req_data(
3642 req
, struct rpccli_samr_SetGroupInfo_state
);
3645 if (tevent_req_is_nterror(req
, &status
)) {
3646 tevent_req_received(req
);
3650 /* Steal possbile out parameters to the callers context */
3651 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3654 *result
= state
->orig
.out
.result
;
3656 tevent_req_received(req
);
3657 return NT_STATUS_OK
;
3660 NTSTATUS
rpccli_samr_SetGroupInfo(struct rpc_pipe_client
*cli
,
3661 TALLOC_CTX
*mem_ctx
,
3662 struct policy_handle
*group_handle
/* [in] [ref] */,
3663 enum samr_GroupInfoEnum level
/* [in] */,
3664 union samr_GroupInfo
*info
/* [in] [ref,switch_is(level)] */)
3666 struct samr_SetGroupInfo r
;
3670 r
.in
.group_handle
= group_handle
;
3674 if (DEBUGLEVEL
>= 10) {
3675 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo
, &r
);
3678 status
= cli
->dispatch(cli
,
3681 NDR_SAMR_SETGROUPINFO
,
3684 if (!NT_STATUS_IS_OK(status
)) {
3688 if (DEBUGLEVEL
>= 10) {
3689 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo
, &r
);
3692 if (NT_STATUS_IS_ERR(status
)) {
3696 /* Return variables */
3699 return r
.out
.result
;
3702 struct rpccli_samr_AddGroupMember_state
{
3703 struct samr_AddGroupMember orig
;
3704 struct samr_AddGroupMember tmp
;
3705 TALLOC_CTX
*out_mem_ctx
;
3706 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3709 static void rpccli_samr_AddGroupMember_done(struct tevent_req
*subreq
);
3711 struct tevent_req
*rpccli_samr_AddGroupMember_send(TALLOC_CTX
*mem_ctx
,
3712 struct tevent_context
*ev
,
3713 struct rpc_pipe_client
*cli
,
3714 struct policy_handle
*_group_handle
/* [in] [ref] */,
3715 uint32_t _rid
/* [in] */,
3716 uint32_t _flags
/* [in] */)
3718 struct tevent_req
*req
;
3719 struct rpccli_samr_AddGroupMember_state
*state
;
3720 struct tevent_req
*subreq
;
3722 req
= tevent_req_create(mem_ctx
, &state
,
3723 struct rpccli_samr_AddGroupMember_state
);
3727 state
->out_mem_ctx
= NULL
;
3728 state
->dispatch_recv
= cli
->dispatch_recv
;
3731 state
->orig
.in
.group_handle
= _group_handle
;
3732 state
->orig
.in
.rid
= _rid
;
3733 state
->orig
.in
.flags
= _flags
;
3735 /* Out parameters */
3738 ZERO_STRUCT(state
->orig
.out
.result
);
3740 if (DEBUGLEVEL
>= 10) {
3741 NDR_PRINT_IN_DEBUG(samr_AddGroupMember
, &state
->orig
);
3744 /* make a temporary copy, that we pass to the dispatch function */
3745 state
->tmp
= state
->orig
;
3747 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3749 NDR_SAMR_ADDGROUPMEMBER
,
3751 if (tevent_req_nomem(subreq
, req
)) {
3752 return tevent_req_post(req
, ev
);
3754 tevent_req_set_callback(subreq
, rpccli_samr_AddGroupMember_done
, req
);
3758 static void rpccli_samr_AddGroupMember_done(struct tevent_req
*subreq
)
3760 struct tevent_req
*req
= tevent_req_callback_data(
3761 subreq
, struct tevent_req
);
3762 struct rpccli_samr_AddGroupMember_state
*state
= tevent_req_data(
3763 req
, struct rpccli_samr_AddGroupMember_state
);
3765 TALLOC_CTX
*mem_ctx
;
3767 if (state
->out_mem_ctx
) {
3768 mem_ctx
= state
->out_mem_ctx
;
3773 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3774 TALLOC_FREE(subreq
);
3775 if (!NT_STATUS_IS_OK(status
)) {
3776 tevent_req_nterror(req
, status
);
3780 /* Copy out parameters */
3783 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3785 /* Reset temporary structure */
3786 ZERO_STRUCT(state
->tmp
);
3788 if (DEBUGLEVEL
>= 10) {
3789 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember
, &state
->orig
);
3792 tevent_req_done(req
);
3795 NTSTATUS
rpccli_samr_AddGroupMember_recv(struct tevent_req
*req
,
3796 TALLOC_CTX
*mem_ctx
,
3799 struct rpccli_samr_AddGroupMember_state
*state
= tevent_req_data(
3800 req
, struct rpccli_samr_AddGroupMember_state
);
3803 if (tevent_req_is_nterror(req
, &status
)) {
3804 tevent_req_received(req
);
3808 /* Steal possbile out parameters to the callers context */
3809 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3812 *result
= state
->orig
.out
.result
;
3814 tevent_req_received(req
);
3815 return NT_STATUS_OK
;
3818 NTSTATUS
rpccli_samr_AddGroupMember(struct rpc_pipe_client
*cli
,
3819 TALLOC_CTX
*mem_ctx
,
3820 struct policy_handle
*group_handle
/* [in] [ref] */,
3821 uint32_t rid
/* [in] */,
3822 uint32_t flags
/* [in] */)
3824 struct samr_AddGroupMember r
;
3828 r
.in
.group_handle
= group_handle
;
3832 if (DEBUGLEVEL
>= 10) {
3833 NDR_PRINT_IN_DEBUG(samr_AddGroupMember
, &r
);
3836 status
= cli
->dispatch(cli
,
3839 NDR_SAMR_ADDGROUPMEMBER
,
3842 if (!NT_STATUS_IS_OK(status
)) {
3846 if (DEBUGLEVEL
>= 10) {
3847 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember
, &r
);
3850 if (NT_STATUS_IS_ERR(status
)) {
3854 /* Return variables */
3857 return r
.out
.result
;
3860 struct rpccli_samr_DeleteDomainGroup_state
{
3861 struct samr_DeleteDomainGroup orig
;
3862 struct samr_DeleteDomainGroup tmp
;
3863 TALLOC_CTX
*out_mem_ctx
;
3864 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3867 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req
*subreq
);
3869 struct tevent_req
*rpccli_samr_DeleteDomainGroup_send(TALLOC_CTX
*mem_ctx
,
3870 struct tevent_context
*ev
,
3871 struct rpc_pipe_client
*cli
,
3872 struct policy_handle
*_group_handle
/* [in,out] [ref] */)
3874 struct tevent_req
*req
;
3875 struct rpccli_samr_DeleteDomainGroup_state
*state
;
3876 struct tevent_req
*subreq
;
3878 req
= tevent_req_create(mem_ctx
, &state
,
3879 struct rpccli_samr_DeleteDomainGroup_state
);
3883 state
->out_mem_ctx
= NULL
;
3884 state
->dispatch_recv
= cli
->dispatch_recv
;
3887 state
->orig
.in
.group_handle
= _group_handle
;
3889 /* Out parameters */
3890 state
->orig
.out
.group_handle
= _group_handle
;
3893 ZERO_STRUCT(state
->orig
.out
.result
);
3895 if (DEBUGLEVEL
>= 10) {
3896 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup
, &state
->orig
);
3899 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3900 "rpccli_samr_DeleteDomainGroup_out_memory");
3901 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3902 return tevent_req_post(req
, ev
);
3905 /* make a temporary copy, that we pass to the dispatch function */
3906 state
->tmp
= state
->orig
;
3908 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3910 NDR_SAMR_DELETEDOMAINGROUP
,
3912 if (tevent_req_nomem(subreq
, req
)) {
3913 return tevent_req_post(req
, ev
);
3915 tevent_req_set_callback(subreq
, rpccli_samr_DeleteDomainGroup_done
, req
);
3919 static void rpccli_samr_DeleteDomainGroup_done(struct tevent_req
*subreq
)
3921 struct tevent_req
*req
= tevent_req_callback_data(
3922 subreq
, struct tevent_req
);
3923 struct rpccli_samr_DeleteDomainGroup_state
*state
= tevent_req_data(
3924 req
, struct rpccli_samr_DeleteDomainGroup_state
);
3926 TALLOC_CTX
*mem_ctx
;
3928 if (state
->out_mem_ctx
) {
3929 mem_ctx
= state
->out_mem_ctx
;
3934 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3935 TALLOC_FREE(subreq
);
3936 if (!NT_STATUS_IS_OK(status
)) {
3937 tevent_req_nterror(req
, status
);
3941 /* Copy out parameters */
3942 *state
->orig
.out
.group_handle
= *state
->tmp
.out
.group_handle
;
3945 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3947 /* Reset temporary structure */
3948 ZERO_STRUCT(state
->tmp
);
3950 if (DEBUGLEVEL
>= 10) {
3951 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup
, &state
->orig
);
3954 tevent_req_done(req
);
3957 NTSTATUS
rpccli_samr_DeleteDomainGroup_recv(struct tevent_req
*req
,
3958 TALLOC_CTX
*mem_ctx
,
3961 struct rpccli_samr_DeleteDomainGroup_state
*state
= tevent_req_data(
3962 req
, struct rpccli_samr_DeleteDomainGroup_state
);
3965 if (tevent_req_is_nterror(req
, &status
)) {
3966 tevent_req_received(req
);
3970 /* Steal possbile out parameters to the callers context */
3971 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3974 *result
= state
->orig
.out
.result
;
3976 tevent_req_received(req
);
3977 return NT_STATUS_OK
;
3980 NTSTATUS
rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client
*cli
,
3981 TALLOC_CTX
*mem_ctx
,
3982 struct policy_handle
*group_handle
/* [in,out] [ref] */)
3984 struct samr_DeleteDomainGroup r
;
3988 r
.in
.group_handle
= group_handle
;
3990 if (DEBUGLEVEL
>= 10) {
3991 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup
, &r
);
3994 status
= cli
->dispatch(cli
,
3997 NDR_SAMR_DELETEDOMAINGROUP
,
4000 if (!NT_STATUS_IS_OK(status
)) {
4004 if (DEBUGLEVEL
>= 10) {
4005 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup
, &r
);
4008 if (NT_STATUS_IS_ERR(status
)) {
4012 /* Return variables */
4013 *group_handle
= *r
.out
.group_handle
;
4016 return r
.out
.result
;
4019 struct rpccli_samr_DeleteGroupMember_state
{
4020 struct samr_DeleteGroupMember orig
;
4021 struct samr_DeleteGroupMember tmp
;
4022 TALLOC_CTX
*out_mem_ctx
;
4023 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4026 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req
*subreq
);
4028 struct tevent_req
*rpccli_samr_DeleteGroupMember_send(TALLOC_CTX
*mem_ctx
,
4029 struct tevent_context
*ev
,
4030 struct rpc_pipe_client
*cli
,
4031 struct policy_handle
*_group_handle
/* [in] [ref] */,
4032 uint32_t _rid
/* [in] */)
4034 struct tevent_req
*req
;
4035 struct rpccli_samr_DeleteGroupMember_state
*state
;
4036 struct tevent_req
*subreq
;
4038 req
= tevent_req_create(mem_ctx
, &state
,
4039 struct rpccli_samr_DeleteGroupMember_state
);
4043 state
->out_mem_ctx
= NULL
;
4044 state
->dispatch_recv
= cli
->dispatch_recv
;
4047 state
->orig
.in
.group_handle
= _group_handle
;
4048 state
->orig
.in
.rid
= _rid
;
4050 /* Out parameters */
4053 ZERO_STRUCT(state
->orig
.out
.result
);
4055 if (DEBUGLEVEL
>= 10) {
4056 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember
, &state
->orig
);
4059 /* make a temporary copy, that we pass to the dispatch function */
4060 state
->tmp
= state
->orig
;
4062 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4064 NDR_SAMR_DELETEGROUPMEMBER
,
4066 if (tevent_req_nomem(subreq
, req
)) {
4067 return tevent_req_post(req
, ev
);
4069 tevent_req_set_callback(subreq
, rpccli_samr_DeleteGroupMember_done
, req
);
4073 static void rpccli_samr_DeleteGroupMember_done(struct tevent_req
*subreq
)
4075 struct tevent_req
*req
= tevent_req_callback_data(
4076 subreq
, struct tevent_req
);
4077 struct rpccli_samr_DeleteGroupMember_state
*state
= tevent_req_data(
4078 req
, struct rpccli_samr_DeleteGroupMember_state
);
4080 TALLOC_CTX
*mem_ctx
;
4082 if (state
->out_mem_ctx
) {
4083 mem_ctx
= state
->out_mem_ctx
;
4088 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4089 TALLOC_FREE(subreq
);
4090 if (!NT_STATUS_IS_OK(status
)) {
4091 tevent_req_nterror(req
, status
);
4095 /* Copy out parameters */
4098 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4100 /* Reset temporary structure */
4101 ZERO_STRUCT(state
->tmp
);
4103 if (DEBUGLEVEL
>= 10) {
4104 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember
, &state
->orig
);
4107 tevent_req_done(req
);
4110 NTSTATUS
rpccli_samr_DeleteGroupMember_recv(struct tevent_req
*req
,
4111 TALLOC_CTX
*mem_ctx
,
4114 struct rpccli_samr_DeleteGroupMember_state
*state
= tevent_req_data(
4115 req
, struct rpccli_samr_DeleteGroupMember_state
);
4118 if (tevent_req_is_nterror(req
, &status
)) {
4119 tevent_req_received(req
);
4123 /* Steal possbile out parameters to the callers context */
4124 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4127 *result
= state
->orig
.out
.result
;
4129 tevent_req_received(req
);
4130 return NT_STATUS_OK
;
4133 NTSTATUS
rpccli_samr_DeleteGroupMember(struct rpc_pipe_client
*cli
,
4134 TALLOC_CTX
*mem_ctx
,
4135 struct policy_handle
*group_handle
/* [in] [ref] */,
4136 uint32_t rid
/* [in] */)
4138 struct samr_DeleteGroupMember r
;
4142 r
.in
.group_handle
= group_handle
;
4145 if (DEBUGLEVEL
>= 10) {
4146 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember
, &r
);
4149 status
= cli
->dispatch(cli
,
4152 NDR_SAMR_DELETEGROUPMEMBER
,
4155 if (!NT_STATUS_IS_OK(status
)) {
4159 if (DEBUGLEVEL
>= 10) {
4160 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember
, &r
);
4163 if (NT_STATUS_IS_ERR(status
)) {
4167 /* Return variables */
4170 return r
.out
.result
;
4173 struct rpccli_samr_QueryGroupMember_state
{
4174 struct samr_QueryGroupMember orig
;
4175 struct samr_QueryGroupMember tmp
;
4176 TALLOC_CTX
*out_mem_ctx
;
4177 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4180 static void rpccli_samr_QueryGroupMember_done(struct tevent_req
*subreq
);
4182 struct tevent_req
*rpccli_samr_QueryGroupMember_send(TALLOC_CTX
*mem_ctx
,
4183 struct tevent_context
*ev
,
4184 struct rpc_pipe_client
*cli
,
4185 struct policy_handle
*_group_handle
/* [in] [ref] */,
4186 struct samr_RidTypeArray
**_rids
/* [out] [ref] */)
4188 struct tevent_req
*req
;
4189 struct rpccli_samr_QueryGroupMember_state
*state
;
4190 struct tevent_req
*subreq
;
4192 req
= tevent_req_create(mem_ctx
, &state
,
4193 struct rpccli_samr_QueryGroupMember_state
);
4197 state
->out_mem_ctx
= NULL
;
4198 state
->dispatch_recv
= cli
->dispatch_recv
;
4201 state
->orig
.in
.group_handle
= _group_handle
;
4203 /* Out parameters */
4204 state
->orig
.out
.rids
= _rids
;
4207 ZERO_STRUCT(state
->orig
.out
.result
);
4209 if (DEBUGLEVEL
>= 10) {
4210 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember
, &state
->orig
);
4213 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4214 "rpccli_samr_QueryGroupMember_out_memory");
4215 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4216 return tevent_req_post(req
, ev
);
4219 /* make a temporary copy, that we pass to the dispatch function */
4220 state
->tmp
= state
->orig
;
4222 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4224 NDR_SAMR_QUERYGROUPMEMBER
,
4226 if (tevent_req_nomem(subreq
, req
)) {
4227 return tevent_req_post(req
, ev
);
4229 tevent_req_set_callback(subreq
, rpccli_samr_QueryGroupMember_done
, req
);
4233 static void rpccli_samr_QueryGroupMember_done(struct tevent_req
*subreq
)
4235 struct tevent_req
*req
= tevent_req_callback_data(
4236 subreq
, struct tevent_req
);
4237 struct rpccli_samr_QueryGroupMember_state
*state
= tevent_req_data(
4238 req
, struct rpccli_samr_QueryGroupMember_state
);
4240 TALLOC_CTX
*mem_ctx
;
4242 if (state
->out_mem_ctx
) {
4243 mem_ctx
= state
->out_mem_ctx
;
4248 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4249 TALLOC_FREE(subreq
);
4250 if (!NT_STATUS_IS_OK(status
)) {
4251 tevent_req_nterror(req
, status
);
4255 /* Copy out parameters */
4256 *state
->orig
.out
.rids
= *state
->tmp
.out
.rids
;
4259 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4261 /* Reset temporary structure */
4262 ZERO_STRUCT(state
->tmp
);
4264 if (DEBUGLEVEL
>= 10) {
4265 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember
, &state
->orig
);
4268 tevent_req_done(req
);
4271 NTSTATUS
rpccli_samr_QueryGroupMember_recv(struct tevent_req
*req
,
4272 TALLOC_CTX
*mem_ctx
,
4275 struct rpccli_samr_QueryGroupMember_state
*state
= tevent_req_data(
4276 req
, struct rpccli_samr_QueryGroupMember_state
);
4279 if (tevent_req_is_nterror(req
, &status
)) {
4280 tevent_req_received(req
);
4284 /* Steal possbile out parameters to the callers context */
4285 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4288 *result
= state
->orig
.out
.result
;
4290 tevent_req_received(req
);
4291 return NT_STATUS_OK
;
4294 NTSTATUS
rpccli_samr_QueryGroupMember(struct rpc_pipe_client
*cli
,
4295 TALLOC_CTX
*mem_ctx
,
4296 struct policy_handle
*group_handle
/* [in] [ref] */,
4297 struct samr_RidTypeArray
**rids
/* [out] [ref] */)
4299 struct samr_QueryGroupMember r
;
4303 r
.in
.group_handle
= group_handle
;
4305 if (DEBUGLEVEL
>= 10) {
4306 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember
, &r
);
4309 status
= cli
->dispatch(cli
,
4312 NDR_SAMR_QUERYGROUPMEMBER
,
4315 if (!NT_STATUS_IS_OK(status
)) {
4319 if (DEBUGLEVEL
>= 10) {
4320 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember
, &r
);
4323 if (NT_STATUS_IS_ERR(status
)) {
4327 /* Return variables */
4328 *rids
= *r
.out
.rids
;
4331 return r
.out
.result
;
4334 struct rpccli_samr_SetMemberAttributesOfGroup_state
{
4335 struct samr_SetMemberAttributesOfGroup orig
;
4336 struct samr_SetMemberAttributesOfGroup tmp
;
4337 TALLOC_CTX
*out_mem_ctx
;
4338 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4341 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req
*subreq
);
4343 struct tevent_req
*rpccli_samr_SetMemberAttributesOfGroup_send(TALLOC_CTX
*mem_ctx
,
4344 struct tevent_context
*ev
,
4345 struct rpc_pipe_client
*cli
,
4346 struct policy_handle
*_group_handle
/* [in] [ref] */,
4347 uint32_t _unknown1
/* [in] */,
4348 uint32_t _unknown2
/* [in] */)
4350 struct tevent_req
*req
;
4351 struct rpccli_samr_SetMemberAttributesOfGroup_state
*state
;
4352 struct tevent_req
*subreq
;
4354 req
= tevent_req_create(mem_ctx
, &state
,
4355 struct rpccli_samr_SetMemberAttributesOfGroup_state
);
4359 state
->out_mem_ctx
= NULL
;
4360 state
->dispatch_recv
= cli
->dispatch_recv
;
4363 state
->orig
.in
.group_handle
= _group_handle
;
4364 state
->orig
.in
.unknown1
= _unknown1
;
4365 state
->orig
.in
.unknown2
= _unknown2
;
4367 /* Out parameters */
4370 ZERO_STRUCT(state
->orig
.out
.result
);
4372 if (DEBUGLEVEL
>= 10) {
4373 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup
, &state
->orig
);
4376 /* make a temporary copy, that we pass to the dispatch function */
4377 state
->tmp
= state
->orig
;
4379 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4381 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP
,
4383 if (tevent_req_nomem(subreq
, req
)) {
4384 return tevent_req_post(req
, ev
);
4386 tevent_req_set_callback(subreq
, rpccli_samr_SetMemberAttributesOfGroup_done
, req
);
4390 static void rpccli_samr_SetMemberAttributesOfGroup_done(struct tevent_req
*subreq
)
4392 struct tevent_req
*req
= tevent_req_callback_data(
4393 subreq
, struct tevent_req
);
4394 struct rpccli_samr_SetMemberAttributesOfGroup_state
*state
= tevent_req_data(
4395 req
, struct rpccli_samr_SetMemberAttributesOfGroup_state
);
4397 TALLOC_CTX
*mem_ctx
;
4399 if (state
->out_mem_ctx
) {
4400 mem_ctx
= state
->out_mem_ctx
;
4405 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4406 TALLOC_FREE(subreq
);
4407 if (!NT_STATUS_IS_OK(status
)) {
4408 tevent_req_nterror(req
, status
);
4412 /* Copy out parameters */
4415 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4417 /* Reset temporary structure */
4418 ZERO_STRUCT(state
->tmp
);
4420 if (DEBUGLEVEL
>= 10) {
4421 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup
, &state
->orig
);
4424 tevent_req_done(req
);
4427 NTSTATUS
rpccli_samr_SetMemberAttributesOfGroup_recv(struct tevent_req
*req
,
4428 TALLOC_CTX
*mem_ctx
,
4431 struct rpccli_samr_SetMemberAttributesOfGroup_state
*state
= tevent_req_data(
4432 req
, struct rpccli_samr_SetMemberAttributesOfGroup_state
);
4435 if (tevent_req_is_nterror(req
, &status
)) {
4436 tevent_req_received(req
);
4440 /* Steal possbile out parameters to the callers context */
4441 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4444 *result
= state
->orig
.out
.result
;
4446 tevent_req_received(req
);
4447 return NT_STATUS_OK
;
4450 NTSTATUS
rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client
*cli
,
4451 TALLOC_CTX
*mem_ctx
,
4452 struct policy_handle
*group_handle
/* [in] [ref] */,
4453 uint32_t unknown1
/* [in] */,
4454 uint32_t unknown2
/* [in] */)
4456 struct samr_SetMemberAttributesOfGroup r
;
4460 r
.in
.group_handle
= group_handle
;
4461 r
.in
.unknown1
= unknown1
;
4462 r
.in
.unknown2
= unknown2
;
4464 if (DEBUGLEVEL
>= 10) {
4465 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup
, &r
);
4468 status
= cli
->dispatch(cli
,
4471 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP
,
4474 if (!NT_STATUS_IS_OK(status
)) {
4478 if (DEBUGLEVEL
>= 10) {
4479 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup
, &r
);
4482 if (NT_STATUS_IS_ERR(status
)) {
4486 /* Return variables */
4489 return r
.out
.result
;
4492 struct rpccli_samr_OpenAlias_state
{
4493 struct samr_OpenAlias orig
;
4494 struct samr_OpenAlias tmp
;
4495 TALLOC_CTX
*out_mem_ctx
;
4496 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4499 static void rpccli_samr_OpenAlias_done(struct tevent_req
*subreq
);
4501 struct tevent_req
*rpccli_samr_OpenAlias_send(TALLOC_CTX
*mem_ctx
,
4502 struct tevent_context
*ev
,
4503 struct rpc_pipe_client
*cli
,
4504 struct policy_handle
*_domain_handle
/* [in] [ref] */,
4505 uint32_t _access_mask
/* [in] */,
4506 uint32_t _rid
/* [in] */,
4507 struct policy_handle
*_alias_handle
/* [out] [ref] */)
4509 struct tevent_req
*req
;
4510 struct rpccli_samr_OpenAlias_state
*state
;
4511 struct tevent_req
*subreq
;
4513 req
= tevent_req_create(mem_ctx
, &state
,
4514 struct rpccli_samr_OpenAlias_state
);
4518 state
->out_mem_ctx
= NULL
;
4519 state
->dispatch_recv
= cli
->dispatch_recv
;
4522 state
->orig
.in
.domain_handle
= _domain_handle
;
4523 state
->orig
.in
.access_mask
= _access_mask
;
4524 state
->orig
.in
.rid
= _rid
;
4526 /* Out parameters */
4527 state
->orig
.out
.alias_handle
= _alias_handle
;
4530 ZERO_STRUCT(state
->orig
.out
.result
);
4532 if (DEBUGLEVEL
>= 10) {
4533 NDR_PRINT_IN_DEBUG(samr_OpenAlias
, &state
->orig
);
4536 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4537 "rpccli_samr_OpenAlias_out_memory");
4538 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4539 return tevent_req_post(req
, ev
);
4542 /* make a temporary copy, that we pass to the dispatch function */
4543 state
->tmp
= state
->orig
;
4545 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4549 if (tevent_req_nomem(subreq
, req
)) {
4550 return tevent_req_post(req
, ev
);
4552 tevent_req_set_callback(subreq
, rpccli_samr_OpenAlias_done
, req
);
4556 static void rpccli_samr_OpenAlias_done(struct tevent_req
*subreq
)
4558 struct tevent_req
*req
= tevent_req_callback_data(
4559 subreq
, struct tevent_req
);
4560 struct rpccli_samr_OpenAlias_state
*state
= tevent_req_data(
4561 req
, struct rpccli_samr_OpenAlias_state
);
4563 TALLOC_CTX
*mem_ctx
;
4565 if (state
->out_mem_ctx
) {
4566 mem_ctx
= state
->out_mem_ctx
;
4571 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4572 TALLOC_FREE(subreq
);
4573 if (!NT_STATUS_IS_OK(status
)) {
4574 tevent_req_nterror(req
, status
);
4578 /* Copy out parameters */
4579 *state
->orig
.out
.alias_handle
= *state
->tmp
.out
.alias_handle
;
4582 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4584 /* Reset temporary structure */
4585 ZERO_STRUCT(state
->tmp
);
4587 if (DEBUGLEVEL
>= 10) {
4588 NDR_PRINT_OUT_DEBUG(samr_OpenAlias
, &state
->orig
);
4591 tevent_req_done(req
);
4594 NTSTATUS
rpccli_samr_OpenAlias_recv(struct tevent_req
*req
,
4595 TALLOC_CTX
*mem_ctx
,
4598 struct rpccli_samr_OpenAlias_state
*state
= tevent_req_data(
4599 req
, struct rpccli_samr_OpenAlias_state
);
4602 if (tevent_req_is_nterror(req
, &status
)) {
4603 tevent_req_received(req
);
4607 /* Steal possbile out parameters to the callers context */
4608 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4611 *result
= state
->orig
.out
.result
;
4613 tevent_req_received(req
);
4614 return NT_STATUS_OK
;
4617 NTSTATUS
rpccli_samr_OpenAlias(struct rpc_pipe_client
*cli
,
4618 TALLOC_CTX
*mem_ctx
,
4619 struct policy_handle
*domain_handle
/* [in] [ref] */,
4620 uint32_t access_mask
/* [in] */,
4621 uint32_t rid
/* [in] */,
4622 struct policy_handle
*alias_handle
/* [out] [ref] */)
4624 struct samr_OpenAlias r
;
4628 r
.in
.domain_handle
= domain_handle
;
4629 r
.in
.access_mask
= access_mask
;
4632 if (DEBUGLEVEL
>= 10) {
4633 NDR_PRINT_IN_DEBUG(samr_OpenAlias
, &r
);
4636 status
= cli
->dispatch(cli
,
4642 if (!NT_STATUS_IS_OK(status
)) {
4646 if (DEBUGLEVEL
>= 10) {
4647 NDR_PRINT_OUT_DEBUG(samr_OpenAlias
, &r
);
4650 if (NT_STATUS_IS_ERR(status
)) {
4654 /* Return variables */
4655 *alias_handle
= *r
.out
.alias_handle
;
4658 return r
.out
.result
;
4661 struct rpccli_samr_QueryAliasInfo_state
{
4662 struct samr_QueryAliasInfo orig
;
4663 struct samr_QueryAliasInfo tmp
;
4664 TALLOC_CTX
*out_mem_ctx
;
4665 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4668 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req
*subreq
);
4670 struct tevent_req
*rpccli_samr_QueryAliasInfo_send(TALLOC_CTX
*mem_ctx
,
4671 struct tevent_context
*ev
,
4672 struct rpc_pipe_client
*cli
,
4673 struct policy_handle
*_alias_handle
/* [in] [ref] */,
4674 enum samr_AliasInfoEnum _level
/* [in] */,
4675 union samr_AliasInfo
**_info
/* [out] [ref,switch_is(level)] */)
4677 struct tevent_req
*req
;
4678 struct rpccli_samr_QueryAliasInfo_state
*state
;
4679 struct tevent_req
*subreq
;
4681 req
= tevent_req_create(mem_ctx
, &state
,
4682 struct rpccli_samr_QueryAliasInfo_state
);
4686 state
->out_mem_ctx
= NULL
;
4687 state
->dispatch_recv
= cli
->dispatch_recv
;
4690 state
->orig
.in
.alias_handle
= _alias_handle
;
4691 state
->orig
.in
.level
= _level
;
4693 /* Out parameters */
4694 state
->orig
.out
.info
= _info
;
4697 ZERO_STRUCT(state
->orig
.out
.result
);
4699 if (DEBUGLEVEL
>= 10) {
4700 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo
, &state
->orig
);
4703 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4704 "rpccli_samr_QueryAliasInfo_out_memory");
4705 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4706 return tevent_req_post(req
, ev
);
4709 /* make a temporary copy, that we pass to the dispatch function */
4710 state
->tmp
= state
->orig
;
4712 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4714 NDR_SAMR_QUERYALIASINFO
,
4716 if (tevent_req_nomem(subreq
, req
)) {
4717 return tevent_req_post(req
, ev
);
4719 tevent_req_set_callback(subreq
, rpccli_samr_QueryAliasInfo_done
, req
);
4723 static void rpccli_samr_QueryAliasInfo_done(struct tevent_req
*subreq
)
4725 struct tevent_req
*req
= tevent_req_callback_data(
4726 subreq
, struct tevent_req
);
4727 struct rpccli_samr_QueryAliasInfo_state
*state
= tevent_req_data(
4728 req
, struct rpccli_samr_QueryAliasInfo_state
);
4730 TALLOC_CTX
*mem_ctx
;
4732 if (state
->out_mem_ctx
) {
4733 mem_ctx
= state
->out_mem_ctx
;
4738 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4739 TALLOC_FREE(subreq
);
4740 if (!NT_STATUS_IS_OK(status
)) {
4741 tevent_req_nterror(req
, status
);
4745 /* Copy out parameters */
4746 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
4749 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4751 /* Reset temporary structure */
4752 ZERO_STRUCT(state
->tmp
);
4754 if (DEBUGLEVEL
>= 10) {
4755 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo
, &state
->orig
);
4758 tevent_req_done(req
);
4761 NTSTATUS
rpccli_samr_QueryAliasInfo_recv(struct tevent_req
*req
,
4762 TALLOC_CTX
*mem_ctx
,
4765 struct rpccli_samr_QueryAliasInfo_state
*state
= tevent_req_data(
4766 req
, struct rpccli_samr_QueryAliasInfo_state
);
4769 if (tevent_req_is_nterror(req
, &status
)) {
4770 tevent_req_received(req
);
4774 /* Steal possbile out parameters to the callers context */
4775 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4778 *result
= state
->orig
.out
.result
;
4780 tevent_req_received(req
);
4781 return NT_STATUS_OK
;
4784 NTSTATUS
rpccli_samr_QueryAliasInfo(struct rpc_pipe_client
*cli
,
4785 TALLOC_CTX
*mem_ctx
,
4786 struct policy_handle
*alias_handle
/* [in] [ref] */,
4787 enum samr_AliasInfoEnum level
/* [in] */,
4788 union samr_AliasInfo
**info
/* [out] [ref,switch_is(level)] */)
4790 struct samr_QueryAliasInfo r
;
4794 r
.in
.alias_handle
= alias_handle
;
4797 if (DEBUGLEVEL
>= 10) {
4798 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo
, &r
);
4801 status
= cli
->dispatch(cli
,
4804 NDR_SAMR_QUERYALIASINFO
,
4807 if (!NT_STATUS_IS_OK(status
)) {
4811 if (DEBUGLEVEL
>= 10) {
4812 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo
, &r
);
4815 if (NT_STATUS_IS_ERR(status
)) {
4819 /* Return variables */
4820 *info
= *r
.out
.info
;
4823 return r
.out
.result
;
4826 struct rpccli_samr_SetAliasInfo_state
{
4827 struct samr_SetAliasInfo orig
;
4828 struct samr_SetAliasInfo tmp
;
4829 TALLOC_CTX
*out_mem_ctx
;
4830 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4833 static void rpccli_samr_SetAliasInfo_done(struct tevent_req
*subreq
);
4835 struct tevent_req
*rpccli_samr_SetAliasInfo_send(TALLOC_CTX
*mem_ctx
,
4836 struct tevent_context
*ev
,
4837 struct rpc_pipe_client
*cli
,
4838 struct policy_handle
*_alias_handle
/* [in] [ref] */,
4839 enum samr_AliasInfoEnum _level
/* [in] */,
4840 union samr_AliasInfo
*_info
/* [in] [ref,switch_is(level)] */)
4842 struct tevent_req
*req
;
4843 struct rpccli_samr_SetAliasInfo_state
*state
;
4844 struct tevent_req
*subreq
;
4846 req
= tevent_req_create(mem_ctx
, &state
,
4847 struct rpccli_samr_SetAliasInfo_state
);
4851 state
->out_mem_ctx
= NULL
;
4852 state
->dispatch_recv
= cli
->dispatch_recv
;
4855 state
->orig
.in
.alias_handle
= _alias_handle
;
4856 state
->orig
.in
.level
= _level
;
4857 state
->orig
.in
.info
= _info
;
4859 /* Out parameters */
4862 ZERO_STRUCT(state
->orig
.out
.result
);
4864 if (DEBUGLEVEL
>= 10) {
4865 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo
, &state
->orig
);
4868 /* make a temporary copy, that we pass to the dispatch function */
4869 state
->tmp
= state
->orig
;
4871 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4873 NDR_SAMR_SETALIASINFO
,
4875 if (tevent_req_nomem(subreq
, req
)) {
4876 return tevent_req_post(req
, ev
);
4878 tevent_req_set_callback(subreq
, rpccli_samr_SetAliasInfo_done
, req
);
4882 static void rpccli_samr_SetAliasInfo_done(struct tevent_req
*subreq
)
4884 struct tevent_req
*req
= tevent_req_callback_data(
4885 subreq
, struct tevent_req
);
4886 struct rpccli_samr_SetAliasInfo_state
*state
= tevent_req_data(
4887 req
, struct rpccli_samr_SetAliasInfo_state
);
4889 TALLOC_CTX
*mem_ctx
;
4891 if (state
->out_mem_ctx
) {
4892 mem_ctx
= state
->out_mem_ctx
;
4897 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4898 TALLOC_FREE(subreq
);
4899 if (!NT_STATUS_IS_OK(status
)) {
4900 tevent_req_nterror(req
, status
);
4904 /* Copy out parameters */
4907 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4909 /* Reset temporary structure */
4910 ZERO_STRUCT(state
->tmp
);
4912 if (DEBUGLEVEL
>= 10) {
4913 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo
, &state
->orig
);
4916 tevent_req_done(req
);
4919 NTSTATUS
rpccli_samr_SetAliasInfo_recv(struct tevent_req
*req
,
4920 TALLOC_CTX
*mem_ctx
,
4923 struct rpccli_samr_SetAliasInfo_state
*state
= tevent_req_data(
4924 req
, struct rpccli_samr_SetAliasInfo_state
);
4927 if (tevent_req_is_nterror(req
, &status
)) {
4928 tevent_req_received(req
);
4932 /* Steal possbile out parameters to the callers context */
4933 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4936 *result
= state
->orig
.out
.result
;
4938 tevent_req_received(req
);
4939 return NT_STATUS_OK
;
4942 NTSTATUS
rpccli_samr_SetAliasInfo(struct rpc_pipe_client
*cli
,
4943 TALLOC_CTX
*mem_ctx
,
4944 struct policy_handle
*alias_handle
/* [in] [ref] */,
4945 enum samr_AliasInfoEnum level
/* [in] */,
4946 union samr_AliasInfo
*info
/* [in] [ref,switch_is(level)] */)
4948 struct samr_SetAliasInfo r
;
4952 r
.in
.alias_handle
= alias_handle
;
4956 if (DEBUGLEVEL
>= 10) {
4957 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo
, &r
);
4960 status
= cli
->dispatch(cli
,
4963 NDR_SAMR_SETALIASINFO
,
4966 if (!NT_STATUS_IS_OK(status
)) {
4970 if (DEBUGLEVEL
>= 10) {
4971 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo
, &r
);
4974 if (NT_STATUS_IS_ERR(status
)) {
4978 /* Return variables */
4981 return r
.out
.result
;
4984 struct rpccli_samr_DeleteDomAlias_state
{
4985 struct samr_DeleteDomAlias orig
;
4986 struct samr_DeleteDomAlias tmp
;
4987 TALLOC_CTX
*out_mem_ctx
;
4988 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4991 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req
*subreq
);
4993 struct tevent_req
*rpccli_samr_DeleteDomAlias_send(TALLOC_CTX
*mem_ctx
,
4994 struct tevent_context
*ev
,
4995 struct rpc_pipe_client
*cli
,
4996 struct policy_handle
*_alias_handle
/* [in,out] [ref] */)
4998 struct tevent_req
*req
;
4999 struct rpccli_samr_DeleteDomAlias_state
*state
;
5000 struct tevent_req
*subreq
;
5002 req
= tevent_req_create(mem_ctx
, &state
,
5003 struct rpccli_samr_DeleteDomAlias_state
);
5007 state
->out_mem_ctx
= NULL
;
5008 state
->dispatch_recv
= cli
->dispatch_recv
;
5011 state
->orig
.in
.alias_handle
= _alias_handle
;
5013 /* Out parameters */
5014 state
->orig
.out
.alias_handle
= _alias_handle
;
5017 ZERO_STRUCT(state
->orig
.out
.result
);
5019 if (DEBUGLEVEL
>= 10) {
5020 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias
, &state
->orig
);
5023 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5024 "rpccli_samr_DeleteDomAlias_out_memory");
5025 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5026 return tevent_req_post(req
, ev
);
5029 /* make a temporary copy, that we pass to the dispatch function */
5030 state
->tmp
= state
->orig
;
5032 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5034 NDR_SAMR_DELETEDOMALIAS
,
5036 if (tevent_req_nomem(subreq
, req
)) {
5037 return tevent_req_post(req
, ev
);
5039 tevent_req_set_callback(subreq
, rpccli_samr_DeleteDomAlias_done
, req
);
5043 static void rpccli_samr_DeleteDomAlias_done(struct tevent_req
*subreq
)
5045 struct tevent_req
*req
= tevent_req_callback_data(
5046 subreq
, struct tevent_req
);
5047 struct rpccli_samr_DeleteDomAlias_state
*state
= tevent_req_data(
5048 req
, struct rpccli_samr_DeleteDomAlias_state
);
5050 TALLOC_CTX
*mem_ctx
;
5052 if (state
->out_mem_ctx
) {
5053 mem_ctx
= state
->out_mem_ctx
;
5058 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5059 TALLOC_FREE(subreq
);
5060 if (!NT_STATUS_IS_OK(status
)) {
5061 tevent_req_nterror(req
, status
);
5065 /* Copy out parameters */
5066 *state
->orig
.out
.alias_handle
= *state
->tmp
.out
.alias_handle
;
5069 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5071 /* Reset temporary structure */
5072 ZERO_STRUCT(state
->tmp
);
5074 if (DEBUGLEVEL
>= 10) {
5075 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias
, &state
->orig
);
5078 tevent_req_done(req
);
5081 NTSTATUS
rpccli_samr_DeleteDomAlias_recv(struct tevent_req
*req
,
5082 TALLOC_CTX
*mem_ctx
,
5085 struct rpccli_samr_DeleteDomAlias_state
*state
= tevent_req_data(
5086 req
, struct rpccli_samr_DeleteDomAlias_state
);
5089 if (tevent_req_is_nterror(req
, &status
)) {
5090 tevent_req_received(req
);
5094 /* Steal possbile out parameters to the callers context */
5095 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5098 *result
= state
->orig
.out
.result
;
5100 tevent_req_received(req
);
5101 return NT_STATUS_OK
;
5104 NTSTATUS
rpccli_samr_DeleteDomAlias(struct rpc_pipe_client
*cli
,
5105 TALLOC_CTX
*mem_ctx
,
5106 struct policy_handle
*alias_handle
/* [in,out] [ref] */)
5108 struct samr_DeleteDomAlias r
;
5112 r
.in
.alias_handle
= alias_handle
;
5114 if (DEBUGLEVEL
>= 10) {
5115 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias
, &r
);
5118 status
= cli
->dispatch(cli
,
5121 NDR_SAMR_DELETEDOMALIAS
,
5124 if (!NT_STATUS_IS_OK(status
)) {
5128 if (DEBUGLEVEL
>= 10) {
5129 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias
, &r
);
5132 if (NT_STATUS_IS_ERR(status
)) {
5136 /* Return variables */
5137 *alias_handle
= *r
.out
.alias_handle
;
5140 return r
.out
.result
;
5143 struct rpccli_samr_AddAliasMember_state
{
5144 struct samr_AddAliasMember orig
;
5145 struct samr_AddAliasMember tmp
;
5146 TALLOC_CTX
*out_mem_ctx
;
5147 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5150 static void rpccli_samr_AddAliasMember_done(struct tevent_req
*subreq
);
5152 struct tevent_req
*rpccli_samr_AddAliasMember_send(TALLOC_CTX
*mem_ctx
,
5153 struct tevent_context
*ev
,
5154 struct rpc_pipe_client
*cli
,
5155 struct policy_handle
*_alias_handle
/* [in] [ref] */,
5156 struct dom_sid2
*_sid
/* [in] [ref] */)
5158 struct tevent_req
*req
;
5159 struct rpccli_samr_AddAliasMember_state
*state
;
5160 struct tevent_req
*subreq
;
5162 req
= tevent_req_create(mem_ctx
, &state
,
5163 struct rpccli_samr_AddAliasMember_state
);
5167 state
->out_mem_ctx
= NULL
;
5168 state
->dispatch_recv
= cli
->dispatch_recv
;
5171 state
->orig
.in
.alias_handle
= _alias_handle
;
5172 state
->orig
.in
.sid
= _sid
;
5174 /* Out parameters */
5177 ZERO_STRUCT(state
->orig
.out
.result
);
5179 if (DEBUGLEVEL
>= 10) {
5180 NDR_PRINT_IN_DEBUG(samr_AddAliasMember
, &state
->orig
);
5183 /* make a temporary copy, that we pass to the dispatch function */
5184 state
->tmp
= state
->orig
;
5186 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5188 NDR_SAMR_ADDALIASMEMBER
,
5190 if (tevent_req_nomem(subreq
, req
)) {
5191 return tevent_req_post(req
, ev
);
5193 tevent_req_set_callback(subreq
, rpccli_samr_AddAliasMember_done
, req
);
5197 static void rpccli_samr_AddAliasMember_done(struct tevent_req
*subreq
)
5199 struct tevent_req
*req
= tevent_req_callback_data(
5200 subreq
, struct tevent_req
);
5201 struct rpccli_samr_AddAliasMember_state
*state
= tevent_req_data(
5202 req
, struct rpccli_samr_AddAliasMember_state
);
5204 TALLOC_CTX
*mem_ctx
;
5206 if (state
->out_mem_ctx
) {
5207 mem_ctx
= state
->out_mem_ctx
;
5212 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5213 TALLOC_FREE(subreq
);
5214 if (!NT_STATUS_IS_OK(status
)) {
5215 tevent_req_nterror(req
, status
);
5219 /* Copy out parameters */
5222 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5224 /* Reset temporary structure */
5225 ZERO_STRUCT(state
->tmp
);
5227 if (DEBUGLEVEL
>= 10) {
5228 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember
, &state
->orig
);
5231 tevent_req_done(req
);
5234 NTSTATUS
rpccli_samr_AddAliasMember_recv(struct tevent_req
*req
,
5235 TALLOC_CTX
*mem_ctx
,
5238 struct rpccli_samr_AddAliasMember_state
*state
= tevent_req_data(
5239 req
, struct rpccli_samr_AddAliasMember_state
);
5242 if (tevent_req_is_nterror(req
, &status
)) {
5243 tevent_req_received(req
);
5247 /* Steal possbile out parameters to the callers context */
5248 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5251 *result
= state
->orig
.out
.result
;
5253 tevent_req_received(req
);
5254 return NT_STATUS_OK
;
5257 NTSTATUS
rpccli_samr_AddAliasMember(struct rpc_pipe_client
*cli
,
5258 TALLOC_CTX
*mem_ctx
,
5259 struct policy_handle
*alias_handle
/* [in] [ref] */,
5260 struct dom_sid2
*sid
/* [in] [ref] */)
5262 struct samr_AddAliasMember r
;
5266 r
.in
.alias_handle
= alias_handle
;
5269 if (DEBUGLEVEL
>= 10) {
5270 NDR_PRINT_IN_DEBUG(samr_AddAliasMember
, &r
);
5273 status
= cli
->dispatch(cli
,
5276 NDR_SAMR_ADDALIASMEMBER
,
5279 if (!NT_STATUS_IS_OK(status
)) {
5283 if (DEBUGLEVEL
>= 10) {
5284 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember
, &r
);
5287 if (NT_STATUS_IS_ERR(status
)) {
5291 /* Return variables */
5294 return r
.out
.result
;
5297 struct rpccli_samr_DeleteAliasMember_state
{
5298 struct samr_DeleteAliasMember orig
;
5299 struct samr_DeleteAliasMember tmp
;
5300 TALLOC_CTX
*out_mem_ctx
;
5301 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5304 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req
*subreq
);
5306 struct tevent_req
*rpccli_samr_DeleteAliasMember_send(TALLOC_CTX
*mem_ctx
,
5307 struct tevent_context
*ev
,
5308 struct rpc_pipe_client
*cli
,
5309 struct policy_handle
*_alias_handle
/* [in] [ref] */,
5310 struct dom_sid2
*_sid
/* [in] [ref] */)
5312 struct tevent_req
*req
;
5313 struct rpccli_samr_DeleteAliasMember_state
*state
;
5314 struct tevent_req
*subreq
;
5316 req
= tevent_req_create(mem_ctx
, &state
,
5317 struct rpccli_samr_DeleteAliasMember_state
);
5321 state
->out_mem_ctx
= NULL
;
5322 state
->dispatch_recv
= cli
->dispatch_recv
;
5325 state
->orig
.in
.alias_handle
= _alias_handle
;
5326 state
->orig
.in
.sid
= _sid
;
5328 /* Out parameters */
5331 ZERO_STRUCT(state
->orig
.out
.result
);
5333 if (DEBUGLEVEL
>= 10) {
5334 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember
, &state
->orig
);
5337 /* make a temporary copy, that we pass to the dispatch function */
5338 state
->tmp
= state
->orig
;
5340 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5342 NDR_SAMR_DELETEALIASMEMBER
,
5344 if (tevent_req_nomem(subreq
, req
)) {
5345 return tevent_req_post(req
, ev
);
5347 tevent_req_set_callback(subreq
, rpccli_samr_DeleteAliasMember_done
, req
);
5351 static void rpccli_samr_DeleteAliasMember_done(struct tevent_req
*subreq
)
5353 struct tevent_req
*req
= tevent_req_callback_data(
5354 subreq
, struct tevent_req
);
5355 struct rpccli_samr_DeleteAliasMember_state
*state
= tevent_req_data(
5356 req
, struct rpccli_samr_DeleteAliasMember_state
);
5358 TALLOC_CTX
*mem_ctx
;
5360 if (state
->out_mem_ctx
) {
5361 mem_ctx
= state
->out_mem_ctx
;
5366 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5367 TALLOC_FREE(subreq
);
5368 if (!NT_STATUS_IS_OK(status
)) {
5369 tevent_req_nterror(req
, status
);
5373 /* Copy out parameters */
5376 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5378 /* Reset temporary structure */
5379 ZERO_STRUCT(state
->tmp
);
5381 if (DEBUGLEVEL
>= 10) {
5382 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember
, &state
->orig
);
5385 tevent_req_done(req
);
5388 NTSTATUS
rpccli_samr_DeleteAliasMember_recv(struct tevent_req
*req
,
5389 TALLOC_CTX
*mem_ctx
,
5392 struct rpccli_samr_DeleteAliasMember_state
*state
= tevent_req_data(
5393 req
, struct rpccli_samr_DeleteAliasMember_state
);
5396 if (tevent_req_is_nterror(req
, &status
)) {
5397 tevent_req_received(req
);
5401 /* Steal possbile out parameters to the callers context */
5402 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5405 *result
= state
->orig
.out
.result
;
5407 tevent_req_received(req
);
5408 return NT_STATUS_OK
;
5411 NTSTATUS
rpccli_samr_DeleteAliasMember(struct rpc_pipe_client
*cli
,
5412 TALLOC_CTX
*mem_ctx
,
5413 struct policy_handle
*alias_handle
/* [in] [ref] */,
5414 struct dom_sid2
*sid
/* [in] [ref] */)
5416 struct samr_DeleteAliasMember r
;
5420 r
.in
.alias_handle
= alias_handle
;
5423 if (DEBUGLEVEL
>= 10) {
5424 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember
, &r
);
5427 status
= cli
->dispatch(cli
,
5430 NDR_SAMR_DELETEALIASMEMBER
,
5433 if (!NT_STATUS_IS_OK(status
)) {
5437 if (DEBUGLEVEL
>= 10) {
5438 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember
, &r
);
5441 if (NT_STATUS_IS_ERR(status
)) {
5445 /* Return variables */
5448 return r
.out
.result
;
5451 struct rpccli_samr_GetMembersInAlias_state
{
5452 struct samr_GetMembersInAlias orig
;
5453 struct samr_GetMembersInAlias tmp
;
5454 TALLOC_CTX
*out_mem_ctx
;
5455 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5458 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req
*subreq
);
5460 struct tevent_req
*rpccli_samr_GetMembersInAlias_send(TALLOC_CTX
*mem_ctx
,
5461 struct tevent_context
*ev
,
5462 struct rpc_pipe_client
*cli
,
5463 struct policy_handle
*_alias_handle
/* [in] [ref] */,
5464 struct lsa_SidArray
*_sids
/* [out] [ref] */)
5466 struct tevent_req
*req
;
5467 struct rpccli_samr_GetMembersInAlias_state
*state
;
5468 struct tevent_req
*subreq
;
5470 req
= tevent_req_create(mem_ctx
, &state
,
5471 struct rpccli_samr_GetMembersInAlias_state
);
5475 state
->out_mem_ctx
= NULL
;
5476 state
->dispatch_recv
= cli
->dispatch_recv
;
5479 state
->orig
.in
.alias_handle
= _alias_handle
;
5481 /* Out parameters */
5482 state
->orig
.out
.sids
= _sids
;
5485 ZERO_STRUCT(state
->orig
.out
.result
);
5487 if (DEBUGLEVEL
>= 10) {
5488 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias
, &state
->orig
);
5491 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5492 "rpccli_samr_GetMembersInAlias_out_memory");
5493 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5494 return tevent_req_post(req
, ev
);
5497 /* make a temporary copy, that we pass to the dispatch function */
5498 state
->tmp
= state
->orig
;
5500 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5502 NDR_SAMR_GETMEMBERSINALIAS
,
5504 if (tevent_req_nomem(subreq
, req
)) {
5505 return tevent_req_post(req
, ev
);
5507 tevent_req_set_callback(subreq
, rpccli_samr_GetMembersInAlias_done
, req
);
5511 static void rpccli_samr_GetMembersInAlias_done(struct tevent_req
*subreq
)
5513 struct tevent_req
*req
= tevent_req_callback_data(
5514 subreq
, struct tevent_req
);
5515 struct rpccli_samr_GetMembersInAlias_state
*state
= tevent_req_data(
5516 req
, struct rpccli_samr_GetMembersInAlias_state
);
5518 TALLOC_CTX
*mem_ctx
;
5520 if (state
->out_mem_ctx
) {
5521 mem_ctx
= state
->out_mem_ctx
;
5526 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5527 TALLOC_FREE(subreq
);
5528 if (!NT_STATUS_IS_OK(status
)) {
5529 tevent_req_nterror(req
, status
);
5533 /* Copy out parameters */
5534 *state
->orig
.out
.sids
= *state
->tmp
.out
.sids
;
5537 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5539 /* Reset temporary structure */
5540 ZERO_STRUCT(state
->tmp
);
5542 if (DEBUGLEVEL
>= 10) {
5543 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias
, &state
->orig
);
5546 tevent_req_done(req
);
5549 NTSTATUS
rpccli_samr_GetMembersInAlias_recv(struct tevent_req
*req
,
5550 TALLOC_CTX
*mem_ctx
,
5553 struct rpccli_samr_GetMembersInAlias_state
*state
= tevent_req_data(
5554 req
, struct rpccli_samr_GetMembersInAlias_state
);
5557 if (tevent_req_is_nterror(req
, &status
)) {
5558 tevent_req_received(req
);
5562 /* Steal possbile out parameters to the callers context */
5563 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5566 *result
= state
->orig
.out
.result
;
5568 tevent_req_received(req
);
5569 return NT_STATUS_OK
;
5572 NTSTATUS
rpccli_samr_GetMembersInAlias(struct rpc_pipe_client
*cli
,
5573 TALLOC_CTX
*mem_ctx
,
5574 struct policy_handle
*alias_handle
/* [in] [ref] */,
5575 struct lsa_SidArray
*sids
/* [out] [ref] */)
5577 struct samr_GetMembersInAlias r
;
5581 r
.in
.alias_handle
= alias_handle
;
5583 if (DEBUGLEVEL
>= 10) {
5584 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias
, &r
);
5587 status
= cli
->dispatch(cli
,
5590 NDR_SAMR_GETMEMBERSINALIAS
,
5593 if (!NT_STATUS_IS_OK(status
)) {
5597 if (DEBUGLEVEL
>= 10) {
5598 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias
, &r
);
5601 if (NT_STATUS_IS_ERR(status
)) {
5605 /* Return variables */
5606 *sids
= *r
.out
.sids
;
5609 return r
.out
.result
;
5612 struct rpccli_samr_OpenUser_state
{
5613 struct samr_OpenUser orig
;
5614 struct samr_OpenUser tmp
;
5615 TALLOC_CTX
*out_mem_ctx
;
5616 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5619 static void rpccli_samr_OpenUser_done(struct tevent_req
*subreq
);
5621 struct tevent_req
*rpccli_samr_OpenUser_send(TALLOC_CTX
*mem_ctx
,
5622 struct tevent_context
*ev
,
5623 struct rpc_pipe_client
*cli
,
5624 struct policy_handle
*_domain_handle
/* [in] [ref] */,
5625 uint32_t _access_mask
/* [in] */,
5626 uint32_t _rid
/* [in] */,
5627 struct policy_handle
*_user_handle
/* [out] [ref] */)
5629 struct tevent_req
*req
;
5630 struct rpccli_samr_OpenUser_state
*state
;
5631 struct tevent_req
*subreq
;
5633 req
= tevent_req_create(mem_ctx
, &state
,
5634 struct rpccli_samr_OpenUser_state
);
5638 state
->out_mem_ctx
= NULL
;
5639 state
->dispatch_recv
= cli
->dispatch_recv
;
5642 state
->orig
.in
.domain_handle
= _domain_handle
;
5643 state
->orig
.in
.access_mask
= _access_mask
;
5644 state
->orig
.in
.rid
= _rid
;
5646 /* Out parameters */
5647 state
->orig
.out
.user_handle
= _user_handle
;
5650 ZERO_STRUCT(state
->orig
.out
.result
);
5652 if (DEBUGLEVEL
>= 10) {
5653 NDR_PRINT_IN_DEBUG(samr_OpenUser
, &state
->orig
);
5656 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5657 "rpccli_samr_OpenUser_out_memory");
5658 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5659 return tevent_req_post(req
, ev
);
5662 /* make a temporary copy, that we pass to the dispatch function */
5663 state
->tmp
= state
->orig
;
5665 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5669 if (tevent_req_nomem(subreq
, req
)) {
5670 return tevent_req_post(req
, ev
);
5672 tevent_req_set_callback(subreq
, rpccli_samr_OpenUser_done
, req
);
5676 static void rpccli_samr_OpenUser_done(struct tevent_req
*subreq
)
5678 struct tevent_req
*req
= tevent_req_callback_data(
5679 subreq
, struct tevent_req
);
5680 struct rpccli_samr_OpenUser_state
*state
= tevent_req_data(
5681 req
, struct rpccli_samr_OpenUser_state
);
5683 TALLOC_CTX
*mem_ctx
;
5685 if (state
->out_mem_ctx
) {
5686 mem_ctx
= state
->out_mem_ctx
;
5691 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5692 TALLOC_FREE(subreq
);
5693 if (!NT_STATUS_IS_OK(status
)) {
5694 tevent_req_nterror(req
, status
);
5698 /* Copy out parameters */
5699 *state
->orig
.out
.user_handle
= *state
->tmp
.out
.user_handle
;
5702 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5704 /* Reset temporary structure */
5705 ZERO_STRUCT(state
->tmp
);
5707 if (DEBUGLEVEL
>= 10) {
5708 NDR_PRINT_OUT_DEBUG(samr_OpenUser
, &state
->orig
);
5711 tevent_req_done(req
);
5714 NTSTATUS
rpccli_samr_OpenUser_recv(struct tevent_req
*req
,
5715 TALLOC_CTX
*mem_ctx
,
5718 struct rpccli_samr_OpenUser_state
*state
= tevent_req_data(
5719 req
, struct rpccli_samr_OpenUser_state
);
5722 if (tevent_req_is_nterror(req
, &status
)) {
5723 tevent_req_received(req
);
5727 /* Steal possbile out parameters to the callers context */
5728 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5731 *result
= state
->orig
.out
.result
;
5733 tevent_req_received(req
);
5734 return NT_STATUS_OK
;
5737 NTSTATUS
rpccli_samr_OpenUser(struct rpc_pipe_client
*cli
,
5738 TALLOC_CTX
*mem_ctx
,
5739 struct policy_handle
*domain_handle
/* [in] [ref] */,
5740 uint32_t access_mask
/* [in] */,
5741 uint32_t rid
/* [in] */,
5742 struct policy_handle
*user_handle
/* [out] [ref] */)
5744 struct samr_OpenUser r
;
5748 r
.in
.domain_handle
= domain_handle
;
5749 r
.in
.access_mask
= access_mask
;
5752 if (DEBUGLEVEL
>= 10) {
5753 NDR_PRINT_IN_DEBUG(samr_OpenUser
, &r
);
5756 status
= cli
->dispatch(cli
,
5762 if (!NT_STATUS_IS_OK(status
)) {
5766 if (DEBUGLEVEL
>= 10) {
5767 NDR_PRINT_OUT_DEBUG(samr_OpenUser
, &r
);
5770 if (NT_STATUS_IS_ERR(status
)) {
5774 /* Return variables */
5775 *user_handle
= *r
.out
.user_handle
;
5778 return r
.out
.result
;
5781 struct rpccli_samr_DeleteUser_state
{
5782 struct samr_DeleteUser orig
;
5783 struct samr_DeleteUser tmp
;
5784 TALLOC_CTX
*out_mem_ctx
;
5785 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5788 static void rpccli_samr_DeleteUser_done(struct tevent_req
*subreq
);
5790 struct tevent_req
*rpccli_samr_DeleteUser_send(TALLOC_CTX
*mem_ctx
,
5791 struct tevent_context
*ev
,
5792 struct rpc_pipe_client
*cli
,
5793 struct policy_handle
*_user_handle
/* [in,out] [ref] */)
5795 struct tevent_req
*req
;
5796 struct rpccli_samr_DeleteUser_state
*state
;
5797 struct tevent_req
*subreq
;
5799 req
= tevent_req_create(mem_ctx
, &state
,
5800 struct rpccli_samr_DeleteUser_state
);
5804 state
->out_mem_ctx
= NULL
;
5805 state
->dispatch_recv
= cli
->dispatch_recv
;
5808 state
->orig
.in
.user_handle
= _user_handle
;
5810 /* Out parameters */
5811 state
->orig
.out
.user_handle
= _user_handle
;
5814 ZERO_STRUCT(state
->orig
.out
.result
);
5816 if (DEBUGLEVEL
>= 10) {
5817 NDR_PRINT_IN_DEBUG(samr_DeleteUser
, &state
->orig
);
5820 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5821 "rpccli_samr_DeleteUser_out_memory");
5822 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5823 return tevent_req_post(req
, ev
);
5826 /* make a temporary copy, that we pass to the dispatch function */
5827 state
->tmp
= state
->orig
;
5829 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5831 NDR_SAMR_DELETEUSER
,
5833 if (tevent_req_nomem(subreq
, req
)) {
5834 return tevent_req_post(req
, ev
);
5836 tevent_req_set_callback(subreq
, rpccli_samr_DeleteUser_done
, req
);
5840 static void rpccli_samr_DeleteUser_done(struct tevent_req
*subreq
)
5842 struct tevent_req
*req
= tevent_req_callback_data(
5843 subreq
, struct tevent_req
);
5844 struct rpccli_samr_DeleteUser_state
*state
= tevent_req_data(
5845 req
, struct rpccli_samr_DeleteUser_state
);
5847 TALLOC_CTX
*mem_ctx
;
5849 if (state
->out_mem_ctx
) {
5850 mem_ctx
= state
->out_mem_ctx
;
5855 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5856 TALLOC_FREE(subreq
);
5857 if (!NT_STATUS_IS_OK(status
)) {
5858 tevent_req_nterror(req
, status
);
5862 /* Copy out parameters */
5863 *state
->orig
.out
.user_handle
= *state
->tmp
.out
.user_handle
;
5866 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5868 /* Reset temporary structure */
5869 ZERO_STRUCT(state
->tmp
);
5871 if (DEBUGLEVEL
>= 10) {
5872 NDR_PRINT_OUT_DEBUG(samr_DeleteUser
, &state
->orig
);
5875 tevent_req_done(req
);
5878 NTSTATUS
rpccli_samr_DeleteUser_recv(struct tevent_req
*req
,
5879 TALLOC_CTX
*mem_ctx
,
5882 struct rpccli_samr_DeleteUser_state
*state
= tevent_req_data(
5883 req
, struct rpccli_samr_DeleteUser_state
);
5886 if (tevent_req_is_nterror(req
, &status
)) {
5887 tevent_req_received(req
);
5891 /* Steal possbile out parameters to the callers context */
5892 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5895 *result
= state
->orig
.out
.result
;
5897 tevent_req_received(req
);
5898 return NT_STATUS_OK
;
5901 NTSTATUS
rpccli_samr_DeleteUser(struct rpc_pipe_client
*cli
,
5902 TALLOC_CTX
*mem_ctx
,
5903 struct policy_handle
*user_handle
/* [in,out] [ref] */)
5905 struct samr_DeleteUser r
;
5909 r
.in
.user_handle
= user_handle
;
5911 if (DEBUGLEVEL
>= 10) {
5912 NDR_PRINT_IN_DEBUG(samr_DeleteUser
, &r
);
5915 status
= cli
->dispatch(cli
,
5918 NDR_SAMR_DELETEUSER
,
5921 if (!NT_STATUS_IS_OK(status
)) {
5925 if (DEBUGLEVEL
>= 10) {
5926 NDR_PRINT_OUT_DEBUG(samr_DeleteUser
, &r
);
5929 if (NT_STATUS_IS_ERR(status
)) {
5933 /* Return variables */
5934 *user_handle
= *r
.out
.user_handle
;
5937 return r
.out
.result
;
5940 struct rpccli_samr_QueryUserInfo_state
{
5941 struct samr_QueryUserInfo orig
;
5942 struct samr_QueryUserInfo tmp
;
5943 TALLOC_CTX
*out_mem_ctx
;
5944 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5947 static void rpccli_samr_QueryUserInfo_done(struct tevent_req
*subreq
);
5949 struct tevent_req
*rpccli_samr_QueryUserInfo_send(TALLOC_CTX
*mem_ctx
,
5950 struct tevent_context
*ev
,
5951 struct rpc_pipe_client
*cli
,
5952 struct policy_handle
*_user_handle
/* [in] [ref] */,
5953 enum samr_UserInfoLevel _level
/* [in] */,
5954 union samr_UserInfo
**_info
/* [out] [ref,switch_is(level)] */)
5956 struct tevent_req
*req
;
5957 struct rpccli_samr_QueryUserInfo_state
*state
;
5958 struct tevent_req
*subreq
;
5960 req
= tevent_req_create(mem_ctx
, &state
,
5961 struct rpccli_samr_QueryUserInfo_state
);
5965 state
->out_mem_ctx
= NULL
;
5966 state
->dispatch_recv
= cli
->dispatch_recv
;
5969 state
->orig
.in
.user_handle
= _user_handle
;
5970 state
->orig
.in
.level
= _level
;
5972 /* Out parameters */
5973 state
->orig
.out
.info
= _info
;
5976 ZERO_STRUCT(state
->orig
.out
.result
);
5978 if (DEBUGLEVEL
>= 10) {
5979 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo
, &state
->orig
);
5982 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5983 "rpccli_samr_QueryUserInfo_out_memory");
5984 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5985 return tevent_req_post(req
, ev
);
5988 /* make a temporary copy, that we pass to the dispatch function */
5989 state
->tmp
= state
->orig
;
5991 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5993 NDR_SAMR_QUERYUSERINFO
,
5995 if (tevent_req_nomem(subreq
, req
)) {
5996 return tevent_req_post(req
, ev
);
5998 tevent_req_set_callback(subreq
, rpccli_samr_QueryUserInfo_done
, req
);
6002 static void rpccli_samr_QueryUserInfo_done(struct tevent_req
*subreq
)
6004 struct tevent_req
*req
= tevent_req_callback_data(
6005 subreq
, struct tevent_req
);
6006 struct rpccli_samr_QueryUserInfo_state
*state
= tevent_req_data(
6007 req
, struct rpccli_samr_QueryUserInfo_state
);
6009 TALLOC_CTX
*mem_ctx
;
6011 if (state
->out_mem_ctx
) {
6012 mem_ctx
= state
->out_mem_ctx
;
6017 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6018 TALLOC_FREE(subreq
);
6019 if (!NT_STATUS_IS_OK(status
)) {
6020 tevent_req_nterror(req
, status
);
6024 /* Copy out parameters */
6025 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
6028 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6030 /* Reset temporary structure */
6031 ZERO_STRUCT(state
->tmp
);
6033 if (DEBUGLEVEL
>= 10) {
6034 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo
, &state
->orig
);
6037 tevent_req_done(req
);
6040 NTSTATUS
rpccli_samr_QueryUserInfo_recv(struct tevent_req
*req
,
6041 TALLOC_CTX
*mem_ctx
,
6044 struct rpccli_samr_QueryUserInfo_state
*state
= tevent_req_data(
6045 req
, struct rpccli_samr_QueryUserInfo_state
);
6048 if (tevent_req_is_nterror(req
, &status
)) {
6049 tevent_req_received(req
);
6053 /* Steal possbile out parameters to the callers context */
6054 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6057 *result
= state
->orig
.out
.result
;
6059 tevent_req_received(req
);
6060 return NT_STATUS_OK
;
6063 NTSTATUS
rpccli_samr_QueryUserInfo(struct rpc_pipe_client
*cli
,
6064 TALLOC_CTX
*mem_ctx
,
6065 struct policy_handle
*user_handle
/* [in] [ref] */,
6066 enum samr_UserInfoLevel level
/* [in] */,
6067 union samr_UserInfo
**info
/* [out] [ref,switch_is(level)] */)
6069 struct samr_QueryUserInfo r
;
6073 r
.in
.user_handle
= user_handle
;
6076 if (DEBUGLEVEL
>= 10) {
6077 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo
, &r
);
6080 status
= cli
->dispatch(cli
,
6083 NDR_SAMR_QUERYUSERINFO
,
6086 if (!NT_STATUS_IS_OK(status
)) {
6090 if (DEBUGLEVEL
>= 10) {
6091 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo
, &r
);
6094 if (NT_STATUS_IS_ERR(status
)) {
6098 /* Return variables */
6099 *info
= *r
.out
.info
;
6102 return r
.out
.result
;
6105 struct rpccli_samr_SetUserInfo_state
{
6106 struct samr_SetUserInfo orig
;
6107 struct samr_SetUserInfo tmp
;
6108 TALLOC_CTX
*out_mem_ctx
;
6109 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6112 static void rpccli_samr_SetUserInfo_done(struct tevent_req
*subreq
);
6114 struct tevent_req
*rpccli_samr_SetUserInfo_send(TALLOC_CTX
*mem_ctx
,
6115 struct tevent_context
*ev
,
6116 struct rpc_pipe_client
*cli
,
6117 struct policy_handle
*_user_handle
/* [in] [ref] */,
6118 enum samr_UserInfoLevel _level
/* [in] */,
6119 union samr_UserInfo
*_info
/* [in] [ref,switch_is(level)] */)
6121 struct tevent_req
*req
;
6122 struct rpccli_samr_SetUserInfo_state
*state
;
6123 struct tevent_req
*subreq
;
6125 req
= tevent_req_create(mem_ctx
, &state
,
6126 struct rpccli_samr_SetUserInfo_state
);
6130 state
->out_mem_ctx
= NULL
;
6131 state
->dispatch_recv
= cli
->dispatch_recv
;
6134 state
->orig
.in
.user_handle
= _user_handle
;
6135 state
->orig
.in
.level
= _level
;
6136 state
->orig
.in
.info
= _info
;
6138 /* Out parameters */
6141 ZERO_STRUCT(state
->orig
.out
.result
);
6143 if (DEBUGLEVEL
>= 10) {
6144 NDR_PRINT_IN_DEBUG(samr_SetUserInfo
, &state
->orig
);
6147 /* make a temporary copy, that we pass to the dispatch function */
6148 state
->tmp
= state
->orig
;
6150 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6152 NDR_SAMR_SETUSERINFO
,
6154 if (tevent_req_nomem(subreq
, req
)) {
6155 return tevent_req_post(req
, ev
);
6157 tevent_req_set_callback(subreq
, rpccli_samr_SetUserInfo_done
, req
);
6161 static void rpccli_samr_SetUserInfo_done(struct tevent_req
*subreq
)
6163 struct tevent_req
*req
= tevent_req_callback_data(
6164 subreq
, struct tevent_req
);
6165 struct rpccli_samr_SetUserInfo_state
*state
= tevent_req_data(
6166 req
, struct rpccli_samr_SetUserInfo_state
);
6168 TALLOC_CTX
*mem_ctx
;
6170 if (state
->out_mem_ctx
) {
6171 mem_ctx
= state
->out_mem_ctx
;
6176 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6177 TALLOC_FREE(subreq
);
6178 if (!NT_STATUS_IS_OK(status
)) {
6179 tevent_req_nterror(req
, status
);
6183 /* Copy out parameters */
6186 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6188 /* Reset temporary structure */
6189 ZERO_STRUCT(state
->tmp
);
6191 if (DEBUGLEVEL
>= 10) {
6192 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo
, &state
->orig
);
6195 tevent_req_done(req
);
6198 NTSTATUS
rpccli_samr_SetUserInfo_recv(struct tevent_req
*req
,
6199 TALLOC_CTX
*mem_ctx
,
6202 struct rpccli_samr_SetUserInfo_state
*state
= tevent_req_data(
6203 req
, struct rpccli_samr_SetUserInfo_state
);
6206 if (tevent_req_is_nterror(req
, &status
)) {
6207 tevent_req_received(req
);
6211 /* Steal possbile out parameters to the callers context */
6212 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6215 *result
= state
->orig
.out
.result
;
6217 tevent_req_received(req
);
6218 return NT_STATUS_OK
;
6221 NTSTATUS
rpccli_samr_SetUserInfo(struct rpc_pipe_client
*cli
,
6222 TALLOC_CTX
*mem_ctx
,
6223 struct policy_handle
*user_handle
/* [in] [ref] */,
6224 enum samr_UserInfoLevel level
/* [in] */,
6225 union samr_UserInfo
*info
/* [in] [ref,switch_is(level)] */)
6227 struct samr_SetUserInfo r
;
6231 r
.in
.user_handle
= user_handle
;
6235 if (DEBUGLEVEL
>= 10) {
6236 NDR_PRINT_IN_DEBUG(samr_SetUserInfo
, &r
);
6239 status
= cli
->dispatch(cli
,
6242 NDR_SAMR_SETUSERINFO
,
6245 if (!NT_STATUS_IS_OK(status
)) {
6249 if (DEBUGLEVEL
>= 10) {
6250 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo
, &r
);
6253 if (NT_STATUS_IS_ERR(status
)) {
6257 /* Return variables */
6260 return r
.out
.result
;
6263 struct rpccli_samr_ChangePasswordUser_state
{
6264 struct samr_ChangePasswordUser orig
;
6265 struct samr_ChangePasswordUser tmp
;
6266 TALLOC_CTX
*out_mem_ctx
;
6267 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6270 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req
*subreq
);
6272 struct tevent_req
*rpccli_samr_ChangePasswordUser_send(TALLOC_CTX
*mem_ctx
,
6273 struct tevent_context
*ev
,
6274 struct rpc_pipe_client
*cli
,
6275 struct policy_handle
*_user_handle
/* [in] [ref] */,
6276 uint8_t _lm_present
/* [in] */,
6277 struct samr_Password
*_old_lm_crypted
/* [in] [unique] */,
6278 struct samr_Password
*_new_lm_crypted
/* [in] [unique] */,
6279 uint8_t _nt_present
/* [in] */,
6280 struct samr_Password
*_old_nt_crypted
/* [in] [unique] */,
6281 struct samr_Password
*_new_nt_crypted
/* [in] [unique] */,
6282 uint8_t _cross1_present
/* [in] */,
6283 struct samr_Password
*_nt_cross
/* [in] [unique] */,
6284 uint8_t _cross2_present
/* [in] */,
6285 struct samr_Password
*_lm_cross
/* [in] [unique] */)
6287 struct tevent_req
*req
;
6288 struct rpccli_samr_ChangePasswordUser_state
*state
;
6289 struct tevent_req
*subreq
;
6291 req
= tevent_req_create(mem_ctx
, &state
,
6292 struct rpccli_samr_ChangePasswordUser_state
);
6296 state
->out_mem_ctx
= NULL
;
6297 state
->dispatch_recv
= cli
->dispatch_recv
;
6300 state
->orig
.in
.user_handle
= _user_handle
;
6301 state
->orig
.in
.lm_present
= _lm_present
;
6302 state
->orig
.in
.old_lm_crypted
= _old_lm_crypted
;
6303 state
->orig
.in
.new_lm_crypted
= _new_lm_crypted
;
6304 state
->orig
.in
.nt_present
= _nt_present
;
6305 state
->orig
.in
.old_nt_crypted
= _old_nt_crypted
;
6306 state
->orig
.in
.new_nt_crypted
= _new_nt_crypted
;
6307 state
->orig
.in
.cross1_present
= _cross1_present
;
6308 state
->orig
.in
.nt_cross
= _nt_cross
;
6309 state
->orig
.in
.cross2_present
= _cross2_present
;
6310 state
->orig
.in
.lm_cross
= _lm_cross
;
6312 /* Out parameters */
6315 ZERO_STRUCT(state
->orig
.out
.result
);
6317 if (DEBUGLEVEL
>= 10) {
6318 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser
, &state
->orig
);
6321 /* make a temporary copy, that we pass to the dispatch function */
6322 state
->tmp
= state
->orig
;
6324 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6326 NDR_SAMR_CHANGEPASSWORDUSER
,
6328 if (tevent_req_nomem(subreq
, req
)) {
6329 return tevent_req_post(req
, ev
);
6331 tevent_req_set_callback(subreq
, rpccli_samr_ChangePasswordUser_done
, req
);
6335 static void rpccli_samr_ChangePasswordUser_done(struct tevent_req
*subreq
)
6337 struct tevent_req
*req
= tevent_req_callback_data(
6338 subreq
, struct tevent_req
);
6339 struct rpccli_samr_ChangePasswordUser_state
*state
= tevent_req_data(
6340 req
, struct rpccli_samr_ChangePasswordUser_state
);
6342 TALLOC_CTX
*mem_ctx
;
6344 if (state
->out_mem_ctx
) {
6345 mem_ctx
= state
->out_mem_ctx
;
6350 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6351 TALLOC_FREE(subreq
);
6352 if (!NT_STATUS_IS_OK(status
)) {
6353 tevent_req_nterror(req
, status
);
6357 /* Copy out parameters */
6360 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6362 /* Reset temporary structure */
6363 ZERO_STRUCT(state
->tmp
);
6365 if (DEBUGLEVEL
>= 10) {
6366 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser
, &state
->orig
);
6369 tevent_req_done(req
);
6372 NTSTATUS
rpccli_samr_ChangePasswordUser_recv(struct tevent_req
*req
,
6373 TALLOC_CTX
*mem_ctx
,
6376 struct rpccli_samr_ChangePasswordUser_state
*state
= tevent_req_data(
6377 req
, struct rpccli_samr_ChangePasswordUser_state
);
6380 if (tevent_req_is_nterror(req
, &status
)) {
6381 tevent_req_received(req
);
6385 /* Steal possbile out parameters to the callers context */
6386 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6389 *result
= state
->orig
.out
.result
;
6391 tevent_req_received(req
);
6392 return NT_STATUS_OK
;
6395 NTSTATUS
rpccli_samr_ChangePasswordUser(struct rpc_pipe_client
*cli
,
6396 TALLOC_CTX
*mem_ctx
,
6397 struct policy_handle
*user_handle
/* [in] [ref] */,
6398 uint8_t lm_present
/* [in] */,
6399 struct samr_Password
*old_lm_crypted
/* [in] [unique] */,
6400 struct samr_Password
*new_lm_crypted
/* [in] [unique] */,
6401 uint8_t nt_present
/* [in] */,
6402 struct samr_Password
*old_nt_crypted
/* [in] [unique] */,
6403 struct samr_Password
*new_nt_crypted
/* [in] [unique] */,
6404 uint8_t cross1_present
/* [in] */,
6405 struct samr_Password
*nt_cross
/* [in] [unique] */,
6406 uint8_t cross2_present
/* [in] */,
6407 struct samr_Password
*lm_cross
/* [in] [unique] */)
6409 struct samr_ChangePasswordUser r
;
6413 r
.in
.user_handle
= user_handle
;
6414 r
.in
.lm_present
= lm_present
;
6415 r
.in
.old_lm_crypted
= old_lm_crypted
;
6416 r
.in
.new_lm_crypted
= new_lm_crypted
;
6417 r
.in
.nt_present
= nt_present
;
6418 r
.in
.old_nt_crypted
= old_nt_crypted
;
6419 r
.in
.new_nt_crypted
= new_nt_crypted
;
6420 r
.in
.cross1_present
= cross1_present
;
6421 r
.in
.nt_cross
= nt_cross
;
6422 r
.in
.cross2_present
= cross2_present
;
6423 r
.in
.lm_cross
= lm_cross
;
6425 if (DEBUGLEVEL
>= 10) {
6426 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser
, &r
);
6429 status
= cli
->dispatch(cli
,
6432 NDR_SAMR_CHANGEPASSWORDUSER
,
6435 if (!NT_STATUS_IS_OK(status
)) {
6439 if (DEBUGLEVEL
>= 10) {
6440 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser
, &r
);
6443 if (NT_STATUS_IS_ERR(status
)) {
6447 /* Return variables */
6450 return r
.out
.result
;
6453 struct rpccli_samr_GetGroupsForUser_state
{
6454 struct samr_GetGroupsForUser orig
;
6455 struct samr_GetGroupsForUser tmp
;
6456 TALLOC_CTX
*out_mem_ctx
;
6457 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6460 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req
*subreq
);
6462 struct tevent_req
*rpccli_samr_GetGroupsForUser_send(TALLOC_CTX
*mem_ctx
,
6463 struct tevent_context
*ev
,
6464 struct rpc_pipe_client
*cli
,
6465 struct policy_handle
*_user_handle
/* [in] [ref] */,
6466 struct samr_RidWithAttributeArray
**_rids
/* [out] [ref] */)
6468 struct tevent_req
*req
;
6469 struct rpccli_samr_GetGroupsForUser_state
*state
;
6470 struct tevent_req
*subreq
;
6472 req
= tevent_req_create(mem_ctx
, &state
,
6473 struct rpccli_samr_GetGroupsForUser_state
);
6477 state
->out_mem_ctx
= NULL
;
6478 state
->dispatch_recv
= cli
->dispatch_recv
;
6481 state
->orig
.in
.user_handle
= _user_handle
;
6483 /* Out parameters */
6484 state
->orig
.out
.rids
= _rids
;
6487 ZERO_STRUCT(state
->orig
.out
.result
);
6489 if (DEBUGLEVEL
>= 10) {
6490 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser
, &state
->orig
);
6493 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6494 "rpccli_samr_GetGroupsForUser_out_memory");
6495 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6496 return tevent_req_post(req
, ev
);
6499 /* make a temporary copy, that we pass to the dispatch function */
6500 state
->tmp
= state
->orig
;
6502 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6504 NDR_SAMR_GETGROUPSFORUSER
,
6506 if (tevent_req_nomem(subreq
, req
)) {
6507 return tevent_req_post(req
, ev
);
6509 tevent_req_set_callback(subreq
, rpccli_samr_GetGroupsForUser_done
, req
);
6513 static void rpccli_samr_GetGroupsForUser_done(struct tevent_req
*subreq
)
6515 struct tevent_req
*req
= tevent_req_callback_data(
6516 subreq
, struct tevent_req
);
6517 struct rpccli_samr_GetGroupsForUser_state
*state
= tevent_req_data(
6518 req
, struct rpccli_samr_GetGroupsForUser_state
);
6520 TALLOC_CTX
*mem_ctx
;
6522 if (state
->out_mem_ctx
) {
6523 mem_ctx
= state
->out_mem_ctx
;
6528 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6529 TALLOC_FREE(subreq
);
6530 if (!NT_STATUS_IS_OK(status
)) {
6531 tevent_req_nterror(req
, status
);
6535 /* Copy out parameters */
6536 *state
->orig
.out
.rids
= *state
->tmp
.out
.rids
;
6539 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6541 /* Reset temporary structure */
6542 ZERO_STRUCT(state
->tmp
);
6544 if (DEBUGLEVEL
>= 10) {
6545 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser
, &state
->orig
);
6548 tevent_req_done(req
);
6551 NTSTATUS
rpccli_samr_GetGroupsForUser_recv(struct tevent_req
*req
,
6552 TALLOC_CTX
*mem_ctx
,
6555 struct rpccli_samr_GetGroupsForUser_state
*state
= tevent_req_data(
6556 req
, struct rpccli_samr_GetGroupsForUser_state
);
6559 if (tevent_req_is_nterror(req
, &status
)) {
6560 tevent_req_received(req
);
6564 /* Steal possbile out parameters to the callers context */
6565 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6568 *result
= state
->orig
.out
.result
;
6570 tevent_req_received(req
);
6571 return NT_STATUS_OK
;
6574 NTSTATUS
rpccli_samr_GetGroupsForUser(struct rpc_pipe_client
*cli
,
6575 TALLOC_CTX
*mem_ctx
,
6576 struct policy_handle
*user_handle
/* [in] [ref] */,
6577 struct samr_RidWithAttributeArray
**rids
/* [out] [ref] */)
6579 struct samr_GetGroupsForUser r
;
6583 r
.in
.user_handle
= user_handle
;
6585 if (DEBUGLEVEL
>= 10) {
6586 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser
, &r
);
6589 status
= cli
->dispatch(cli
,
6592 NDR_SAMR_GETGROUPSFORUSER
,
6595 if (!NT_STATUS_IS_OK(status
)) {
6599 if (DEBUGLEVEL
>= 10) {
6600 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser
, &r
);
6603 if (NT_STATUS_IS_ERR(status
)) {
6607 /* Return variables */
6608 *rids
= *r
.out
.rids
;
6611 return r
.out
.result
;
6614 struct rpccli_samr_QueryDisplayInfo_state
{
6615 struct samr_QueryDisplayInfo orig
;
6616 struct samr_QueryDisplayInfo tmp
;
6617 TALLOC_CTX
*out_mem_ctx
;
6618 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6621 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req
*subreq
);
6623 struct tevent_req
*rpccli_samr_QueryDisplayInfo_send(TALLOC_CTX
*mem_ctx
,
6624 struct tevent_context
*ev
,
6625 struct rpc_pipe_client
*cli
,
6626 struct policy_handle
*_domain_handle
/* [in] [ref] */,
6627 uint16_t _level
/* [in] */,
6628 uint32_t _start_idx
/* [in] */,
6629 uint32_t _max_entries
/* [in] */,
6630 uint32_t _buf_size
/* [in] */,
6631 uint32_t *_total_size
/* [out] [ref] */,
6632 uint32_t *_returned_size
/* [out] [ref] */,
6633 union samr_DispInfo
*_info
/* [out] [ref,switch_is(level)] */)
6635 struct tevent_req
*req
;
6636 struct rpccli_samr_QueryDisplayInfo_state
*state
;
6637 struct tevent_req
*subreq
;
6639 req
= tevent_req_create(mem_ctx
, &state
,
6640 struct rpccli_samr_QueryDisplayInfo_state
);
6644 state
->out_mem_ctx
= NULL
;
6645 state
->dispatch_recv
= cli
->dispatch_recv
;
6648 state
->orig
.in
.domain_handle
= _domain_handle
;
6649 state
->orig
.in
.level
= _level
;
6650 state
->orig
.in
.start_idx
= _start_idx
;
6651 state
->orig
.in
.max_entries
= _max_entries
;
6652 state
->orig
.in
.buf_size
= _buf_size
;
6654 /* Out parameters */
6655 state
->orig
.out
.total_size
= _total_size
;
6656 state
->orig
.out
.returned_size
= _returned_size
;
6657 state
->orig
.out
.info
= _info
;
6660 ZERO_STRUCT(state
->orig
.out
.result
);
6662 if (DEBUGLEVEL
>= 10) {
6663 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo
, &state
->orig
);
6666 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6667 "rpccli_samr_QueryDisplayInfo_out_memory");
6668 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6669 return tevent_req_post(req
, ev
);
6672 /* make a temporary copy, that we pass to the dispatch function */
6673 state
->tmp
= state
->orig
;
6675 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6677 NDR_SAMR_QUERYDISPLAYINFO
,
6679 if (tevent_req_nomem(subreq
, req
)) {
6680 return tevent_req_post(req
, ev
);
6682 tevent_req_set_callback(subreq
, rpccli_samr_QueryDisplayInfo_done
, req
);
6686 static void rpccli_samr_QueryDisplayInfo_done(struct tevent_req
*subreq
)
6688 struct tevent_req
*req
= tevent_req_callback_data(
6689 subreq
, struct tevent_req
);
6690 struct rpccli_samr_QueryDisplayInfo_state
*state
= tevent_req_data(
6691 req
, struct rpccli_samr_QueryDisplayInfo_state
);
6693 TALLOC_CTX
*mem_ctx
;
6695 if (state
->out_mem_ctx
) {
6696 mem_ctx
= state
->out_mem_ctx
;
6701 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6702 TALLOC_FREE(subreq
);
6703 if (!NT_STATUS_IS_OK(status
)) {
6704 tevent_req_nterror(req
, status
);
6708 /* Copy out parameters */
6709 *state
->orig
.out
.total_size
= *state
->tmp
.out
.total_size
;
6710 *state
->orig
.out
.returned_size
= *state
->tmp
.out
.returned_size
;
6711 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
6714 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6716 /* Reset temporary structure */
6717 ZERO_STRUCT(state
->tmp
);
6719 if (DEBUGLEVEL
>= 10) {
6720 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo
, &state
->orig
);
6723 tevent_req_done(req
);
6726 NTSTATUS
rpccli_samr_QueryDisplayInfo_recv(struct tevent_req
*req
,
6727 TALLOC_CTX
*mem_ctx
,
6730 struct rpccli_samr_QueryDisplayInfo_state
*state
= tevent_req_data(
6731 req
, struct rpccli_samr_QueryDisplayInfo_state
);
6734 if (tevent_req_is_nterror(req
, &status
)) {
6735 tevent_req_received(req
);
6739 /* Steal possbile out parameters to the callers context */
6740 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6743 *result
= state
->orig
.out
.result
;
6745 tevent_req_received(req
);
6746 return NT_STATUS_OK
;
6749 NTSTATUS
rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client
*cli
,
6750 TALLOC_CTX
*mem_ctx
,
6751 struct policy_handle
*domain_handle
/* [in] [ref] */,
6752 uint16_t level
/* [in] */,
6753 uint32_t start_idx
/* [in] */,
6754 uint32_t max_entries
/* [in] */,
6755 uint32_t buf_size
/* [in] */,
6756 uint32_t *total_size
/* [out] [ref] */,
6757 uint32_t *returned_size
/* [out] [ref] */,
6758 union samr_DispInfo
*info
/* [out] [ref,switch_is(level)] */)
6760 struct samr_QueryDisplayInfo r
;
6764 r
.in
.domain_handle
= domain_handle
;
6766 r
.in
.start_idx
= start_idx
;
6767 r
.in
.max_entries
= max_entries
;
6768 r
.in
.buf_size
= buf_size
;
6770 if (DEBUGLEVEL
>= 10) {
6771 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo
, &r
);
6774 status
= cli
->dispatch(cli
,
6777 NDR_SAMR_QUERYDISPLAYINFO
,
6780 if (!NT_STATUS_IS_OK(status
)) {
6784 if (DEBUGLEVEL
>= 10) {
6785 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo
, &r
);
6788 if (NT_STATUS_IS_ERR(status
)) {
6792 /* Return variables */
6793 *total_size
= *r
.out
.total_size
;
6794 *returned_size
= *r
.out
.returned_size
;
6795 *info
= *r
.out
.info
;
6798 return r
.out
.result
;
6801 struct rpccli_samr_GetDisplayEnumerationIndex_state
{
6802 struct samr_GetDisplayEnumerationIndex orig
;
6803 struct samr_GetDisplayEnumerationIndex tmp
;
6804 TALLOC_CTX
*out_mem_ctx
;
6805 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6808 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req
*subreq
);
6810 struct tevent_req
*rpccli_samr_GetDisplayEnumerationIndex_send(TALLOC_CTX
*mem_ctx
,
6811 struct tevent_context
*ev
,
6812 struct rpc_pipe_client
*cli
,
6813 struct policy_handle
*_domain_handle
/* [in] [ref] */,
6814 uint16_t _level
/* [in] */,
6815 struct lsa_String
*_name
/* [in] [ref] */,
6816 uint32_t *_idx
/* [out] [ref] */)
6818 struct tevent_req
*req
;
6819 struct rpccli_samr_GetDisplayEnumerationIndex_state
*state
;
6820 struct tevent_req
*subreq
;
6822 req
= tevent_req_create(mem_ctx
, &state
,
6823 struct rpccli_samr_GetDisplayEnumerationIndex_state
);
6827 state
->out_mem_ctx
= NULL
;
6828 state
->dispatch_recv
= cli
->dispatch_recv
;
6831 state
->orig
.in
.domain_handle
= _domain_handle
;
6832 state
->orig
.in
.level
= _level
;
6833 state
->orig
.in
.name
= _name
;
6835 /* Out parameters */
6836 state
->orig
.out
.idx
= _idx
;
6839 ZERO_STRUCT(state
->orig
.out
.result
);
6841 if (DEBUGLEVEL
>= 10) {
6842 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex
, &state
->orig
);
6845 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6846 "rpccli_samr_GetDisplayEnumerationIndex_out_memory");
6847 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6848 return tevent_req_post(req
, ev
);
6851 /* make a temporary copy, that we pass to the dispatch function */
6852 state
->tmp
= state
->orig
;
6854 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6856 NDR_SAMR_GETDISPLAYENUMERATIONINDEX
,
6858 if (tevent_req_nomem(subreq
, req
)) {
6859 return tevent_req_post(req
, ev
);
6861 tevent_req_set_callback(subreq
, rpccli_samr_GetDisplayEnumerationIndex_done
, req
);
6865 static void rpccli_samr_GetDisplayEnumerationIndex_done(struct tevent_req
*subreq
)
6867 struct tevent_req
*req
= tevent_req_callback_data(
6868 subreq
, struct tevent_req
);
6869 struct rpccli_samr_GetDisplayEnumerationIndex_state
*state
= tevent_req_data(
6870 req
, struct rpccli_samr_GetDisplayEnumerationIndex_state
);
6872 TALLOC_CTX
*mem_ctx
;
6874 if (state
->out_mem_ctx
) {
6875 mem_ctx
= state
->out_mem_ctx
;
6880 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6881 TALLOC_FREE(subreq
);
6882 if (!NT_STATUS_IS_OK(status
)) {
6883 tevent_req_nterror(req
, status
);
6887 /* Copy out parameters */
6888 *state
->orig
.out
.idx
= *state
->tmp
.out
.idx
;
6891 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6893 /* Reset temporary structure */
6894 ZERO_STRUCT(state
->tmp
);
6896 if (DEBUGLEVEL
>= 10) {
6897 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex
, &state
->orig
);
6900 tevent_req_done(req
);
6903 NTSTATUS
rpccli_samr_GetDisplayEnumerationIndex_recv(struct tevent_req
*req
,
6904 TALLOC_CTX
*mem_ctx
,
6907 struct rpccli_samr_GetDisplayEnumerationIndex_state
*state
= tevent_req_data(
6908 req
, struct rpccli_samr_GetDisplayEnumerationIndex_state
);
6911 if (tevent_req_is_nterror(req
, &status
)) {
6912 tevent_req_received(req
);
6916 /* Steal possbile out parameters to the callers context */
6917 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6920 *result
= state
->orig
.out
.result
;
6922 tevent_req_received(req
);
6923 return NT_STATUS_OK
;
6926 NTSTATUS
rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client
*cli
,
6927 TALLOC_CTX
*mem_ctx
,
6928 struct policy_handle
*domain_handle
/* [in] [ref] */,
6929 uint16_t level
/* [in] */,
6930 struct lsa_String
*name
/* [in] [ref] */,
6931 uint32_t *idx
/* [out] [ref] */)
6933 struct samr_GetDisplayEnumerationIndex r
;
6937 r
.in
.domain_handle
= domain_handle
;
6941 if (DEBUGLEVEL
>= 10) {
6942 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex
, &r
);
6945 status
= cli
->dispatch(cli
,
6948 NDR_SAMR_GETDISPLAYENUMERATIONINDEX
,
6951 if (!NT_STATUS_IS_OK(status
)) {
6955 if (DEBUGLEVEL
>= 10) {
6956 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex
, &r
);
6959 if (NT_STATUS_IS_ERR(status
)) {
6963 /* Return variables */
6967 return r
.out
.result
;
6970 struct rpccli_samr_TestPrivateFunctionsDomain_state
{
6971 struct samr_TestPrivateFunctionsDomain orig
;
6972 struct samr_TestPrivateFunctionsDomain tmp
;
6973 TALLOC_CTX
*out_mem_ctx
;
6974 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6977 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req
*subreq
);
6979 struct tevent_req
*rpccli_samr_TestPrivateFunctionsDomain_send(TALLOC_CTX
*mem_ctx
,
6980 struct tevent_context
*ev
,
6981 struct rpc_pipe_client
*cli
,
6982 struct policy_handle
*_domain_handle
/* [in] [ref] */)
6984 struct tevent_req
*req
;
6985 struct rpccli_samr_TestPrivateFunctionsDomain_state
*state
;
6986 struct tevent_req
*subreq
;
6988 req
= tevent_req_create(mem_ctx
, &state
,
6989 struct rpccli_samr_TestPrivateFunctionsDomain_state
);
6993 state
->out_mem_ctx
= NULL
;
6994 state
->dispatch_recv
= cli
->dispatch_recv
;
6997 state
->orig
.in
.domain_handle
= _domain_handle
;
6999 /* Out parameters */
7002 ZERO_STRUCT(state
->orig
.out
.result
);
7004 if (DEBUGLEVEL
>= 10) {
7005 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain
, &state
->orig
);
7008 /* make a temporary copy, that we pass to the dispatch function */
7009 state
->tmp
= state
->orig
;
7011 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7013 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN
,
7015 if (tevent_req_nomem(subreq
, req
)) {
7016 return tevent_req_post(req
, ev
);
7018 tevent_req_set_callback(subreq
, rpccli_samr_TestPrivateFunctionsDomain_done
, req
);
7022 static void rpccli_samr_TestPrivateFunctionsDomain_done(struct tevent_req
*subreq
)
7024 struct tevent_req
*req
= tevent_req_callback_data(
7025 subreq
, struct tevent_req
);
7026 struct rpccli_samr_TestPrivateFunctionsDomain_state
*state
= tevent_req_data(
7027 req
, struct rpccli_samr_TestPrivateFunctionsDomain_state
);
7029 TALLOC_CTX
*mem_ctx
;
7031 if (state
->out_mem_ctx
) {
7032 mem_ctx
= state
->out_mem_ctx
;
7037 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7038 TALLOC_FREE(subreq
);
7039 if (!NT_STATUS_IS_OK(status
)) {
7040 tevent_req_nterror(req
, status
);
7044 /* Copy out parameters */
7047 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7049 /* Reset temporary structure */
7050 ZERO_STRUCT(state
->tmp
);
7052 if (DEBUGLEVEL
>= 10) {
7053 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain
, &state
->orig
);
7056 tevent_req_done(req
);
7059 NTSTATUS
rpccli_samr_TestPrivateFunctionsDomain_recv(struct tevent_req
*req
,
7060 TALLOC_CTX
*mem_ctx
,
7063 struct rpccli_samr_TestPrivateFunctionsDomain_state
*state
= tevent_req_data(
7064 req
, struct rpccli_samr_TestPrivateFunctionsDomain_state
);
7067 if (tevent_req_is_nterror(req
, &status
)) {
7068 tevent_req_received(req
);
7072 /* Steal possbile out parameters to the callers context */
7073 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7076 *result
= state
->orig
.out
.result
;
7078 tevent_req_received(req
);
7079 return NT_STATUS_OK
;
7082 NTSTATUS
rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client
*cli
,
7083 TALLOC_CTX
*mem_ctx
,
7084 struct policy_handle
*domain_handle
/* [in] [ref] */)
7086 struct samr_TestPrivateFunctionsDomain r
;
7090 r
.in
.domain_handle
= domain_handle
;
7092 if (DEBUGLEVEL
>= 10) {
7093 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain
, &r
);
7096 status
= cli
->dispatch(cli
,
7099 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN
,
7102 if (!NT_STATUS_IS_OK(status
)) {
7106 if (DEBUGLEVEL
>= 10) {
7107 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain
, &r
);
7110 if (NT_STATUS_IS_ERR(status
)) {
7114 /* Return variables */
7117 return r
.out
.result
;
7120 struct rpccli_samr_TestPrivateFunctionsUser_state
{
7121 struct samr_TestPrivateFunctionsUser orig
;
7122 struct samr_TestPrivateFunctionsUser tmp
;
7123 TALLOC_CTX
*out_mem_ctx
;
7124 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7127 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req
*subreq
);
7129 struct tevent_req
*rpccli_samr_TestPrivateFunctionsUser_send(TALLOC_CTX
*mem_ctx
,
7130 struct tevent_context
*ev
,
7131 struct rpc_pipe_client
*cli
,
7132 struct policy_handle
*_user_handle
/* [in] [ref] */)
7134 struct tevent_req
*req
;
7135 struct rpccli_samr_TestPrivateFunctionsUser_state
*state
;
7136 struct tevent_req
*subreq
;
7138 req
= tevent_req_create(mem_ctx
, &state
,
7139 struct rpccli_samr_TestPrivateFunctionsUser_state
);
7143 state
->out_mem_ctx
= NULL
;
7144 state
->dispatch_recv
= cli
->dispatch_recv
;
7147 state
->orig
.in
.user_handle
= _user_handle
;
7149 /* Out parameters */
7152 ZERO_STRUCT(state
->orig
.out
.result
);
7154 if (DEBUGLEVEL
>= 10) {
7155 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser
, &state
->orig
);
7158 /* make a temporary copy, that we pass to the dispatch function */
7159 state
->tmp
= state
->orig
;
7161 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7163 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER
,
7165 if (tevent_req_nomem(subreq
, req
)) {
7166 return tevent_req_post(req
, ev
);
7168 tevent_req_set_callback(subreq
, rpccli_samr_TestPrivateFunctionsUser_done
, req
);
7172 static void rpccli_samr_TestPrivateFunctionsUser_done(struct tevent_req
*subreq
)
7174 struct tevent_req
*req
= tevent_req_callback_data(
7175 subreq
, struct tevent_req
);
7176 struct rpccli_samr_TestPrivateFunctionsUser_state
*state
= tevent_req_data(
7177 req
, struct rpccli_samr_TestPrivateFunctionsUser_state
);
7179 TALLOC_CTX
*mem_ctx
;
7181 if (state
->out_mem_ctx
) {
7182 mem_ctx
= state
->out_mem_ctx
;
7187 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7188 TALLOC_FREE(subreq
);
7189 if (!NT_STATUS_IS_OK(status
)) {
7190 tevent_req_nterror(req
, status
);
7194 /* Copy out parameters */
7197 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7199 /* Reset temporary structure */
7200 ZERO_STRUCT(state
->tmp
);
7202 if (DEBUGLEVEL
>= 10) {
7203 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser
, &state
->orig
);
7206 tevent_req_done(req
);
7209 NTSTATUS
rpccli_samr_TestPrivateFunctionsUser_recv(struct tevent_req
*req
,
7210 TALLOC_CTX
*mem_ctx
,
7213 struct rpccli_samr_TestPrivateFunctionsUser_state
*state
= tevent_req_data(
7214 req
, struct rpccli_samr_TestPrivateFunctionsUser_state
);
7217 if (tevent_req_is_nterror(req
, &status
)) {
7218 tevent_req_received(req
);
7222 /* Steal possbile out parameters to the callers context */
7223 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7226 *result
= state
->orig
.out
.result
;
7228 tevent_req_received(req
);
7229 return NT_STATUS_OK
;
7232 NTSTATUS
rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client
*cli
,
7233 TALLOC_CTX
*mem_ctx
,
7234 struct policy_handle
*user_handle
/* [in] [ref] */)
7236 struct samr_TestPrivateFunctionsUser r
;
7240 r
.in
.user_handle
= user_handle
;
7242 if (DEBUGLEVEL
>= 10) {
7243 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser
, &r
);
7246 status
= cli
->dispatch(cli
,
7249 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER
,
7252 if (!NT_STATUS_IS_OK(status
)) {
7256 if (DEBUGLEVEL
>= 10) {
7257 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser
, &r
);
7260 if (NT_STATUS_IS_ERR(status
)) {
7264 /* Return variables */
7267 return r
.out
.result
;
7270 struct rpccli_samr_GetUserPwInfo_state
{
7271 struct samr_GetUserPwInfo orig
;
7272 struct samr_GetUserPwInfo tmp
;
7273 TALLOC_CTX
*out_mem_ctx
;
7274 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7277 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req
*subreq
);
7279 struct tevent_req
*rpccli_samr_GetUserPwInfo_send(TALLOC_CTX
*mem_ctx
,
7280 struct tevent_context
*ev
,
7281 struct rpc_pipe_client
*cli
,
7282 struct policy_handle
*_user_handle
/* [in] [ref] */,
7283 struct samr_PwInfo
*_info
/* [out] [ref] */)
7285 struct tevent_req
*req
;
7286 struct rpccli_samr_GetUserPwInfo_state
*state
;
7287 struct tevent_req
*subreq
;
7289 req
= tevent_req_create(mem_ctx
, &state
,
7290 struct rpccli_samr_GetUserPwInfo_state
);
7294 state
->out_mem_ctx
= NULL
;
7295 state
->dispatch_recv
= cli
->dispatch_recv
;
7298 state
->orig
.in
.user_handle
= _user_handle
;
7300 /* Out parameters */
7301 state
->orig
.out
.info
= _info
;
7304 ZERO_STRUCT(state
->orig
.out
.result
);
7306 if (DEBUGLEVEL
>= 10) {
7307 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo
, &state
->orig
);
7310 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7311 "rpccli_samr_GetUserPwInfo_out_memory");
7312 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7313 return tevent_req_post(req
, ev
);
7316 /* make a temporary copy, that we pass to the dispatch function */
7317 state
->tmp
= state
->orig
;
7319 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7321 NDR_SAMR_GETUSERPWINFO
,
7323 if (tevent_req_nomem(subreq
, req
)) {
7324 return tevent_req_post(req
, ev
);
7326 tevent_req_set_callback(subreq
, rpccli_samr_GetUserPwInfo_done
, req
);
7330 static void rpccli_samr_GetUserPwInfo_done(struct tevent_req
*subreq
)
7332 struct tevent_req
*req
= tevent_req_callback_data(
7333 subreq
, struct tevent_req
);
7334 struct rpccli_samr_GetUserPwInfo_state
*state
= tevent_req_data(
7335 req
, struct rpccli_samr_GetUserPwInfo_state
);
7337 TALLOC_CTX
*mem_ctx
;
7339 if (state
->out_mem_ctx
) {
7340 mem_ctx
= state
->out_mem_ctx
;
7345 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7346 TALLOC_FREE(subreq
);
7347 if (!NT_STATUS_IS_OK(status
)) {
7348 tevent_req_nterror(req
, status
);
7352 /* Copy out parameters */
7353 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
7356 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7358 /* Reset temporary structure */
7359 ZERO_STRUCT(state
->tmp
);
7361 if (DEBUGLEVEL
>= 10) {
7362 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo
, &state
->orig
);
7365 tevent_req_done(req
);
7368 NTSTATUS
rpccli_samr_GetUserPwInfo_recv(struct tevent_req
*req
,
7369 TALLOC_CTX
*mem_ctx
,
7372 struct rpccli_samr_GetUserPwInfo_state
*state
= tevent_req_data(
7373 req
, struct rpccli_samr_GetUserPwInfo_state
);
7376 if (tevent_req_is_nterror(req
, &status
)) {
7377 tevent_req_received(req
);
7381 /* Steal possbile out parameters to the callers context */
7382 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7385 *result
= state
->orig
.out
.result
;
7387 tevent_req_received(req
);
7388 return NT_STATUS_OK
;
7391 NTSTATUS
rpccli_samr_GetUserPwInfo(struct rpc_pipe_client
*cli
,
7392 TALLOC_CTX
*mem_ctx
,
7393 struct policy_handle
*user_handle
/* [in] [ref] */,
7394 struct samr_PwInfo
*info
/* [out] [ref] */)
7396 struct samr_GetUserPwInfo r
;
7400 r
.in
.user_handle
= user_handle
;
7402 if (DEBUGLEVEL
>= 10) {
7403 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo
, &r
);
7406 status
= cli
->dispatch(cli
,
7409 NDR_SAMR_GETUSERPWINFO
,
7412 if (!NT_STATUS_IS_OK(status
)) {
7416 if (DEBUGLEVEL
>= 10) {
7417 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo
, &r
);
7420 if (NT_STATUS_IS_ERR(status
)) {
7424 /* Return variables */
7425 *info
= *r
.out
.info
;
7428 return r
.out
.result
;
7431 struct rpccli_samr_RemoveMemberFromForeignDomain_state
{
7432 struct samr_RemoveMemberFromForeignDomain orig
;
7433 struct samr_RemoveMemberFromForeignDomain tmp
;
7434 TALLOC_CTX
*out_mem_ctx
;
7435 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7438 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req
*subreq
);
7440 struct tevent_req
*rpccli_samr_RemoveMemberFromForeignDomain_send(TALLOC_CTX
*mem_ctx
,
7441 struct tevent_context
*ev
,
7442 struct rpc_pipe_client
*cli
,
7443 struct policy_handle
*_domain_handle
/* [in] [ref] */,
7444 struct dom_sid2
*_sid
/* [in] [ref] */)
7446 struct tevent_req
*req
;
7447 struct rpccli_samr_RemoveMemberFromForeignDomain_state
*state
;
7448 struct tevent_req
*subreq
;
7450 req
= tevent_req_create(mem_ctx
, &state
,
7451 struct rpccli_samr_RemoveMemberFromForeignDomain_state
);
7455 state
->out_mem_ctx
= NULL
;
7456 state
->dispatch_recv
= cli
->dispatch_recv
;
7459 state
->orig
.in
.domain_handle
= _domain_handle
;
7460 state
->orig
.in
.sid
= _sid
;
7462 /* Out parameters */
7465 ZERO_STRUCT(state
->orig
.out
.result
);
7467 if (DEBUGLEVEL
>= 10) {
7468 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain
, &state
->orig
);
7471 /* make a temporary copy, that we pass to the dispatch function */
7472 state
->tmp
= state
->orig
;
7474 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7476 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN
,
7478 if (tevent_req_nomem(subreq
, req
)) {
7479 return tevent_req_post(req
, ev
);
7481 tevent_req_set_callback(subreq
, rpccli_samr_RemoveMemberFromForeignDomain_done
, req
);
7485 static void rpccli_samr_RemoveMemberFromForeignDomain_done(struct tevent_req
*subreq
)
7487 struct tevent_req
*req
= tevent_req_callback_data(
7488 subreq
, struct tevent_req
);
7489 struct rpccli_samr_RemoveMemberFromForeignDomain_state
*state
= tevent_req_data(
7490 req
, struct rpccli_samr_RemoveMemberFromForeignDomain_state
);
7492 TALLOC_CTX
*mem_ctx
;
7494 if (state
->out_mem_ctx
) {
7495 mem_ctx
= state
->out_mem_ctx
;
7500 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7501 TALLOC_FREE(subreq
);
7502 if (!NT_STATUS_IS_OK(status
)) {
7503 tevent_req_nterror(req
, status
);
7507 /* Copy out parameters */
7510 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7512 /* Reset temporary structure */
7513 ZERO_STRUCT(state
->tmp
);
7515 if (DEBUGLEVEL
>= 10) {
7516 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain
, &state
->orig
);
7519 tevent_req_done(req
);
7522 NTSTATUS
rpccli_samr_RemoveMemberFromForeignDomain_recv(struct tevent_req
*req
,
7523 TALLOC_CTX
*mem_ctx
,
7526 struct rpccli_samr_RemoveMemberFromForeignDomain_state
*state
= tevent_req_data(
7527 req
, struct rpccli_samr_RemoveMemberFromForeignDomain_state
);
7530 if (tevent_req_is_nterror(req
, &status
)) {
7531 tevent_req_received(req
);
7535 /* Steal possbile out parameters to the callers context */
7536 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7539 *result
= state
->orig
.out
.result
;
7541 tevent_req_received(req
);
7542 return NT_STATUS_OK
;
7545 NTSTATUS
rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client
*cli
,
7546 TALLOC_CTX
*mem_ctx
,
7547 struct policy_handle
*domain_handle
/* [in] [ref] */,
7548 struct dom_sid2
*sid
/* [in] [ref] */)
7550 struct samr_RemoveMemberFromForeignDomain r
;
7554 r
.in
.domain_handle
= domain_handle
;
7557 if (DEBUGLEVEL
>= 10) {
7558 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain
, &r
);
7561 status
= cli
->dispatch(cli
,
7564 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN
,
7567 if (!NT_STATUS_IS_OK(status
)) {
7571 if (DEBUGLEVEL
>= 10) {
7572 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain
, &r
);
7575 if (NT_STATUS_IS_ERR(status
)) {
7579 /* Return variables */
7582 return r
.out
.result
;
7585 struct rpccli_samr_QueryDomainInfo2_state
{
7586 struct samr_QueryDomainInfo2 orig
;
7587 struct samr_QueryDomainInfo2 tmp
;
7588 TALLOC_CTX
*out_mem_ctx
;
7589 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7592 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req
*subreq
);
7594 struct tevent_req
*rpccli_samr_QueryDomainInfo2_send(TALLOC_CTX
*mem_ctx
,
7595 struct tevent_context
*ev
,
7596 struct rpc_pipe_client
*cli
,
7597 struct policy_handle
*_domain_handle
/* [in] [ref] */,
7598 enum samr_DomainInfoClass _level
/* [in] */,
7599 union samr_DomainInfo
**_info
/* [out] [ref,switch_is(level)] */)
7601 struct tevent_req
*req
;
7602 struct rpccli_samr_QueryDomainInfo2_state
*state
;
7603 struct tevent_req
*subreq
;
7605 req
= tevent_req_create(mem_ctx
, &state
,
7606 struct rpccli_samr_QueryDomainInfo2_state
);
7610 state
->out_mem_ctx
= NULL
;
7611 state
->dispatch_recv
= cli
->dispatch_recv
;
7614 state
->orig
.in
.domain_handle
= _domain_handle
;
7615 state
->orig
.in
.level
= _level
;
7617 /* Out parameters */
7618 state
->orig
.out
.info
= _info
;
7621 ZERO_STRUCT(state
->orig
.out
.result
);
7623 if (DEBUGLEVEL
>= 10) {
7624 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2
, &state
->orig
);
7627 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7628 "rpccli_samr_QueryDomainInfo2_out_memory");
7629 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7630 return tevent_req_post(req
, ev
);
7633 /* make a temporary copy, that we pass to the dispatch function */
7634 state
->tmp
= state
->orig
;
7636 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7638 NDR_SAMR_QUERYDOMAININFO2
,
7640 if (tevent_req_nomem(subreq
, req
)) {
7641 return tevent_req_post(req
, ev
);
7643 tevent_req_set_callback(subreq
, rpccli_samr_QueryDomainInfo2_done
, req
);
7647 static void rpccli_samr_QueryDomainInfo2_done(struct tevent_req
*subreq
)
7649 struct tevent_req
*req
= tevent_req_callback_data(
7650 subreq
, struct tevent_req
);
7651 struct rpccli_samr_QueryDomainInfo2_state
*state
= tevent_req_data(
7652 req
, struct rpccli_samr_QueryDomainInfo2_state
);
7654 TALLOC_CTX
*mem_ctx
;
7656 if (state
->out_mem_ctx
) {
7657 mem_ctx
= state
->out_mem_ctx
;
7662 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7663 TALLOC_FREE(subreq
);
7664 if (!NT_STATUS_IS_OK(status
)) {
7665 tevent_req_nterror(req
, status
);
7669 /* Copy out parameters */
7670 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
7673 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7675 /* Reset temporary structure */
7676 ZERO_STRUCT(state
->tmp
);
7678 if (DEBUGLEVEL
>= 10) {
7679 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2
, &state
->orig
);
7682 tevent_req_done(req
);
7685 NTSTATUS
rpccli_samr_QueryDomainInfo2_recv(struct tevent_req
*req
,
7686 TALLOC_CTX
*mem_ctx
,
7689 struct rpccli_samr_QueryDomainInfo2_state
*state
= tevent_req_data(
7690 req
, struct rpccli_samr_QueryDomainInfo2_state
);
7693 if (tevent_req_is_nterror(req
, &status
)) {
7694 tevent_req_received(req
);
7698 /* Steal possbile out parameters to the callers context */
7699 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7702 *result
= state
->orig
.out
.result
;
7704 tevent_req_received(req
);
7705 return NT_STATUS_OK
;
7708 NTSTATUS
rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client
*cli
,
7709 TALLOC_CTX
*mem_ctx
,
7710 struct policy_handle
*domain_handle
/* [in] [ref] */,
7711 enum samr_DomainInfoClass level
/* [in] */,
7712 union samr_DomainInfo
**info
/* [out] [ref,switch_is(level)] */)
7714 struct samr_QueryDomainInfo2 r
;
7718 r
.in
.domain_handle
= domain_handle
;
7721 if (DEBUGLEVEL
>= 10) {
7722 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2
, &r
);
7725 status
= cli
->dispatch(cli
,
7728 NDR_SAMR_QUERYDOMAININFO2
,
7731 if (!NT_STATUS_IS_OK(status
)) {
7735 if (DEBUGLEVEL
>= 10) {
7736 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2
, &r
);
7739 if (NT_STATUS_IS_ERR(status
)) {
7743 /* Return variables */
7744 *info
= *r
.out
.info
;
7747 return r
.out
.result
;
7750 struct rpccli_samr_QueryUserInfo2_state
{
7751 struct samr_QueryUserInfo2 orig
;
7752 struct samr_QueryUserInfo2 tmp
;
7753 TALLOC_CTX
*out_mem_ctx
;
7754 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7757 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req
*subreq
);
7759 struct tevent_req
*rpccli_samr_QueryUserInfo2_send(TALLOC_CTX
*mem_ctx
,
7760 struct tevent_context
*ev
,
7761 struct rpc_pipe_client
*cli
,
7762 struct policy_handle
*_user_handle
/* [in] [ref] */,
7763 enum samr_UserInfoLevel _level
/* [in] */,
7764 union samr_UserInfo
**_info
/* [out] [ref,switch_is(level)] */)
7766 struct tevent_req
*req
;
7767 struct rpccli_samr_QueryUserInfo2_state
*state
;
7768 struct tevent_req
*subreq
;
7770 req
= tevent_req_create(mem_ctx
, &state
,
7771 struct rpccli_samr_QueryUserInfo2_state
);
7775 state
->out_mem_ctx
= NULL
;
7776 state
->dispatch_recv
= cli
->dispatch_recv
;
7779 state
->orig
.in
.user_handle
= _user_handle
;
7780 state
->orig
.in
.level
= _level
;
7782 /* Out parameters */
7783 state
->orig
.out
.info
= _info
;
7786 ZERO_STRUCT(state
->orig
.out
.result
);
7788 if (DEBUGLEVEL
>= 10) {
7789 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2
, &state
->orig
);
7792 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7793 "rpccli_samr_QueryUserInfo2_out_memory");
7794 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7795 return tevent_req_post(req
, ev
);
7798 /* make a temporary copy, that we pass to the dispatch function */
7799 state
->tmp
= state
->orig
;
7801 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7803 NDR_SAMR_QUERYUSERINFO2
,
7805 if (tevent_req_nomem(subreq
, req
)) {
7806 return tevent_req_post(req
, ev
);
7808 tevent_req_set_callback(subreq
, rpccli_samr_QueryUserInfo2_done
, req
);
7812 static void rpccli_samr_QueryUserInfo2_done(struct tevent_req
*subreq
)
7814 struct tevent_req
*req
= tevent_req_callback_data(
7815 subreq
, struct tevent_req
);
7816 struct rpccli_samr_QueryUserInfo2_state
*state
= tevent_req_data(
7817 req
, struct rpccli_samr_QueryUserInfo2_state
);
7819 TALLOC_CTX
*mem_ctx
;
7821 if (state
->out_mem_ctx
) {
7822 mem_ctx
= state
->out_mem_ctx
;
7827 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7828 TALLOC_FREE(subreq
);
7829 if (!NT_STATUS_IS_OK(status
)) {
7830 tevent_req_nterror(req
, status
);
7834 /* Copy out parameters */
7835 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
7838 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7840 /* Reset temporary structure */
7841 ZERO_STRUCT(state
->tmp
);
7843 if (DEBUGLEVEL
>= 10) {
7844 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2
, &state
->orig
);
7847 tevent_req_done(req
);
7850 NTSTATUS
rpccli_samr_QueryUserInfo2_recv(struct tevent_req
*req
,
7851 TALLOC_CTX
*mem_ctx
,
7854 struct rpccli_samr_QueryUserInfo2_state
*state
= tevent_req_data(
7855 req
, struct rpccli_samr_QueryUserInfo2_state
);
7858 if (tevent_req_is_nterror(req
, &status
)) {
7859 tevent_req_received(req
);
7863 /* Steal possbile out parameters to the callers context */
7864 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7867 *result
= state
->orig
.out
.result
;
7869 tevent_req_received(req
);
7870 return NT_STATUS_OK
;
7873 NTSTATUS
rpccli_samr_QueryUserInfo2(struct rpc_pipe_client
*cli
,
7874 TALLOC_CTX
*mem_ctx
,
7875 struct policy_handle
*user_handle
/* [in] [ref] */,
7876 enum samr_UserInfoLevel level
/* [in] */,
7877 union samr_UserInfo
**info
/* [out] [ref,switch_is(level)] */)
7879 struct samr_QueryUserInfo2 r
;
7883 r
.in
.user_handle
= user_handle
;
7886 if (DEBUGLEVEL
>= 10) {
7887 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2
, &r
);
7890 status
= cli
->dispatch(cli
,
7893 NDR_SAMR_QUERYUSERINFO2
,
7896 if (!NT_STATUS_IS_OK(status
)) {
7900 if (DEBUGLEVEL
>= 10) {
7901 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2
, &r
);
7904 if (NT_STATUS_IS_ERR(status
)) {
7908 /* Return variables */
7909 *info
= *r
.out
.info
;
7912 return r
.out
.result
;
7915 struct rpccli_samr_QueryDisplayInfo2_state
{
7916 struct samr_QueryDisplayInfo2 orig
;
7917 struct samr_QueryDisplayInfo2 tmp
;
7918 TALLOC_CTX
*out_mem_ctx
;
7919 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7922 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req
*subreq
);
7924 struct tevent_req
*rpccli_samr_QueryDisplayInfo2_send(TALLOC_CTX
*mem_ctx
,
7925 struct tevent_context
*ev
,
7926 struct rpc_pipe_client
*cli
,
7927 struct policy_handle
*_domain_handle
/* [in] [ref] */,
7928 uint16_t _level
/* [in] */,
7929 uint32_t _start_idx
/* [in] */,
7930 uint32_t _max_entries
/* [in] */,
7931 uint32_t _buf_size
/* [in] */,
7932 uint32_t *_total_size
/* [out] [ref] */,
7933 uint32_t *_returned_size
/* [out] [ref] */,
7934 union samr_DispInfo
*_info
/* [out] [ref,switch_is(level)] */)
7936 struct tevent_req
*req
;
7937 struct rpccli_samr_QueryDisplayInfo2_state
*state
;
7938 struct tevent_req
*subreq
;
7940 req
= tevent_req_create(mem_ctx
, &state
,
7941 struct rpccli_samr_QueryDisplayInfo2_state
);
7945 state
->out_mem_ctx
= NULL
;
7946 state
->dispatch_recv
= cli
->dispatch_recv
;
7949 state
->orig
.in
.domain_handle
= _domain_handle
;
7950 state
->orig
.in
.level
= _level
;
7951 state
->orig
.in
.start_idx
= _start_idx
;
7952 state
->orig
.in
.max_entries
= _max_entries
;
7953 state
->orig
.in
.buf_size
= _buf_size
;
7955 /* Out parameters */
7956 state
->orig
.out
.total_size
= _total_size
;
7957 state
->orig
.out
.returned_size
= _returned_size
;
7958 state
->orig
.out
.info
= _info
;
7961 ZERO_STRUCT(state
->orig
.out
.result
);
7963 if (DEBUGLEVEL
>= 10) {
7964 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2
, &state
->orig
);
7967 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7968 "rpccli_samr_QueryDisplayInfo2_out_memory");
7969 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7970 return tevent_req_post(req
, ev
);
7973 /* make a temporary copy, that we pass to the dispatch function */
7974 state
->tmp
= state
->orig
;
7976 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7978 NDR_SAMR_QUERYDISPLAYINFO2
,
7980 if (tevent_req_nomem(subreq
, req
)) {
7981 return tevent_req_post(req
, ev
);
7983 tevent_req_set_callback(subreq
, rpccli_samr_QueryDisplayInfo2_done
, req
);
7987 static void rpccli_samr_QueryDisplayInfo2_done(struct tevent_req
*subreq
)
7989 struct tevent_req
*req
= tevent_req_callback_data(
7990 subreq
, struct tevent_req
);
7991 struct rpccli_samr_QueryDisplayInfo2_state
*state
= tevent_req_data(
7992 req
, struct rpccli_samr_QueryDisplayInfo2_state
);
7994 TALLOC_CTX
*mem_ctx
;
7996 if (state
->out_mem_ctx
) {
7997 mem_ctx
= state
->out_mem_ctx
;
8002 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8003 TALLOC_FREE(subreq
);
8004 if (!NT_STATUS_IS_OK(status
)) {
8005 tevent_req_nterror(req
, status
);
8009 /* Copy out parameters */
8010 *state
->orig
.out
.total_size
= *state
->tmp
.out
.total_size
;
8011 *state
->orig
.out
.returned_size
= *state
->tmp
.out
.returned_size
;
8012 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
8015 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8017 /* Reset temporary structure */
8018 ZERO_STRUCT(state
->tmp
);
8020 if (DEBUGLEVEL
>= 10) {
8021 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2
, &state
->orig
);
8024 tevent_req_done(req
);
8027 NTSTATUS
rpccli_samr_QueryDisplayInfo2_recv(struct tevent_req
*req
,
8028 TALLOC_CTX
*mem_ctx
,
8031 struct rpccli_samr_QueryDisplayInfo2_state
*state
= tevent_req_data(
8032 req
, struct rpccli_samr_QueryDisplayInfo2_state
);
8035 if (tevent_req_is_nterror(req
, &status
)) {
8036 tevent_req_received(req
);
8040 /* Steal possbile out parameters to the callers context */
8041 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8044 *result
= state
->orig
.out
.result
;
8046 tevent_req_received(req
);
8047 return NT_STATUS_OK
;
8050 NTSTATUS
rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client
*cli
,
8051 TALLOC_CTX
*mem_ctx
,
8052 struct policy_handle
*domain_handle
/* [in] [ref] */,
8053 uint16_t level
/* [in] */,
8054 uint32_t start_idx
/* [in] */,
8055 uint32_t max_entries
/* [in] */,
8056 uint32_t buf_size
/* [in] */,
8057 uint32_t *total_size
/* [out] [ref] */,
8058 uint32_t *returned_size
/* [out] [ref] */,
8059 union samr_DispInfo
*info
/* [out] [ref,switch_is(level)] */)
8061 struct samr_QueryDisplayInfo2 r
;
8065 r
.in
.domain_handle
= domain_handle
;
8067 r
.in
.start_idx
= start_idx
;
8068 r
.in
.max_entries
= max_entries
;
8069 r
.in
.buf_size
= buf_size
;
8071 if (DEBUGLEVEL
>= 10) {
8072 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2
, &r
);
8075 status
= cli
->dispatch(cli
,
8078 NDR_SAMR_QUERYDISPLAYINFO2
,
8081 if (!NT_STATUS_IS_OK(status
)) {
8085 if (DEBUGLEVEL
>= 10) {
8086 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2
, &r
);
8089 if (NT_STATUS_IS_ERR(status
)) {
8093 /* Return variables */
8094 *total_size
= *r
.out
.total_size
;
8095 *returned_size
= *r
.out
.returned_size
;
8096 *info
= *r
.out
.info
;
8099 return r
.out
.result
;
8102 struct rpccli_samr_GetDisplayEnumerationIndex2_state
{
8103 struct samr_GetDisplayEnumerationIndex2 orig
;
8104 struct samr_GetDisplayEnumerationIndex2 tmp
;
8105 TALLOC_CTX
*out_mem_ctx
;
8106 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8109 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req
*subreq
);
8111 struct tevent_req
*rpccli_samr_GetDisplayEnumerationIndex2_send(TALLOC_CTX
*mem_ctx
,
8112 struct tevent_context
*ev
,
8113 struct rpc_pipe_client
*cli
,
8114 struct policy_handle
*_domain_handle
/* [in] [ref] */,
8115 uint16_t _level
/* [in] */,
8116 struct lsa_String
*_name
/* [in] [ref] */,
8117 uint32_t *_idx
/* [out] [ref] */)
8119 struct tevent_req
*req
;
8120 struct rpccli_samr_GetDisplayEnumerationIndex2_state
*state
;
8121 struct tevent_req
*subreq
;
8123 req
= tevent_req_create(mem_ctx
, &state
,
8124 struct rpccli_samr_GetDisplayEnumerationIndex2_state
);
8128 state
->out_mem_ctx
= NULL
;
8129 state
->dispatch_recv
= cli
->dispatch_recv
;
8132 state
->orig
.in
.domain_handle
= _domain_handle
;
8133 state
->orig
.in
.level
= _level
;
8134 state
->orig
.in
.name
= _name
;
8136 /* Out parameters */
8137 state
->orig
.out
.idx
= _idx
;
8140 ZERO_STRUCT(state
->orig
.out
.result
);
8142 if (DEBUGLEVEL
>= 10) {
8143 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2
, &state
->orig
);
8146 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8147 "rpccli_samr_GetDisplayEnumerationIndex2_out_memory");
8148 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8149 return tevent_req_post(req
, ev
);
8152 /* make a temporary copy, that we pass to the dispatch function */
8153 state
->tmp
= state
->orig
;
8155 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8157 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2
,
8159 if (tevent_req_nomem(subreq
, req
)) {
8160 return tevent_req_post(req
, ev
);
8162 tevent_req_set_callback(subreq
, rpccli_samr_GetDisplayEnumerationIndex2_done
, req
);
8166 static void rpccli_samr_GetDisplayEnumerationIndex2_done(struct tevent_req
*subreq
)
8168 struct tevent_req
*req
= tevent_req_callback_data(
8169 subreq
, struct tevent_req
);
8170 struct rpccli_samr_GetDisplayEnumerationIndex2_state
*state
= tevent_req_data(
8171 req
, struct rpccli_samr_GetDisplayEnumerationIndex2_state
);
8173 TALLOC_CTX
*mem_ctx
;
8175 if (state
->out_mem_ctx
) {
8176 mem_ctx
= state
->out_mem_ctx
;
8181 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8182 TALLOC_FREE(subreq
);
8183 if (!NT_STATUS_IS_OK(status
)) {
8184 tevent_req_nterror(req
, status
);
8188 /* Copy out parameters */
8189 *state
->orig
.out
.idx
= *state
->tmp
.out
.idx
;
8192 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8194 /* Reset temporary structure */
8195 ZERO_STRUCT(state
->tmp
);
8197 if (DEBUGLEVEL
>= 10) {
8198 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2
, &state
->orig
);
8201 tevent_req_done(req
);
8204 NTSTATUS
rpccli_samr_GetDisplayEnumerationIndex2_recv(struct tevent_req
*req
,
8205 TALLOC_CTX
*mem_ctx
,
8208 struct rpccli_samr_GetDisplayEnumerationIndex2_state
*state
= tevent_req_data(
8209 req
, struct rpccli_samr_GetDisplayEnumerationIndex2_state
);
8212 if (tevent_req_is_nterror(req
, &status
)) {
8213 tevent_req_received(req
);
8217 /* Steal possbile out parameters to the callers context */
8218 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8221 *result
= state
->orig
.out
.result
;
8223 tevent_req_received(req
);
8224 return NT_STATUS_OK
;
8227 NTSTATUS
rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client
*cli
,
8228 TALLOC_CTX
*mem_ctx
,
8229 struct policy_handle
*domain_handle
/* [in] [ref] */,
8230 uint16_t level
/* [in] */,
8231 struct lsa_String
*name
/* [in] [ref] */,
8232 uint32_t *idx
/* [out] [ref] */)
8234 struct samr_GetDisplayEnumerationIndex2 r
;
8238 r
.in
.domain_handle
= domain_handle
;
8242 if (DEBUGLEVEL
>= 10) {
8243 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2
, &r
);
8246 status
= cli
->dispatch(cli
,
8249 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2
,
8252 if (!NT_STATUS_IS_OK(status
)) {
8256 if (DEBUGLEVEL
>= 10) {
8257 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2
, &r
);
8260 if (NT_STATUS_IS_ERR(status
)) {
8264 /* Return variables */
8268 return r
.out
.result
;
8271 struct rpccli_samr_CreateUser2_state
{
8272 struct samr_CreateUser2 orig
;
8273 struct samr_CreateUser2 tmp
;
8274 TALLOC_CTX
*out_mem_ctx
;
8275 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8278 static void rpccli_samr_CreateUser2_done(struct tevent_req
*subreq
);
8280 struct tevent_req
*rpccli_samr_CreateUser2_send(TALLOC_CTX
*mem_ctx
,
8281 struct tevent_context
*ev
,
8282 struct rpc_pipe_client
*cli
,
8283 struct policy_handle
*_domain_handle
/* [in] [ref] */,
8284 struct lsa_String
*_account_name
/* [in] [ref] */,
8285 uint32_t _acct_flags
/* [in] */,
8286 uint32_t _access_mask
/* [in] */,
8287 struct policy_handle
*_user_handle
/* [out] [ref] */,
8288 uint32_t *_access_granted
/* [out] [ref] */,
8289 uint32_t *_rid
/* [out] [ref] */)
8291 struct tevent_req
*req
;
8292 struct rpccli_samr_CreateUser2_state
*state
;
8293 struct tevent_req
*subreq
;
8295 req
= tevent_req_create(mem_ctx
, &state
,
8296 struct rpccli_samr_CreateUser2_state
);
8300 state
->out_mem_ctx
= NULL
;
8301 state
->dispatch_recv
= cli
->dispatch_recv
;
8304 state
->orig
.in
.domain_handle
= _domain_handle
;
8305 state
->orig
.in
.account_name
= _account_name
;
8306 state
->orig
.in
.acct_flags
= _acct_flags
;
8307 state
->orig
.in
.access_mask
= _access_mask
;
8309 /* Out parameters */
8310 state
->orig
.out
.user_handle
= _user_handle
;
8311 state
->orig
.out
.access_granted
= _access_granted
;
8312 state
->orig
.out
.rid
= _rid
;
8315 ZERO_STRUCT(state
->orig
.out
.result
);
8317 if (DEBUGLEVEL
>= 10) {
8318 NDR_PRINT_IN_DEBUG(samr_CreateUser2
, &state
->orig
);
8321 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8322 "rpccli_samr_CreateUser2_out_memory");
8323 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8324 return tevent_req_post(req
, ev
);
8327 /* make a temporary copy, that we pass to the dispatch function */
8328 state
->tmp
= state
->orig
;
8330 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8332 NDR_SAMR_CREATEUSER2
,
8334 if (tevent_req_nomem(subreq
, req
)) {
8335 return tevent_req_post(req
, ev
);
8337 tevent_req_set_callback(subreq
, rpccli_samr_CreateUser2_done
, req
);
8341 static void rpccli_samr_CreateUser2_done(struct tevent_req
*subreq
)
8343 struct tevent_req
*req
= tevent_req_callback_data(
8344 subreq
, struct tevent_req
);
8345 struct rpccli_samr_CreateUser2_state
*state
= tevent_req_data(
8346 req
, struct rpccli_samr_CreateUser2_state
);
8348 TALLOC_CTX
*mem_ctx
;
8350 if (state
->out_mem_ctx
) {
8351 mem_ctx
= state
->out_mem_ctx
;
8356 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8357 TALLOC_FREE(subreq
);
8358 if (!NT_STATUS_IS_OK(status
)) {
8359 tevent_req_nterror(req
, status
);
8363 /* Copy out parameters */
8364 *state
->orig
.out
.user_handle
= *state
->tmp
.out
.user_handle
;
8365 *state
->orig
.out
.access_granted
= *state
->tmp
.out
.access_granted
;
8366 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
8369 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8371 /* Reset temporary structure */
8372 ZERO_STRUCT(state
->tmp
);
8374 if (DEBUGLEVEL
>= 10) {
8375 NDR_PRINT_OUT_DEBUG(samr_CreateUser2
, &state
->orig
);
8378 tevent_req_done(req
);
8381 NTSTATUS
rpccli_samr_CreateUser2_recv(struct tevent_req
*req
,
8382 TALLOC_CTX
*mem_ctx
,
8385 struct rpccli_samr_CreateUser2_state
*state
= tevent_req_data(
8386 req
, struct rpccli_samr_CreateUser2_state
);
8389 if (tevent_req_is_nterror(req
, &status
)) {
8390 tevent_req_received(req
);
8394 /* Steal possbile out parameters to the callers context */
8395 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8398 *result
= state
->orig
.out
.result
;
8400 tevent_req_received(req
);
8401 return NT_STATUS_OK
;
8404 NTSTATUS
rpccli_samr_CreateUser2(struct rpc_pipe_client
*cli
,
8405 TALLOC_CTX
*mem_ctx
,
8406 struct policy_handle
*domain_handle
/* [in] [ref] */,
8407 struct lsa_String
*account_name
/* [in] [ref] */,
8408 uint32_t acct_flags
/* [in] */,
8409 uint32_t access_mask
/* [in] */,
8410 struct policy_handle
*user_handle
/* [out] [ref] */,
8411 uint32_t *access_granted
/* [out] [ref] */,
8412 uint32_t *rid
/* [out] [ref] */)
8414 struct samr_CreateUser2 r
;
8418 r
.in
.domain_handle
= domain_handle
;
8419 r
.in
.account_name
= account_name
;
8420 r
.in
.acct_flags
= acct_flags
;
8421 r
.in
.access_mask
= access_mask
;
8423 if (DEBUGLEVEL
>= 10) {
8424 NDR_PRINT_IN_DEBUG(samr_CreateUser2
, &r
);
8427 status
= cli
->dispatch(cli
,
8430 NDR_SAMR_CREATEUSER2
,
8433 if (!NT_STATUS_IS_OK(status
)) {
8437 if (DEBUGLEVEL
>= 10) {
8438 NDR_PRINT_OUT_DEBUG(samr_CreateUser2
, &r
);
8441 if (NT_STATUS_IS_ERR(status
)) {
8445 /* Return variables */
8446 *user_handle
= *r
.out
.user_handle
;
8447 *access_granted
= *r
.out
.access_granted
;
8451 return r
.out
.result
;
8454 struct rpccli_samr_QueryDisplayInfo3_state
{
8455 struct samr_QueryDisplayInfo3 orig
;
8456 struct samr_QueryDisplayInfo3 tmp
;
8457 TALLOC_CTX
*out_mem_ctx
;
8458 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8461 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req
*subreq
);
8463 struct tevent_req
*rpccli_samr_QueryDisplayInfo3_send(TALLOC_CTX
*mem_ctx
,
8464 struct tevent_context
*ev
,
8465 struct rpc_pipe_client
*cli
,
8466 struct policy_handle
*_domain_handle
/* [in] [ref] */,
8467 uint16_t _level
/* [in] */,
8468 uint32_t _start_idx
/* [in] */,
8469 uint32_t _max_entries
/* [in] */,
8470 uint32_t _buf_size
/* [in] */,
8471 uint32_t *_total_size
/* [out] [ref] */,
8472 uint32_t *_returned_size
/* [out] [ref] */,
8473 union samr_DispInfo
*_info
/* [out] [ref,switch_is(level)] */)
8475 struct tevent_req
*req
;
8476 struct rpccli_samr_QueryDisplayInfo3_state
*state
;
8477 struct tevent_req
*subreq
;
8479 req
= tevent_req_create(mem_ctx
, &state
,
8480 struct rpccli_samr_QueryDisplayInfo3_state
);
8484 state
->out_mem_ctx
= NULL
;
8485 state
->dispatch_recv
= cli
->dispatch_recv
;
8488 state
->orig
.in
.domain_handle
= _domain_handle
;
8489 state
->orig
.in
.level
= _level
;
8490 state
->orig
.in
.start_idx
= _start_idx
;
8491 state
->orig
.in
.max_entries
= _max_entries
;
8492 state
->orig
.in
.buf_size
= _buf_size
;
8494 /* Out parameters */
8495 state
->orig
.out
.total_size
= _total_size
;
8496 state
->orig
.out
.returned_size
= _returned_size
;
8497 state
->orig
.out
.info
= _info
;
8500 ZERO_STRUCT(state
->orig
.out
.result
);
8502 if (DEBUGLEVEL
>= 10) {
8503 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3
, &state
->orig
);
8506 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8507 "rpccli_samr_QueryDisplayInfo3_out_memory");
8508 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8509 return tevent_req_post(req
, ev
);
8512 /* make a temporary copy, that we pass to the dispatch function */
8513 state
->tmp
= state
->orig
;
8515 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8517 NDR_SAMR_QUERYDISPLAYINFO3
,
8519 if (tevent_req_nomem(subreq
, req
)) {
8520 return tevent_req_post(req
, ev
);
8522 tevent_req_set_callback(subreq
, rpccli_samr_QueryDisplayInfo3_done
, req
);
8526 static void rpccli_samr_QueryDisplayInfo3_done(struct tevent_req
*subreq
)
8528 struct tevent_req
*req
= tevent_req_callback_data(
8529 subreq
, struct tevent_req
);
8530 struct rpccli_samr_QueryDisplayInfo3_state
*state
= tevent_req_data(
8531 req
, struct rpccli_samr_QueryDisplayInfo3_state
);
8533 TALLOC_CTX
*mem_ctx
;
8535 if (state
->out_mem_ctx
) {
8536 mem_ctx
= state
->out_mem_ctx
;
8541 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8542 TALLOC_FREE(subreq
);
8543 if (!NT_STATUS_IS_OK(status
)) {
8544 tevent_req_nterror(req
, status
);
8548 /* Copy out parameters */
8549 *state
->orig
.out
.total_size
= *state
->tmp
.out
.total_size
;
8550 *state
->orig
.out
.returned_size
= *state
->tmp
.out
.returned_size
;
8551 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
8554 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8556 /* Reset temporary structure */
8557 ZERO_STRUCT(state
->tmp
);
8559 if (DEBUGLEVEL
>= 10) {
8560 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3
, &state
->orig
);
8563 tevent_req_done(req
);
8566 NTSTATUS
rpccli_samr_QueryDisplayInfo3_recv(struct tevent_req
*req
,
8567 TALLOC_CTX
*mem_ctx
,
8570 struct rpccli_samr_QueryDisplayInfo3_state
*state
= tevent_req_data(
8571 req
, struct rpccli_samr_QueryDisplayInfo3_state
);
8574 if (tevent_req_is_nterror(req
, &status
)) {
8575 tevent_req_received(req
);
8579 /* Steal possbile out parameters to the callers context */
8580 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8583 *result
= state
->orig
.out
.result
;
8585 tevent_req_received(req
);
8586 return NT_STATUS_OK
;
8589 NTSTATUS
rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client
*cli
,
8590 TALLOC_CTX
*mem_ctx
,
8591 struct policy_handle
*domain_handle
/* [in] [ref] */,
8592 uint16_t level
/* [in] */,
8593 uint32_t start_idx
/* [in] */,
8594 uint32_t max_entries
/* [in] */,
8595 uint32_t buf_size
/* [in] */,
8596 uint32_t *total_size
/* [out] [ref] */,
8597 uint32_t *returned_size
/* [out] [ref] */,
8598 union samr_DispInfo
*info
/* [out] [ref,switch_is(level)] */)
8600 struct samr_QueryDisplayInfo3 r
;
8604 r
.in
.domain_handle
= domain_handle
;
8606 r
.in
.start_idx
= start_idx
;
8607 r
.in
.max_entries
= max_entries
;
8608 r
.in
.buf_size
= buf_size
;
8610 if (DEBUGLEVEL
>= 10) {
8611 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3
, &r
);
8614 status
= cli
->dispatch(cli
,
8617 NDR_SAMR_QUERYDISPLAYINFO3
,
8620 if (!NT_STATUS_IS_OK(status
)) {
8624 if (DEBUGLEVEL
>= 10) {
8625 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3
, &r
);
8628 if (NT_STATUS_IS_ERR(status
)) {
8632 /* Return variables */
8633 *total_size
= *r
.out
.total_size
;
8634 *returned_size
= *r
.out
.returned_size
;
8635 *info
= *r
.out
.info
;
8638 return r
.out
.result
;
8641 struct rpccli_samr_AddMultipleMembersToAlias_state
{
8642 struct samr_AddMultipleMembersToAlias orig
;
8643 struct samr_AddMultipleMembersToAlias tmp
;
8644 TALLOC_CTX
*out_mem_ctx
;
8645 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8648 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req
*subreq
);
8650 struct tevent_req
*rpccli_samr_AddMultipleMembersToAlias_send(TALLOC_CTX
*mem_ctx
,
8651 struct tevent_context
*ev
,
8652 struct rpc_pipe_client
*cli
,
8653 struct policy_handle
*_alias_handle
/* [in] [ref] */,
8654 struct lsa_SidArray
*_sids
/* [in] [ref] */)
8656 struct tevent_req
*req
;
8657 struct rpccli_samr_AddMultipleMembersToAlias_state
*state
;
8658 struct tevent_req
*subreq
;
8660 req
= tevent_req_create(mem_ctx
, &state
,
8661 struct rpccli_samr_AddMultipleMembersToAlias_state
);
8665 state
->out_mem_ctx
= NULL
;
8666 state
->dispatch_recv
= cli
->dispatch_recv
;
8669 state
->orig
.in
.alias_handle
= _alias_handle
;
8670 state
->orig
.in
.sids
= _sids
;
8672 /* Out parameters */
8675 ZERO_STRUCT(state
->orig
.out
.result
);
8677 if (DEBUGLEVEL
>= 10) {
8678 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias
, &state
->orig
);
8681 /* make a temporary copy, that we pass to the dispatch function */
8682 state
->tmp
= state
->orig
;
8684 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8686 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS
,
8688 if (tevent_req_nomem(subreq
, req
)) {
8689 return tevent_req_post(req
, ev
);
8691 tevent_req_set_callback(subreq
, rpccli_samr_AddMultipleMembersToAlias_done
, req
);
8695 static void rpccli_samr_AddMultipleMembersToAlias_done(struct tevent_req
*subreq
)
8697 struct tevent_req
*req
= tevent_req_callback_data(
8698 subreq
, struct tevent_req
);
8699 struct rpccli_samr_AddMultipleMembersToAlias_state
*state
= tevent_req_data(
8700 req
, struct rpccli_samr_AddMultipleMembersToAlias_state
);
8702 TALLOC_CTX
*mem_ctx
;
8704 if (state
->out_mem_ctx
) {
8705 mem_ctx
= state
->out_mem_ctx
;
8710 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8711 TALLOC_FREE(subreq
);
8712 if (!NT_STATUS_IS_OK(status
)) {
8713 tevent_req_nterror(req
, status
);
8717 /* Copy out parameters */
8720 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8722 /* Reset temporary structure */
8723 ZERO_STRUCT(state
->tmp
);
8725 if (DEBUGLEVEL
>= 10) {
8726 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias
, &state
->orig
);
8729 tevent_req_done(req
);
8732 NTSTATUS
rpccli_samr_AddMultipleMembersToAlias_recv(struct tevent_req
*req
,
8733 TALLOC_CTX
*mem_ctx
,
8736 struct rpccli_samr_AddMultipleMembersToAlias_state
*state
= tevent_req_data(
8737 req
, struct rpccli_samr_AddMultipleMembersToAlias_state
);
8740 if (tevent_req_is_nterror(req
, &status
)) {
8741 tevent_req_received(req
);
8745 /* Steal possbile out parameters to the callers context */
8746 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8749 *result
= state
->orig
.out
.result
;
8751 tevent_req_received(req
);
8752 return NT_STATUS_OK
;
8755 NTSTATUS
rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client
*cli
,
8756 TALLOC_CTX
*mem_ctx
,
8757 struct policy_handle
*alias_handle
/* [in] [ref] */,
8758 struct lsa_SidArray
*sids
/* [in] [ref] */)
8760 struct samr_AddMultipleMembersToAlias r
;
8764 r
.in
.alias_handle
= alias_handle
;
8767 if (DEBUGLEVEL
>= 10) {
8768 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias
, &r
);
8771 status
= cli
->dispatch(cli
,
8774 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS
,
8777 if (!NT_STATUS_IS_OK(status
)) {
8781 if (DEBUGLEVEL
>= 10) {
8782 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias
, &r
);
8785 if (NT_STATUS_IS_ERR(status
)) {
8789 /* Return variables */
8792 return r
.out
.result
;
8795 struct rpccli_samr_RemoveMultipleMembersFromAlias_state
{
8796 struct samr_RemoveMultipleMembersFromAlias orig
;
8797 struct samr_RemoveMultipleMembersFromAlias tmp
;
8798 TALLOC_CTX
*out_mem_ctx
;
8799 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8802 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req
*subreq
);
8804 struct tevent_req
*rpccli_samr_RemoveMultipleMembersFromAlias_send(TALLOC_CTX
*mem_ctx
,
8805 struct tevent_context
*ev
,
8806 struct rpc_pipe_client
*cli
,
8807 struct policy_handle
*_alias_handle
/* [in] [ref] */,
8808 struct lsa_SidArray
*_sids
/* [in] [ref] */)
8810 struct tevent_req
*req
;
8811 struct rpccli_samr_RemoveMultipleMembersFromAlias_state
*state
;
8812 struct tevent_req
*subreq
;
8814 req
= tevent_req_create(mem_ctx
, &state
,
8815 struct rpccli_samr_RemoveMultipleMembersFromAlias_state
);
8819 state
->out_mem_ctx
= NULL
;
8820 state
->dispatch_recv
= cli
->dispatch_recv
;
8823 state
->orig
.in
.alias_handle
= _alias_handle
;
8824 state
->orig
.in
.sids
= _sids
;
8826 /* Out parameters */
8829 ZERO_STRUCT(state
->orig
.out
.result
);
8831 if (DEBUGLEVEL
>= 10) {
8832 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias
, &state
->orig
);
8835 /* make a temporary copy, that we pass to the dispatch function */
8836 state
->tmp
= state
->orig
;
8838 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8840 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS
,
8842 if (tevent_req_nomem(subreq
, req
)) {
8843 return tevent_req_post(req
, ev
);
8845 tevent_req_set_callback(subreq
, rpccli_samr_RemoveMultipleMembersFromAlias_done
, req
);
8849 static void rpccli_samr_RemoveMultipleMembersFromAlias_done(struct tevent_req
*subreq
)
8851 struct tevent_req
*req
= tevent_req_callback_data(
8852 subreq
, struct tevent_req
);
8853 struct rpccli_samr_RemoveMultipleMembersFromAlias_state
*state
= tevent_req_data(
8854 req
, struct rpccli_samr_RemoveMultipleMembersFromAlias_state
);
8856 TALLOC_CTX
*mem_ctx
;
8858 if (state
->out_mem_ctx
) {
8859 mem_ctx
= state
->out_mem_ctx
;
8864 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8865 TALLOC_FREE(subreq
);
8866 if (!NT_STATUS_IS_OK(status
)) {
8867 tevent_req_nterror(req
, status
);
8871 /* Copy out parameters */
8874 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8876 /* Reset temporary structure */
8877 ZERO_STRUCT(state
->tmp
);
8879 if (DEBUGLEVEL
>= 10) {
8880 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias
, &state
->orig
);
8883 tevent_req_done(req
);
8886 NTSTATUS
rpccli_samr_RemoveMultipleMembersFromAlias_recv(struct tevent_req
*req
,
8887 TALLOC_CTX
*mem_ctx
,
8890 struct rpccli_samr_RemoveMultipleMembersFromAlias_state
*state
= tevent_req_data(
8891 req
, struct rpccli_samr_RemoveMultipleMembersFromAlias_state
);
8894 if (tevent_req_is_nterror(req
, &status
)) {
8895 tevent_req_received(req
);
8899 /* Steal possbile out parameters to the callers context */
8900 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8903 *result
= state
->orig
.out
.result
;
8905 tevent_req_received(req
);
8906 return NT_STATUS_OK
;
8909 NTSTATUS
rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client
*cli
,
8910 TALLOC_CTX
*mem_ctx
,
8911 struct policy_handle
*alias_handle
/* [in] [ref] */,
8912 struct lsa_SidArray
*sids
/* [in] [ref] */)
8914 struct samr_RemoveMultipleMembersFromAlias r
;
8918 r
.in
.alias_handle
= alias_handle
;
8921 if (DEBUGLEVEL
>= 10) {
8922 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias
, &r
);
8925 status
= cli
->dispatch(cli
,
8928 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS
,
8931 if (!NT_STATUS_IS_OK(status
)) {
8935 if (DEBUGLEVEL
>= 10) {
8936 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias
, &r
);
8939 if (NT_STATUS_IS_ERR(status
)) {
8943 /* Return variables */
8946 return r
.out
.result
;
8949 struct rpccli_samr_OemChangePasswordUser2_state
{
8950 struct samr_OemChangePasswordUser2 orig
;
8951 struct samr_OemChangePasswordUser2 tmp
;
8952 TALLOC_CTX
*out_mem_ctx
;
8953 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8956 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req
*subreq
);
8958 struct tevent_req
*rpccli_samr_OemChangePasswordUser2_send(TALLOC_CTX
*mem_ctx
,
8959 struct tevent_context
*ev
,
8960 struct rpc_pipe_client
*cli
,
8961 struct lsa_AsciiString
*_server
/* [in] [unique] */,
8962 struct lsa_AsciiString
*_account
/* [in] [ref] */,
8963 struct samr_CryptPassword
*_password
/* [in] [unique] */,
8964 struct samr_Password
*_hash
/* [in] [unique] */)
8966 struct tevent_req
*req
;
8967 struct rpccli_samr_OemChangePasswordUser2_state
*state
;
8968 struct tevent_req
*subreq
;
8970 req
= tevent_req_create(mem_ctx
, &state
,
8971 struct rpccli_samr_OemChangePasswordUser2_state
);
8975 state
->out_mem_ctx
= NULL
;
8976 state
->dispatch_recv
= cli
->dispatch_recv
;
8979 state
->orig
.in
.server
= _server
;
8980 state
->orig
.in
.account
= _account
;
8981 state
->orig
.in
.password
= _password
;
8982 state
->orig
.in
.hash
= _hash
;
8984 /* Out parameters */
8987 ZERO_STRUCT(state
->orig
.out
.result
);
8989 if (DEBUGLEVEL
>= 10) {
8990 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2
, &state
->orig
);
8993 /* make a temporary copy, that we pass to the dispatch function */
8994 state
->tmp
= state
->orig
;
8996 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8998 NDR_SAMR_OEMCHANGEPASSWORDUSER2
,
9000 if (tevent_req_nomem(subreq
, req
)) {
9001 return tevent_req_post(req
, ev
);
9003 tevent_req_set_callback(subreq
, rpccli_samr_OemChangePasswordUser2_done
, req
);
9007 static void rpccli_samr_OemChangePasswordUser2_done(struct tevent_req
*subreq
)
9009 struct tevent_req
*req
= tevent_req_callback_data(
9010 subreq
, struct tevent_req
);
9011 struct rpccli_samr_OemChangePasswordUser2_state
*state
= tevent_req_data(
9012 req
, struct rpccli_samr_OemChangePasswordUser2_state
);
9014 TALLOC_CTX
*mem_ctx
;
9016 if (state
->out_mem_ctx
) {
9017 mem_ctx
= state
->out_mem_ctx
;
9022 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9023 TALLOC_FREE(subreq
);
9024 if (!NT_STATUS_IS_OK(status
)) {
9025 tevent_req_nterror(req
, status
);
9029 /* Copy out parameters */
9032 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9034 /* Reset temporary structure */
9035 ZERO_STRUCT(state
->tmp
);
9037 if (DEBUGLEVEL
>= 10) {
9038 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2
, &state
->orig
);
9041 tevent_req_done(req
);
9044 NTSTATUS
rpccli_samr_OemChangePasswordUser2_recv(struct tevent_req
*req
,
9045 TALLOC_CTX
*mem_ctx
,
9048 struct rpccli_samr_OemChangePasswordUser2_state
*state
= tevent_req_data(
9049 req
, struct rpccli_samr_OemChangePasswordUser2_state
);
9052 if (tevent_req_is_nterror(req
, &status
)) {
9053 tevent_req_received(req
);
9057 /* Steal possbile out parameters to the callers context */
9058 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9061 *result
= state
->orig
.out
.result
;
9063 tevent_req_received(req
);
9064 return NT_STATUS_OK
;
9067 NTSTATUS
rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client
*cli
,
9068 TALLOC_CTX
*mem_ctx
,
9069 struct lsa_AsciiString
*server
/* [in] [unique] */,
9070 struct lsa_AsciiString
*account
/* [in] [ref] */,
9071 struct samr_CryptPassword
*password
/* [in] [unique] */,
9072 struct samr_Password
*hash
/* [in] [unique] */)
9074 struct samr_OemChangePasswordUser2 r
;
9078 r
.in
.server
= server
;
9079 r
.in
.account
= account
;
9080 r
.in
.password
= password
;
9083 if (DEBUGLEVEL
>= 10) {
9084 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2
, &r
);
9087 status
= cli
->dispatch(cli
,
9090 NDR_SAMR_OEMCHANGEPASSWORDUSER2
,
9093 if (!NT_STATUS_IS_OK(status
)) {
9097 if (DEBUGLEVEL
>= 10) {
9098 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2
, &r
);
9101 if (NT_STATUS_IS_ERR(status
)) {
9105 /* Return variables */
9108 return r
.out
.result
;
9111 struct rpccli_samr_ChangePasswordUser2_state
{
9112 struct samr_ChangePasswordUser2 orig
;
9113 struct samr_ChangePasswordUser2 tmp
;
9114 TALLOC_CTX
*out_mem_ctx
;
9115 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9118 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req
*subreq
);
9120 struct tevent_req
*rpccli_samr_ChangePasswordUser2_send(TALLOC_CTX
*mem_ctx
,
9121 struct tevent_context
*ev
,
9122 struct rpc_pipe_client
*cli
,
9123 struct lsa_String
*_server
/* [in] [unique] */,
9124 struct lsa_String
*_account
/* [in] [ref] */,
9125 struct samr_CryptPassword
*_nt_password
/* [in] [unique] */,
9126 struct samr_Password
*_nt_verifier
/* [in] [unique] */,
9127 uint8_t _lm_change
/* [in] */,
9128 struct samr_CryptPassword
*_lm_password
/* [in] [unique] */,
9129 struct samr_Password
*_lm_verifier
/* [in] [unique] */)
9131 struct tevent_req
*req
;
9132 struct rpccli_samr_ChangePasswordUser2_state
*state
;
9133 struct tevent_req
*subreq
;
9135 req
= tevent_req_create(mem_ctx
, &state
,
9136 struct rpccli_samr_ChangePasswordUser2_state
);
9140 state
->out_mem_ctx
= NULL
;
9141 state
->dispatch_recv
= cli
->dispatch_recv
;
9144 state
->orig
.in
.server
= _server
;
9145 state
->orig
.in
.account
= _account
;
9146 state
->orig
.in
.nt_password
= _nt_password
;
9147 state
->orig
.in
.nt_verifier
= _nt_verifier
;
9148 state
->orig
.in
.lm_change
= _lm_change
;
9149 state
->orig
.in
.lm_password
= _lm_password
;
9150 state
->orig
.in
.lm_verifier
= _lm_verifier
;
9152 /* Out parameters */
9155 ZERO_STRUCT(state
->orig
.out
.result
);
9157 if (DEBUGLEVEL
>= 10) {
9158 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2
, &state
->orig
);
9161 /* make a temporary copy, that we pass to the dispatch function */
9162 state
->tmp
= state
->orig
;
9164 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9166 NDR_SAMR_CHANGEPASSWORDUSER2
,
9168 if (tevent_req_nomem(subreq
, req
)) {
9169 return tevent_req_post(req
, ev
);
9171 tevent_req_set_callback(subreq
, rpccli_samr_ChangePasswordUser2_done
, req
);
9175 static void rpccli_samr_ChangePasswordUser2_done(struct tevent_req
*subreq
)
9177 struct tevent_req
*req
= tevent_req_callback_data(
9178 subreq
, struct tevent_req
);
9179 struct rpccli_samr_ChangePasswordUser2_state
*state
= tevent_req_data(
9180 req
, struct rpccli_samr_ChangePasswordUser2_state
);
9182 TALLOC_CTX
*mem_ctx
;
9184 if (state
->out_mem_ctx
) {
9185 mem_ctx
= state
->out_mem_ctx
;
9190 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9191 TALLOC_FREE(subreq
);
9192 if (!NT_STATUS_IS_OK(status
)) {
9193 tevent_req_nterror(req
, status
);
9197 /* Copy out parameters */
9200 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9202 /* Reset temporary structure */
9203 ZERO_STRUCT(state
->tmp
);
9205 if (DEBUGLEVEL
>= 10) {
9206 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2
, &state
->orig
);
9209 tevent_req_done(req
);
9212 NTSTATUS
rpccli_samr_ChangePasswordUser2_recv(struct tevent_req
*req
,
9213 TALLOC_CTX
*mem_ctx
,
9216 struct rpccli_samr_ChangePasswordUser2_state
*state
= tevent_req_data(
9217 req
, struct rpccli_samr_ChangePasswordUser2_state
);
9220 if (tevent_req_is_nterror(req
, &status
)) {
9221 tevent_req_received(req
);
9225 /* Steal possbile out parameters to the callers context */
9226 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9229 *result
= state
->orig
.out
.result
;
9231 tevent_req_received(req
);
9232 return NT_STATUS_OK
;
9235 NTSTATUS
rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client
*cli
,
9236 TALLOC_CTX
*mem_ctx
,
9237 struct lsa_String
*server
/* [in] [unique] */,
9238 struct lsa_String
*account
/* [in] [ref] */,
9239 struct samr_CryptPassword
*nt_password
/* [in] [unique] */,
9240 struct samr_Password
*nt_verifier
/* [in] [unique] */,
9241 uint8_t lm_change
/* [in] */,
9242 struct samr_CryptPassword
*lm_password
/* [in] [unique] */,
9243 struct samr_Password
*lm_verifier
/* [in] [unique] */)
9245 struct samr_ChangePasswordUser2 r
;
9249 r
.in
.server
= server
;
9250 r
.in
.account
= account
;
9251 r
.in
.nt_password
= nt_password
;
9252 r
.in
.nt_verifier
= nt_verifier
;
9253 r
.in
.lm_change
= lm_change
;
9254 r
.in
.lm_password
= lm_password
;
9255 r
.in
.lm_verifier
= lm_verifier
;
9257 if (DEBUGLEVEL
>= 10) {
9258 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2
, &r
);
9261 status
= cli
->dispatch(cli
,
9264 NDR_SAMR_CHANGEPASSWORDUSER2
,
9267 if (!NT_STATUS_IS_OK(status
)) {
9271 if (DEBUGLEVEL
>= 10) {
9272 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2
, &r
);
9275 if (NT_STATUS_IS_ERR(status
)) {
9279 /* Return variables */
9282 return r
.out
.result
;
9285 struct rpccli_samr_GetDomPwInfo_state
{
9286 struct samr_GetDomPwInfo orig
;
9287 struct samr_GetDomPwInfo tmp
;
9288 TALLOC_CTX
*out_mem_ctx
;
9289 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9292 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req
*subreq
);
9294 struct tevent_req
*rpccli_samr_GetDomPwInfo_send(TALLOC_CTX
*mem_ctx
,
9295 struct tevent_context
*ev
,
9296 struct rpc_pipe_client
*cli
,
9297 struct lsa_String
*_domain_name
/* [in] [unique] */,
9298 struct samr_PwInfo
*_info
/* [out] [ref] */)
9300 struct tevent_req
*req
;
9301 struct rpccli_samr_GetDomPwInfo_state
*state
;
9302 struct tevent_req
*subreq
;
9304 req
= tevent_req_create(mem_ctx
, &state
,
9305 struct rpccli_samr_GetDomPwInfo_state
);
9309 state
->out_mem_ctx
= NULL
;
9310 state
->dispatch_recv
= cli
->dispatch_recv
;
9313 state
->orig
.in
.domain_name
= _domain_name
;
9315 /* Out parameters */
9316 state
->orig
.out
.info
= _info
;
9319 ZERO_STRUCT(state
->orig
.out
.result
);
9321 if (DEBUGLEVEL
>= 10) {
9322 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo
, &state
->orig
);
9325 state
->out_mem_ctx
= talloc_named_const(state
, 0,
9326 "rpccli_samr_GetDomPwInfo_out_memory");
9327 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
9328 return tevent_req_post(req
, ev
);
9331 /* make a temporary copy, that we pass to the dispatch function */
9332 state
->tmp
= state
->orig
;
9334 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9336 NDR_SAMR_GETDOMPWINFO
,
9338 if (tevent_req_nomem(subreq
, req
)) {
9339 return tevent_req_post(req
, ev
);
9341 tevent_req_set_callback(subreq
, rpccli_samr_GetDomPwInfo_done
, req
);
9345 static void rpccli_samr_GetDomPwInfo_done(struct tevent_req
*subreq
)
9347 struct tevent_req
*req
= tevent_req_callback_data(
9348 subreq
, struct tevent_req
);
9349 struct rpccli_samr_GetDomPwInfo_state
*state
= tevent_req_data(
9350 req
, struct rpccli_samr_GetDomPwInfo_state
);
9352 TALLOC_CTX
*mem_ctx
;
9354 if (state
->out_mem_ctx
) {
9355 mem_ctx
= state
->out_mem_ctx
;
9360 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9361 TALLOC_FREE(subreq
);
9362 if (!NT_STATUS_IS_OK(status
)) {
9363 tevent_req_nterror(req
, status
);
9367 /* Copy out parameters */
9368 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
9371 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9373 /* Reset temporary structure */
9374 ZERO_STRUCT(state
->tmp
);
9376 if (DEBUGLEVEL
>= 10) {
9377 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo
, &state
->orig
);
9380 tevent_req_done(req
);
9383 NTSTATUS
rpccli_samr_GetDomPwInfo_recv(struct tevent_req
*req
,
9384 TALLOC_CTX
*mem_ctx
,
9387 struct rpccli_samr_GetDomPwInfo_state
*state
= tevent_req_data(
9388 req
, struct rpccli_samr_GetDomPwInfo_state
);
9391 if (tevent_req_is_nterror(req
, &status
)) {
9392 tevent_req_received(req
);
9396 /* Steal possbile out parameters to the callers context */
9397 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9400 *result
= state
->orig
.out
.result
;
9402 tevent_req_received(req
);
9403 return NT_STATUS_OK
;
9406 NTSTATUS
rpccli_samr_GetDomPwInfo(struct rpc_pipe_client
*cli
,
9407 TALLOC_CTX
*mem_ctx
,
9408 struct lsa_String
*domain_name
/* [in] [unique] */,
9409 struct samr_PwInfo
*info
/* [out] [ref] */)
9411 struct samr_GetDomPwInfo r
;
9415 r
.in
.domain_name
= domain_name
;
9417 if (DEBUGLEVEL
>= 10) {
9418 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo
, &r
);
9421 status
= cli
->dispatch(cli
,
9424 NDR_SAMR_GETDOMPWINFO
,
9427 if (!NT_STATUS_IS_OK(status
)) {
9431 if (DEBUGLEVEL
>= 10) {
9432 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo
, &r
);
9435 if (NT_STATUS_IS_ERR(status
)) {
9439 /* Return variables */
9440 *info
= *r
.out
.info
;
9443 return r
.out
.result
;
9446 struct rpccli_samr_Connect2_state
{
9447 struct samr_Connect2 orig
;
9448 struct samr_Connect2 tmp
;
9449 TALLOC_CTX
*out_mem_ctx
;
9450 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9453 static void rpccli_samr_Connect2_done(struct tevent_req
*subreq
);
9455 struct tevent_req
*rpccli_samr_Connect2_send(TALLOC_CTX
*mem_ctx
,
9456 struct tevent_context
*ev
,
9457 struct rpc_pipe_client
*cli
,
9458 const char *_system_name
/* [in] [unique,charset(UTF16)] */,
9459 uint32_t _access_mask
/* [in] */,
9460 struct policy_handle
*_connect_handle
/* [out] [ref] */)
9462 struct tevent_req
*req
;
9463 struct rpccli_samr_Connect2_state
*state
;
9464 struct tevent_req
*subreq
;
9466 req
= tevent_req_create(mem_ctx
, &state
,
9467 struct rpccli_samr_Connect2_state
);
9471 state
->out_mem_ctx
= NULL
;
9472 state
->dispatch_recv
= cli
->dispatch_recv
;
9475 state
->orig
.in
.system_name
= _system_name
;
9476 state
->orig
.in
.access_mask
= _access_mask
;
9478 /* Out parameters */
9479 state
->orig
.out
.connect_handle
= _connect_handle
;
9482 ZERO_STRUCT(state
->orig
.out
.result
);
9484 if (DEBUGLEVEL
>= 10) {
9485 NDR_PRINT_IN_DEBUG(samr_Connect2
, &state
->orig
);
9488 state
->out_mem_ctx
= talloc_named_const(state
, 0,
9489 "rpccli_samr_Connect2_out_memory");
9490 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
9491 return tevent_req_post(req
, ev
);
9494 /* make a temporary copy, that we pass to the dispatch function */
9495 state
->tmp
= state
->orig
;
9497 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9501 if (tevent_req_nomem(subreq
, req
)) {
9502 return tevent_req_post(req
, ev
);
9504 tevent_req_set_callback(subreq
, rpccli_samr_Connect2_done
, req
);
9508 static void rpccli_samr_Connect2_done(struct tevent_req
*subreq
)
9510 struct tevent_req
*req
= tevent_req_callback_data(
9511 subreq
, struct tevent_req
);
9512 struct rpccli_samr_Connect2_state
*state
= tevent_req_data(
9513 req
, struct rpccli_samr_Connect2_state
);
9515 TALLOC_CTX
*mem_ctx
;
9517 if (state
->out_mem_ctx
) {
9518 mem_ctx
= state
->out_mem_ctx
;
9523 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9524 TALLOC_FREE(subreq
);
9525 if (!NT_STATUS_IS_OK(status
)) {
9526 tevent_req_nterror(req
, status
);
9530 /* Copy out parameters */
9531 *state
->orig
.out
.connect_handle
= *state
->tmp
.out
.connect_handle
;
9534 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9536 /* Reset temporary structure */
9537 ZERO_STRUCT(state
->tmp
);
9539 if (DEBUGLEVEL
>= 10) {
9540 NDR_PRINT_OUT_DEBUG(samr_Connect2
, &state
->orig
);
9543 tevent_req_done(req
);
9546 NTSTATUS
rpccli_samr_Connect2_recv(struct tevent_req
*req
,
9547 TALLOC_CTX
*mem_ctx
,
9550 struct rpccli_samr_Connect2_state
*state
= tevent_req_data(
9551 req
, struct rpccli_samr_Connect2_state
);
9554 if (tevent_req_is_nterror(req
, &status
)) {
9555 tevent_req_received(req
);
9559 /* Steal possbile out parameters to the callers context */
9560 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9563 *result
= state
->orig
.out
.result
;
9565 tevent_req_received(req
);
9566 return NT_STATUS_OK
;
9569 NTSTATUS
rpccli_samr_Connect2(struct rpc_pipe_client
*cli
,
9570 TALLOC_CTX
*mem_ctx
,
9571 const char *system_name
/* [in] [unique,charset(UTF16)] */,
9572 uint32_t access_mask
/* [in] */,
9573 struct policy_handle
*connect_handle
/* [out] [ref] */)
9575 struct samr_Connect2 r
;
9579 r
.in
.system_name
= system_name
;
9580 r
.in
.access_mask
= access_mask
;
9582 if (DEBUGLEVEL
>= 10) {
9583 NDR_PRINT_IN_DEBUG(samr_Connect2
, &r
);
9586 status
= cli
->dispatch(cli
,
9592 if (!NT_STATUS_IS_OK(status
)) {
9596 if (DEBUGLEVEL
>= 10) {
9597 NDR_PRINT_OUT_DEBUG(samr_Connect2
, &r
);
9600 if (NT_STATUS_IS_ERR(status
)) {
9604 /* Return variables */
9605 *connect_handle
= *r
.out
.connect_handle
;
9608 return r
.out
.result
;
9611 struct rpccli_samr_SetUserInfo2_state
{
9612 struct samr_SetUserInfo2 orig
;
9613 struct samr_SetUserInfo2 tmp
;
9614 TALLOC_CTX
*out_mem_ctx
;
9615 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9618 static void rpccli_samr_SetUserInfo2_done(struct tevent_req
*subreq
);
9620 struct tevent_req
*rpccli_samr_SetUserInfo2_send(TALLOC_CTX
*mem_ctx
,
9621 struct tevent_context
*ev
,
9622 struct rpc_pipe_client
*cli
,
9623 struct policy_handle
*_user_handle
/* [in] [ref] */,
9624 enum samr_UserInfoLevel _level
/* [in] */,
9625 union samr_UserInfo
*_info
/* [in] [ref,switch_is(level)] */)
9627 struct tevent_req
*req
;
9628 struct rpccli_samr_SetUserInfo2_state
*state
;
9629 struct tevent_req
*subreq
;
9631 req
= tevent_req_create(mem_ctx
, &state
,
9632 struct rpccli_samr_SetUserInfo2_state
);
9636 state
->out_mem_ctx
= NULL
;
9637 state
->dispatch_recv
= cli
->dispatch_recv
;
9640 state
->orig
.in
.user_handle
= _user_handle
;
9641 state
->orig
.in
.level
= _level
;
9642 state
->orig
.in
.info
= _info
;
9644 /* Out parameters */
9647 ZERO_STRUCT(state
->orig
.out
.result
);
9649 if (DEBUGLEVEL
>= 10) {
9650 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2
, &state
->orig
);
9653 /* make a temporary copy, that we pass to the dispatch function */
9654 state
->tmp
= state
->orig
;
9656 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9658 NDR_SAMR_SETUSERINFO2
,
9660 if (tevent_req_nomem(subreq
, req
)) {
9661 return tevent_req_post(req
, ev
);
9663 tevent_req_set_callback(subreq
, rpccli_samr_SetUserInfo2_done
, req
);
9667 static void rpccli_samr_SetUserInfo2_done(struct tevent_req
*subreq
)
9669 struct tevent_req
*req
= tevent_req_callback_data(
9670 subreq
, struct tevent_req
);
9671 struct rpccli_samr_SetUserInfo2_state
*state
= tevent_req_data(
9672 req
, struct rpccli_samr_SetUserInfo2_state
);
9674 TALLOC_CTX
*mem_ctx
;
9676 if (state
->out_mem_ctx
) {
9677 mem_ctx
= state
->out_mem_ctx
;
9682 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9683 TALLOC_FREE(subreq
);
9684 if (!NT_STATUS_IS_OK(status
)) {
9685 tevent_req_nterror(req
, status
);
9689 /* Copy out parameters */
9692 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9694 /* Reset temporary structure */
9695 ZERO_STRUCT(state
->tmp
);
9697 if (DEBUGLEVEL
>= 10) {
9698 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2
, &state
->orig
);
9701 tevent_req_done(req
);
9704 NTSTATUS
rpccli_samr_SetUserInfo2_recv(struct tevent_req
*req
,
9705 TALLOC_CTX
*mem_ctx
,
9708 struct rpccli_samr_SetUserInfo2_state
*state
= tevent_req_data(
9709 req
, struct rpccli_samr_SetUserInfo2_state
);
9712 if (tevent_req_is_nterror(req
, &status
)) {
9713 tevent_req_received(req
);
9717 /* Steal possbile out parameters to the callers context */
9718 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9721 *result
= state
->orig
.out
.result
;
9723 tevent_req_received(req
);
9724 return NT_STATUS_OK
;
9727 NTSTATUS
rpccli_samr_SetUserInfo2(struct rpc_pipe_client
*cli
,
9728 TALLOC_CTX
*mem_ctx
,
9729 struct policy_handle
*user_handle
/* [in] [ref] */,
9730 enum samr_UserInfoLevel level
/* [in] */,
9731 union samr_UserInfo
*info
/* [in] [ref,switch_is(level)] */)
9733 struct samr_SetUserInfo2 r
;
9737 r
.in
.user_handle
= user_handle
;
9741 if (DEBUGLEVEL
>= 10) {
9742 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2
, &r
);
9745 status
= cli
->dispatch(cli
,
9748 NDR_SAMR_SETUSERINFO2
,
9751 if (!NT_STATUS_IS_OK(status
)) {
9755 if (DEBUGLEVEL
>= 10) {
9756 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2
, &r
);
9759 if (NT_STATUS_IS_ERR(status
)) {
9763 /* Return variables */
9766 return r
.out
.result
;
9769 struct rpccli_samr_SetBootKeyInformation_state
{
9770 struct samr_SetBootKeyInformation orig
;
9771 struct samr_SetBootKeyInformation tmp
;
9772 TALLOC_CTX
*out_mem_ctx
;
9773 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9776 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req
*subreq
);
9778 struct tevent_req
*rpccli_samr_SetBootKeyInformation_send(TALLOC_CTX
*mem_ctx
,
9779 struct tevent_context
*ev
,
9780 struct rpc_pipe_client
*cli
,
9781 struct policy_handle
*_connect_handle
/* [in] [ref] */,
9782 uint32_t _unknown1
/* [in] */,
9783 uint32_t _unknown2
/* [in] */,
9784 uint32_t _unknown3
/* [in] */)
9786 struct tevent_req
*req
;
9787 struct rpccli_samr_SetBootKeyInformation_state
*state
;
9788 struct tevent_req
*subreq
;
9790 req
= tevent_req_create(mem_ctx
, &state
,
9791 struct rpccli_samr_SetBootKeyInformation_state
);
9795 state
->out_mem_ctx
= NULL
;
9796 state
->dispatch_recv
= cli
->dispatch_recv
;
9799 state
->orig
.in
.connect_handle
= _connect_handle
;
9800 state
->orig
.in
.unknown1
= _unknown1
;
9801 state
->orig
.in
.unknown2
= _unknown2
;
9802 state
->orig
.in
.unknown3
= _unknown3
;
9804 /* Out parameters */
9807 ZERO_STRUCT(state
->orig
.out
.result
);
9809 if (DEBUGLEVEL
>= 10) {
9810 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation
, &state
->orig
);
9813 /* make a temporary copy, that we pass to the dispatch function */
9814 state
->tmp
= state
->orig
;
9816 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9818 NDR_SAMR_SETBOOTKEYINFORMATION
,
9820 if (tevent_req_nomem(subreq
, req
)) {
9821 return tevent_req_post(req
, ev
);
9823 tevent_req_set_callback(subreq
, rpccli_samr_SetBootKeyInformation_done
, req
);
9827 static void rpccli_samr_SetBootKeyInformation_done(struct tevent_req
*subreq
)
9829 struct tevent_req
*req
= tevent_req_callback_data(
9830 subreq
, struct tevent_req
);
9831 struct rpccli_samr_SetBootKeyInformation_state
*state
= tevent_req_data(
9832 req
, struct rpccli_samr_SetBootKeyInformation_state
);
9834 TALLOC_CTX
*mem_ctx
;
9836 if (state
->out_mem_ctx
) {
9837 mem_ctx
= state
->out_mem_ctx
;
9842 status
= state
->dispatch_recv(subreq
, mem_ctx
);
9843 TALLOC_FREE(subreq
);
9844 if (!NT_STATUS_IS_OK(status
)) {
9845 tevent_req_nterror(req
, status
);
9849 /* Copy out parameters */
9852 state
->orig
.out
.result
= state
->tmp
.out
.result
;
9854 /* Reset temporary structure */
9855 ZERO_STRUCT(state
->tmp
);
9857 if (DEBUGLEVEL
>= 10) {
9858 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation
, &state
->orig
);
9861 tevent_req_done(req
);
9864 NTSTATUS
rpccli_samr_SetBootKeyInformation_recv(struct tevent_req
*req
,
9865 TALLOC_CTX
*mem_ctx
,
9868 struct rpccli_samr_SetBootKeyInformation_state
*state
= tevent_req_data(
9869 req
, struct rpccli_samr_SetBootKeyInformation_state
);
9872 if (tevent_req_is_nterror(req
, &status
)) {
9873 tevent_req_received(req
);
9877 /* Steal possbile out parameters to the callers context */
9878 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
9881 *result
= state
->orig
.out
.result
;
9883 tevent_req_received(req
);
9884 return NT_STATUS_OK
;
9887 NTSTATUS
rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client
*cli
,
9888 TALLOC_CTX
*mem_ctx
,
9889 struct policy_handle
*connect_handle
/* [in] [ref] */,
9890 uint32_t unknown1
/* [in] */,
9891 uint32_t unknown2
/* [in] */,
9892 uint32_t unknown3
/* [in] */)
9894 struct samr_SetBootKeyInformation r
;
9898 r
.in
.connect_handle
= connect_handle
;
9899 r
.in
.unknown1
= unknown1
;
9900 r
.in
.unknown2
= unknown2
;
9901 r
.in
.unknown3
= unknown3
;
9903 if (DEBUGLEVEL
>= 10) {
9904 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation
, &r
);
9907 status
= cli
->dispatch(cli
,
9910 NDR_SAMR_SETBOOTKEYINFORMATION
,
9913 if (!NT_STATUS_IS_OK(status
)) {
9917 if (DEBUGLEVEL
>= 10) {
9918 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation
, &r
);
9921 if (NT_STATUS_IS_ERR(status
)) {
9925 /* Return variables */
9928 return r
.out
.result
;
9931 struct rpccli_samr_GetBootKeyInformation_state
{
9932 struct samr_GetBootKeyInformation orig
;
9933 struct samr_GetBootKeyInformation tmp
;
9934 TALLOC_CTX
*out_mem_ctx
;
9935 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
9938 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req
*subreq
);
9940 struct tevent_req
*rpccli_samr_GetBootKeyInformation_send(TALLOC_CTX
*mem_ctx
,
9941 struct tevent_context
*ev
,
9942 struct rpc_pipe_client
*cli
,
9943 struct policy_handle
*_domain_handle
/* [in] [ref] */,
9944 uint32_t *_unknown
/* [out] [ref] */)
9946 struct tevent_req
*req
;
9947 struct rpccli_samr_GetBootKeyInformation_state
*state
;
9948 struct tevent_req
*subreq
;
9950 req
= tevent_req_create(mem_ctx
, &state
,
9951 struct rpccli_samr_GetBootKeyInformation_state
);
9955 state
->out_mem_ctx
= NULL
;
9956 state
->dispatch_recv
= cli
->dispatch_recv
;
9959 state
->orig
.in
.domain_handle
= _domain_handle
;
9961 /* Out parameters */
9962 state
->orig
.out
.unknown
= _unknown
;
9965 ZERO_STRUCT(state
->orig
.out
.result
);
9967 if (DEBUGLEVEL
>= 10) {
9968 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation
, &state
->orig
);
9971 state
->out_mem_ctx
= talloc_named_const(state
, 0,
9972 "rpccli_samr_GetBootKeyInformation_out_memory");
9973 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
9974 return tevent_req_post(req
, ev
);
9977 /* make a temporary copy, that we pass to the dispatch function */
9978 state
->tmp
= state
->orig
;
9980 subreq
= cli
->dispatch_send(state
, ev
, cli
,
9982 NDR_SAMR_GETBOOTKEYINFORMATION
,
9984 if (tevent_req_nomem(subreq
, req
)) {
9985 return tevent_req_post(req
, ev
);
9987 tevent_req_set_callback(subreq
, rpccli_samr_GetBootKeyInformation_done
, req
);
9991 static void rpccli_samr_GetBootKeyInformation_done(struct tevent_req
*subreq
)
9993 struct tevent_req
*req
= tevent_req_callback_data(
9994 subreq
, struct tevent_req
);
9995 struct rpccli_samr_GetBootKeyInformation_state
*state
= tevent_req_data(
9996 req
, struct rpccli_samr_GetBootKeyInformation_state
);
9998 TALLOC_CTX
*mem_ctx
;
10000 if (state
->out_mem_ctx
) {
10001 mem_ctx
= state
->out_mem_ctx
;
10006 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10007 TALLOC_FREE(subreq
);
10008 if (!NT_STATUS_IS_OK(status
)) {
10009 tevent_req_nterror(req
, status
);
10013 /* Copy out parameters */
10014 *state
->orig
.out
.unknown
= *state
->tmp
.out
.unknown
;
10017 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10019 /* Reset temporary structure */
10020 ZERO_STRUCT(state
->tmp
);
10022 if (DEBUGLEVEL
>= 10) {
10023 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation
, &state
->orig
);
10026 tevent_req_done(req
);
10029 NTSTATUS
rpccli_samr_GetBootKeyInformation_recv(struct tevent_req
*req
,
10030 TALLOC_CTX
*mem_ctx
,
10033 struct rpccli_samr_GetBootKeyInformation_state
*state
= tevent_req_data(
10034 req
, struct rpccli_samr_GetBootKeyInformation_state
);
10037 if (tevent_req_is_nterror(req
, &status
)) {
10038 tevent_req_received(req
);
10042 /* Steal possbile out parameters to the callers context */
10043 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10045 /* Return result */
10046 *result
= state
->orig
.out
.result
;
10048 tevent_req_received(req
);
10049 return NT_STATUS_OK
;
10052 NTSTATUS
rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client
*cli
,
10053 TALLOC_CTX
*mem_ctx
,
10054 struct policy_handle
*domain_handle
/* [in] [ref] */,
10055 uint32_t *unknown
/* [out] [ref] */)
10057 struct samr_GetBootKeyInformation r
;
10060 /* In parameters */
10061 r
.in
.domain_handle
= domain_handle
;
10063 if (DEBUGLEVEL
>= 10) {
10064 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation
, &r
);
10067 status
= cli
->dispatch(cli
,
10070 NDR_SAMR_GETBOOTKEYINFORMATION
,
10073 if (!NT_STATUS_IS_OK(status
)) {
10077 if (DEBUGLEVEL
>= 10) {
10078 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation
, &r
);
10081 if (NT_STATUS_IS_ERR(status
)) {
10085 /* Return variables */
10086 *unknown
= *r
.out
.unknown
;
10088 /* Return result */
10089 return r
.out
.result
;
10092 struct rpccli_samr_Connect3_state
{
10093 struct samr_Connect3 orig
;
10094 struct samr_Connect3 tmp
;
10095 TALLOC_CTX
*out_mem_ctx
;
10096 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10099 static void rpccli_samr_Connect3_done(struct tevent_req
*subreq
);
10101 struct tevent_req
*rpccli_samr_Connect3_send(TALLOC_CTX
*mem_ctx
,
10102 struct tevent_context
*ev
,
10103 struct rpc_pipe_client
*cli
,
10104 const char *_system_name
/* [in] [unique,charset(UTF16)] */,
10105 uint32_t _unknown
/* [in] */,
10106 uint32_t _access_mask
/* [in] */,
10107 struct policy_handle
*_connect_handle
/* [out] [ref] */)
10109 struct tevent_req
*req
;
10110 struct rpccli_samr_Connect3_state
*state
;
10111 struct tevent_req
*subreq
;
10113 req
= tevent_req_create(mem_ctx
, &state
,
10114 struct rpccli_samr_Connect3_state
);
10118 state
->out_mem_ctx
= NULL
;
10119 state
->dispatch_recv
= cli
->dispatch_recv
;
10121 /* In parameters */
10122 state
->orig
.in
.system_name
= _system_name
;
10123 state
->orig
.in
.unknown
= _unknown
;
10124 state
->orig
.in
.access_mask
= _access_mask
;
10126 /* Out parameters */
10127 state
->orig
.out
.connect_handle
= _connect_handle
;
10130 ZERO_STRUCT(state
->orig
.out
.result
);
10132 if (DEBUGLEVEL
>= 10) {
10133 NDR_PRINT_IN_DEBUG(samr_Connect3
, &state
->orig
);
10136 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10137 "rpccli_samr_Connect3_out_memory");
10138 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10139 return tevent_req_post(req
, ev
);
10142 /* make a temporary copy, that we pass to the dispatch function */
10143 state
->tmp
= state
->orig
;
10145 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10149 if (tevent_req_nomem(subreq
, req
)) {
10150 return tevent_req_post(req
, ev
);
10152 tevent_req_set_callback(subreq
, rpccli_samr_Connect3_done
, req
);
10156 static void rpccli_samr_Connect3_done(struct tevent_req
*subreq
)
10158 struct tevent_req
*req
= tevent_req_callback_data(
10159 subreq
, struct tevent_req
);
10160 struct rpccli_samr_Connect3_state
*state
= tevent_req_data(
10161 req
, struct rpccli_samr_Connect3_state
);
10163 TALLOC_CTX
*mem_ctx
;
10165 if (state
->out_mem_ctx
) {
10166 mem_ctx
= state
->out_mem_ctx
;
10171 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10172 TALLOC_FREE(subreq
);
10173 if (!NT_STATUS_IS_OK(status
)) {
10174 tevent_req_nterror(req
, status
);
10178 /* Copy out parameters */
10179 *state
->orig
.out
.connect_handle
= *state
->tmp
.out
.connect_handle
;
10182 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10184 /* Reset temporary structure */
10185 ZERO_STRUCT(state
->tmp
);
10187 if (DEBUGLEVEL
>= 10) {
10188 NDR_PRINT_OUT_DEBUG(samr_Connect3
, &state
->orig
);
10191 tevent_req_done(req
);
10194 NTSTATUS
rpccli_samr_Connect3_recv(struct tevent_req
*req
,
10195 TALLOC_CTX
*mem_ctx
,
10198 struct rpccli_samr_Connect3_state
*state
= tevent_req_data(
10199 req
, struct rpccli_samr_Connect3_state
);
10202 if (tevent_req_is_nterror(req
, &status
)) {
10203 tevent_req_received(req
);
10207 /* Steal possbile out parameters to the callers context */
10208 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10210 /* Return result */
10211 *result
= state
->orig
.out
.result
;
10213 tevent_req_received(req
);
10214 return NT_STATUS_OK
;
10217 NTSTATUS
rpccli_samr_Connect3(struct rpc_pipe_client
*cli
,
10218 TALLOC_CTX
*mem_ctx
,
10219 const char *system_name
/* [in] [unique,charset(UTF16)] */,
10220 uint32_t unknown
/* [in] */,
10221 uint32_t access_mask
/* [in] */,
10222 struct policy_handle
*connect_handle
/* [out] [ref] */)
10224 struct samr_Connect3 r
;
10227 /* In parameters */
10228 r
.in
.system_name
= system_name
;
10229 r
.in
.unknown
= unknown
;
10230 r
.in
.access_mask
= access_mask
;
10232 if (DEBUGLEVEL
>= 10) {
10233 NDR_PRINT_IN_DEBUG(samr_Connect3
, &r
);
10236 status
= cli
->dispatch(cli
,
10242 if (!NT_STATUS_IS_OK(status
)) {
10246 if (DEBUGLEVEL
>= 10) {
10247 NDR_PRINT_OUT_DEBUG(samr_Connect3
, &r
);
10250 if (NT_STATUS_IS_ERR(status
)) {
10254 /* Return variables */
10255 *connect_handle
= *r
.out
.connect_handle
;
10257 /* Return result */
10258 return r
.out
.result
;
10261 struct rpccli_samr_Connect4_state
{
10262 struct samr_Connect4 orig
;
10263 struct samr_Connect4 tmp
;
10264 TALLOC_CTX
*out_mem_ctx
;
10265 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10268 static void rpccli_samr_Connect4_done(struct tevent_req
*subreq
);
10270 struct tevent_req
*rpccli_samr_Connect4_send(TALLOC_CTX
*mem_ctx
,
10271 struct tevent_context
*ev
,
10272 struct rpc_pipe_client
*cli
,
10273 const char *_system_name
/* [in] [unique,charset(UTF16)] */,
10274 enum samr_ConnectVersion _client_version
/* [in] */,
10275 uint32_t _access_mask
/* [in] */,
10276 struct policy_handle
*_connect_handle
/* [out] [ref] */)
10278 struct tevent_req
*req
;
10279 struct rpccli_samr_Connect4_state
*state
;
10280 struct tevent_req
*subreq
;
10282 req
= tevent_req_create(mem_ctx
, &state
,
10283 struct rpccli_samr_Connect4_state
);
10287 state
->out_mem_ctx
= NULL
;
10288 state
->dispatch_recv
= cli
->dispatch_recv
;
10290 /* In parameters */
10291 state
->orig
.in
.system_name
= _system_name
;
10292 state
->orig
.in
.client_version
= _client_version
;
10293 state
->orig
.in
.access_mask
= _access_mask
;
10295 /* Out parameters */
10296 state
->orig
.out
.connect_handle
= _connect_handle
;
10299 ZERO_STRUCT(state
->orig
.out
.result
);
10301 if (DEBUGLEVEL
>= 10) {
10302 NDR_PRINT_IN_DEBUG(samr_Connect4
, &state
->orig
);
10305 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10306 "rpccli_samr_Connect4_out_memory");
10307 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10308 return tevent_req_post(req
, ev
);
10311 /* make a temporary copy, that we pass to the dispatch function */
10312 state
->tmp
= state
->orig
;
10314 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10318 if (tevent_req_nomem(subreq
, req
)) {
10319 return tevent_req_post(req
, ev
);
10321 tevent_req_set_callback(subreq
, rpccli_samr_Connect4_done
, req
);
10325 static void rpccli_samr_Connect4_done(struct tevent_req
*subreq
)
10327 struct tevent_req
*req
= tevent_req_callback_data(
10328 subreq
, struct tevent_req
);
10329 struct rpccli_samr_Connect4_state
*state
= tevent_req_data(
10330 req
, struct rpccli_samr_Connect4_state
);
10332 TALLOC_CTX
*mem_ctx
;
10334 if (state
->out_mem_ctx
) {
10335 mem_ctx
= state
->out_mem_ctx
;
10340 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10341 TALLOC_FREE(subreq
);
10342 if (!NT_STATUS_IS_OK(status
)) {
10343 tevent_req_nterror(req
, status
);
10347 /* Copy out parameters */
10348 *state
->orig
.out
.connect_handle
= *state
->tmp
.out
.connect_handle
;
10351 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10353 /* Reset temporary structure */
10354 ZERO_STRUCT(state
->tmp
);
10356 if (DEBUGLEVEL
>= 10) {
10357 NDR_PRINT_OUT_DEBUG(samr_Connect4
, &state
->orig
);
10360 tevent_req_done(req
);
10363 NTSTATUS
rpccli_samr_Connect4_recv(struct tevent_req
*req
,
10364 TALLOC_CTX
*mem_ctx
,
10367 struct rpccli_samr_Connect4_state
*state
= tevent_req_data(
10368 req
, struct rpccli_samr_Connect4_state
);
10371 if (tevent_req_is_nterror(req
, &status
)) {
10372 tevent_req_received(req
);
10376 /* Steal possbile out parameters to the callers context */
10377 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10379 /* Return result */
10380 *result
= state
->orig
.out
.result
;
10382 tevent_req_received(req
);
10383 return NT_STATUS_OK
;
10386 NTSTATUS
rpccli_samr_Connect4(struct rpc_pipe_client
*cli
,
10387 TALLOC_CTX
*mem_ctx
,
10388 const char *system_name
/* [in] [unique,charset(UTF16)] */,
10389 enum samr_ConnectVersion client_version
/* [in] */,
10390 uint32_t access_mask
/* [in] */,
10391 struct policy_handle
*connect_handle
/* [out] [ref] */)
10393 struct samr_Connect4 r
;
10396 /* In parameters */
10397 r
.in
.system_name
= system_name
;
10398 r
.in
.client_version
= client_version
;
10399 r
.in
.access_mask
= access_mask
;
10401 if (DEBUGLEVEL
>= 10) {
10402 NDR_PRINT_IN_DEBUG(samr_Connect4
, &r
);
10405 status
= cli
->dispatch(cli
,
10411 if (!NT_STATUS_IS_OK(status
)) {
10415 if (DEBUGLEVEL
>= 10) {
10416 NDR_PRINT_OUT_DEBUG(samr_Connect4
, &r
);
10419 if (NT_STATUS_IS_ERR(status
)) {
10423 /* Return variables */
10424 *connect_handle
= *r
.out
.connect_handle
;
10426 /* Return result */
10427 return r
.out
.result
;
10430 struct rpccli_samr_ChangePasswordUser3_state
{
10431 struct samr_ChangePasswordUser3 orig
;
10432 struct samr_ChangePasswordUser3 tmp
;
10433 TALLOC_CTX
*out_mem_ctx
;
10434 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10437 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req
*subreq
);
10439 struct tevent_req
*rpccli_samr_ChangePasswordUser3_send(TALLOC_CTX
*mem_ctx
,
10440 struct tevent_context
*ev
,
10441 struct rpc_pipe_client
*cli
,
10442 struct lsa_String
*_server
/* [in] [unique] */,
10443 struct lsa_String
*_account
/* [in] [ref] */,
10444 struct samr_CryptPassword
*_nt_password
/* [in] [unique] */,
10445 struct samr_Password
*_nt_verifier
/* [in] [unique] */,
10446 uint8_t _lm_change
/* [in] */,
10447 struct samr_CryptPassword
*_lm_password
/* [in] [unique] */,
10448 struct samr_Password
*_lm_verifier
/* [in] [unique] */,
10449 struct samr_CryptPassword
*_password3
/* [in] [unique] */,
10450 struct samr_DomInfo1
**_dominfo
/* [out] [ref] */,
10451 struct samr_ChangeReject
**_reject
/* [out] [ref] */)
10453 struct tevent_req
*req
;
10454 struct rpccli_samr_ChangePasswordUser3_state
*state
;
10455 struct tevent_req
*subreq
;
10457 req
= tevent_req_create(mem_ctx
, &state
,
10458 struct rpccli_samr_ChangePasswordUser3_state
);
10462 state
->out_mem_ctx
= NULL
;
10463 state
->dispatch_recv
= cli
->dispatch_recv
;
10465 /* In parameters */
10466 state
->orig
.in
.server
= _server
;
10467 state
->orig
.in
.account
= _account
;
10468 state
->orig
.in
.nt_password
= _nt_password
;
10469 state
->orig
.in
.nt_verifier
= _nt_verifier
;
10470 state
->orig
.in
.lm_change
= _lm_change
;
10471 state
->orig
.in
.lm_password
= _lm_password
;
10472 state
->orig
.in
.lm_verifier
= _lm_verifier
;
10473 state
->orig
.in
.password3
= _password3
;
10475 /* Out parameters */
10476 state
->orig
.out
.dominfo
= _dominfo
;
10477 state
->orig
.out
.reject
= _reject
;
10480 ZERO_STRUCT(state
->orig
.out
.result
);
10482 if (DEBUGLEVEL
>= 10) {
10483 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3
, &state
->orig
);
10486 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10487 "rpccli_samr_ChangePasswordUser3_out_memory");
10488 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10489 return tevent_req_post(req
, ev
);
10492 /* make a temporary copy, that we pass to the dispatch function */
10493 state
->tmp
= state
->orig
;
10495 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10497 NDR_SAMR_CHANGEPASSWORDUSER3
,
10499 if (tevent_req_nomem(subreq
, req
)) {
10500 return tevent_req_post(req
, ev
);
10502 tevent_req_set_callback(subreq
, rpccli_samr_ChangePasswordUser3_done
, req
);
10506 static void rpccli_samr_ChangePasswordUser3_done(struct tevent_req
*subreq
)
10508 struct tevent_req
*req
= tevent_req_callback_data(
10509 subreq
, struct tevent_req
);
10510 struct rpccli_samr_ChangePasswordUser3_state
*state
= tevent_req_data(
10511 req
, struct rpccli_samr_ChangePasswordUser3_state
);
10513 TALLOC_CTX
*mem_ctx
;
10515 if (state
->out_mem_ctx
) {
10516 mem_ctx
= state
->out_mem_ctx
;
10521 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10522 TALLOC_FREE(subreq
);
10523 if (!NT_STATUS_IS_OK(status
)) {
10524 tevent_req_nterror(req
, status
);
10528 /* Copy out parameters */
10529 *state
->orig
.out
.dominfo
= *state
->tmp
.out
.dominfo
;
10530 *state
->orig
.out
.reject
= *state
->tmp
.out
.reject
;
10533 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10535 /* Reset temporary structure */
10536 ZERO_STRUCT(state
->tmp
);
10538 if (DEBUGLEVEL
>= 10) {
10539 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3
, &state
->orig
);
10542 tevent_req_done(req
);
10545 NTSTATUS
rpccli_samr_ChangePasswordUser3_recv(struct tevent_req
*req
,
10546 TALLOC_CTX
*mem_ctx
,
10549 struct rpccli_samr_ChangePasswordUser3_state
*state
= tevent_req_data(
10550 req
, struct rpccli_samr_ChangePasswordUser3_state
);
10553 if (tevent_req_is_nterror(req
, &status
)) {
10554 tevent_req_received(req
);
10558 /* Steal possbile out parameters to the callers context */
10559 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10561 /* Return result */
10562 *result
= state
->orig
.out
.result
;
10564 tevent_req_received(req
);
10565 return NT_STATUS_OK
;
10568 NTSTATUS
rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client
*cli
,
10569 TALLOC_CTX
*mem_ctx
,
10570 struct lsa_String
*server
/* [in] [unique] */,
10571 struct lsa_String
*account
/* [in] [ref] */,
10572 struct samr_CryptPassword
*nt_password
/* [in] [unique] */,
10573 struct samr_Password
*nt_verifier
/* [in] [unique] */,
10574 uint8_t lm_change
/* [in] */,
10575 struct samr_CryptPassword
*lm_password
/* [in] [unique] */,
10576 struct samr_Password
*lm_verifier
/* [in] [unique] */,
10577 struct samr_CryptPassword
*password3
/* [in] [unique] */,
10578 struct samr_DomInfo1
**dominfo
/* [out] [ref] */,
10579 struct samr_ChangeReject
**reject
/* [out] [ref] */)
10581 struct samr_ChangePasswordUser3 r
;
10584 /* In parameters */
10585 r
.in
.server
= server
;
10586 r
.in
.account
= account
;
10587 r
.in
.nt_password
= nt_password
;
10588 r
.in
.nt_verifier
= nt_verifier
;
10589 r
.in
.lm_change
= lm_change
;
10590 r
.in
.lm_password
= lm_password
;
10591 r
.in
.lm_verifier
= lm_verifier
;
10592 r
.in
.password3
= password3
;
10594 if (DEBUGLEVEL
>= 10) {
10595 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3
, &r
);
10598 status
= cli
->dispatch(cli
,
10601 NDR_SAMR_CHANGEPASSWORDUSER3
,
10604 if (!NT_STATUS_IS_OK(status
)) {
10608 if (DEBUGLEVEL
>= 10) {
10609 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3
, &r
);
10612 if (NT_STATUS_IS_ERR(status
)) {
10616 /* Return variables */
10617 *dominfo
= *r
.out
.dominfo
;
10618 *reject
= *r
.out
.reject
;
10620 /* Return result */
10621 return r
.out
.result
;
10624 struct rpccli_samr_Connect5_state
{
10625 struct samr_Connect5 orig
;
10626 struct samr_Connect5 tmp
;
10627 TALLOC_CTX
*out_mem_ctx
;
10628 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10631 static void rpccli_samr_Connect5_done(struct tevent_req
*subreq
);
10633 struct tevent_req
*rpccli_samr_Connect5_send(TALLOC_CTX
*mem_ctx
,
10634 struct tevent_context
*ev
,
10635 struct rpc_pipe_client
*cli
,
10636 const char *_system_name
/* [in] [unique,charset(UTF16)] */,
10637 uint32_t _access_mask
/* [in] */,
10638 uint32_t _level_in
/* [in] */,
10639 union samr_ConnectInfo
*_info_in
/* [in] [ref,switch_is(level_in)] */,
10640 uint32_t *_level_out
/* [out] [ref] */,
10641 union samr_ConnectInfo
*_info_out
/* [out] [ref,switch_is(*level_out)] */,
10642 struct policy_handle
*_connect_handle
/* [out] [ref] */)
10644 struct tevent_req
*req
;
10645 struct rpccli_samr_Connect5_state
*state
;
10646 struct tevent_req
*subreq
;
10648 req
= tevent_req_create(mem_ctx
, &state
,
10649 struct rpccli_samr_Connect5_state
);
10653 state
->out_mem_ctx
= NULL
;
10654 state
->dispatch_recv
= cli
->dispatch_recv
;
10656 /* In parameters */
10657 state
->orig
.in
.system_name
= _system_name
;
10658 state
->orig
.in
.access_mask
= _access_mask
;
10659 state
->orig
.in
.level_in
= _level_in
;
10660 state
->orig
.in
.info_in
= _info_in
;
10662 /* Out parameters */
10663 state
->orig
.out
.level_out
= _level_out
;
10664 state
->orig
.out
.info_out
= _info_out
;
10665 state
->orig
.out
.connect_handle
= _connect_handle
;
10668 ZERO_STRUCT(state
->orig
.out
.result
);
10670 if (DEBUGLEVEL
>= 10) {
10671 NDR_PRINT_IN_DEBUG(samr_Connect5
, &state
->orig
);
10674 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10675 "rpccli_samr_Connect5_out_memory");
10676 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10677 return tevent_req_post(req
, ev
);
10680 /* make a temporary copy, that we pass to the dispatch function */
10681 state
->tmp
= state
->orig
;
10683 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10687 if (tevent_req_nomem(subreq
, req
)) {
10688 return tevent_req_post(req
, ev
);
10690 tevent_req_set_callback(subreq
, rpccli_samr_Connect5_done
, req
);
10694 static void rpccli_samr_Connect5_done(struct tevent_req
*subreq
)
10696 struct tevent_req
*req
= tevent_req_callback_data(
10697 subreq
, struct tevent_req
);
10698 struct rpccli_samr_Connect5_state
*state
= tevent_req_data(
10699 req
, struct rpccli_samr_Connect5_state
);
10701 TALLOC_CTX
*mem_ctx
;
10703 if (state
->out_mem_ctx
) {
10704 mem_ctx
= state
->out_mem_ctx
;
10709 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10710 TALLOC_FREE(subreq
);
10711 if (!NT_STATUS_IS_OK(status
)) {
10712 tevent_req_nterror(req
, status
);
10716 /* Copy out parameters */
10717 *state
->orig
.out
.level_out
= *state
->tmp
.out
.level_out
;
10718 *state
->orig
.out
.info_out
= *state
->tmp
.out
.info_out
;
10719 *state
->orig
.out
.connect_handle
= *state
->tmp
.out
.connect_handle
;
10722 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10724 /* Reset temporary structure */
10725 ZERO_STRUCT(state
->tmp
);
10727 if (DEBUGLEVEL
>= 10) {
10728 NDR_PRINT_OUT_DEBUG(samr_Connect5
, &state
->orig
);
10731 tevent_req_done(req
);
10734 NTSTATUS
rpccli_samr_Connect5_recv(struct tevent_req
*req
,
10735 TALLOC_CTX
*mem_ctx
,
10738 struct rpccli_samr_Connect5_state
*state
= tevent_req_data(
10739 req
, struct rpccli_samr_Connect5_state
);
10742 if (tevent_req_is_nterror(req
, &status
)) {
10743 tevent_req_received(req
);
10747 /* Steal possbile out parameters to the callers context */
10748 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10750 /* Return result */
10751 *result
= state
->orig
.out
.result
;
10753 tevent_req_received(req
);
10754 return NT_STATUS_OK
;
10757 NTSTATUS
rpccli_samr_Connect5(struct rpc_pipe_client
*cli
,
10758 TALLOC_CTX
*mem_ctx
,
10759 const char *system_name
/* [in] [unique,charset(UTF16)] */,
10760 uint32_t access_mask
/* [in] */,
10761 uint32_t level_in
/* [in] */,
10762 union samr_ConnectInfo
*info_in
/* [in] [ref,switch_is(level_in)] */,
10763 uint32_t *level_out
/* [out] [ref] */,
10764 union samr_ConnectInfo
*info_out
/* [out] [ref,switch_is(*level_out)] */,
10765 struct policy_handle
*connect_handle
/* [out] [ref] */)
10767 struct samr_Connect5 r
;
10770 /* In parameters */
10771 r
.in
.system_name
= system_name
;
10772 r
.in
.access_mask
= access_mask
;
10773 r
.in
.level_in
= level_in
;
10774 r
.in
.info_in
= info_in
;
10776 if (DEBUGLEVEL
>= 10) {
10777 NDR_PRINT_IN_DEBUG(samr_Connect5
, &r
);
10780 status
= cli
->dispatch(cli
,
10786 if (!NT_STATUS_IS_OK(status
)) {
10790 if (DEBUGLEVEL
>= 10) {
10791 NDR_PRINT_OUT_DEBUG(samr_Connect5
, &r
);
10794 if (NT_STATUS_IS_ERR(status
)) {
10798 /* Return variables */
10799 *level_out
= *r
.out
.level_out
;
10800 *info_out
= *r
.out
.info_out
;
10801 *connect_handle
= *r
.out
.connect_handle
;
10803 /* Return result */
10804 return r
.out
.result
;
10807 struct rpccli_samr_RidToSid_state
{
10808 struct samr_RidToSid orig
;
10809 struct samr_RidToSid tmp
;
10810 TALLOC_CTX
*out_mem_ctx
;
10811 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10814 static void rpccli_samr_RidToSid_done(struct tevent_req
*subreq
);
10816 struct tevent_req
*rpccli_samr_RidToSid_send(TALLOC_CTX
*mem_ctx
,
10817 struct tevent_context
*ev
,
10818 struct rpc_pipe_client
*cli
,
10819 struct policy_handle
*_domain_handle
/* [in] [ref] */,
10820 uint32_t _rid
/* [in] */,
10821 struct dom_sid2
**_sid
/* [out] [ref] */)
10823 struct tevent_req
*req
;
10824 struct rpccli_samr_RidToSid_state
*state
;
10825 struct tevent_req
*subreq
;
10827 req
= tevent_req_create(mem_ctx
, &state
,
10828 struct rpccli_samr_RidToSid_state
);
10832 state
->out_mem_ctx
= NULL
;
10833 state
->dispatch_recv
= cli
->dispatch_recv
;
10835 /* In parameters */
10836 state
->orig
.in
.domain_handle
= _domain_handle
;
10837 state
->orig
.in
.rid
= _rid
;
10839 /* Out parameters */
10840 state
->orig
.out
.sid
= _sid
;
10843 ZERO_STRUCT(state
->orig
.out
.result
);
10845 if (DEBUGLEVEL
>= 10) {
10846 NDR_PRINT_IN_DEBUG(samr_RidToSid
, &state
->orig
);
10849 state
->out_mem_ctx
= talloc_named_const(state
, 0,
10850 "rpccli_samr_RidToSid_out_memory");
10851 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
10852 return tevent_req_post(req
, ev
);
10855 /* make a temporary copy, that we pass to the dispatch function */
10856 state
->tmp
= state
->orig
;
10858 subreq
= cli
->dispatch_send(state
, ev
, cli
,
10862 if (tevent_req_nomem(subreq
, req
)) {
10863 return tevent_req_post(req
, ev
);
10865 tevent_req_set_callback(subreq
, rpccli_samr_RidToSid_done
, req
);
10869 static void rpccli_samr_RidToSid_done(struct tevent_req
*subreq
)
10871 struct tevent_req
*req
= tevent_req_callback_data(
10872 subreq
, struct tevent_req
);
10873 struct rpccli_samr_RidToSid_state
*state
= tevent_req_data(
10874 req
, struct rpccli_samr_RidToSid_state
);
10876 TALLOC_CTX
*mem_ctx
;
10878 if (state
->out_mem_ctx
) {
10879 mem_ctx
= state
->out_mem_ctx
;
10884 status
= state
->dispatch_recv(subreq
, mem_ctx
);
10885 TALLOC_FREE(subreq
);
10886 if (!NT_STATUS_IS_OK(status
)) {
10887 tevent_req_nterror(req
, status
);
10891 /* Copy out parameters */
10892 *state
->orig
.out
.sid
= *state
->tmp
.out
.sid
;
10895 state
->orig
.out
.result
= state
->tmp
.out
.result
;
10897 /* Reset temporary structure */
10898 ZERO_STRUCT(state
->tmp
);
10900 if (DEBUGLEVEL
>= 10) {
10901 NDR_PRINT_OUT_DEBUG(samr_RidToSid
, &state
->orig
);
10904 tevent_req_done(req
);
10907 NTSTATUS
rpccli_samr_RidToSid_recv(struct tevent_req
*req
,
10908 TALLOC_CTX
*mem_ctx
,
10911 struct rpccli_samr_RidToSid_state
*state
= tevent_req_data(
10912 req
, struct rpccli_samr_RidToSid_state
);
10915 if (tevent_req_is_nterror(req
, &status
)) {
10916 tevent_req_received(req
);
10920 /* Steal possbile out parameters to the callers context */
10921 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
10923 /* Return result */
10924 *result
= state
->orig
.out
.result
;
10926 tevent_req_received(req
);
10927 return NT_STATUS_OK
;
10930 NTSTATUS
rpccli_samr_RidToSid(struct rpc_pipe_client
*cli
,
10931 TALLOC_CTX
*mem_ctx
,
10932 struct policy_handle
*domain_handle
/* [in] [ref] */,
10933 uint32_t rid
/* [in] */,
10934 struct dom_sid2
**sid
/* [out] [ref] */)
10936 struct samr_RidToSid r
;
10939 /* In parameters */
10940 r
.in
.domain_handle
= domain_handle
;
10943 if (DEBUGLEVEL
>= 10) {
10944 NDR_PRINT_IN_DEBUG(samr_RidToSid
, &r
);
10947 status
= cli
->dispatch(cli
,
10953 if (!NT_STATUS_IS_OK(status
)) {
10957 if (DEBUGLEVEL
>= 10) {
10958 NDR_PRINT_OUT_DEBUG(samr_RidToSid
, &r
);
10961 if (NT_STATUS_IS_ERR(status
)) {
10965 /* Return variables */
10968 /* Return result */
10969 return r
.out
.result
;
10972 struct rpccli_samr_SetDsrmPassword_state
{
10973 struct samr_SetDsrmPassword orig
;
10974 struct samr_SetDsrmPassword tmp
;
10975 TALLOC_CTX
*out_mem_ctx
;
10976 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
10979 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req
*subreq
);
10981 struct tevent_req
*rpccli_samr_SetDsrmPassword_send(TALLOC_CTX
*mem_ctx
,
10982 struct tevent_context
*ev
,
10983 struct rpc_pipe_client
*cli
,
10984 struct lsa_String
*_name
/* [in] [unique] */,
10985 uint32_t _unknown
/* [in] */,
10986 struct samr_Password
*_hash
/* [in] [unique] */)
10988 struct tevent_req
*req
;
10989 struct rpccli_samr_SetDsrmPassword_state
*state
;
10990 struct tevent_req
*subreq
;
10992 req
= tevent_req_create(mem_ctx
, &state
,
10993 struct rpccli_samr_SetDsrmPassword_state
);
10997 state
->out_mem_ctx
= NULL
;
10998 state
->dispatch_recv
= cli
->dispatch_recv
;
11000 /* In parameters */
11001 state
->orig
.in
.name
= _name
;
11002 state
->orig
.in
.unknown
= _unknown
;
11003 state
->orig
.in
.hash
= _hash
;
11005 /* Out parameters */
11008 ZERO_STRUCT(state
->orig
.out
.result
);
11010 if (DEBUGLEVEL
>= 10) {
11011 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword
, &state
->orig
);
11014 /* make a temporary copy, that we pass to the dispatch function */
11015 state
->tmp
= state
->orig
;
11017 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11019 NDR_SAMR_SETDSRMPASSWORD
,
11021 if (tevent_req_nomem(subreq
, req
)) {
11022 return tevent_req_post(req
, ev
);
11024 tevent_req_set_callback(subreq
, rpccli_samr_SetDsrmPassword_done
, req
);
11028 static void rpccli_samr_SetDsrmPassword_done(struct tevent_req
*subreq
)
11030 struct tevent_req
*req
= tevent_req_callback_data(
11031 subreq
, struct tevent_req
);
11032 struct rpccli_samr_SetDsrmPassword_state
*state
= tevent_req_data(
11033 req
, struct rpccli_samr_SetDsrmPassword_state
);
11035 TALLOC_CTX
*mem_ctx
;
11037 if (state
->out_mem_ctx
) {
11038 mem_ctx
= state
->out_mem_ctx
;
11043 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11044 TALLOC_FREE(subreq
);
11045 if (!NT_STATUS_IS_OK(status
)) {
11046 tevent_req_nterror(req
, status
);
11050 /* Copy out parameters */
11053 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11055 /* Reset temporary structure */
11056 ZERO_STRUCT(state
->tmp
);
11058 if (DEBUGLEVEL
>= 10) {
11059 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword
, &state
->orig
);
11062 tevent_req_done(req
);
11065 NTSTATUS
rpccli_samr_SetDsrmPassword_recv(struct tevent_req
*req
,
11066 TALLOC_CTX
*mem_ctx
,
11069 struct rpccli_samr_SetDsrmPassword_state
*state
= tevent_req_data(
11070 req
, struct rpccli_samr_SetDsrmPassword_state
);
11073 if (tevent_req_is_nterror(req
, &status
)) {
11074 tevent_req_received(req
);
11078 /* Steal possbile out parameters to the callers context */
11079 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11081 /* Return result */
11082 *result
= state
->orig
.out
.result
;
11084 tevent_req_received(req
);
11085 return NT_STATUS_OK
;
11088 NTSTATUS
rpccli_samr_SetDsrmPassword(struct rpc_pipe_client
*cli
,
11089 TALLOC_CTX
*mem_ctx
,
11090 struct lsa_String
*name
/* [in] [unique] */,
11091 uint32_t unknown
/* [in] */,
11092 struct samr_Password
*hash
/* [in] [unique] */)
11094 struct samr_SetDsrmPassword r
;
11097 /* In parameters */
11099 r
.in
.unknown
= unknown
;
11102 if (DEBUGLEVEL
>= 10) {
11103 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword
, &r
);
11106 status
= cli
->dispatch(cli
,
11109 NDR_SAMR_SETDSRMPASSWORD
,
11112 if (!NT_STATUS_IS_OK(status
)) {
11116 if (DEBUGLEVEL
>= 10) {
11117 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword
, &r
);
11120 if (NT_STATUS_IS_ERR(status
)) {
11124 /* Return variables */
11126 /* Return result */
11127 return r
.out
.result
;
11130 struct rpccli_samr_ValidatePassword_state
{
11131 struct samr_ValidatePassword orig
;
11132 struct samr_ValidatePassword tmp
;
11133 TALLOC_CTX
*out_mem_ctx
;
11134 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
11137 static void rpccli_samr_ValidatePassword_done(struct tevent_req
*subreq
);
11139 struct tevent_req
*rpccli_samr_ValidatePassword_send(TALLOC_CTX
*mem_ctx
,
11140 struct tevent_context
*ev
,
11141 struct rpc_pipe_client
*cli
,
11142 enum samr_ValidatePasswordLevel _level
/* [in] */,
11143 union samr_ValidatePasswordReq
*_req
/* [in] [ref,switch_is(level)] */,
11144 union samr_ValidatePasswordRep
**_rep
/* [out] [ref,switch_is(level)] */)
11146 struct tevent_req
*req
;
11147 struct rpccli_samr_ValidatePassword_state
*state
;
11148 struct tevent_req
*subreq
;
11150 req
= tevent_req_create(mem_ctx
, &state
,
11151 struct rpccli_samr_ValidatePassword_state
);
11155 state
->out_mem_ctx
= NULL
;
11156 state
->dispatch_recv
= cli
->dispatch_recv
;
11158 /* In parameters */
11159 state
->orig
.in
.level
= _level
;
11160 state
->orig
.in
.req
= _req
;
11162 /* Out parameters */
11163 state
->orig
.out
.rep
= _rep
;
11166 ZERO_STRUCT(state
->orig
.out
.result
);
11168 if (DEBUGLEVEL
>= 10) {
11169 NDR_PRINT_IN_DEBUG(samr_ValidatePassword
, &state
->orig
);
11172 state
->out_mem_ctx
= talloc_named_const(state
, 0,
11173 "rpccli_samr_ValidatePassword_out_memory");
11174 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
11175 return tevent_req_post(req
, ev
);
11178 /* make a temporary copy, that we pass to the dispatch function */
11179 state
->tmp
= state
->orig
;
11181 subreq
= cli
->dispatch_send(state
, ev
, cli
,
11183 NDR_SAMR_VALIDATEPASSWORD
,
11185 if (tevent_req_nomem(subreq
, req
)) {
11186 return tevent_req_post(req
, ev
);
11188 tevent_req_set_callback(subreq
, rpccli_samr_ValidatePassword_done
, req
);
11192 static void rpccli_samr_ValidatePassword_done(struct tevent_req
*subreq
)
11194 struct tevent_req
*req
= tevent_req_callback_data(
11195 subreq
, struct tevent_req
);
11196 struct rpccli_samr_ValidatePassword_state
*state
= tevent_req_data(
11197 req
, struct rpccli_samr_ValidatePassword_state
);
11199 TALLOC_CTX
*mem_ctx
;
11201 if (state
->out_mem_ctx
) {
11202 mem_ctx
= state
->out_mem_ctx
;
11207 status
= state
->dispatch_recv(subreq
, mem_ctx
);
11208 TALLOC_FREE(subreq
);
11209 if (!NT_STATUS_IS_OK(status
)) {
11210 tevent_req_nterror(req
, status
);
11214 /* Copy out parameters */
11215 *state
->orig
.out
.rep
= *state
->tmp
.out
.rep
;
11218 state
->orig
.out
.result
= state
->tmp
.out
.result
;
11220 /* Reset temporary structure */
11221 ZERO_STRUCT(state
->tmp
);
11223 if (DEBUGLEVEL
>= 10) {
11224 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword
, &state
->orig
);
11227 tevent_req_done(req
);
11230 NTSTATUS
rpccli_samr_ValidatePassword_recv(struct tevent_req
*req
,
11231 TALLOC_CTX
*mem_ctx
,
11234 struct rpccli_samr_ValidatePassword_state
*state
= tevent_req_data(
11235 req
, struct rpccli_samr_ValidatePassword_state
);
11238 if (tevent_req_is_nterror(req
, &status
)) {
11239 tevent_req_received(req
);
11243 /* Steal possbile out parameters to the callers context */
11244 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
11246 /* Return result */
11247 *result
= state
->orig
.out
.result
;
11249 tevent_req_received(req
);
11250 return NT_STATUS_OK
;
11253 NTSTATUS
rpccli_samr_ValidatePassword(struct rpc_pipe_client
*cli
,
11254 TALLOC_CTX
*mem_ctx
,
11255 enum samr_ValidatePasswordLevel level
/* [in] */,
11256 union samr_ValidatePasswordReq
*req
/* [in] [ref,switch_is(level)] */,
11257 union samr_ValidatePasswordRep
**rep
/* [out] [ref,switch_is(level)] */)
11259 struct samr_ValidatePassword r
;
11262 /* In parameters */
11263 r
.in
.level
= level
;
11266 if (DEBUGLEVEL
>= 10) {
11267 NDR_PRINT_IN_DEBUG(samr_ValidatePassword
, &r
);
11270 status
= cli
->dispatch(cli
,
11273 NDR_SAMR_VALIDATEPASSWORD
,
11276 if (!NT_STATUS_IS_OK(status
)) {
11280 if (DEBUGLEVEL
>= 10) {
11281 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword
, &r
);
11284 if (NT_STATUS_IS_ERR(status
)) {
11288 /* Return variables */
11291 /* Return result */
11292 return r
.out
.result
;