2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
7 #include "../librpc/gen_ndr/cli_netlogon.h"
9 struct rpccli_netr_LogonUasLogon_state
{
10 struct netr_LogonUasLogon orig
;
11 struct netr_LogonUasLogon tmp
;
12 TALLOC_CTX
*out_mem_ctx
;
13 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
16 static void rpccli_netr_LogonUasLogon_done(struct tevent_req
*subreq
);
18 struct tevent_req
*rpccli_netr_LogonUasLogon_send(TALLOC_CTX
*mem_ctx
,
19 struct tevent_context
*ev
,
20 struct rpc_pipe_client
*cli
,
21 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
22 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
23 const char *_workstation
/* [in] [ref,charset(UTF16)] */,
24 struct netr_UasInfo
**_info
/* [out] [ref] */)
26 struct tevent_req
*req
;
27 struct rpccli_netr_LogonUasLogon_state
*state
;
28 struct tevent_req
*subreq
;
30 req
= tevent_req_create(mem_ctx
, &state
,
31 struct rpccli_netr_LogonUasLogon_state
);
35 state
->out_mem_ctx
= NULL
;
36 state
->dispatch_recv
= cli
->dispatch_recv
;
39 state
->orig
.in
.server_name
= _server_name
;
40 state
->orig
.in
.account_name
= _account_name
;
41 state
->orig
.in
.workstation
= _workstation
;
44 state
->orig
.out
.info
= _info
;
47 ZERO_STRUCT(state
->orig
.out
.result
);
49 if (DEBUGLEVEL
>= 10) {
50 NDR_PRINT_IN_DEBUG(netr_LogonUasLogon
, &state
->orig
);
53 state
->out_mem_ctx
= talloc_named_const(state
, 0,
54 "rpccli_netr_LogonUasLogon_out_memory");
55 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
56 return tevent_req_post(req
, ev
);
59 /* make a temporary copy, that we pass to the dispatch function */
60 state
->tmp
= state
->orig
;
62 subreq
= cli
->dispatch_send(state
, ev
, cli
,
64 NDR_NETR_LOGONUASLOGON
,
66 if (tevent_req_nomem(subreq
, req
)) {
67 return tevent_req_post(req
, ev
);
69 tevent_req_set_callback(subreq
, rpccli_netr_LogonUasLogon_done
, req
);
73 static void rpccli_netr_LogonUasLogon_done(struct tevent_req
*subreq
)
75 struct tevent_req
*req
= tevent_req_callback_data(
76 subreq
, struct tevent_req
);
77 struct rpccli_netr_LogonUasLogon_state
*state
= tevent_req_data(
78 req
, struct rpccli_netr_LogonUasLogon_state
);
82 if (state
->out_mem_ctx
) {
83 mem_ctx
= state
->out_mem_ctx
;
88 status
= state
->dispatch_recv(subreq
, mem_ctx
);
90 if (!NT_STATUS_IS_OK(status
)) {
91 tevent_req_nterror(req
, status
);
95 /* Copy out parameters */
96 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
99 state
->orig
.out
.result
= state
->tmp
.out
.result
;
101 /* Reset temporary structure */
102 ZERO_STRUCT(state
->tmp
);
104 if (DEBUGLEVEL
>= 10) {
105 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon
, &state
->orig
);
108 tevent_req_done(req
);
111 NTSTATUS
rpccli_netr_LogonUasLogon_recv(struct tevent_req
*req
,
115 struct rpccli_netr_LogonUasLogon_state
*state
= tevent_req_data(
116 req
, struct rpccli_netr_LogonUasLogon_state
);
119 if (tevent_req_is_nterror(req
, &status
)) {
120 tevent_req_received(req
);
124 /* Steal possbile out parameters to the callers context */
125 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
128 *result
= state
->orig
.out
.result
;
130 tevent_req_received(req
);
134 NTSTATUS
rpccli_netr_LogonUasLogon(struct rpc_pipe_client
*cli
,
136 const char *server_name
/* [in] [unique,charset(UTF16)] */,
137 const char *account_name
/* [in] [ref,charset(UTF16)] */,
138 const char *workstation
/* [in] [ref,charset(UTF16)] */,
139 struct netr_UasInfo
**info
/* [out] [ref] */,
142 struct netr_LogonUasLogon r
;
146 r
.in
.server_name
= server_name
;
147 r
.in
.account_name
= account_name
;
148 r
.in
.workstation
= workstation
;
150 if (DEBUGLEVEL
>= 10) {
151 NDR_PRINT_IN_DEBUG(netr_LogonUasLogon
, &r
);
154 status
= cli
->dispatch(cli
,
157 NDR_NETR_LOGONUASLOGON
,
160 if (!NT_STATUS_IS_OK(status
)) {
164 if (DEBUGLEVEL
>= 10) {
165 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon
, &r
);
168 if (NT_STATUS_IS_ERR(status
)) {
172 /* Return variables */
177 *werror
= r
.out
.result
;
180 return werror_to_ntstatus(r
.out
.result
);
183 struct rpccli_netr_LogonUasLogoff_state
{
184 struct netr_LogonUasLogoff orig
;
185 struct netr_LogonUasLogoff tmp
;
186 TALLOC_CTX
*out_mem_ctx
;
187 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
190 static void rpccli_netr_LogonUasLogoff_done(struct tevent_req
*subreq
);
192 struct tevent_req
*rpccli_netr_LogonUasLogoff_send(TALLOC_CTX
*mem_ctx
,
193 struct tevent_context
*ev
,
194 struct rpc_pipe_client
*cli
,
195 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
196 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
197 const char *_workstation
/* [in] [ref,charset(UTF16)] */,
198 struct netr_UasLogoffInfo
*_info
/* [out] [ref] */)
200 struct tevent_req
*req
;
201 struct rpccli_netr_LogonUasLogoff_state
*state
;
202 struct tevent_req
*subreq
;
204 req
= tevent_req_create(mem_ctx
, &state
,
205 struct rpccli_netr_LogonUasLogoff_state
);
209 state
->out_mem_ctx
= NULL
;
210 state
->dispatch_recv
= cli
->dispatch_recv
;
213 state
->orig
.in
.server_name
= _server_name
;
214 state
->orig
.in
.account_name
= _account_name
;
215 state
->orig
.in
.workstation
= _workstation
;
218 state
->orig
.out
.info
= _info
;
221 ZERO_STRUCT(state
->orig
.out
.result
);
223 if (DEBUGLEVEL
>= 10) {
224 NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff
, &state
->orig
);
227 state
->out_mem_ctx
= talloc_named_const(state
, 0,
228 "rpccli_netr_LogonUasLogoff_out_memory");
229 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
230 return tevent_req_post(req
, ev
);
233 /* make a temporary copy, that we pass to the dispatch function */
234 state
->tmp
= state
->orig
;
236 subreq
= cli
->dispatch_send(state
, ev
, cli
,
238 NDR_NETR_LOGONUASLOGOFF
,
240 if (tevent_req_nomem(subreq
, req
)) {
241 return tevent_req_post(req
, ev
);
243 tevent_req_set_callback(subreq
, rpccli_netr_LogonUasLogoff_done
, req
);
247 static void rpccli_netr_LogonUasLogoff_done(struct tevent_req
*subreq
)
249 struct tevent_req
*req
= tevent_req_callback_data(
250 subreq
, struct tevent_req
);
251 struct rpccli_netr_LogonUasLogoff_state
*state
= tevent_req_data(
252 req
, struct rpccli_netr_LogonUasLogoff_state
);
256 if (state
->out_mem_ctx
) {
257 mem_ctx
= state
->out_mem_ctx
;
262 status
= state
->dispatch_recv(subreq
, mem_ctx
);
264 if (!NT_STATUS_IS_OK(status
)) {
265 tevent_req_nterror(req
, status
);
269 /* Copy out parameters */
270 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
273 state
->orig
.out
.result
= state
->tmp
.out
.result
;
275 /* Reset temporary structure */
276 ZERO_STRUCT(state
->tmp
);
278 if (DEBUGLEVEL
>= 10) {
279 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff
, &state
->orig
);
282 tevent_req_done(req
);
285 NTSTATUS
rpccli_netr_LogonUasLogoff_recv(struct tevent_req
*req
,
289 struct rpccli_netr_LogonUasLogoff_state
*state
= tevent_req_data(
290 req
, struct rpccli_netr_LogonUasLogoff_state
);
293 if (tevent_req_is_nterror(req
, &status
)) {
294 tevent_req_received(req
);
298 /* Steal possbile out parameters to the callers context */
299 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
302 *result
= state
->orig
.out
.result
;
304 tevent_req_received(req
);
308 NTSTATUS
rpccli_netr_LogonUasLogoff(struct rpc_pipe_client
*cli
,
310 const char *server_name
/* [in] [unique,charset(UTF16)] */,
311 const char *account_name
/* [in] [ref,charset(UTF16)] */,
312 const char *workstation
/* [in] [ref,charset(UTF16)] */,
313 struct netr_UasLogoffInfo
*info
/* [out] [ref] */,
316 struct netr_LogonUasLogoff r
;
320 r
.in
.server_name
= server_name
;
321 r
.in
.account_name
= account_name
;
322 r
.in
.workstation
= workstation
;
324 if (DEBUGLEVEL
>= 10) {
325 NDR_PRINT_IN_DEBUG(netr_LogonUasLogoff
, &r
);
328 status
= cli
->dispatch(cli
,
331 NDR_NETR_LOGONUASLOGOFF
,
334 if (!NT_STATUS_IS_OK(status
)) {
338 if (DEBUGLEVEL
>= 10) {
339 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff
, &r
);
342 if (NT_STATUS_IS_ERR(status
)) {
346 /* Return variables */
351 *werror
= r
.out
.result
;
354 return werror_to_ntstatus(r
.out
.result
);
357 struct rpccli_netr_LogonSamLogon_state
{
358 struct netr_LogonSamLogon orig
;
359 struct netr_LogonSamLogon tmp
;
360 TALLOC_CTX
*out_mem_ctx
;
361 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
364 static void rpccli_netr_LogonSamLogon_done(struct tevent_req
*subreq
);
366 struct tevent_req
*rpccli_netr_LogonSamLogon_send(TALLOC_CTX
*mem_ctx
,
367 struct tevent_context
*ev
,
368 struct rpc_pipe_client
*cli
,
369 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
370 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
371 struct netr_Authenticator
*_credential
/* [in] [unique] */,
372 struct netr_Authenticator
*_return_authenticator
/* [in,out] [unique] */,
373 enum netr_LogonInfoClass _logon_level
/* [in] */,
374 union netr_LogonLevel
*_logon
/* [in] [ref,switch_is(logon_level)] */,
375 uint16_t _validation_level
/* [in] */,
376 union netr_Validation
*_validation
/* [out] [ref,switch_is(validation_level)] */,
377 uint8_t *_authoritative
/* [out] [ref] */)
379 struct tevent_req
*req
;
380 struct rpccli_netr_LogonSamLogon_state
*state
;
381 struct tevent_req
*subreq
;
383 req
= tevent_req_create(mem_ctx
, &state
,
384 struct rpccli_netr_LogonSamLogon_state
);
388 state
->out_mem_ctx
= NULL
;
389 state
->dispatch_recv
= cli
->dispatch_recv
;
392 state
->orig
.in
.server_name
= _server_name
;
393 state
->orig
.in
.computer_name
= _computer_name
;
394 state
->orig
.in
.credential
= _credential
;
395 state
->orig
.in
.return_authenticator
= _return_authenticator
;
396 state
->orig
.in
.logon_level
= _logon_level
;
397 state
->orig
.in
.logon
= _logon
;
398 state
->orig
.in
.validation_level
= _validation_level
;
401 state
->orig
.out
.return_authenticator
= _return_authenticator
;
402 state
->orig
.out
.validation
= _validation
;
403 state
->orig
.out
.authoritative
= _authoritative
;
406 ZERO_STRUCT(state
->orig
.out
.result
);
408 if (DEBUGLEVEL
>= 10) {
409 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon
, &state
->orig
);
412 state
->out_mem_ctx
= talloc_named_const(state
, 0,
413 "rpccli_netr_LogonSamLogon_out_memory");
414 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
415 return tevent_req_post(req
, ev
);
418 /* make a temporary copy, that we pass to the dispatch function */
419 state
->tmp
= state
->orig
;
421 subreq
= cli
->dispatch_send(state
, ev
, cli
,
423 NDR_NETR_LOGONSAMLOGON
,
425 if (tevent_req_nomem(subreq
, req
)) {
426 return tevent_req_post(req
, ev
);
428 tevent_req_set_callback(subreq
, rpccli_netr_LogonSamLogon_done
, req
);
432 static void rpccli_netr_LogonSamLogon_done(struct tevent_req
*subreq
)
434 struct tevent_req
*req
= tevent_req_callback_data(
435 subreq
, struct tevent_req
);
436 struct rpccli_netr_LogonSamLogon_state
*state
= tevent_req_data(
437 req
, struct rpccli_netr_LogonSamLogon_state
);
441 if (state
->out_mem_ctx
) {
442 mem_ctx
= state
->out_mem_ctx
;
447 status
= state
->dispatch_recv(subreq
, mem_ctx
);
449 if (!NT_STATUS_IS_OK(status
)) {
450 tevent_req_nterror(req
, status
);
454 /* Copy out parameters */
455 if (state
->orig
.out
.return_authenticator
&& state
->tmp
.out
.return_authenticator
) {
456 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
458 *state
->orig
.out
.validation
= *state
->tmp
.out
.validation
;
459 *state
->orig
.out
.authoritative
= *state
->tmp
.out
.authoritative
;
462 state
->orig
.out
.result
= state
->tmp
.out
.result
;
464 /* Reset temporary structure */
465 ZERO_STRUCT(state
->tmp
);
467 if (DEBUGLEVEL
>= 10) {
468 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon
, &state
->orig
);
471 tevent_req_done(req
);
474 NTSTATUS
rpccli_netr_LogonSamLogon_recv(struct tevent_req
*req
,
478 struct rpccli_netr_LogonSamLogon_state
*state
= tevent_req_data(
479 req
, struct rpccli_netr_LogonSamLogon_state
);
482 if (tevent_req_is_nterror(req
, &status
)) {
483 tevent_req_received(req
);
487 /* Steal possbile out parameters to the callers context */
488 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
491 *result
= state
->orig
.out
.result
;
493 tevent_req_received(req
);
497 NTSTATUS
rpccli_netr_LogonSamLogon(struct rpc_pipe_client
*cli
,
499 const char *server_name
/* [in] [unique,charset(UTF16)] */,
500 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
501 struct netr_Authenticator
*credential
/* [in] [unique] */,
502 struct netr_Authenticator
*return_authenticator
/* [in,out] [unique] */,
503 enum netr_LogonInfoClass logon_level
/* [in] */,
504 union netr_LogonLevel
*logon
/* [in] [ref,switch_is(logon_level)] */,
505 uint16_t validation_level
/* [in] */,
506 union netr_Validation
*validation
/* [out] [ref,switch_is(validation_level)] */,
507 uint8_t *authoritative
/* [out] [ref] */)
509 struct netr_LogonSamLogon r
;
513 r
.in
.server_name
= server_name
;
514 r
.in
.computer_name
= computer_name
;
515 r
.in
.credential
= credential
;
516 r
.in
.return_authenticator
= return_authenticator
;
517 r
.in
.logon_level
= logon_level
;
519 r
.in
.validation_level
= validation_level
;
521 if (DEBUGLEVEL
>= 10) {
522 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon
, &r
);
525 status
= cli
->dispatch(cli
,
528 NDR_NETR_LOGONSAMLOGON
,
531 if (!NT_STATUS_IS_OK(status
)) {
535 if (DEBUGLEVEL
>= 10) {
536 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon
, &r
);
539 if (NT_STATUS_IS_ERR(status
)) {
543 /* Return variables */
544 if (return_authenticator
&& r
.out
.return_authenticator
) {
545 *return_authenticator
= *r
.out
.return_authenticator
;
547 *validation
= *r
.out
.validation
;
548 *authoritative
= *r
.out
.authoritative
;
554 struct rpccli_netr_LogonSamLogoff_state
{
555 struct netr_LogonSamLogoff orig
;
556 struct netr_LogonSamLogoff tmp
;
557 TALLOC_CTX
*out_mem_ctx
;
558 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
561 static void rpccli_netr_LogonSamLogoff_done(struct tevent_req
*subreq
);
563 struct tevent_req
*rpccli_netr_LogonSamLogoff_send(TALLOC_CTX
*mem_ctx
,
564 struct tevent_context
*ev
,
565 struct rpc_pipe_client
*cli
,
566 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
567 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
568 struct netr_Authenticator
*_credential
/* [in] [unique] */,
569 struct netr_Authenticator
*_return_authenticator
/* [in,out] [unique] */,
570 enum netr_LogonInfoClass _logon_level
/* [in] */,
571 union netr_LogonLevel _logon
/* [in] [switch_is(logon_level)] */)
573 struct tevent_req
*req
;
574 struct rpccli_netr_LogonSamLogoff_state
*state
;
575 struct tevent_req
*subreq
;
577 req
= tevent_req_create(mem_ctx
, &state
,
578 struct rpccli_netr_LogonSamLogoff_state
);
582 state
->out_mem_ctx
= NULL
;
583 state
->dispatch_recv
= cli
->dispatch_recv
;
586 state
->orig
.in
.server_name
= _server_name
;
587 state
->orig
.in
.computer_name
= _computer_name
;
588 state
->orig
.in
.credential
= _credential
;
589 state
->orig
.in
.return_authenticator
= _return_authenticator
;
590 state
->orig
.in
.logon_level
= _logon_level
;
591 state
->orig
.in
.logon
= _logon
;
594 state
->orig
.out
.return_authenticator
= _return_authenticator
;
597 ZERO_STRUCT(state
->orig
.out
.result
);
599 if (DEBUGLEVEL
>= 10) {
600 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff
, &state
->orig
);
603 state
->out_mem_ctx
= talloc_named_const(state
, 0,
604 "rpccli_netr_LogonSamLogoff_out_memory");
605 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
606 return tevent_req_post(req
, ev
);
609 /* make a temporary copy, that we pass to the dispatch function */
610 state
->tmp
= state
->orig
;
612 subreq
= cli
->dispatch_send(state
, ev
, cli
,
614 NDR_NETR_LOGONSAMLOGOFF
,
616 if (tevent_req_nomem(subreq
, req
)) {
617 return tevent_req_post(req
, ev
);
619 tevent_req_set_callback(subreq
, rpccli_netr_LogonSamLogoff_done
, req
);
623 static void rpccli_netr_LogonSamLogoff_done(struct tevent_req
*subreq
)
625 struct tevent_req
*req
= tevent_req_callback_data(
626 subreq
, struct tevent_req
);
627 struct rpccli_netr_LogonSamLogoff_state
*state
= tevent_req_data(
628 req
, struct rpccli_netr_LogonSamLogoff_state
);
632 if (state
->out_mem_ctx
) {
633 mem_ctx
= state
->out_mem_ctx
;
638 status
= state
->dispatch_recv(subreq
, mem_ctx
);
640 if (!NT_STATUS_IS_OK(status
)) {
641 tevent_req_nterror(req
, status
);
645 /* Copy out parameters */
646 if (state
->orig
.out
.return_authenticator
&& state
->tmp
.out
.return_authenticator
) {
647 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
651 state
->orig
.out
.result
= state
->tmp
.out
.result
;
653 /* Reset temporary structure */
654 ZERO_STRUCT(state
->tmp
);
656 if (DEBUGLEVEL
>= 10) {
657 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff
, &state
->orig
);
660 tevent_req_done(req
);
663 NTSTATUS
rpccli_netr_LogonSamLogoff_recv(struct tevent_req
*req
,
667 struct rpccli_netr_LogonSamLogoff_state
*state
= tevent_req_data(
668 req
, struct rpccli_netr_LogonSamLogoff_state
);
671 if (tevent_req_is_nterror(req
, &status
)) {
672 tevent_req_received(req
);
676 /* Steal possbile out parameters to the callers context */
677 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
680 *result
= state
->orig
.out
.result
;
682 tevent_req_received(req
);
686 NTSTATUS
rpccli_netr_LogonSamLogoff(struct rpc_pipe_client
*cli
,
688 const char *server_name
/* [in] [unique,charset(UTF16)] */,
689 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
690 struct netr_Authenticator
*credential
/* [in] [unique] */,
691 struct netr_Authenticator
*return_authenticator
/* [in,out] [unique] */,
692 enum netr_LogonInfoClass logon_level
/* [in] */,
693 union netr_LogonLevel logon
/* [in] [switch_is(logon_level)] */)
695 struct netr_LogonSamLogoff r
;
699 r
.in
.server_name
= server_name
;
700 r
.in
.computer_name
= computer_name
;
701 r
.in
.credential
= credential
;
702 r
.in
.return_authenticator
= return_authenticator
;
703 r
.in
.logon_level
= logon_level
;
706 if (DEBUGLEVEL
>= 10) {
707 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff
, &r
);
710 status
= cli
->dispatch(cli
,
713 NDR_NETR_LOGONSAMLOGOFF
,
716 if (!NT_STATUS_IS_OK(status
)) {
720 if (DEBUGLEVEL
>= 10) {
721 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff
, &r
);
724 if (NT_STATUS_IS_ERR(status
)) {
728 /* Return variables */
729 if (return_authenticator
&& r
.out
.return_authenticator
) {
730 *return_authenticator
= *r
.out
.return_authenticator
;
737 struct rpccli_netr_ServerReqChallenge_state
{
738 struct netr_ServerReqChallenge orig
;
739 struct netr_ServerReqChallenge tmp
;
740 TALLOC_CTX
*out_mem_ctx
;
741 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
744 static void rpccli_netr_ServerReqChallenge_done(struct tevent_req
*subreq
);
746 struct tevent_req
*rpccli_netr_ServerReqChallenge_send(TALLOC_CTX
*mem_ctx
,
747 struct tevent_context
*ev
,
748 struct rpc_pipe_client
*cli
,
749 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
750 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
751 struct netr_Credential
*_credentials
/* [in] [ref] */,
752 struct netr_Credential
*_return_credentials
/* [out] [ref] */)
754 struct tevent_req
*req
;
755 struct rpccli_netr_ServerReqChallenge_state
*state
;
756 struct tevent_req
*subreq
;
758 req
= tevent_req_create(mem_ctx
, &state
,
759 struct rpccli_netr_ServerReqChallenge_state
);
763 state
->out_mem_ctx
= NULL
;
764 state
->dispatch_recv
= cli
->dispatch_recv
;
767 state
->orig
.in
.server_name
= _server_name
;
768 state
->orig
.in
.computer_name
= _computer_name
;
769 state
->orig
.in
.credentials
= _credentials
;
772 state
->orig
.out
.return_credentials
= _return_credentials
;
775 ZERO_STRUCT(state
->orig
.out
.result
);
777 if (DEBUGLEVEL
>= 10) {
778 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge
, &state
->orig
);
781 state
->out_mem_ctx
= talloc_named_const(state
, 0,
782 "rpccli_netr_ServerReqChallenge_out_memory");
783 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
784 return tevent_req_post(req
, ev
);
787 /* make a temporary copy, that we pass to the dispatch function */
788 state
->tmp
= state
->orig
;
790 subreq
= cli
->dispatch_send(state
, ev
, cli
,
792 NDR_NETR_SERVERREQCHALLENGE
,
794 if (tevent_req_nomem(subreq
, req
)) {
795 return tevent_req_post(req
, ev
);
797 tevent_req_set_callback(subreq
, rpccli_netr_ServerReqChallenge_done
, req
);
801 static void rpccli_netr_ServerReqChallenge_done(struct tevent_req
*subreq
)
803 struct tevent_req
*req
= tevent_req_callback_data(
804 subreq
, struct tevent_req
);
805 struct rpccli_netr_ServerReqChallenge_state
*state
= tevent_req_data(
806 req
, struct rpccli_netr_ServerReqChallenge_state
);
810 if (state
->out_mem_ctx
) {
811 mem_ctx
= state
->out_mem_ctx
;
816 status
= state
->dispatch_recv(subreq
, mem_ctx
);
818 if (!NT_STATUS_IS_OK(status
)) {
819 tevent_req_nterror(req
, status
);
823 /* Copy out parameters */
824 *state
->orig
.out
.return_credentials
= *state
->tmp
.out
.return_credentials
;
827 state
->orig
.out
.result
= state
->tmp
.out
.result
;
829 /* Reset temporary structure */
830 ZERO_STRUCT(state
->tmp
);
832 if (DEBUGLEVEL
>= 10) {
833 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge
, &state
->orig
);
836 tevent_req_done(req
);
839 NTSTATUS
rpccli_netr_ServerReqChallenge_recv(struct tevent_req
*req
,
843 struct rpccli_netr_ServerReqChallenge_state
*state
= tevent_req_data(
844 req
, struct rpccli_netr_ServerReqChallenge_state
);
847 if (tevent_req_is_nterror(req
, &status
)) {
848 tevent_req_received(req
);
852 /* Steal possbile out parameters to the callers context */
853 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
856 *result
= state
->orig
.out
.result
;
858 tevent_req_received(req
);
862 NTSTATUS
rpccli_netr_ServerReqChallenge(struct rpc_pipe_client
*cli
,
864 const char *server_name
/* [in] [unique,charset(UTF16)] */,
865 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
866 struct netr_Credential
*credentials
/* [in] [ref] */,
867 struct netr_Credential
*return_credentials
/* [out] [ref] */)
869 struct netr_ServerReqChallenge r
;
873 r
.in
.server_name
= server_name
;
874 r
.in
.computer_name
= computer_name
;
875 r
.in
.credentials
= credentials
;
877 if (DEBUGLEVEL
>= 10) {
878 NDR_PRINT_IN_DEBUG(netr_ServerReqChallenge
, &r
);
881 status
= cli
->dispatch(cli
,
884 NDR_NETR_SERVERREQCHALLENGE
,
887 if (!NT_STATUS_IS_OK(status
)) {
891 if (DEBUGLEVEL
>= 10) {
892 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge
, &r
);
895 if (NT_STATUS_IS_ERR(status
)) {
899 /* Return variables */
900 *return_credentials
= *r
.out
.return_credentials
;
906 struct rpccli_netr_ServerAuthenticate_state
{
907 struct netr_ServerAuthenticate orig
;
908 struct netr_ServerAuthenticate tmp
;
909 TALLOC_CTX
*out_mem_ctx
;
910 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
913 static void rpccli_netr_ServerAuthenticate_done(struct tevent_req
*subreq
);
915 struct tevent_req
*rpccli_netr_ServerAuthenticate_send(TALLOC_CTX
*mem_ctx
,
916 struct tevent_context
*ev
,
917 struct rpc_pipe_client
*cli
,
918 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
919 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
920 enum netr_SchannelType _secure_channel_type
/* [in] */,
921 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
922 struct netr_Credential
*_credentials
/* [in] [ref] */,
923 struct netr_Credential
*_return_credentials
/* [out] [ref] */)
925 struct tevent_req
*req
;
926 struct rpccli_netr_ServerAuthenticate_state
*state
;
927 struct tevent_req
*subreq
;
929 req
= tevent_req_create(mem_ctx
, &state
,
930 struct rpccli_netr_ServerAuthenticate_state
);
934 state
->out_mem_ctx
= NULL
;
935 state
->dispatch_recv
= cli
->dispatch_recv
;
938 state
->orig
.in
.server_name
= _server_name
;
939 state
->orig
.in
.account_name
= _account_name
;
940 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
941 state
->orig
.in
.computer_name
= _computer_name
;
942 state
->orig
.in
.credentials
= _credentials
;
945 state
->orig
.out
.return_credentials
= _return_credentials
;
948 ZERO_STRUCT(state
->orig
.out
.result
);
950 if (DEBUGLEVEL
>= 10) {
951 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate
, &state
->orig
);
954 state
->out_mem_ctx
= talloc_named_const(state
, 0,
955 "rpccli_netr_ServerAuthenticate_out_memory");
956 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
957 return tevent_req_post(req
, ev
);
960 /* make a temporary copy, that we pass to the dispatch function */
961 state
->tmp
= state
->orig
;
963 subreq
= cli
->dispatch_send(state
, ev
, cli
,
965 NDR_NETR_SERVERAUTHENTICATE
,
967 if (tevent_req_nomem(subreq
, req
)) {
968 return tevent_req_post(req
, ev
);
970 tevent_req_set_callback(subreq
, rpccli_netr_ServerAuthenticate_done
, req
);
974 static void rpccli_netr_ServerAuthenticate_done(struct tevent_req
*subreq
)
976 struct tevent_req
*req
= tevent_req_callback_data(
977 subreq
, struct tevent_req
);
978 struct rpccli_netr_ServerAuthenticate_state
*state
= tevent_req_data(
979 req
, struct rpccli_netr_ServerAuthenticate_state
);
983 if (state
->out_mem_ctx
) {
984 mem_ctx
= state
->out_mem_ctx
;
989 status
= state
->dispatch_recv(subreq
, mem_ctx
);
991 if (!NT_STATUS_IS_OK(status
)) {
992 tevent_req_nterror(req
, status
);
996 /* Copy out parameters */
997 *state
->orig
.out
.return_credentials
= *state
->tmp
.out
.return_credentials
;
1000 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1002 /* Reset temporary structure */
1003 ZERO_STRUCT(state
->tmp
);
1005 if (DEBUGLEVEL
>= 10) {
1006 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate
, &state
->orig
);
1009 tevent_req_done(req
);
1012 NTSTATUS
rpccli_netr_ServerAuthenticate_recv(struct tevent_req
*req
,
1013 TALLOC_CTX
*mem_ctx
,
1016 struct rpccli_netr_ServerAuthenticate_state
*state
= tevent_req_data(
1017 req
, struct rpccli_netr_ServerAuthenticate_state
);
1020 if (tevent_req_is_nterror(req
, &status
)) {
1021 tevent_req_received(req
);
1025 /* Steal possbile out parameters to the callers context */
1026 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1029 *result
= state
->orig
.out
.result
;
1031 tevent_req_received(req
);
1032 return NT_STATUS_OK
;
1035 NTSTATUS
rpccli_netr_ServerAuthenticate(struct rpc_pipe_client
*cli
,
1036 TALLOC_CTX
*mem_ctx
,
1037 const char *server_name
/* [in] [unique,charset(UTF16)] */,
1038 const char *account_name
/* [in] [ref,charset(UTF16)] */,
1039 enum netr_SchannelType secure_channel_type
/* [in] */,
1040 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
1041 struct netr_Credential
*credentials
/* [in] [ref] */,
1042 struct netr_Credential
*return_credentials
/* [out] [ref] */)
1044 struct netr_ServerAuthenticate r
;
1048 r
.in
.server_name
= server_name
;
1049 r
.in
.account_name
= account_name
;
1050 r
.in
.secure_channel_type
= secure_channel_type
;
1051 r
.in
.computer_name
= computer_name
;
1052 r
.in
.credentials
= credentials
;
1054 if (DEBUGLEVEL
>= 10) {
1055 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate
, &r
);
1058 status
= cli
->dispatch(cli
,
1060 &ndr_table_netlogon
,
1061 NDR_NETR_SERVERAUTHENTICATE
,
1064 if (!NT_STATUS_IS_OK(status
)) {
1068 if (DEBUGLEVEL
>= 10) {
1069 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate
, &r
);
1072 if (NT_STATUS_IS_ERR(status
)) {
1076 /* Return variables */
1077 *return_credentials
= *r
.out
.return_credentials
;
1080 return r
.out
.result
;
1083 struct rpccli_netr_ServerPasswordSet_state
{
1084 struct netr_ServerPasswordSet orig
;
1085 struct netr_ServerPasswordSet tmp
;
1086 TALLOC_CTX
*out_mem_ctx
;
1087 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1090 static void rpccli_netr_ServerPasswordSet_done(struct tevent_req
*subreq
);
1092 struct tevent_req
*rpccli_netr_ServerPasswordSet_send(TALLOC_CTX
*mem_ctx
,
1093 struct tevent_context
*ev
,
1094 struct rpc_pipe_client
*cli
,
1095 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
1096 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
1097 enum netr_SchannelType _secure_channel_type
/* [in] */,
1098 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
1099 struct netr_Authenticator
*_credential
/* [in] [ref] */,
1100 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
1101 struct samr_Password
*_new_password
/* [in] [ref] */)
1103 struct tevent_req
*req
;
1104 struct rpccli_netr_ServerPasswordSet_state
*state
;
1105 struct tevent_req
*subreq
;
1107 req
= tevent_req_create(mem_ctx
, &state
,
1108 struct rpccli_netr_ServerPasswordSet_state
);
1112 state
->out_mem_ctx
= NULL
;
1113 state
->dispatch_recv
= cli
->dispatch_recv
;
1116 state
->orig
.in
.server_name
= _server_name
;
1117 state
->orig
.in
.account_name
= _account_name
;
1118 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
1119 state
->orig
.in
.computer_name
= _computer_name
;
1120 state
->orig
.in
.credential
= _credential
;
1121 state
->orig
.in
.new_password
= _new_password
;
1123 /* Out parameters */
1124 state
->orig
.out
.return_authenticator
= _return_authenticator
;
1127 ZERO_STRUCT(state
->orig
.out
.result
);
1129 if (DEBUGLEVEL
>= 10) {
1130 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet
, &state
->orig
);
1133 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1134 "rpccli_netr_ServerPasswordSet_out_memory");
1135 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1136 return tevent_req_post(req
, ev
);
1139 /* make a temporary copy, that we pass to the dispatch function */
1140 state
->tmp
= state
->orig
;
1142 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1143 &ndr_table_netlogon
,
1144 NDR_NETR_SERVERPASSWORDSET
,
1146 if (tevent_req_nomem(subreq
, req
)) {
1147 return tevent_req_post(req
, ev
);
1149 tevent_req_set_callback(subreq
, rpccli_netr_ServerPasswordSet_done
, req
);
1153 static void rpccli_netr_ServerPasswordSet_done(struct tevent_req
*subreq
)
1155 struct tevent_req
*req
= tevent_req_callback_data(
1156 subreq
, struct tevent_req
);
1157 struct rpccli_netr_ServerPasswordSet_state
*state
= tevent_req_data(
1158 req
, struct rpccli_netr_ServerPasswordSet_state
);
1160 TALLOC_CTX
*mem_ctx
;
1162 if (state
->out_mem_ctx
) {
1163 mem_ctx
= state
->out_mem_ctx
;
1168 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1169 TALLOC_FREE(subreq
);
1170 if (!NT_STATUS_IS_OK(status
)) {
1171 tevent_req_nterror(req
, status
);
1175 /* Copy out parameters */
1176 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
1179 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1181 /* Reset temporary structure */
1182 ZERO_STRUCT(state
->tmp
);
1184 if (DEBUGLEVEL
>= 10) {
1185 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet
, &state
->orig
);
1188 tevent_req_done(req
);
1191 NTSTATUS
rpccli_netr_ServerPasswordSet_recv(struct tevent_req
*req
,
1192 TALLOC_CTX
*mem_ctx
,
1195 struct rpccli_netr_ServerPasswordSet_state
*state
= tevent_req_data(
1196 req
, struct rpccli_netr_ServerPasswordSet_state
);
1199 if (tevent_req_is_nterror(req
, &status
)) {
1200 tevent_req_received(req
);
1204 /* Steal possbile out parameters to the callers context */
1205 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1208 *result
= state
->orig
.out
.result
;
1210 tevent_req_received(req
);
1211 return NT_STATUS_OK
;
1214 NTSTATUS
rpccli_netr_ServerPasswordSet(struct rpc_pipe_client
*cli
,
1215 TALLOC_CTX
*mem_ctx
,
1216 const char *server_name
/* [in] [unique,charset(UTF16)] */,
1217 const char *account_name
/* [in] [ref,charset(UTF16)] */,
1218 enum netr_SchannelType secure_channel_type
/* [in] */,
1219 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
1220 struct netr_Authenticator
*credential
/* [in] [ref] */,
1221 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
1222 struct samr_Password
*new_password
/* [in] [ref] */)
1224 struct netr_ServerPasswordSet r
;
1228 r
.in
.server_name
= server_name
;
1229 r
.in
.account_name
= account_name
;
1230 r
.in
.secure_channel_type
= secure_channel_type
;
1231 r
.in
.computer_name
= computer_name
;
1232 r
.in
.credential
= credential
;
1233 r
.in
.new_password
= new_password
;
1235 if (DEBUGLEVEL
>= 10) {
1236 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet
, &r
);
1239 status
= cli
->dispatch(cli
,
1241 &ndr_table_netlogon
,
1242 NDR_NETR_SERVERPASSWORDSET
,
1245 if (!NT_STATUS_IS_OK(status
)) {
1249 if (DEBUGLEVEL
>= 10) {
1250 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet
, &r
);
1253 if (NT_STATUS_IS_ERR(status
)) {
1257 /* Return variables */
1258 *return_authenticator
= *r
.out
.return_authenticator
;
1261 return r
.out
.result
;
1264 struct rpccli_netr_DatabaseDeltas_state
{
1265 struct netr_DatabaseDeltas orig
;
1266 struct netr_DatabaseDeltas tmp
;
1267 TALLOC_CTX
*out_mem_ctx
;
1268 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1271 static void rpccli_netr_DatabaseDeltas_done(struct tevent_req
*subreq
);
1273 struct tevent_req
*rpccli_netr_DatabaseDeltas_send(TALLOC_CTX
*mem_ctx
,
1274 struct tevent_context
*ev
,
1275 struct rpc_pipe_client
*cli
,
1276 const char *_logon_server
/* [in] [ref,charset(UTF16)] */,
1277 const char *_computername
/* [in] [ref,charset(UTF16)] */,
1278 struct netr_Authenticator
*_credential
/* [in] [ref] */,
1279 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
1280 enum netr_SamDatabaseID _database_id
/* [in] */,
1281 uint64_t *_sequence_num
/* [in,out] [ref] */,
1282 struct netr_DELTA_ENUM_ARRAY
**_delta_enum_array
/* [out] [ref] */,
1283 uint32_t _preferredmaximumlength
/* [in] */)
1285 struct tevent_req
*req
;
1286 struct rpccli_netr_DatabaseDeltas_state
*state
;
1287 struct tevent_req
*subreq
;
1289 req
= tevent_req_create(mem_ctx
, &state
,
1290 struct rpccli_netr_DatabaseDeltas_state
);
1294 state
->out_mem_ctx
= NULL
;
1295 state
->dispatch_recv
= cli
->dispatch_recv
;
1298 state
->orig
.in
.logon_server
= _logon_server
;
1299 state
->orig
.in
.computername
= _computername
;
1300 state
->orig
.in
.credential
= _credential
;
1301 state
->orig
.in
.return_authenticator
= _return_authenticator
;
1302 state
->orig
.in
.database_id
= _database_id
;
1303 state
->orig
.in
.sequence_num
= _sequence_num
;
1304 state
->orig
.in
.preferredmaximumlength
= _preferredmaximumlength
;
1306 /* Out parameters */
1307 state
->orig
.out
.return_authenticator
= _return_authenticator
;
1308 state
->orig
.out
.sequence_num
= _sequence_num
;
1309 state
->orig
.out
.delta_enum_array
= _delta_enum_array
;
1312 ZERO_STRUCT(state
->orig
.out
.result
);
1314 if (DEBUGLEVEL
>= 10) {
1315 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas
, &state
->orig
);
1318 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1319 "rpccli_netr_DatabaseDeltas_out_memory");
1320 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1321 return tevent_req_post(req
, ev
);
1324 /* make a temporary copy, that we pass to the dispatch function */
1325 state
->tmp
= state
->orig
;
1327 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1328 &ndr_table_netlogon
,
1329 NDR_NETR_DATABASEDELTAS
,
1331 if (tevent_req_nomem(subreq
, req
)) {
1332 return tevent_req_post(req
, ev
);
1334 tevent_req_set_callback(subreq
, rpccli_netr_DatabaseDeltas_done
, req
);
1338 static void rpccli_netr_DatabaseDeltas_done(struct tevent_req
*subreq
)
1340 struct tevent_req
*req
= tevent_req_callback_data(
1341 subreq
, struct tevent_req
);
1342 struct rpccli_netr_DatabaseDeltas_state
*state
= tevent_req_data(
1343 req
, struct rpccli_netr_DatabaseDeltas_state
);
1345 TALLOC_CTX
*mem_ctx
;
1347 if (state
->out_mem_ctx
) {
1348 mem_ctx
= state
->out_mem_ctx
;
1353 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1354 TALLOC_FREE(subreq
);
1355 if (!NT_STATUS_IS_OK(status
)) {
1356 tevent_req_nterror(req
, status
);
1360 /* Copy out parameters */
1361 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
1362 *state
->orig
.out
.sequence_num
= *state
->tmp
.out
.sequence_num
;
1363 *state
->orig
.out
.delta_enum_array
= *state
->tmp
.out
.delta_enum_array
;
1366 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1368 /* Reset temporary structure */
1369 ZERO_STRUCT(state
->tmp
);
1371 if (DEBUGLEVEL
>= 10) {
1372 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas
, &state
->orig
);
1375 tevent_req_done(req
);
1378 NTSTATUS
rpccli_netr_DatabaseDeltas_recv(struct tevent_req
*req
,
1379 TALLOC_CTX
*mem_ctx
,
1382 struct rpccli_netr_DatabaseDeltas_state
*state
= tevent_req_data(
1383 req
, struct rpccli_netr_DatabaseDeltas_state
);
1386 if (tevent_req_is_nterror(req
, &status
)) {
1387 tevent_req_received(req
);
1391 /* Steal possbile out parameters to the callers context */
1392 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1395 *result
= state
->orig
.out
.result
;
1397 tevent_req_received(req
);
1398 return NT_STATUS_OK
;
1401 NTSTATUS
rpccli_netr_DatabaseDeltas(struct rpc_pipe_client
*cli
,
1402 TALLOC_CTX
*mem_ctx
,
1403 const char *logon_server
/* [in] [ref,charset(UTF16)] */,
1404 const char *computername
/* [in] [ref,charset(UTF16)] */,
1405 struct netr_Authenticator
*credential
/* [in] [ref] */,
1406 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
1407 enum netr_SamDatabaseID database_id
/* [in] */,
1408 uint64_t *sequence_num
/* [in,out] [ref] */,
1409 struct netr_DELTA_ENUM_ARRAY
**delta_enum_array
/* [out] [ref] */,
1410 uint32_t preferredmaximumlength
/* [in] */)
1412 struct netr_DatabaseDeltas r
;
1416 r
.in
.logon_server
= logon_server
;
1417 r
.in
.computername
= computername
;
1418 r
.in
.credential
= credential
;
1419 r
.in
.return_authenticator
= return_authenticator
;
1420 r
.in
.database_id
= database_id
;
1421 r
.in
.sequence_num
= sequence_num
;
1422 r
.in
.preferredmaximumlength
= preferredmaximumlength
;
1424 if (DEBUGLEVEL
>= 10) {
1425 NDR_PRINT_IN_DEBUG(netr_DatabaseDeltas
, &r
);
1428 status
= cli
->dispatch(cli
,
1430 &ndr_table_netlogon
,
1431 NDR_NETR_DATABASEDELTAS
,
1434 if (!NT_STATUS_IS_OK(status
)) {
1438 if (DEBUGLEVEL
>= 10) {
1439 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas
, &r
);
1442 if (NT_STATUS_IS_ERR(status
)) {
1446 /* Return variables */
1447 *return_authenticator
= *r
.out
.return_authenticator
;
1448 *sequence_num
= *r
.out
.sequence_num
;
1449 *delta_enum_array
= *r
.out
.delta_enum_array
;
1452 return r
.out
.result
;
1455 struct rpccli_netr_DatabaseSync_state
{
1456 struct netr_DatabaseSync orig
;
1457 struct netr_DatabaseSync tmp
;
1458 TALLOC_CTX
*out_mem_ctx
;
1459 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1462 static void rpccli_netr_DatabaseSync_done(struct tevent_req
*subreq
);
1464 struct tevent_req
*rpccli_netr_DatabaseSync_send(TALLOC_CTX
*mem_ctx
,
1465 struct tevent_context
*ev
,
1466 struct rpc_pipe_client
*cli
,
1467 const char *_logon_server
/* [in] [ref,charset(UTF16)] */,
1468 const char *_computername
/* [in] [ref,charset(UTF16)] */,
1469 struct netr_Authenticator
*_credential
/* [in] [ref] */,
1470 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
1471 enum netr_SamDatabaseID _database_id
/* [in] */,
1472 uint32_t *_sync_context
/* [in,out] [ref] */,
1473 struct netr_DELTA_ENUM_ARRAY
**_delta_enum_array
/* [out] [ref] */,
1474 uint32_t _preferredmaximumlength
/* [in] */)
1476 struct tevent_req
*req
;
1477 struct rpccli_netr_DatabaseSync_state
*state
;
1478 struct tevent_req
*subreq
;
1480 req
= tevent_req_create(mem_ctx
, &state
,
1481 struct rpccli_netr_DatabaseSync_state
);
1485 state
->out_mem_ctx
= NULL
;
1486 state
->dispatch_recv
= cli
->dispatch_recv
;
1489 state
->orig
.in
.logon_server
= _logon_server
;
1490 state
->orig
.in
.computername
= _computername
;
1491 state
->orig
.in
.credential
= _credential
;
1492 state
->orig
.in
.return_authenticator
= _return_authenticator
;
1493 state
->orig
.in
.database_id
= _database_id
;
1494 state
->orig
.in
.sync_context
= _sync_context
;
1495 state
->orig
.in
.preferredmaximumlength
= _preferredmaximumlength
;
1497 /* Out parameters */
1498 state
->orig
.out
.return_authenticator
= _return_authenticator
;
1499 state
->orig
.out
.sync_context
= _sync_context
;
1500 state
->orig
.out
.delta_enum_array
= _delta_enum_array
;
1503 ZERO_STRUCT(state
->orig
.out
.result
);
1505 if (DEBUGLEVEL
>= 10) {
1506 NDR_PRINT_IN_DEBUG(netr_DatabaseSync
, &state
->orig
);
1509 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1510 "rpccli_netr_DatabaseSync_out_memory");
1511 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1512 return tevent_req_post(req
, ev
);
1515 /* make a temporary copy, that we pass to the dispatch function */
1516 state
->tmp
= state
->orig
;
1518 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1519 &ndr_table_netlogon
,
1520 NDR_NETR_DATABASESYNC
,
1522 if (tevent_req_nomem(subreq
, req
)) {
1523 return tevent_req_post(req
, ev
);
1525 tevent_req_set_callback(subreq
, rpccli_netr_DatabaseSync_done
, req
);
1529 static void rpccli_netr_DatabaseSync_done(struct tevent_req
*subreq
)
1531 struct tevent_req
*req
= tevent_req_callback_data(
1532 subreq
, struct tevent_req
);
1533 struct rpccli_netr_DatabaseSync_state
*state
= tevent_req_data(
1534 req
, struct rpccli_netr_DatabaseSync_state
);
1536 TALLOC_CTX
*mem_ctx
;
1538 if (state
->out_mem_ctx
) {
1539 mem_ctx
= state
->out_mem_ctx
;
1544 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1545 TALLOC_FREE(subreq
);
1546 if (!NT_STATUS_IS_OK(status
)) {
1547 tevent_req_nterror(req
, status
);
1551 /* Copy out parameters */
1552 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
1553 *state
->orig
.out
.sync_context
= *state
->tmp
.out
.sync_context
;
1554 *state
->orig
.out
.delta_enum_array
= *state
->tmp
.out
.delta_enum_array
;
1557 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1559 /* Reset temporary structure */
1560 ZERO_STRUCT(state
->tmp
);
1562 if (DEBUGLEVEL
>= 10) {
1563 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync
, &state
->orig
);
1566 tevent_req_done(req
);
1569 NTSTATUS
rpccli_netr_DatabaseSync_recv(struct tevent_req
*req
,
1570 TALLOC_CTX
*mem_ctx
,
1573 struct rpccli_netr_DatabaseSync_state
*state
= tevent_req_data(
1574 req
, struct rpccli_netr_DatabaseSync_state
);
1577 if (tevent_req_is_nterror(req
, &status
)) {
1578 tevent_req_received(req
);
1582 /* Steal possbile out parameters to the callers context */
1583 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1586 *result
= state
->orig
.out
.result
;
1588 tevent_req_received(req
);
1589 return NT_STATUS_OK
;
1592 NTSTATUS
rpccli_netr_DatabaseSync(struct rpc_pipe_client
*cli
,
1593 TALLOC_CTX
*mem_ctx
,
1594 const char *logon_server
/* [in] [ref,charset(UTF16)] */,
1595 const char *computername
/* [in] [ref,charset(UTF16)] */,
1596 struct netr_Authenticator
*credential
/* [in] [ref] */,
1597 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
1598 enum netr_SamDatabaseID database_id
/* [in] */,
1599 uint32_t *sync_context
/* [in,out] [ref] */,
1600 struct netr_DELTA_ENUM_ARRAY
**delta_enum_array
/* [out] [ref] */,
1601 uint32_t preferredmaximumlength
/* [in] */)
1603 struct netr_DatabaseSync r
;
1607 r
.in
.logon_server
= logon_server
;
1608 r
.in
.computername
= computername
;
1609 r
.in
.credential
= credential
;
1610 r
.in
.return_authenticator
= return_authenticator
;
1611 r
.in
.database_id
= database_id
;
1612 r
.in
.sync_context
= sync_context
;
1613 r
.in
.preferredmaximumlength
= preferredmaximumlength
;
1615 if (DEBUGLEVEL
>= 10) {
1616 NDR_PRINT_IN_DEBUG(netr_DatabaseSync
, &r
);
1619 status
= cli
->dispatch(cli
,
1621 &ndr_table_netlogon
,
1622 NDR_NETR_DATABASESYNC
,
1625 if (!NT_STATUS_IS_OK(status
)) {
1629 if (DEBUGLEVEL
>= 10) {
1630 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync
, &r
);
1633 if (NT_STATUS_IS_ERR(status
)) {
1637 /* Return variables */
1638 *return_authenticator
= *r
.out
.return_authenticator
;
1639 *sync_context
= *r
.out
.sync_context
;
1640 *delta_enum_array
= *r
.out
.delta_enum_array
;
1643 return r
.out
.result
;
1646 struct rpccli_netr_AccountDeltas_state
{
1647 struct netr_AccountDeltas orig
;
1648 struct netr_AccountDeltas tmp
;
1649 TALLOC_CTX
*out_mem_ctx
;
1650 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1653 static void rpccli_netr_AccountDeltas_done(struct tevent_req
*subreq
);
1655 struct tevent_req
*rpccli_netr_AccountDeltas_send(TALLOC_CTX
*mem_ctx
,
1656 struct tevent_context
*ev
,
1657 struct rpc_pipe_client
*cli
,
1658 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
1659 const char *_computername
/* [in] [ref,charset(UTF16)] */,
1660 struct netr_Authenticator _credential
/* [in] */,
1661 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
1662 struct netr_UAS_INFO_0 _uas
/* [in] */,
1663 uint32_t _count
/* [in] */,
1664 uint32_t _level
/* [in] */,
1665 uint32_t _buffersize
/* [in] */,
1666 struct netr_AccountBuffer
*_buffer
/* [out] [ref,subcontext(4)] */,
1667 uint32_t *_count_returned
/* [out] [ref] */,
1668 uint32_t *_total_entries
/* [out] [ref] */,
1669 struct netr_UAS_INFO_0
*_recordid
/* [out] [ref] */)
1671 struct tevent_req
*req
;
1672 struct rpccli_netr_AccountDeltas_state
*state
;
1673 struct tevent_req
*subreq
;
1675 req
= tevent_req_create(mem_ctx
, &state
,
1676 struct rpccli_netr_AccountDeltas_state
);
1680 state
->out_mem_ctx
= NULL
;
1681 state
->dispatch_recv
= cli
->dispatch_recv
;
1684 state
->orig
.in
.logon_server
= _logon_server
;
1685 state
->orig
.in
.computername
= _computername
;
1686 state
->orig
.in
.credential
= _credential
;
1687 state
->orig
.in
.return_authenticator
= _return_authenticator
;
1688 state
->orig
.in
.uas
= _uas
;
1689 state
->orig
.in
.count
= _count
;
1690 state
->orig
.in
.level
= _level
;
1691 state
->orig
.in
.buffersize
= _buffersize
;
1693 /* Out parameters */
1694 state
->orig
.out
.return_authenticator
= _return_authenticator
;
1695 state
->orig
.out
.buffer
= _buffer
;
1696 state
->orig
.out
.count_returned
= _count_returned
;
1697 state
->orig
.out
.total_entries
= _total_entries
;
1698 state
->orig
.out
.recordid
= _recordid
;
1701 ZERO_STRUCT(state
->orig
.out
.result
);
1703 if (DEBUGLEVEL
>= 10) {
1704 NDR_PRINT_IN_DEBUG(netr_AccountDeltas
, &state
->orig
);
1707 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1708 "rpccli_netr_AccountDeltas_out_memory");
1709 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1710 return tevent_req_post(req
, ev
);
1713 /* make a temporary copy, that we pass to the dispatch function */
1714 state
->tmp
= state
->orig
;
1716 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1717 &ndr_table_netlogon
,
1718 NDR_NETR_ACCOUNTDELTAS
,
1720 if (tevent_req_nomem(subreq
, req
)) {
1721 return tevent_req_post(req
, ev
);
1723 tevent_req_set_callback(subreq
, rpccli_netr_AccountDeltas_done
, req
);
1727 static void rpccli_netr_AccountDeltas_done(struct tevent_req
*subreq
)
1729 struct tevent_req
*req
= tevent_req_callback_data(
1730 subreq
, struct tevent_req
);
1731 struct rpccli_netr_AccountDeltas_state
*state
= tevent_req_data(
1732 req
, struct rpccli_netr_AccountDeltas_state
);
1734 TALLOC_CTX
*mem_ctx
;
1736 if (state
->out_mem_ctx
) {
1737 mem_ctx
= state
->out_mem_ctx
;
1742 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1743 TALLOC_FREE(subreq
);
1744 if (!NT_STATUS_IS_OK(status
)) {
1745 tevent_req_nterror(req
, status
);
1749 /* Copy out parameters */
1750 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
1751 *state
->orig
.out
.buffer
= *state
->tmp
.out
.buffer
;
1752 *state
->orig
.out
.count_returned
= *state
->tmp
.out
.count_returned
;
1753 *state
->orig
.out
.total_entries
= *state
->tmp
.out
.total_entries
;
1754 *state
->orig
.out
.recordid
= *state
->tmp
.out
.recordid
;
1757 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1759 /* Reset temporary structure */
1760 ZERO_STRUCT(state
->tmp
);
1762 if (DEBUGLEVEL
>= 10) {
1763 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas
, &state
->orig
);
1766 tevent_req_done(req
);
1769 NTSTATUS
rpccli_netr_AccountDeltas_recv(struct tevent_req
*req
,
1770 TALLOC_CTX
*mem_ctx
,
1773 struct rpccli_netr_AccountDeltas_state
*state
= tevent_req_data(
1774 req
, struct rpccli_netr_AccountDeltas_state
);
1777 if (tevent_req_is_nterror(req
, &status
)) {
1778 tevent_req_received(req
);
1782 /* Steal possbile out parameters to the callers context */
1783 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1786 *result
= state
->orig
.out
.result
;
1788 tevent_req_received(req
);
1789 return NT_STATUS_OK
;
1792 NTSTATUS
rpccli_netr_AccountDeltas(struct rpc_pipe_client
*cli
,
1793 TALLOC_CTX
*mem_ctx
,
1794 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
1795 const char *computername
/* [in] [ref,charset(UTF16)] */,
1796 struct netr_Authenticator credential
/* [in] */,
1797 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
1798 struct netr_UAS_INFO_0 uas
/* [in] */,
1799 uint32_t count
/* [in] */,
1800 uint32_t level
/* [in] */,
1801 uint32_t buffersize
/* [in] */,
1802 struct netr_AccountBuffer
*buffer
/* [out] [ref,subcontext(4)] */,
1803 uint32_t *count_returned
/* [out] [ref] */,
1804 uint32_t *total_entries
/* [out] [ref] */,
1805 struct netr_UAS_INFO_0
*recordid
/* [out] [ref] */)
1807 struct netr_AccountDeltas r
;
1811 r
.in
.logon_server
= logon_server
;
1812 r
.in
.computername
= computername
;
1813 r
.in
.credential
= credential
;
1814 r
.in
.return_authenticator
= return_authenticator
;
1818 r
.in
.buffersize
= buffersize
;
1820 if (DEBUGLEVEL
>= 10) {
1821 NDR_PRINT_IN_DEBUG(netr_AccountDeltas
, &r
);
1824 status
= cli
->dispatch(cli
,
1826 &ndr_table_netlogon
,
1827 NDR_NETR_ACCOUNTDELTAS
,
1830 if (!NT_STATUS_IS_OK(status
)) {
1834 if (DEBUGLEVEL
>= 10) {
1835 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas
, &r
);
1838 if (NT_STATUS_IS_ERR(status
)) {
1842 /* Return variables */
1843 *return_authenticator
= *r
.out
.return_authenticator
;
1844 *buffer
= *r
.out
.buffer
;
1845 *count_returned
= *r
.out
.count_returned
;
1846 *total_entries
= *r
.out
.total_entries
;
1847 *recordid
= *r
.out
.recordid
;
1850 return r
.out
.result
;
1853 struct rpccli_netr_AccountSync_state
{
1854 struct netr_AccountSync orig
;
1855 struct netr_AccountSync tmp
;
1856 TALLOC_CTX
*out_mem_ctx
;
1857 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
1860 static void rpccli_netr_AccountSync_done(struct tevent_req
*subreq
);
1862 struct tevent_req
*rpccli_netr_AccountSync_send(TALLOC_CTX
*mem_ctx
,
1863 struct tevent_context
*ev
,
1864 struct rpc_pipe_client
*cli
,
1865 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
1866 const char *_computername
/* [in] [ref,charset(UTF16)] */,
1867 struct netr_Authenticator _credential
/* [in] */,
1868 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
1869 uint32_t _reference
/* [in] */,
1870 uint32_t _level
/* [in] */,
1871 uint32_t _buffersize
/* [in] */,
1872 struct netr_AccountBuffer
*_buffer
/* [out] [ref,subcontext(4)] */,
1873 uint32_t *_count_returned
/* [out] [ref] */,
1874 uint32_t *_total_entries
/* [out] [ref] */,
1875 uint32_t *_next_reference
/* [out] [ref] */,
1876 struct netr_UAS_INFO_0
*_recordid
/* [in,out] [ref] */)
1878 struct tevent_req
*req
;
1879 struct rpccli_netr_AccountSync_state
*state
;
1880 struct tevent_req
*subreq
;
1882 req
= tevent_req_create(mem_ctx
, &state
,
1883 struct rpccli_netr_AccountSync_state
);
1887 state
->out_mem_ctx
= NULL
;
1888 state
->dispatch_recv
= cli
->dispatch_recv
;
1891 state
->orig
.in
.logon_server
= _logon_server
;
1892 state
->orig
.in
.computername
= _computername
;
1893 state
->orig
.in
.credential
= _credential
;
1894 state
->orig
.in
.return_authenticator
= _return_authenticator
;
1895 state
->orig
.in
.reference
= _reference
;
1896 state
->orig
.in
.level
= _level
;
1897 state
->orig
.in
.buffersize
= _buffersize
;
1898 state
->orig
.in
.recordid
= _recordid
;
1900 /* Out parameters */
1901 state
->orig
.out
.return_authenticator
= _return_authenticator
;
1902 state
->orig
.out
.buffer
= _buffer
;
1903 state
->orig
.out
.count_returned
= _count_returned
;
1904 state
->orig
.out
.total_entries
= _total_entries
;
1905 state
->orig
.out
.next_reference
= _next_reference
;
1906 state
->orig
.out
.recordid
= _recordid
;
1909 ZERO_STRUCT(state
->orig
.out
.result
);
1911 if (DEBUGLEVEL
>= 10) {
1912 NDR_PRINT_IN_DEBUG(netr_AccountSync
, &state
->orig
);
1915 state
->out_mem_ctx
= talloc_named_const(state
, 0,
1916 "rpccli_netr_AccountSync_out_memory");
1917 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
1918 return tevent_req_post(req
, ev
);
1921 /* make a temporary copy, that we pass to the dispatch function */
1922 state
->tmp
= state
->orig
;
1924 subreq
= cli
->dispatch_send(state
, ev
, cli
,
1925 &ndr_table_netlogon
,
1926 NDR_NETR_ACCOUNTSYNC
,
1928 if (tevent_req_nomem(subreq
, req
)) {
1929 return tevent_req_post(req
, ev
);
1931 tevent_req_set_callback(subreq
, rpccli_netr_AccountSync_done
, req
);
1935 static void rpccli_netr_AccountSync_done(struct tevent_req
*subreq
)
1937 struct tevent_req
*req
= tevent_req_callback_data(
1938 subreq
, struct tevent_req
);
1939 struct rpccli_netr_AccountSync_state
*state
= tevent_req_data(
1940 req
, struct rpccli_netr_AccountSync_state
);
1942 TALLOC_CTX
*mem_ctx
;
1944 if (state
->out_mem_ctx
) {
1945 mem_ctx
= state
->out_mem_ctx
;
1950 status
= state
->dispatch_recv(subreq
, mem_ctx
);
1951 TALLOC_FREE(subreq
);
1952 if (!NT_STATUS_IS_OK(status
)) {
1953 tevent_req_nterror(req
, status
);
1957 /* Copy out parameters */
1958 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
1959 *state
->orig
.out
.buffer
= *state
->tmp
.out
.buffer
;
1960 *state
->orig
.out
.count_returned
= *state
->tmp
.out
.count_returned
;
1961 *state
->orig
.out
.total_entries
= *state
->tmp
.out
.total_entries
;
1962 *state
->orig
.out
.next_reference
= *state
->tmp
.out
.next_reference
;
1963 *state
->orig
.out
.recordid
= *state
->tmp
.out
.recordid
;
1966 state
->orig
.out
.result
= state
->tmp
.out
.result
;
1968 /* Reset temporary structure */
1969 ZERO_STRUCT(state
->tmp
);
1971 if (DEBUGLEVEL
>= 10) {
1972 NDR_PRINT_OUT_DEBUG(netr_AccountSync
, &state
->orig
);
1975 tevent_req_done(req
);
1978 NTSTATUS
rpccli_netr_AccountSync_recv(struct tevent_req
*req
,
1979 TALLOC_CTX
*mem_ctx
,
1982 struct rpccli_netr_AccountSync_state
*state
= tevent_req_data(
1983 req
, struct rpccli_netr_AccountSync_state
);
1986 if (tevent_req_is_nterror(req
, &status
)) {
1987 tevent_req_received(req
);
1991 /* Steal possbile out parameters to the callers context */
1992 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
1995 *result
= state
->orig
.out
.result
;
1997 tevent_req_received(req
);
1998 return NT_STATUS_OK
;
2001 NTSTATUS
rpccli_netr_AccountSync(struct rpc_pipe_client
*cli
,
2002 TALLOC_CTX
*mem_ctx
,
2003 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
2004 const char *computername
/* [in] [ref,charset(UTF16)] */,
2005 struct netr_Authenticator credential
/* [in] */,
2006 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
2007 uint32_t reference
/* [in] */,
2008 uint32_t level
/* [in] */,
2009 uint32_t buffersize
/* [in] */,
2010 struct netr_AccountBuffer
*buffer
/* [out] [ref,subcontext(4)] */,
2011 uint32_t *count_returned
/* [out] [ref] */,
2012 uint32_t *total_entries
/* [out] [ref] */,
2013 uint32_t *next_reference
/* [out] [ref] */,
2014 struct netr_UAS_INFO_0
*recordid
/* [in,out] [ref] */)
2016 struct netr_AccountSync r
;
2020 r
.in
.logon_server
= logon_server
;
2021 r
.in
.computername
= computername
;
2022 r
.in
.credential
= credential
;
2023 r
.in
.return_authenticator
= return_authenticator
;
2024 r
.in
.reference
= reference
;
2026 r
.in
.buffersize
= buffersize
;
2027 r
.in
.recordid
= recordid
;
2029 if (DEBUGLEVEL
>= 10) {
2030 NDR_PRINT_IN_DEBUG(netr_AccountSync
, &r
);
2033 status
= cli
->dispatch(cli
,
2035 &ndr_table_netlogon
,
2036 NDR_NETR_ACCOUNTSYNC
,
2039 if (!NT_STATUS_IS_OK(status
)) {
2043 if (DEBUGLEVEL
>= 10) {
2044 NDR_PRINT_OUT_DEBUG(netr_AccountSync
, &r
);
2047 if (NT_STATUS_IS_ERR(status
)) {
2051 /* Return variables */
2052 *return_authenticator
= *r
.out
.return_authenticator
;
2053 *buffer
= *r
.out
.buffer
;
2054 *count_returned
= *r
.out
.count_returned
;
2055 *total_entries
= *r
.out
.total_entries
;
2056 *next_reference
= *r
.out
.next_reference
;
2057 *recordid
= *r
.out
.recordid
;
2060 return r
.out
.result
;
2063 struct rpccli_netr_GetDcName_state
{
2064 struct netr_GetDcName orig
;
2065 struct netr_GetDcName tmp
;
2066 TALLOC_CTX
*out_mem_ctx
;
2067 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2070 static void rpccli_netr_GetDcName_done(struct tevent_req
*subreq
);
2072 struct tevent_req
*rpccli_netr_GetDcName_send(TALLOC_CTX
*mem_ctx
,
2073 struct tevent_context
*ev
,
2074 struct rpc_pipe_client
*cli
,
2075 const char *_logon_server
/* [in] [ref,charset(UTF16)] */,
2076 const char *_domainname
/* [in] [unique,charset(UTF16)] */,
2077 const char **_dcname
/* [out] [ref,charset(UTF16)] */)
2079 struct tevent_req
*req
;
2080 struct rpccli_netr_GetDcName_state
*state
;
2081 struct tevent_req
*subreq
;
2083 req
= tevent_req_create(mem_ctx
, &state
,
2084 struct rpccli_netr_GetDcName_state
);
2088 state
->out_mem_ctx
= NULL
;
2089 state
->dispatch_recv
= cli
->dispatch_recv
;
2092 state
->orig
.in
.logon_server
= _logon_server
;
2093 state
->orig
.in
.domainname
= _domainname
;
2095 /* Out parameters */
2096 state
->orig
.out
.dcname
= _dcname
;
2099 ZERO_STRUCT(state
->orig
.out
.result
);
2101 if (DEBUGLEVEL
>= 10) {
2102 NDR_PRINT_IN_DEBUG(netr_GetDcName
, &state
->orig
);
2105 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2106 "rpccli_netr_GetDcName_out_memory");
2107 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2108 return tevent_req_post(req
, ev
);
2111 /* make a temporary copy, that we pass to the dispatch function */
2112 state
->tmp
= state
->orig
;
2114 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2115 &ndr_table_netlogon
,
2118 if (tevent_req_nomem(subreq
, req
)) {
2119 return tevent_req_post(req
, ev
);
2121 tevent_req_set_callback(subreq
, rpccli_netr_GetDcName_done
, req
);
2125 static void rpccli_netr_GetDcName_done(struct tevent_req
*subreq
)
2127 struct tevent_req
*req
= tevent_req_callback_data(
2128 subreq
, struct tevent_req
);
2129 struct rpccli_netr_GetDcName_state
*state
= tevent_req_data(
2130 req
, struct rpccli_netr_GetDcName_state
);
2132 TALLOC_CTX
*mem_ctx
;
2134 if (state
->out_mem_ctx
) {
2135 mem_ctx
= state
->out_mem_ctx
;
2140 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2141 TALLOC_FREE(subreq
);
2142 if (!NT_STATUS_IS_OK(status
)) {
2143 tevent_req_nterror(req
, status
);
2147 /* Copy out parameters */
2148 *state
->orig
.out
.dcname
= *state
->tmp
.out
.dcname
;
2151 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2153 /* Reset temporary structure */
2154 ZERO_STRUCT(state
->tmp
);
2156 if (DEBUGLEVEL
>= 10) {
2157 NDR_PRINT_OUT_DEBUG(netr_GetDcName
, &state
->orig
);
2160 tevent_req_done(req
);
2163 NTSTATUS
rpccli_netr_GetDcName_recv(struct tevent_req
*req
,
2164 TALLOC_CTX
*mem_ctx
,
2167 struct rpccli_netr_GetDcName_state
*state
= tevent_req_data(
2168 req
, struct rpccli_netr_GetDcName_state
);
2171 if (tevent_req_is_nterror(req
, &status
)) {
2172 tevent_req_received(req
);
2176 /* Steal possbile out parameters to the callers context */
2177 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2180 *result
= state
->orig
.out
.result
;
2182 tevent_req_received(req
);
2183 return NT_STATUS_OK
;
2186 NTSTATUS
rpccli_netr_GetDcName(struct rpc_pipe_client
*cli
,
2187 TALLOC_CTX
*mem_ctx
,
2188 const char *logon_server
/* [in] [ref,charset(UTF16)] */,
2189 const char *domainname
/* [in] [unique,charset(UTF16)] */,
2190 const char **dcname
/* [out] [ref,charset(UTF16)] */,
2193 struct netr_GetDcName r
;
2197 r
.in
.logon_server
= logon_server
;
2198 r
.in
.domainname
= domainname
;
2200 if (DEBUGLEVEL
>= 10) {
2201 NDR_PRINT_IN_DEBUG(netr_GetDcName
, &r
);
2204 status
= cli
->dispatch(cli
,
2206 &ndr_table_netlogon
,
2210 if (!NT_STATUS_IS_OK(status
)) {
2214 if (DEBUGLEVEL
>= 10) {
2215 NDR_PRINT_OUT_DEBUG(netr_GetDcName
, &r
);
2218 if (NT_STATUS_IS_ERR(status
)) {
2222 /* Return variables */
2223 *dcname
= *r
.out
.dcname
;
2227 *werror
= r
.out
.result
;
2230 return werror_to_ntstatus(r
.out
.result
);
2233 struct rpccli_netr_LogonControl_state
{
2234 struct netr_LogonControl orig
;
2235 struct netr_LogonControl tmp
;
2236 TALLOC_CTX
*out_mem_ctx
;
2237 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2240 static void rpccli_netr_LogonControl_done(struct tevent_req
*subreq
);
2242 struct tevent_req
*rpccli_netr_LogonControl_send(TALLOC_CTX
*mem_ctx
,
2243 struct tevent_context
*ev
,
2244 struct rpc_pipe_client
*cli
,
2245 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
2246 enum netr_LogonControlCode _function_code
/* [in] */,
2247 uint32_t _level
/* [in] */,
2248 union netr_CONTROL_QUERY_INFORMATION
*_query
/* [out] [ref,switch_is(level)] */)
2250 struct tevent_req
*req
;
2251 struct rpccli_netr_LogonControl_state
*state
;
2252 struct tevent_req
*subreq
;
2254 req
= tevent_req_create(mem_ctx
, &state
,
2255 struct rpccli_netr_LogonControl_state
);
2259 state
->out_mem_ctx
= NULL
;
2260 state
->dispatch_recv
= cli
->dispatch_recv
;
2263 state
->orig
.in
.logon_server
= _logon_server
;
2264 state
->orig
.in
.function_code
= _function_code
;
2265 state
->orig
.in
.level
= _level
;
2267 /* Out parameters */
2268 state
->orig
.out
.query
= _query
;
2271 ZERO_STRUCT(state
->orig
.out
.result
);
2273 if (DEBUGLEVEL
>= 10) {
2274 NDR_PRINT_IN_DEBUG(netr_LogonControl
, &state
->orig
);
2277 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2278 "rpccli_netr_LogonControl_out_memory");
2279 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2280 return tevent_req_post(req
, ev
);
2283 /* make a temporary copy, that we pass to the dispatch function */
2284 state
->tmp
= state
->orig
;
2286 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2287 &ndr_table_netlogon
,
2288 NDR_NETR_LOGONCONTROL
,
2290 if (tevent_req_nomem(subreq
, req
)) {
2291 return tevent_req_post(req
, ev
);
2293 tevent_req_set_callback(subreq
, rpccli_netr_LogonControl_done
, req
);
2297 static void rpccli_netr_LogonControl_done(struct tevent_req
*subreq
)
2299 struct tevent_req
*req
= tevent_req_callback_data(
2300 subreq
, struct tevent_req
);
2301 struct rpccli_netr_LogonControl_state
*state
= tevent_req_data(
2302 req
, struct rpccli_netr_LogonControl_state
);
2304 TALLOC_CTX
*mem_ctx
;
2306 if (state
->out_mem_ctx
) {
2307 mem_ctx
= state
->out_mem_ctx
;
2312 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2313 TALLOC_FREE(subreq
);
2314 if (!NT_STATUS_IS_OK(status
)) {
2315 tevent_req_nterror(req
, status
);
2319 /* Copy out parameters */
2320 *state
->orig
.out
.query
= *state
->tmp
.out
.query
;
2323 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2325 /* Reset temporary structure */
2326 ZERO_STRUCT(state
->tmp
);
2328 if (DEBUGLEVEL
>= 10) {
2329 NDR_PRINT_OUT_DEBUG(netr_LogonControl
, &state
->orig
);
2332 tevent_req_done(req
);
2335 NTSTATUS
rpccli_netr_LogonControl_recv(struct tevent_req
*req
,
2336 TALLOC_CTX
*mem_ctx
,
2339 struct rpccli_netr_LogonControl_state
*state
= tevent_req_data(
2340 req
, struct rpccli_netr_LogonControl_state
);
2343 if (tevent_req_is_nterror(req
, &status
)) {
2344 tevent_req_received(req
);
2348 /* Steal possbile out parameters to the callers context */
2349 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2352 *result
= state
->orig
.out
.result
;
2354 tevent_req_received(req
);
2355 return NT_STATUS_OK
;
2358 NTSTATUS
rpccli_netr_LogonControl(struct rpc_pipe_client
*cli
,
2359 TALLOC_CTX
*mem_ctx
,
2360 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
2361 enum netr_LogonControlCode function_code
/* [in] */,
2362 uint32_t level
/* [in] */,
2363 union netr_CONTROL_QUERY_INFORMATION
*query
/* [out] [ref,switch_is(level)] */,
2366 struct netr_LogonControl r
;
2370 r
.in
.logon_server
= logon_server
;
2371 r
.in
.function_code
= function_code
;
2374 if (DEBUGLEVEL
>= 10) {
2375 NDR_PRINT_IN_DEBUG(netr_LogonControl
, &r
);
2378 status
= cli
->dispatch(cli
,
2380 &ndr_table_netlogon
,
2381 NDR_NETR_LOGONCONTROL
,
2384 if (!NT_STATUS_IS_OK(status
)) {
2388 if (DEBUGLEVEL
>= 10) {
2389 NDR_PRINT_OUT_DEBUG(netr_LogonControl
, &r
);
2392 if (NT_STATUS_IS_ERR(status
)) {
2396 /* Return variables */
2397 *query
= *r
.out
.query
;
2401 *werror
= r
.out
.result
;
2404 return werror_to_ntstatus(r
.out
.result
);
2407 struct rpccli_netr_GetAnyDCName_state
{
2408 struct netr_GetAnyDCName orig
;
2409 struct netr_GetAnyDCName tmp
;
2410 TALLOC_CTX
*out_mem_ctx
;
2411 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2414 static void rpccli_netr_GetAnyDCName_done(struct tevent_req
*subreq
);
2416 struct tevent_req
*rpccli_netr_GetAnyDCName_send(TALLOC_CTX
*mem_ctx
,
2417 struct tevent_context
*ev
,
2418 struct rpc_pipe_client
*cli
,
2419 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
2420 const char *_domainname
/* [in] [unique,charset(UTF16)] */,
2421 const char **_dcname
/* [out] [ref,charset(UTF16)] */)
2423 struct tevent_req
*req
;
2424 struct rpccli_netr_GetAnyDCName_state
*state
;
2425 struct tevent_req
*subreq
;
2427 req
= tevent_req_create(mem_ctx
, &state
,
2428 struct rpccli_netr_GetAnyDCName_state
);
2432 state
->out_mem_ctx
= NULL
;
2433 state
->dispatch_recv
= cli
->dispatch_recv
;
2436 state
->orig
.in
.logon_server
= _logon_server
;
2437 state
->orig
.in
.domainname
= _domainname
;
2439 /* Out parameters */
2440 state
->orig
.out
.dcname
= _dcname
;
2443 ZERO_STRUCT(state
->orig
.out
.result
);
2445 if (DEBUGLEVEL
>= 10) {
2446 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName
, &state
->orig
);
2449 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2450 "rpccli_netr_GetAnyDCName_out_memory");
2451 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2452 return tevent_req_post(req
, ev
);
2455 /* make a temporary copy, that we pass to the dispatch function */
2456 state
->tmp
= state
->orig
;
2458 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2459 &ndr_table_netlogon
,
2460 NDR_NETR_GETANYDCNAME
,
2462 if (tevent_req_nomem(subreq
, req
)) {
2463 return tevent_req_post(req
, ev
);
2465 tevent_req_set_callback(subreq
, rpccli_netr_GetAnyDCName_done
, req
);
2469 static void rpccli_netr_GetAnyDCName_done(struct tevent_req
*subreq
)
2471 struct tevent_req
*req
= tevent_req_callback_data(
2472 subreq
, struct tevent_req
);
2473 struct rpccli_netr_GetAnyDCName_state
*state
= tevent_req_data(
2474 req
, struct rpccli_netr_GetAnyDCName_state
);
2476 TALLOC_CTX
*mem_ctx
;
2478 if (state
->out_mem_ctx
) {
2479 mem_ctx
= state
->out_mem_ctx
;
2484 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2485 TALLOC_FREE(subreq
);
2486 if (!NT_STATUS_IS_OK(status
)) {
2487 tevent_req_nterror(req
, status
);
2491 /* Copy out parameters */
2492 *state
->orig
.out
.dcname
= *state
->tmp
.out
.dcname
;
2495 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2497 /* Reset temporary structure */
2498 ZERO_STRUCT(state
->tmp
);
2500 if (DEBUGLEVEL
>= 10) {
2501 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName
, &state
->orig
);
2504 tevent_req_done(req
);
2507 NTSTATUS
rpccli_netr_GetAnyDCName_recv(struct tevent_req
*req
,
2508 TALLOC_CTX
*mem_ctx
,
2511 struct rpccli_netr_GetAnyDCName_state
*state
= tevent_req_data(
2512 req
, struct rpccli_netr_GetAnyDCName_state
);
2515 if (tevent_req_is_nterror(req
, &status
)) {
2516 tevent_req_received(req
);
2520 /* Steal possbile out parameters to the callers context */
2521 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2524 *result
= state
->orig
.out
.result
;
2526 tevent_req_received(req
);
2527 return NT_STATUS_OK
;
2530 NTSTATUS
rpccli_netr_GetAnyDCName(struct rpc_pipe_client
*cli
,
2531 TALLOC_CTX
*mem_ctx
,
2532 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
2533 const char *domainname
/* [in] [unique,charset(UTF16)] */,
2534 const char **dcname
/* [out] [ref,charset(UTF16)] */,
2537 struct netr_GetAnyDCName r
;
2541 r
.in
.logon_server
= logon_server
;
2542 r
.in
.domainname
= domainname
;
2544 if (DEBUGLEVEL
>= 10) {
2545 NDR_PRINT_IN_DEBUG(netr_GetAnyDCName
, &r
);
2548 status
= cli
->dispatch(cli
,
2550 &ndr_table_netlogon
,
2551 NDR_NETR_GETANYDCNAME
,
2554 if (!NT_STATUS_IS_OK(status
)) {
2558 if (DEBUGLEVEL
>= 10) {
2559 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName
, &r
);
2562 if (NT_STATUS_IS_ERR(status
)) {
2566 /* Return variables */
2567 *dcname
= *r
.out
.dcname
;
2571 *werror
= r
.out
.result
;
2574 return werror_to_ntstatus(r
.out
.result
);
2577 struct rpccli_netr_LogonControl2_state
{
2578 struct netr_LogonControl2 orig
;
2579 struct netr_LogonControl2 tmp
;
2580 TALLOC_CTX
*out_mem_ctx
;
2581 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2584 static void rpccli_netr_LogonControl2_done(struct tevent_req
*subreq
);
2586 struct tevent_req
*rpccli_netr_LogonControl2_send(TALLOC_CTX
*mem_ctx
,
2587 struct tevent_context
*ev
,
2588 struct rpc_pipe_client
*cli
,
2589 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
2590 enum netr_LogonControlCode _function_code
/* [in] */,
2591 uint32_t _level
/* [in] */,
2592 union netr_CONTROL_DATA_INFORMATION
*_data
/* [in] [ref,switch_is(function_code)] */,
2593 union netr_CONTROL_QUERY_INFORMATION
*_query
/* [out] [ref,switch_is(level)] */)
2595 struct tevent_req
*req
;
2596 struct rpccli_netr_LogonControl2_state
*state
;
2597 struct tevent_req
*subreq
;
2599 req
= tevent_req_create(mem_ctx
, &state
,
2600 struct rpccli_netr_LogonControl2_state
);
2604 state
->out_mem_ctx
= NULL
;
2605 state
->dispatch_recv
= cli
->dispatch_recv
;
2608 state
->orig
.in
.logon_server
= _logon_server
;
2609 state
->orig
.in
.function_code
= _function_code
;
2610 state
->orig
.in
.level
= _level
;
2611 state
->orig
.in
.data
= _data
;
2613 /* Out parameters */
2614 state
->orig
.out
.query
= _query
;
2617 ZERO_STRUCT(state
->orig
.out
.result
);
2619 if (DEBUGLEVEL
>= 10) {
2620 NDR_PRINT_IN_DEBUG(netr_LogonControl2
, &state
->orig
);
2623 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2624 "rpccli_netr_LogonControl2_out_memory");
2625 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2626 return tevent_req_post(req
, ev
);
2629 /* make a temporary copy, that we pass to the dispatch function */
2630 state
->tmp
= state
->orig
;
2632 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2633 &ndr_table_netlogon
,
2634 NDR_NETR_LOGONCONTROL2
,
2636 if (tevent_req_nomem(subreq
, req
)) {
2637 return tevent_req_post(req
, ev
);
2639 tevent_req_set_callback(subreq
, rpccli_netr_LogonControl2_done
, req
);
2643 static void rpccli_netr_LogonControl2_done(struct tevent_req
*subreq
)
2645 struct tevent_req
*req
= tevent_req_callback_data(
2646 subreq
, struct tevent_req
);
2647 struct rpccli_netr_LogonControl2_state
*state
= tevent_req_data(
2648 req
, struct rpccli_netr_LogonControl2_state
);
2650 TALLOC_CTX
*mem_ctx
;
2652 if (state
->out_mem_ctx
) {
2653 mem_ctx
= state
->out_mem_ctx
;
2658 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2659 TALLOC_FREE(subreq
);
2660 if (!NT_STATUS_IS_OK(status
)) {
2661 tevent_req_nterror(req
, status
);
2665 /* Copy out parameters */
2666 *state
->orig
.out
.query
= *state
->tmp
.out
.query
;
2669 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2671 /* Reset temporary structure */
2672 ZERO_STRUCT(state
->tmp
);
2674 if (DEBUGLEVEL
>= 10) {
2675 NDR_PRINT_OUT_DEBUG(netr_LogonControl2
, &state
->orig
);
2678 tevent_req_done(req
);
2681 NTSTATUS
rpccli_netr_LogonControl2_recv(struct tevent_req
*req
,
2682 TALLOC_CTX
*mem_ctx
,
2685 struct rpccli_netr_LogonControl2_state
*state
= tevent_req_data(
2686 req
, struct rpccli_netr_LogonControl2_state
);
2689 if (tevent_req_is_nterror(req
, &status
)) {
2690 tevent_req_received(req
);
2694 /* Steal possbile out parameters to the callers context */
2695 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2698 *result
= state
->orig
.out
.result
;
2700 tevent_req_received(req
);
2701 return NT_STATUS_OK
;
2704 NTSTATUS
rpccli_netr_LogonControl2(struct rpc_pipe_client
*cli
,
2705 TALLOC_CTX
*mem_ctx
,
2706 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
2707 enum netr_LogonControlCode function_code
/* [in] */,
2708 uint32_t level
/* [in] */,
2709 union netr_CONTROL_DATA_INFORMATION
*data
/* [in] [ref,switch_is(function_code)] */,
2710 union netr_CONTROL_QUERY_INFORMATION
*query
/* [out] [ref,switch_is(level)] */,
2713 struct netr_LogonControl2 r
;
2717 r
.in
.logon_server
= logon_server
;
2718 r
.in
.function_code
= function_code
;
2722 if (DEBUGLEVEL
>= 10) {
2723 NDR_PRINT_IN_DEBUG(netr_LogonControl2
, &r
);
2726 status
= cli
->dispatch(cli
,
2728 &ndr_table_netlogon
,
2729 NDR_NETR_LOGONCONTROL2
,
2732 if (!NT_STATUS_IS_OK(status
)) {
2736 if (DEBUGLEVEL
>= 10) {
2737 NDR_PRINT_OUT_DEBUG(netr_LogonControl2
, &r
);
2740 if (NT_STATUS_IS_ERR(status
)) {
2744 /* Return variables */
2745 *query
= *r
.out
.query
;
2749 *werror
= r
.out
.result
;
2752 return werror_to_ntstatus(r
.out
.result
);
2755 struct rpccli_netr_ServerAuthenticate2_state
{
2756 struct netr_ServerAuthenticate2 orig
;
2757 struct netr_ServerAuthenticate2 tmp
;
2758 TALLOC_CTX
*out_mem_ctx
;
2759 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2762 static void rpccli_netr_ServerAuthenticate2_done(struct tevent_req
*subreq
);
2764 struct tevent_req
*rpccli_netr_ServerAuthenticate2_send(TALLOC_CTX
*mem_ctx
,
2765 struct tevent_context
*ev
,
2766 struct rpc_pipe_client
*cli
,
2767 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
2768 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
2769 enum netr_SchannelType _secure_channel_type
/* [in] */,
2770 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
2771 struct netr_Credential
*_credentials
/* [in] [ref] */,
2772 struct netr_Credential
*_return_credentials
/* [out] [ref] */,
2773 uint32_t *_negotiate_flags
/* [in,out] [ref] */)
2775 struct tevent_req
*req
;
2776 struct rpccli_netr_ServerAuthenticate2_state
*state
;
2777 struct tevent_req
*subreq
;
2779 req
= tevent_req_create(mem_ctx
, &state
,
2780 struct rpccli_netr_ServerAuthenticate2_state
);
2784 state
->out_mem_ctx
= NULL
;
2785 state
->dispatch_recv
= cli
->dispatch_recv
;
2788 state
->orig
.in
.server_name
= _server_name
;
2789 state
->orig
.in
.account_name
= _account_name
;
2790 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
2791 state
->orig
.in
.computer_name
= _computer_name
;
2792 state
->orig
.in
.credentials
= _credentials
;
2793 state
->orig
.in
.negotiate_flags
= _negotiate_flags
;
2795 /* Out parameters */
2796 state
->orig
.out
.return_credentials
= _return_credentials
;
2797 state
->orig
.out
.negotiate_flags
= _negotiate_flags
;
2800 ZERO_STRUCT(state
->orig
.out
.result
);
2802 if (DEBUGLEVEL
>= 10) {
2803 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2
, &state
->orig
);
2806 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2807 "rpccli_netr_ServerAuthenticate2_out_memory");
2808 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2809 return tevent_req_post(req
, ev
);
2812 /* make a temporary copy, that we pass to the dispatch function */
2813 state
->tmp
= state
->orig
;
2815 subreq
= cli
->dispatch_send(state
, ev
, cli
,
2816 &ndr_table_netlogon
,
2817 NDR_NETR_SERVERAUTHENTICATE2
,
2819 if (tevent_req_nomem(subreq
, req
)) {
2820 return tevent_req_post(req
, ev
);
2822 tevent_req_set_callback(subreq
, rpccli_netr_ServerAuthenticate2_done
, req
);
2826 static void rpccli_netr_ServerAuthenticate2_done(struct tevent_req
*subreq
)
2828 struct tevent_req
*req
= tevent_req_callback_data(
2829 subreq
, struct tevent_req
);
2830 struct rpccli_netr_ServerAuthenticate2_state
*state
= tevent_req_data(
2831 req
, struct rpccli_netr_ServerAuthenticate2_state
);
2833 TALLOC_CTX
*mem_ctx
;
2835 if (state
->out_mem_ctx
) {
2836 mem_ctx
= state
->out_mem_ctx
;
2841 status
= state
->dispatch_recv(subreq
, mem_ctx
);
2842 TALLOC_FREE(subreq
);
2843 if (!NT_STATUS_IS_OK(status
)) {
2844 tevent_req_nterror(req
, status
);
2848 /* Copy out parameters */
2849 *state
->orig
.out
.return_credentials
= *state
->tmp
.out
.return_credentials
;
2850 *state
->orig
.out
.negotiate_flags
= *state
->tmp
.out
.negotiate_flags
;
2853 state
->orig
.out
.result
= state
->tmp
.out
.result
;
2855 /* Reset temporary structure */
2856 ZERO_STRUCT(state
->tmp
);
2858 if (DEBUGLEVEL
>= 10) {
2859 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2
, &state
->orig
);
2862 tevent_req_done(req
);
2865 NTSTATUS
rpccli_netr_ServerAuthenticate2_recv(struct tevent_req
*req
,
2866 TALLOC_CTX
*mem_ctx
,
2869 struct rpccli_netr_ServerAuthenticate2_state
*state
= tevent_req_data(
2870 req
, struct rpccli_netr_ServerAuthenticate2_state
);
2873 if (tevent_req_is_nterror(req
, &status
)) {
2874 tevent_req_received(req
);
2878 /* Steal possbile out parameters to the callers context */
2879 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
2882 *result
= state
->orig
.out
.result
;
2884 tevent_req_received(req
);
2885 return NT_STATUS_OK
;
2888 NTSTATUS
rpccli_netr_ServerAuthenticate2(struct rpc_pipe_client
*cli
,
2889 TALLOC_CTX
*mem_ctx
,
2890 const char *server_name
/* [in] [unique,charset(UTF16)] */,
2891 const char *account_name
/* [in] [ref,charset(UTF16)] */,
2892 enum netr_SchannelType secure_channel_type
/* [in] */,
2893 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
2894 struct netr_Credential
*credentials
/* [in] [ref] */,
2895 struct netr_Credential
*return_credentials
/* [out] [ref] */,
2896 uint32_t *negotiate_flags
/* [in,out] [ref] */)
2898 struct netr_ServerAuthenticate2 r
;
2902 r
.in
.server_name
= server_name
;
2903 r
.in
.account_name
= account_name
;
2904 r
.in
.secure_channel_type
= secure_channel_type
;
2905 r
.in
.computer_name
= computer_name
;
2906 r
.in
.credentials
= credentials
;
2907 r
.in
.negotiate_flags
= negotiate_flags
;
2909 if (DEBUGLEVEL
>= 10) {
2910 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate2
, &r
);
2913 status
= cli
->dispatch(cli
,
2915 &ndr_table_netlogon
,
2916 NDR_NETR_SERVERAUTHENTICATE2
,
2919 if (!NT_STATUS_IS_OK(status
)) {
2923 if (DEBUGLEVEL
>= 10) {
2924 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2
, &r
);
2927 if (NT_STATUS_IS_ERR(status
)) {
2931 /* Return variables */
2932 *return_credentials
= *r
.out
.return_credentials
;
2933 *negotiate_flags
= *r
.out
.negotiate_flags
;
2936 return r
.out
.result
;
2939 struct rpccli_netr_DatabaseSync2_state
{
2940 struct netr_DatabaseSync2 orig
;
2941 struct netr_DatabaseSync2 tmp
;
2942 TALLOC_CTX
*out_mem_ctx
;
2943 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
2946 static void rpccli_netr_DatabaseSync2_done(struct tevent_req
*subreq
);
2948 struct tevent_req
*rpccli_netr_DatabaseSync2_send(TALLOC_CTX
*mem_ctx
,
2949 struct tevent_context
*ev
,
2950 struct rpc_pipe_client
*cli
,
2951 const char *_logon_server
/* [in] [ref,charset(UTF16)] */,
2952 const char *_computername
/* [in] [ref,charset(UTF16)] */,
2953 struct netr_Authenticator
*_credential
/* [in] [ref] */,
2954 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
2955 enum netr_SamDatabaseID _database_id
/* [in] */,
2956 enum SyncStateEnum _restart_state
/* [in] */,
2957 uint32_t *_sync_context
/* [in,out] [ref] */,
2958 struct netr_DELTA_ENUM_ARRAY
**_delta_enum_array
/* [out] [ref] */,
2959 uint32_t _preferredmaximumlength
/* [in] */)
2961 struct tevent_req
*req
;
2962 struct rpccli_netr_DatabaseSync2_state
*state
;
2963 struct tevent_req
*subreq
;
2965 req
= tevent_req_create(mem_ctx
, &state
,
2966 struct rpccli_netr_DatabaseSync2_state
);
2970 state
->out_mem_ctx
= NULL
;
2971 state
->dispatch_recv
= cli
->dispatch_recv
;
2974 state
->orig
.in
.logon_server
= _logon_server
;
2975 state
->orig
.in
.computername
= _computername
;
2976 state
->orig
.in
.credential
= _credential
;
2977 state
->orig
.in
.return_authenticator
= _return_authenticator
;
2978 state
->orig
.in
.database_id
= _database_id
;
2979 state
->orig
.in
.restart_state
= _restart_state
;
2980 state
->orig
.in
.sync_context
= _sync_context
;
2981 state
->orig
.in
.preferredmaximumlength
= _preferredmaximumlength
;
2983 /* Out parameters */
2984 state
->orig
.out
.return_authenticator
= _return_authenticator
;
2985 state
->orig
.out
.sync_context
= _sync_context
;
2986 state
->orig
.out
.delta_enum_array
= _delta_enum_array
;
2989 ZERO_STRUCT(state
->orig
.out
.result
);
2991 if (DEBUGLEVEL
>= 10) {
2992 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2
, &state
->orig
);
2995 state
->out_mem_ctx
= talloc_named_const(state
, 0,
2996 "rpccli_netr_DatabaseSync2_out_memory");
2997 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
2998 return tevent_req_post(req
, ev
);
3001 /* make a temporary copy, that we pass to the dispatch function */
3002 state
->tmp
= state
->orig
;
3004 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3005 &ndr_table_netlogon
,
3006 NDR_NETR_DATABASESYNC2
,
3008 if (tevent_req_nomem(subreq
, req
)) {
3009 return tevent_req_post(req
, ev
);
3011 tevent_req_set_callback(subreq
, rpccli_netr_DatabaseSync2_done
, req
);
3015 static void rpccli_netr_DatabaseSync2_done(struct tevent_req
*subreq
)
3017 struct tevent_req
*req
= tevent_req_callback_data(
3018 subreq
, struct tevent_req
);
3019 struct rpccli_netr_DatabaseSync2_state
*state
= tevent_req_data(
3020 req
, struct rpccli_netr_DatabaseSync2_state
);
3022 TALLOC_CTX
*mem_ctx
;
3024 if (state
->out_mem_ctx
) {
3025 mem_ctx
= state
->out_mem_ctx
;
3030 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3031 TALLOC_FREE(subreq
);
3032 if (!NT_STATUS_IS_OK(status
)) {
3033 tevent_req_nterror(req
, status
);
3037 /* Copy out parameters */
3038 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
3039 *state
->orig
.out
.sync_context
= *state
->tmp
.out
.sync_context
;
3040 *state
->orig
.out
.delta_enum_array
= *state
->tmp
.out
.delta_enum_array
;
3043 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3045 /* Reset temporary structure */
3046 ZERO_STRUCT(state
->tmp
);
3048 if (DEBUGLEVEL
>= 10) {
3049 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2
, &state
->orig
);
3052 tevent_req_done(req
);
3055 NTSTATUS
rpccli_netr_DatabaseSync2_recv(struct tevent_req
*req
,
3056 TALLOC_CTX
*mem_ctx
,
3059 struct rpccli_netr_DatabaseSync2_state
*state
= tevent_req_data(
3060 req
, struct rpccli_netr_DatabaseSync2_state
);
3063 if (tevent_req_is_nterror(req
, &status
)) {
3064 tevent_req_received(req
);
3068 /* Steal possbile out parameters to the callers context */
3069 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3072 *result
= state
->orig
.out
.result
;
3074 tevent_req_received(req
);
3075 return NT_STATUS_OK
;
3078 NTSTATUS
rpccli_netr_DatabaseSync2(struct rpc_pipe_client
*cli
,
3079 TALLOC_CTX
*mem_ctx
,
3080 const char *logon_server
/* [in] [ref,charset(UTF16)] */,
3081 const char *computername
/* [in] [ref,charset(UTF16)] */,
3082 struct netr_Authenticator
*credential
/* [in] [ref] */,
3083 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
3084 enum netr_SamDatabaseID database_id
/* [in] */,
3085 enum SyncStateEnum restart_state
/* [in] */,
3086 uint32_t *sync_context
/* [in,out] [ref] */,
3087 struct netr_DELTA_ENUM_ARRAY
**delta_enum_array
/* [out] [ref] */,
3088 uint32_t preferredmaximumlength
/* [in] */)
3090 struct netr_DatabaseSync2 r
;
3094 r
.in
.logon_server
= logon_server
;
3095 r
.in
.computername
= computername
;
3096 r
.in
.credential
= credential
;
3097 r
.in
.return_authenticator
= return_authenticator
;
3098 r
.in
.database_id
= database_id
;
3099 r
.in
.restart_state
= restart_state
;
3100 r
.in
.sync_context
= sync_context
;
3101 r
.in
.preferredmaximumlength
= preferredmaximumlength
;
3103 if (DEBUGLEVEL
>= 10) {
3104 NDR_PRINT_IN_DEBUG(netr_DatabaseSync2
, &r
);
3107 status
= cli
->dispatch(cli
,
3109 &ndr_table_netlogon
,
3110 NDR_NETR_DATABASESYNC2
,
3113 if (!NT_STATUS_IS_OK(status
)) {
3117 if (DEBUGLEVEL
>= 10) {
3118 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2
, &r
);
3121 if (NT_STATUS_IS_ERR(status
)) {
3125 /* Return variables */
3126 *return_authenticator
= *r
.out
.return_authenticator
;
3127 *sync_context
= *r
.out
.sync_context
;
3128 *delta_enum_array
= *r
.out
.delta_enum_array
;
3131 return r
.out
.result
;
3134 struct rpccli_netr_DatabaseRedo_state
{
3135 struct netr_DatabaseRedo orig
;
3136 struct netr_DatabaseRedo tmp
;
3137 TALLOC_CTX
*out_mem_ctx
;
3138 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3141 static void rpccli_netr_DatabaseRedo_done(struct tevent_req
*subreq
);
3143 struct tevent_req
*rpccli_netr_DatabaseRedo_send(TALLOC_CTX
*mem_ctx
,
3144 struct tevent_context
*ev
,
3145 struct rpc_pipe_client
*cli
,
3146 const char *_logon_server
/* [in] [ref,charset(UTF16)] */,
3147 const char *_computername
/* [in] [ref,charset(UTF16)] */,
3148 struct netr_Authenticator
*_credential
/* [in] [ref] */,
3149 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
3150 struct netr_ChangeLogEntry _change_log_entry
/* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
3151 uint32_t _change_log_entry_size
/* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
3152 struct netr_DELTA_ENUM_ARRAY
**_delta_enum_array
/* [out] [ref] */)
3154 struct tevent_req
*req
;
3155 struct rpccli_netr_DatabaseRedo_state
*state
;
3156 struct tevent_req
*subreq
;
3158 req
= tevent_req_create(mem_ctx
, &state
,
3159 struct rpccli_netr_DatabaseRedo_state
);
3163 state
->out_mem_ctx
= NULL
;
3164 state
->dispatch_recv
= cli
->dispatch_recv
;
3167 state
->orig
.in
.logon_server
= _logon_server
;
3168 state
->orig
.in
.computername
= _computername
;
3169 state
->orig
.in
.credential
= _credential
;
3170 state
->orig
.in
.return_authenticator
= _return_authenticator
;
3171 state
->orig
.in
.change_log_entry
= _change_log_entry
;
3172 state
->orig
.in
.change_log_entry_size
= _change_log_entry_size
;
3174 /* Out parameters */
3175 state
->orig
.out
.return_authenticator
= _return_authenticator
;
3176 state
->orig
.out
.delta_enum_array
= _delta_enum_array
;
3179 ZERO_STRUCT(state
->orig
.out
.result
);
3181 if (DEBUGLEVEL
>= 10) {
3182 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo
, &state
->orig
);
3185 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3186 "rpccli_netr_DatabaseRedo_out_memory");
3187 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3188 return tevent_req_post(req
, ev
);
3191 /* make a temporary copy, that we pass to the dispatch function */
3192 state
->tmp
= state
->orig
;
3194 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3195 &ndr_table_netlogon
,
3196 NDR_NETR_DATABASEREDO
,
3198 if (tevent_req_nomem(subreq
, req
)) {
3199 return tevent_req_post(req
, ev
);
3201 tevent_req_set_callback(subreq
, rpccli_netr_DatabaseRedo_done
, req
);
3205 static void rpccli_netr_DatabaseRedo_done(struct tevent_req
*subreq
)
3207 struct tevent_req
*req
= tevent_req_callback_data(
3208 subreq
, struct tevent_req
);
3209 struct rpccli_netr_DatabaseRedo_state
*state
= tevent_req_data(
3210 req
, struct rpccli_netr_DatabaseRedo_state
);
3212 TALLOC_CTX
*mem_ctx
;
3214 if (state
->out_mem_ctx
) {
3215 mem_ctx
= state
->out_mem_ctx
;
3220 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3221 TALLOC_FREE(subreq
);
3222 if (!NT_STATUS_IS_OK(status
)) {
3223 tevent_req_nterror(req
, status
);
3227 /* Copy out parameters */
3228 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
3229 *state
->orig
.out
.delta_enum_array
= *state
->tmp
.out
.delta_enum_array
;
3232 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3234 /* Reset temporary structure */
3235 ZERO_STRUCT(state
->tmp
);
3237 if (DEBUGLEVEL
>= 10) {
3238 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo
, &state
->orig
);
3241 tevent_req_done(req
);
3244 NTSTATUS
rpccli_netr_DatabaseRedo_recv(struct tevent_req
*req
,
3245 TALLOC_CTX
*mem_ctx
,
3248 struct rpccli_netr_DatabaseRedo_state
*state
= tevent_req_data(
3249 req
, struct rpccli_netr_DatabaseRedo_state
);
3252 if (tevent_req_is_nterror(req
, &status
)) {
3253 tevent_req_received(req
);
3257 /* Steal possbile out parameters to the callers context */
3258 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3261 *result
= state
->orig
.out
.result
;
3263 tevent_req_received(req
);
3264 return NT_STATUS_OK
;
3267 NTSTATUS
rpccli_netr_DatabaseRedo(struct rpc_pipe_client
*cli
,
3268 TALLOC_CTX
*mem_ctx
,
3269 const char *logon_server
/* [in] [ref,charset(UTF16)] */,
3270 const char *computername
/* [in] [ref,charset(UTF16)] */,
3271 struct netr_Authenticator
*credential
/* [in] [ref] */,
3272 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
3273 struct netr_ChangeLogEntry change_log_entry
/* [in] [subcontext_size(change_log_entry_size),subcontext(4)] */,
3274 uint32_t change_log_entry_size
/* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */,
3275 struct netr_DELTA_ENUM_ARRAY
**delta_enum_array
/* [out] [ref] */)
3277 struct netr_DatabaseRedo r
;
3281 r
.in
.logon_server
= logon_server
;
3282 r
.in
.computername
= computername
;
3283 r
.in
.credential
= credential
;
3284 r
.in
.return_authenticator
= return_authenticator
;
3285 r
.in
.change_log_entry
= change_log_entry
;
3286 r
.in
.change_log_entry_size
= change_log_entry_size
;
3288 if (DEBUGLEVEL
>= 10) {
3289 NDR_PRINT_IN_DEBUG(netr_DatabaseRedo
, &r
);
3292 status
= cli
->dispatch(cli
,
3294 &ndr_table_netlogon
,
3295 NDR_NETR_DATABASEREDO
,
3298 if (!NT_STATUS_IS_OK(status
)) {
3302 if (DEBUGLEVEL
>= 10) {
3303 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo
, &r
);
3306 if (NT_STATUS_IS_ERR(status
)) {
3310 /* Return variables */
3311 *return_authenticator
= *r
.out
.return_authenticator
;
3312 *delta_enum_array
= *r
.out
.delta_enum_array
;
3315 return r
.out
.result
;
3318 struct rpccli_netr_LogonControl2Ex_state
{
3319 struct netr_LogonControl2Ex orig
;
3320 struct netr_LogonControl2Ex tmp
;
3321 TALLOC_CTX
*out_mem_ctx
;
3322 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3325 static void rpccli_netr_LogonControl2Ex_done(struct tevent_req
*subreq
);
3327 struct tevent_req
*rpccli_netr_LogonControl2Ex_send(TALLOC_CTX
*mem_ctx
,
3328 struct tevent_context
*ev
,
3329 struct rpc_pipe_client
*cli
,
3330 const char *_logon_server
/* [in] [unique,charset(UTF16)] */,
3331 enum netr_LogonControlCode _function_code
/* [in] */,
3332 uint32_t _level
/* [in] */,
3333 union netr_CONTROL_DATA_INFORMATION
*_data
/* [in] [ref,switch_is(function_code)] */,
3334 union netr_CONTROL_QUERY_INFORMATION
*_query
/* [out] [ref,switch_is(level)] */)
3336 struct tevent_req
*req
;
3337 struct rpccli_netr_LogonControl2Ex_state
*state
;
3338 struct tevent_req
*subreq
;
3340 req
= tevent_req_create(mem_ctx
, &state
,
3341 struct rpccli_netr_LogonControl2Ex_state
);
3345 state
->out_mem_ctx
= NULL
;
3346 state
->dispatch_recv
= cli
->dispatch_recv
;
3349 state
->orig
.in
.logon_server
= _logon_server
;
3350 state
->orig
.in
.function_code
= _function_code
;
3351 state
->orig
.in
.level
= _level
;
3352 state
->orig
.in
.data
= _data
;
3354 /* Out parameters */
3355 state
->orig
.out
.query
= _query
;
3358 ZERO_STRUCT(state
->orig
.out
.result
);
3360 if (DEBUGLEVEL
>= 10) {
3361 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex
, &state
->orig
);
3364 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3365 "rpccli_netr_LogonControl2Ex_out_memory");
3366 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3367 return tevent_req_post(req
, ev
);
3370 /* make a temporary copy, that we pass to the dispatch function */
3371 state
->tmp
= state
->orig
;
3373 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3374 &ndr_table_netlogon
,
3375 NDR_NETR_LOGONCONTROL2EX
,
3377 if (tevent_req_nomem(subreq
, req
)) {
3378 return tevent_req_post(req
, ev
);
3380 tevent_req_set_callback(subreq
, rpccli_netr_LogonControl2Ex_done
, req
);
3384 static void rpccli_netr_LogonControl2Ex_done(struct tevent_req
*subreq
)
3386 struct tevent_req
*req
= tevent_req_callback_data(
3387 subreq
, struct tevent_req
);
3388 struct rpccli_netr_LogonControl2Ex_state
*state
= tevent_req_data(
3389 req
, struct rpccli_netr_LogonControl2Ex_state
);
3391 TALLOC_CTX
*mem_ctx
;
3393 if (state
->out_mem_ctx
) {
3394 mem_ctx
= state
->out_mem_ctx
;
3399 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3400 TALLOC_FREE(subreq
);
3401 if (!NT_STATUS_IS_OK(status
)) {
3402 tevent_req_nterror(req
, status
);
3406 /* Copy out parameters */
3407 *state
->orig
.out
.query
= *state
->tmp
.out
.query
;
3410 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3412 /* Reset temporary structure */
3413 ZERO_STRUCT(state
->tmp
);
3415 if (DEBUGLEVEL
>= 10) {
3416 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex
, &state
->orig
);
3419 tevent_req_done(req
);
3422 NTSTATUS
rpccli_netr_LogonControl2Ex_recv(struct tevent_req
*req
,
3423 TALLOC_CTX
*mem_ctx
,
3426 struct rpccli_netr_LogonControl2Ex_state
*state
= tevent_req_data(
3427 req
, struct rpccli_netr_LogonControl2Ex_state
);
3430 if (tevent_req_is_nterror(req
, &status
)) {
3431 tevent_req_received(req
);
3435 /* Steal possbile out parameters to the callers context */
3436 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3439 *result
= state
->orig
.out
.result
;
3441 tevent_req_received(req
);
3442 return NT_STATUS_OK
;
3445 NTSTATUS
rpccli_netr_LogonControl2Ex(struct rpc_pipe_client
*cli
,
3446 TALLOC_CTX
*mem_ctx
,
3447 const char *logon_server
/* [in] [unique,charset(UTF16)] */,
3448 enum netr_LogonControlCode function_code
/* [in] */,
3449 uint32_t level
/* [in] */,
3450 union netr_CONTROL_DATA_INFORMATION
*data
/* [in] [ref,switch_is(function_code)] */,
3451 union netr_CONTROL_QUERY_INFORMATION
*query
/* [out] [ref,switch_is(level)] */,
3454 struct netr_LogonControl2Ex r
;
3458 r
.in
.logon_server
= logon_server
;
3459 r
.in
.function_code
= function_code
;
3463 if (DEBUGLEVEL
>= 10) {
3464 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex
, &r
);
3467 status
= cli
->dispatch(cli
,
3469 &ndr_table_netlogon
,
3470 NDR_NETR_LOGONCONTROL2EX
,
3473 if (!NT_STATUS_IS_OK(status
)) {
3477 if (DEBUGLEVEL
>= 10) {
3478 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex
, &r
);
3481 if (NT_STATUS_IS_ERR(status
)) {
3485 /* Return variables */
3486 *query
= *r
.out
.query
;
3490 *werror
= r
.out
.result
;
3493 return werror_to_ntstatus(r
.out
.result
);
3496 struct rpccli_netr_NetrEnumerateTrustedDomains_state
{
3497 struct netr_NetrEnumerateTrustedDomains orig
;
3498 struct netr_NetrEnumerateTrustedDomains tmp
;
3499 TALLOC_CTX
*out_mem_ctx
;
3500 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3503 static void rpccli_netr_NetrEnumerateTrustedDomains_done(struct tevent_req
*subreq
);
3505 struct tevent_req
*rpccli_netr_NetrEnumerateTrustedDomains_send(TALLOC_CTX
*mem_ctx
,
3506 struct tevent_context
*ev
,
3507 struct rpc_pipe_client
*cli
,
3508 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
3509 struct netr_Blob
*_trusted_domains_blob
/* [out] [ref] */)
3511 struct tevent_req
*req
;
3512 struct rpccli_netr_NetrEnumerateTrustedDomains_state
*state
;
3513 struct tevent_req
*subreq
;
3515 req
= tevent_req_create(mem_ctx
, &state
,
3516 struct rpccli_netr_NetrEnumerateTrustedDomains_state
);
3520 state
->out_mem_ctx
= NULL
;
3521 state
->dispatch_recv
= cli
->dispatch_recv
;
3524 state
->orig
.in
.server_name
= _server_name
;
3526 /* Out parameters */
3527 state
->orig
.out
.trusted_domains_blob
= _trusted_domains_blob
;
3530 ZERO_STRUCT(state
->orig
.out
.result
);
3532 if (DEBUGLEVEL
>= 10) {
3533 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains
, &state
->orig
);
3536 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3537 "rpccli_netr_NetrEnumerateTrustedDomains_out_memory");
3538 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3539 return tevent_req_post(req
, ev
);
3542 /* make a temporary copy, that we pass to the dispatch function */
3543 state
->tmp
= state
->orig
;
3545 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3546 &ndr_table_netlogon
,
3547 NDR_NETR_NETRENUMERATETRUSTEDDOMAINS
,
3549 if (tevent_req_nomem(subreq
, req
)) {
3550 return tevent_req_post(req
, ev
);
3552 tevent_req_set_callback(subreq
, rpccli_netr_NetrEnumerateTrustedDomains_done
, req
);
3556 static void rpccli_netr_NetrEnumerateTrustedDomains_done(struct tevent_req
*subreq
)
3558 struct tevent_req
*req
= tevent_req_callback_data(
3559 subreq
, struct tevent_req
);
3560 struct rpccli_netr_NetrEnumerateTrustedDomains_state
*state
= tevent_req_data(
3561 req
, struct rpccli_netr_NetrEnumerateTrustedDomains_state
);
3563 TALLOC_CTX
*mem_ctx
;
3565 if (state
->out_mem_ctx
) {
3566 mem_ctx
= state
->out_mem_ctx
;
3571 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3572 TALLOC_FREE(subreq
);
3573 if (!NT_STATUS_IS_OK(status
)) {
3574 tevent_req_nterror(req
, status
);
3578 /* Copy out parameters */
3579 *state
->orig
.out
.trusted_domains_blob
= *state
->tmp
.out
.trusted_domains_blob
;
3582 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3584 /* Reset temporary structure */
3585 ZERO_STRUCT(state
->tmp
);
3587 if (DEBUGLEVEL
>= 10) {
3588 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains
, &state
->orig
);
3591 tevent_req_done(req
);
3594 NTSTATUS
rpccli_netr_NetrEnumerateTrustedDomains_recv(struct tevent_req
*req
,
3595 TALLOC_CTX
*mem_ctx
,
3598 struct rpccli_netr_NetrEnumerateTrustedDomains_state
*state
= tevent_req_data(
3599 req
, struct rpccli_netr_NetrEnumerateTrustedDomains_state
);
3602 if (tevent_req_is_nterror(req
, &status
)) {
3603 tevent_req_received(req
);
3607 /* Steal possbile out parameters to the callers context */
3608 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3611 *result
= state
->orig
.out
.result
;
3613 tevent_req_received(req
);
3614 return NT_STATUS_OK
;
3617 NTSTATUS
rpccli_netr_NetrEnumerateTrustedDomains(struct rpc_pipe_client
*cli
,
3618 TALLOC_CTX
*mem_ctx
,
3619 const char *server_name
/* [in] [unique,charset(UTF16)] */,
3620 struct netr_Blob
*trusted_domains_blob
/* [out] [ref] */,
3623 struct netr_NetrEnumerateTrustedDomains r
;
3627 r
.in
.server_name
= server_name
;
3629 if (DEBUGLEVEL
>= 10) {
3630 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains
, &r
);
3633 status
= cli
->dispatch(cli
,
3635 &ndr_table_netlogon
,
3636 NDR_NETR_NETRENUMERATETRUSTEDDOMAINS
,
3639 if (!NT_STATUS_IS_OK(status
)) {
3643 if (DEBUGLEVEL
>= 10) {
3644 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains
, &r
);
3647 if (NT_STATUS_IS_ERR(status
)) {
3651 /* Return variables */
3652 *trusted_domains_blob
= *r
.out
.trusted_domains_blob
;
3656 *werror
= r
.out
.result
;
3659 return werror_to_ntstatus(r
.out
.result
);
3662 struct rpccli_netr_DsRGetDCName_state
{
3663 struct netr_DsRGetDCName orig
;
3664 struct netr_DsRGetDCName tmp
;
3665 TALLOC_CTX
*out_mem_ctx
;
3666 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3669 static void rpccli_netr_DsRGetDCName_done(struct tevent_req
*subreq
);
3671 struct tevent_req
*rpccli_netr_DsRGetDCName_send(TALLOC_CTX
*mem_ctx
,
3672 struct tevent_context
*ev
,
3673 struct rpc_pipe_client
*cli
,
3674 const char *_server_unc
/* [in] [unique,charset(UTF16)] */,
3675 const char *_domain_name
/* [in] [unique,charset(UTF16)] */,
3676 struct GUID
*_domain_guid
/* [in] [unique] */,
3677 struct GUID
*_site_guid
/* [in] [unique] */,
3678 uint32_t _flags
/* [in] */,
3679 struct netr_DsRGetDCNameInfo
**_info
/* [out] [ref] */)
3681 struct tevent_req
*req
;
3682 struct rpccli_netr_DsRGetDCName_state
*state
;
3683 struct tevent_req
*subreq
;
3685 req
= tevent_req_create(mem_ctx
, &state
,
3686 struct rpccli_netr_DsRGetDCName_state
);
3690 state
->out_mem_ctx
= NULL
;
3691 state
->dispatch_recv
= cli
->dispatch_recv
;
3694 state
->orig
.in
.server_unc
= _server_unc
;
3695 state
->orig
.in
.domain_name
= _domain_name
;
3696 state
->orig
.in
.domain_guid
= _domain_guid
;
3697 state
->orig
.in
.site_guid
= _site_guid
;
3698 state
->orig
.in
.flags
= _flags
;
3700 /* Out parameters */
3701 state
->orig
.out
.info
= _info
;
3704 ZERO_STRUCT(state
->orig
.out
.result
);
3706 if (DEBUGLEVEL
>= 10) {
3707 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName
, &state
->orig
);
3710 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3711 "rpccli_netr_DsRGetDCName_out_memory");
3712 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3713 return tevent_req_post(req
, ev
);
3716 /* make a temporary copy, that we pass to the dispatch function */
3717 state
->tmp
= state
->orig
;
3719 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3720 &ndr_table_netlogon
,
3721 NDR_NETR_DSRGETDCNAME
,
3723 if (tevent_req_nomem(subreq
, req
)) {
3724 return tevent_req_post(req
, ev
);
3726 tevent_req_set_callback(subreq
, rpccli_netr_DsRGetDCName_done
, req
);
3730 static void rpccli_netr_DsRGetDCName_done(struct tevent_req
*subreq
)
3732 struct tevent_req
*req
= tevent_req_callback_data(
3733 subreq
, struct tevent_req
);
3734 struct rpccli_netr_DsRGetDCName_state
*state
= tevent_req_data(
3735 req
, struct rpccli_netr_DsRGetDCName_state
);
3737 TALLOC_CTX
*mem_ctx
;
3739 if (state
->out_mem_ctx
) {
3740 mem_ctx
= state
->out_mem_ctx
;
3745 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3746 TALLOC_FREE(subreq
);
3747 if (!NT_STATUS_IS_OK(status
)) {
3748 tevent_req_nterror(req
, status
);
3752 /* Copy out parameters */
3753 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
3756 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3758 /* Reset temporary structure */
3759 ZERO_STRUCT(state
->tmp
);
3761 if (DEBUGLEVEL
>= 10) {
3762 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName
, &state
->orig
);
3765 tevent_req_done(req
);
3768 NTSTATUS
rpccli_netr_DsRGetDCName_recv(struct tevent_req
*req
,
3769 TALLOC_CTX
*mem_ctx
,
3772 struct rpccli_netr_DsRGetDCName_state
*state
= tevent_req_data(
3773 req
, struct rpccli_netr_DsRGetDCName_state
);
3776 if (tevent_req_is_nterror(req
, &status
)) {
3777 tevent_req_received(req
);
3781 /* Steal possbile out parameters to the callers context */
3782 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3785 *result
= state
->orig
.out
.result
;
3787 tevent_req_received(req
);
3788 return NT_STATUS_OK
;
3791 NTSTATUS
rpccli_netr_DsRGetDCName(struct rpc_pipe_client
*cli
,
3792 TALLOC_CTX
*mem_ctx
,
3793 const char *server_unc
/* [in] [unique,charset(UTF16)] */,
3794 const char *domain_name
/* [in] [unique,charset(UTF16)] */,
3795 struct GUID
*domain_guid
/* [in] [unique] */,
3796 struct GUID
*site_guid
/* [in] [unique] */,
3797 uint32_t flags
/* [in] */,
3798 struct netr_DsRGetDCNameInfo
**info
/* [out] [ref] */,
3801 struct netr_DsRGetDCName r
;
3805 r
.in
.server_unc
= server_unc
;
3806 r
.in
.domain_name
= domain_name
;
3807 r
.in
.domain_guid
= domain_guid
;
3808 r
.in
.site_guid
= site_guid
;
3811 if (DEBUGLEVEL
>= 10) {
3812 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName
, &r
);
3815 status
= cli
->dispatch(cli
,
3817 &ndr_table_netlogon
,
3818 NDR_NETR_DSRGETDCNAME
,
3821 if (!NT_STATUS_IS_OK(status
)) {
3825 if (DEBUGLEVEL
>= 10) {
3826 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName
, &r
);
3829 if (NT_STATUS_IS_ERR(status
)) {
3833 /* Return variables */
3834 *info
= *r
.out
.info
;
3838 *werror
= r
.out
.result
;
3841 return werror_to_ntstatus(r
.out
.result
);
3844 struct rpccli_netr_LogonGetCapabilities_state
{
3845 struct netr_LogonGetCapabilities orig
;
3846 struct netr_LogonGetCapabilities tmp
;
3847 TALLOC_CTX
*out_mem_ctx
;
3848 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
3851 static void rpccli_netr_LogonGetCapabilities_done(struct tevent_req
*subreq
);
3853 struct tevent_req
*rpccli_netr_LogonGetCapabilities_send(TALLOC_CTX
*mem_ctx
,
3854 struct tevent_context
*ev
,
3855 struct rpc_pipe_client
*cli
,
3856 const char *_server_name
/* [in] [ref,charset(UTF16)] */,
3857 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
3858 struct netr_Authenticator
*_credential
/* [in] [ref] */,
3859 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
3860 uint32_t _query_level
/* [in] */,
3861 union netr_Capabilities
*_capabilities
/* [out] [ref,switch_is(query_level)] */)
3863 struct tevent_req
*req
;
3864 struct rpccli_netr_LogonGetCapabilities_state
*state
;
3865 struct tevent_req
*subreq
;
3867 req
= tevent_req_create(mem_ctx
, &state
,
3868 struct rpccli_netr_LogonGetCapabilities_state
);
3872 state
->out_mem_ctx
= NULL
;
3873 state
->dispatch_recv
= cli
->dispatch_recv
;
3876 state
->orig
.in
.server_name
= _server_name
;
3877 state
->orig
.in
.computer_name
= _computer_name
;
3878 state
->orig
.in
.credential
= _credential
;
3879 state
->orig
.in
.return_authenticator
= _return_authenticator
;
3880 state
->orig
.in
.query_level
= _query_level
;
3882 /* Out parameters */
3883 state
->orig
.out
.return_authenticator
= _return_authenticator
;
3884 state
->orig
.out
.capabilities
= _capabilities
;
3887 ZERO_STRUCT(state
->orig
.out
.result
);
3889 if (DEBUGLEVEL
>= 10) {
3890 NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities
, &state
->orig
);
3893 state
->out_mem_ctx
= talloc_named_const(state
, 0,
3894 "rpccli_netr_LogonGetCapabilities_out_memory");
3895 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
3896 return tevent_req_post(req
, ev
);
3899 /* make a temporary copy, that we pass to the dispatch function */
3900 state
->tmp
= state
->orig
;
3902 subreq
= cli
->dispatch_send(state
, ev
, cli
,
3903 &ndr_table_netlogon
,
3904 NDR_NETR_LOGONGETCAPABILITIES
,
3906 if (tevent_req_nomem(subreq
, req
)) {
3907 return tevent_req_post(req
, ev
);
3909 tevent_req_set_callback(subreq
, rpccli_netr_LogonGetCapabilities_done
, req
);
3913 static void rpccli_netr_LogonGetCapabilities_done(struct tevent_req
*subreq
)
3915 struct tevent_req
*req
= tevent_req_callback_data(
3916 subreq
, struct tevent_req
);
3917 struct rpccli_netr_LogonGetCapabilities_state
*state
= tevent_req_data(
3918 req
, struct rpccli_netr_LogonGetCapabilities_state
);
3920 TALLOC_CTX
*mem_ctx
;
3922 if (state
->out_mem_ctx
) {
3923 mem_ctx
= state
->out_mem_ctx
;
3928 status
= state
->dispatch_recv(subreq
, mem_ctx
);
3929 TALLOC_FREE(subreq
);
3930 if (!NT_STATUS_IS_OK(status
)) {
3931 tevent_req_nterror(req
, status
);
3935 /* Copy out parameters */
3936 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
3937 *state
->orig
.out
.capabilities
= *state
->tmp
.out
.capabilities
;
3940 state
->orig
.out
.result
= state
->tmp
.out
.result
;
3942 /* Reset temporary structure */
3943 ZERO_STRUCT(state
->tmp
);
3945 if (DEBUGLEVEL
>= 10) {
3946 NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities
, &state
->orig
);
3949 tevent_req_done(req
);
3952 NTSTATUS
rpccli_netr_LogonGetCapabilities_recv(struct tevent_req
*req
,
3953 TALLOC_CTX
*mem_ctx
,
3956 struct rpccli_netr_LogonGetCapabilities_state
*state
= tevent_req_data(
3957 req
, struct rpccli_netr_LogonGetCapabilities_state
);
3960 if (tevent_req_is_nterror(req
, &status
)) {
3961 tevent_req_received(req
);
3965 /* Steal possbile out parameters to the callers context */
3966 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
3969 *result
= state
->orig
.out
.result
;
3971 tevent_req_received(req
);
3972 return NT_STATUS_OK
;
3975 NTSTATUS
rpccli_netr_LogonGetCapabilities(struct rpc_pipe_client
*cli
,
3976 TALLOC_CTX
*mem_ctx
,
3977 const char *server_name
/* [in] [ref,charset(UTF16)] */,
3978 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
3979 struct netr_Authenticator
*credential
/* [in] [ref] */,
3980 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
3981 uint32_t query_level
/* [in] */,
3982 union netr_Capabilities
*capabilities
/* [out] [ref,switch_is(query_level)] */)
3984 struct netr_LogonGetCapabilities r
;
3988 r
.in
.server_name
= server_name
;
3989 r
.in
.computer_name
= computer_name
;
3990 r
.in
.credential
= credential
;
3991 r
.in
.return_authenticator
= return_authenticator
;
3992 r
.in
.query_level
= query_level
;
3994 if (DEBUGLEVEL
>= 10) {
3995 NDR_PRINT_IN_DEBUG(netr_LogonGetCapabilities
, &r
);
3998 status
= cli
->dispatch(cli
,
4000 &ndr_table_netlogon
,
4001 NDR_NETR_LOGONGETCAPABILITIES
,
4004 if (!NT_STATUS_IS_OK(status
)) {
4008 if (DEBUGLEVEL
>= 10) {
4009 NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities
, &r
);
4012 if (NT_STATUS_IS_ERR(status
)) {
4016 /* Return variables */
4017 *return_authenticator
= *r
.out
.return_authenticator
;
4018 *capabilities
= *r
.out
.capabilities
;
4021 return r
.out
.result
;
4024 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
{
4025 struct netr_NETRLOGONSETSERVICEBITS orig
;
4026 struct netr_NETRLOGONSETSERVICEBITS tmp
;
4027 TALLOC_CTX
*out_mem_ctx
;
4028 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4031 static void rpccli_netr_NETRLOGONSETSERVICEBITS_done(struct tevent_req
*subreq
);
4033 struct tevent_req
*rpccli_netr_NETRLOGONSETSERVICEBITS_send(TALLOC_CTX
*mem_ctx
,
4034 struct tevent_context
*ev
,
4035 struct rpc_pipe_client
*cli
)
4037 struct tevent_req
*req
;
4038 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
*state
;
4039 struct tevent_req
*subreq
;
4041 req
= tevent_req_create(mem_ctx
, &state
,
4042 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
);
4046 state
->out_mem_ctx
= NULL
;
4047 state
->dispatch_recv
= cli
->dispatch_recv
;
4051 /* Out parameters */
4054 ZERO_STRUCT(state
->orig
.out
.result
);
4056 if (DEBUGLEVEL
>= 10) {
4057 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS
, &state
->orig
);
4060 /* make a temporary copy, that we pass to the dispatch function */
4061 state
->tmp
= state
->orig
;
4063 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4064 &ndr_table_netlogon
,
4065 NDR_NETR_NETRLOGONSETSERVICEBITS
,
4067 if (tevent_req_nomem(subreq
, req
)) {
4068 return tevent_req_post(req
, ev
);
4070 tevent_req_set_callback(subreq
, rpccli_netr_NETRLOGONSETSERVICEBITS_done
, req
);
4074 static void rpccli_netr_NETRLOGONSETSERVICEBITS_done(struct tevent_req
*subreq
)
4076 struct tevent_req
*req
= tevent_req_callback_data(
4077 subreq
, struct tevent_req
);
4078 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
*state
= tevent_req_data(
4079 req
, struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
);
4081 TALLOC_CTX
*mem_ctx
;
4083 if (state
->out_mem_ctx
) {
4084 mem_ctx
= state
->out_mem_ctx
;
4089 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4090 TALLOC_FREE(subreq
);
4091 if (!NT_STATUS_IS_OK(status
)) {
4092 tevent_req_nterror(req
, status
);
4096 /* Copy out parameters */
4099 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4101 /* Reset temporary structure */
4102 ZERO_STRUCT(state
->tmp
);
4104 if (DEBUGLEVEL
>= 10) {
4105 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS
, &state
->orig
);
4108 tevent_req_done(req
);
4111 NTSTATUS
rpccli_netr_NETRLOGONSETSERVICEBITS_recv(struct tevent_req
*req
,
4112 TALLOC_CTX
*mem_ctx
,
4115 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
*state
= tevent_req_data(
4116 req
, struct rpccli_netr_NETRLOGONSETSERVICEBITS_state
);
4119 if (tevent_req_is_nterror(req
, &status
)) {
4120 tevent_req_received(req
);
4124 /* Steal possbile out parameters to the callers context */
4125 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4128 *result
= state
->orig
.out
.result
;
4130 tevent_req_received(req
);
4131 return NT_STATUS_OK
;
4134 NTSTATUS
rpccli_netr_NETRLOGONSETSERVICEBITS(struct rpc_pipe_client
*cli
,
4135 TALLOC_CTX
*mem_ctx
,
4138 struct netr_NETRLOGONSETSERVICEBITS r
;
4143 if (DEBUGLEVEL
>= 10) {
4144 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS
, &r
);
4147 status
= cli
->dispatch(cli
,
4149 &ndr_table_netlogon
,
4150 NDR_NETR_NETRLOGONSETSERVICEBITS
,
4153 if (!NT_STATUS_IS_OK(status
)) {
4157 if (DEBUGLEVEL
>= 10) {
4158 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS
, &r
);
4161 if (NT_STATUS_IS_ERR(status
)) {
4165 /* Return variables */
4169 *werror
= r
.out
.result
;
4172 return werror_to_ntstatus(r
.out
.result
);
4175 struct rpccli_netr_LogonGetTrustRid_state
{
4176 struct netr_LogonGetTrustRid orig
;
4177 struct netr_LogonGetTrustRid tmp
;
4178 TALLOC_CTX
*out_mem_ctx
;
4179 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4182 static void rpccli_netr_LogonGetTrustRid_done(struct tevent_req
*subreq
);
4184 struct tevent_req
*rpccli_netr_LogonGetTrustRid_send(TALLOC_CTX
*mem_ctx
,
4185 struct tevent_context
*ev
,
4186 struct rpc_pipe_client
*cli
,
4187 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
4188 const char *_domain_name
/* [in] [unique,charset(UTF16)] */,
4189 uint32_t *_rid
/* [out] [ref] */)
4191 struct tevent_req
*req
;
4192 struct rpccli_netr_LogonGetTrustRid_state
*state
;
4193 struct tevent_req
*subreq
;
4195 req
= tevent_req_create(mem_ctx
, &state
,
4196 struct rpccli_netr_LogonGetTrustRid_state
);
4200 state
->out_mem_ctx
= NULL
;
4201 state
->dispatch_recv
= cli
->dispatch_recv
;
4204 state
->orig
.in
.server_name
= _server_name
;
4205 state
->orig
.in
.domain_name
= _domain_name
;
4207 /* Out parameters */
4208 state
->orig
.out
.rid
= _rid
;
4211 ZERO_STRUCT(state
->orig
.out
.result
);
4213 if (DEBUGLEVEL
>= 10) {
4214 NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid
, &state
->orig
);
4217 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4218 "rpccli_netr_LogonGetTrustRid_out_memory");
4219 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4220 return tevent_req_post(req
, ev
);
4223 /* make a temporary copy, that we pass to the dispatch function */
4224 state
->tmp
= state
->orig
;
4226 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4227 &ndr_table_netlogon
,
4228 NDR_NETR_LOGONGETTRUSTRID
,
4230 if (tevent_req_nomem(subreq
, req
)) {
4231 return tevent_req_post(req
, ev
);
4233 tevent_req_set_callback(subreq
, rpccli_netr_LogonGetTrustRid_done
, req
);
4237 static void rpccli_netr_LogonGetTrustRid_done(struct tevent_req
*subreq
)
4239 struct tevent_req
*req
= tevent_req_callback_data(
4240 subreq
, struct tevent_req
);
4241 struct rpccli_netr_LogonGetTrustRid_state
*state
= tevent_req_data(
4242 req
, struct rpccli_netr_LogonGetTrustRid_state
);
4244 TALLOC_CTX
*mem_ctx
;
4246 if (state
->out_mem_ctx
) {
4247 mem_ctx
= state
->out_mem_ctx
;
4252 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4253 TALLOC_FREE(subreq
);
4254 if (!NT_STATUS_IS_OK(status
)) {
4255 tevent_req_nterror(req
, status
);
4259 /* Copy out parameters */
4260 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
4263 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4265 /* Reset temporary structure */
4266 ZERO_STRUCT(state
->tmp
);
4268 if (DEBUGLEVEL
>= 10) {
4269 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid
, &state
->orig
);
4272 tevent_req_done(req
);
4275 NTSTATUS
rpccli_netr_LogonGetTrustRid_recv(struct tevent_req
*req
,
4276 TALLOC_CTX
*mem_ctx
,
4279 struct rpccli_netr_LogonGetTrustRid_state
*state
= tevent_req_data(
4280 req
, struct rpccli_netr_LogonGetTrustRid_state
);
4283 if (tevent_req_is_nterror(req
, &status
)) {
4284 tevent_req_received(req
);
4288 /* Steal possbile out parameters to the callers context */
4289 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4292 *result
= state
->orig
.out
.result
;
4294 tevent_req_received(req
);
4295 return NT_STATUS_OK
;
4298 NTSTATUS
rpccli_netr_LogonGetTrustRid(struct rpc_pipe_client
*cli
,
4299 TALLOC_CTX
*mem_ctx
,
4300 const char *server_name
/* [in] [unique,charset(UTF16)] */,
4301 const char *domain_name
/* [in] [unique,charset(UTF16)] */,
4302 uint32_t *rid
/* [out] [ref] */,
4305 struct netr_LogonGetTrustRid r
;
4309 r
.in
.server_name
= server_name
;
4310 r
.in
.domain_name
= domain_name
;
4312 if (DEBUGLEVEL
>= 10) {
4313 NDR_PRINT_IN_DEBUG(netr_LogonGetTrustRid
, &r
);
4316 status
= cli
->dispatch(cli
,
4318 &ndr_table_netlogon
,
4319 NDR_NETR_LOGONGETTRUSTRID
,
4322 if (!NT_STATUS_IS_OK(status
)) {
4326 if (DEBUGLEVEL
>= 10) {
4327 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid
, &r
);
4330 if (NT_STATUS_IS_ERR(status
)) {
4334 /* Return variables */
4339 *werror
= r
.out
.result
;
4342 return werror_to_ntstatus(r
.out
.result
);
4345 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
{
4346 struct netr_NETRLOGONCOMPUTESERVERDIGEST orig
;
4347 struct netr_NETRLOGONCOMPUTESERVERDIGEST tmp
;
4348 TALLOC_CTX
*out_mem_ctx
;
4349 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4352 static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done(struct tevent_req
*subreq
);
4354 struct tevent_req
*rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_send(TALLOC_CTX
*mem_ctx
,
4355 struct tevent_context
*ev
,
4356 struct rpc_pipe_client
*cli
)
4358 struct tevent_req
*req
;
4359 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
*state
;
4360 struct tevent_req
*subreq
;
4362 req
= tevent_req_create(mem_ctx
, &state
,
4363 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
);
4367 state
->out_mem_ctx
= NULL
;
4368 state
->dispatch_recv
= cli
->dispatch_recv
;
4372 /* Out parameters */
4375 ZERO_STRUCT(state
->orig
.out
.result
);
4377 if (DEBUGLEVEL
>= 10) {
4378 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST
, &state
->orig
);
4381 /* make a temporary copy, that we pass to the dispatch function */
4382 state
->tmp
= state
->orig
;
4384 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4385 &ndr_table_netlogon
,
4386 NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST
,
4388 if (tevent_req_nomem(subreq
, req
)) {
4389 return tevent_req_post(req
, ev
);
4391 tevent_req_set_callback(subreq
, rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done
, req
);
4395 static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done(struct tevent_req
*subreq
)
4397 struct tevent_req
*req
= tevent_req_callback_data(
4398 subreq
, struct tevent_req
);
4399 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
*state
= tevent_req_data(
4400 req
, struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
);
4402 TALLOC_CTX
*mem_ctx
;
4404 if (state
->out_mem_ctx
) {
4405 mem_ctx
= state
->out_mem_ctx
;
4410 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4411 TALLOC_FREE(subreq
);
4412 if (!NT_STATUS_IS_OK(status
)) {
4413 tevent_req_nterror(req
, status
);
4417 /* Copy out parameters */
4420 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4422 /* Reset temporary structure */
4423 ZERO_STRUCT(state
->tmp
);
4425 if (DEBUGLEVEL
>= 10) {
4426 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST
, &state
->orig
);
4429 tevent_req_done(req
);
4432 NTSTATUS
rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_recv(struct tevent_req
*req
,
4433 TALLOC_CTX
*mem_ctx
,
4436 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
*state
= tevent_req_data(
4437 req
, struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state
);
4440 if (tevent_req_is_nterror(req
, &status
)) {
4441 tevent_req_received(req
);
4445 /* Steal possbile out parameters to the callers context */
4446 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4449 *result
= state
->orig
.out
.result
;
4451 tevent_req_received(req
);
4452 return NT_STATUS_OK
;
4455 NTSTATUS
rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST(struct rpc_pipe_client
*cli
,
4456 TALLOC_CTX
*mem_ctx
,
4459 struct netr_NETRLOGONCOMPUTESERVERDIGEST r
;
4464 if (DEBUGLEVEL
>= 10) {
4465 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST
, &r
);
4468 status
= cli
->dispatch(cli
,
4470 &ndr_table_netlogon
,
4471 NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST
,
4474 if (!NT_STATUS_IS_OK(status
)) {
4478 if (DEBUGLEVEL
>= 10) {
4479 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST
, &r
);
4482 if (NT_STATUS_IS_ERR(status
)) {
4486 /* Return variables */
4490 *werror
= r
.out
.result
;
4493 return werror_to_ntstatus(r
.out
.result
);
4496 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
{
4497 struct netr_NETRLOGONCOMPUTECLIENTDIGEST orig
;
4498 struct netr_NETRLOGONCOMPUTECLIENTDIGEST tmp
;
4499 TALLOC_CTX
*out_mem_ctx
;
4500 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4503 static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done(struct tevent_req
*subreq
);
4505 struct tevent_req
*rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_send(TALLOC_CTX
*mem_ctx
,
4506 struct tevent_context
*ev
,
4507 struct rpc_pipe_client
*cli
)
4509 struct tevent_req
*req
;
4510 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
*state
;
4511 struct tevent_req
*subreq
;
4513 req
= tevent_req_create(mem_ctx
, &state
,
4514 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
);
4518 state
->out_mem_ctx
= NULL
;
4519 state
->dispatch_recv
= cli
->dispatch_recv
;
4523 /* Out parameters */
4526 ZERO_STRUCT(state
->orig
.out
.result
);
4528 if (DEBUGLEVEL
>= 10) {
4529 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST
, &state
->orig
);
4532 /* make a temporary copy, that we pass to the dispatch function */
4533 state
->tmp
= state
->orig
;
4535 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4536 &ndr_table_netlogon
,
4537 NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST
,
4539 if (tevent_req_nomem(subreq
, req
)) {
4540 return tevent_req_post(req
, ev
);
4542 tevent_req_set_callback(subreq
, rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done
, req
);
4546 static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done(struct tevent_req
*subreq
)
4548 struct tevent_req
*req
= tevent_req_callback_data(
4549 subreq
, struct tevent_req
);
4550 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
*state
= tevent_req_data(
4551 req
, struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
);
4553 TALLOC_CTX
*mem_ctx
;
4555 if (state
->out_mem_ctx
) {
4556 mem_ctx
= state
->out_mem_ctx
;
4561 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4562 TALLOC_FREE(subreq
);
4563 if (!NT_STATUS_IS_OK(status
)) {
4564 tevent_req_nterror(req
, status
);
4568 /* Copy out parameters */
4571 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4573 /* Reset temporary structure */
4574 ZERO_STRUCT(state
->tmp
);
4576 if (DEBUGLEVEL
>= 10) {
4577 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST
, &state
->orig
);
4580 tevent_req_done(req
);
4583 NTSTATUS
rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_recv(struct tevent_req
*req
,
4584 TALLOC_CTX
*mem_ctx
,
4587 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
*state
= tevent_req_data(
4588 req
, struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state
);
4591 if (tevent_req_is_nterror(req
, &status
)) {
4592 tevent_req_received(req
);
4596 /* Steal possbile out parameters to the callers context */
4597 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4600 *result
= state
->orig
.out
.result
;
4602 tevent_req_received(req
);
4603 return NT_STATUS_OK
;
4606 NTSTATUS
rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct rpc_pipe_client
*cli
,
4607 TALLOC_CTX
*mem_ctx
,
4610 struct netr_NETRLOGONCOMPUTECLIENTDIGEST r
;
4615 if (DEBUGLEVEL
>= 10) {
4616 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST
, &r
);
4619 status
= cli
->dispatch(cli
,
4621 &ndr_table_netlogon
,
4622 NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST
,
4625 if (!NT_STATUS_IS_OK(status
)) {
4629 if (DEBUGLEVEL
>= 10) {
4630 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST
, &r
);
4633 if (NT_STATUS_IS_ERR(status
)) {
4637 /* Return variables */
4641 *werror
= r
.out
.result
;
4644 return werror_to_ntstatus(r
.out
.result
);
4647 struct rpccli_netr_ServerAuthenticate3_state
{
4648 struct netr_ServerAuthenticate3 orig
;
4649 struct netr_ServerAuthenticate3 tmp
;
4650 TALLOC_CTX
*out_mem_ctx
;
4651 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4654 static void rpccli_netr_ServerAuthenticate3_done(struct tevent_req
*subreq
);
4656 struct tevent_req
*rpccli_netr_ServerAuthenticate3_send(TALLOC_CTX
*mem_ctx
,
4657 struct tevent_context
*ev
,
4658 struct rpc_pipe_client
*cli
,
4659 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
4660 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
4661 enum netr_SchannelType _secure_channel_type
/* [in] */,
4662 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
4663 struct netr_Credential
*_credentials
/* [in] [ref] */,
4664 struct netr_Credential
*_return_credentials
/* [out] [ref] */,
4665 uint32_t *_negotiate_flags
/* [in,out] [ref] */,
4666 uint32_t *_rid
/* [out] [ref] */)
4668 struct tevent_req
*req
;
4669 struct rpccli_netr_ServerAuthenticate3_state
*state
;
4670 struct tevent_req
*subreq
;
4672 req
= tevent_req_create(mem_ctx
, &state
,
4673 struct rpccli_netr_ServerAuthenticate3_state
);
4677 state
->out_mem_ctx
= NULL
;
4678 state
->dispatch_recv
= cli
->dispatch_recv
;
4681 state
->orig
.in
.server_name
= _server_name
;
4682 state
->orig
.in
.account_name
= _account_name
;
4683 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
4684 state
->orig
.in
.computer_name
= _computer_name
;
4685 state
->orig
.in
.credentials
= _credentials
;
4686 state
->orig
.in
.negotiate_flags
= _negotiate_flags
;
4688 /* Out parameters */
4689 state
->orig
.out
.return_credentials
= _return_credentials
;
4690 state
->orig
.out
.negotiate_flags
= _negotiate_flags
;
4691 state
->orig
.out
.rid
= _rid
;
4694 ZERO_STRUCT(state
->orig
.out
.result
);
4696 if (DEBUGLEVEL
>= 10) {
4697 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3
, &state
->orig
);
4700 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4701 "rpccli_netr_ServerAuthenticate3_out_memory");
4702 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4703 return tevent_req_post(req
, ev
);
4706 /* make a temporary copy, that we pass to the dispatch function */
4707 state
->tmp
= state
->orig
;
4709 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4710 &ndr_table_netlogon
,
4711 NDR_NETR_SERVERAUTHENTICATE3
,
4713 if (tevent_req_nomem(subreq
, req
)) {
4714 return tevent_req_post(req
, ev
);
4716 tevent_req_set_callback(subreq
, rpccli_netr_ServerAuthenticate3_done
, req
);
4720 static void rpccli_netr_ServerAuthenticate3_done(struct tevent_req
*subreq
)
4722 struct tevent_req
*req
= tevent_req_callback_data(
4723 subreq
, struct tevent_req
);
4724 struct rpccli_netr_ServerAuthenticate3_state
*state
= tevent_req_data(
4725 req
, struct rpccli_netr_ServerAuthenticate3_state
);
4727 TALLOC_CTX
*mem_ctx
;
4729 if (state
->out_mem_ctx
) {
4730 mem_ctx
= state
->out_mem_ctx
;
4735 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4736 TALLOC_FREE(subreq
);
4737 if (!NT_STATUS_IS_OK(status
)) {
4738 tevent_req_nterror(req
, status
);
4742 /* Copy out parameters */
4743 *state
->orig
.out
.return_credentials
= *state
->tmp
.out
.return_credentials
;
4744 *state
->orig
.out
.negotiate_flags
= *state
->tmp
.out
.negotiate_flags
;
4745 *state
->orig
.out
.rid
= *state
->tmp
.out
.rid
;
4748 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4750 /* Reset temporary structure */
4751 ZERO_STRUCT(state
->tmp
);
4753 if (DEBUGLEVEL
>= 10) {
4754 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3
, &state
->orig
);
4757 tevent_req_done(req
);
4760 NTSTATUS
rpccli_netr_ServerAuthenticate3_recv(struct tevent_req
*req
,
4761 TALLOC_CTX
*mem_ctx
,
4764 struct rpccli_netr_ServerAuthenticate3_state
*state
= tevent_req_data(
4765 req
, struct rpccli_netr_ServerAuthenticate3_state
);
4768 if (tevent_req_is_nterror(req
, &status
)) {
4769 tevent_req_received(req
);
4773 /* Steal possbile out parameters to the callers context */
4774 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4777 *result
= state
->orig
.out
.result
;
4779 tevent_req_received(req
);
4780 return NT_STATUS_OK
;
4783 NTSTATUS
rpccli_netr_ServerAuthenticate3(struct rpc_pipe_client
*cli
,
4784 TALLOC_CTX
*mem_ctx
,
4785 const char *server_name
/* [in] [unique,charset(UTF16)] */,
4786 const char *account_name
/* [in] [ref,charset(UTF16)] */,
4787 enum netr_SchannelType secure_channel_type
/* [in] */,
4788 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
4789 struct netr_Credential
*credentials
/* [in] [ref] */,
4790 struct netr_Credential
*return_credentials
/* [out] [ref] */,
4791 uint32_t *negotiate_flags
/* [in,out] [ref] */,
4792 uint32_t *rid
/* [out] [ref] */)
4794 struct netr_ServerAuthenticate3 r
;
4798 r
.in
.server_name
= server_name
;
4799 r
.in
.account_name
= account_name
;
4800 r
.in
.secure_channel_type
= secure_channel_type
;
4801 r
.in
.computer_name
= computer_name
;
4802 r
.in
.credentials
= credentials
;
4803 r
.in
.negotiate_flags
= negotiate_flags
;
4805 if (DEBUGLEVEL
>= 10) {
4806 NDR_PRINT_IN_DEBUG(netr_ServerAuthenticate3
, &r
);
4809 status
= cli
->dispatch(cli
,
4811 &ndr_table_netlogon
,
4812 NDR_NETR_SERVERAUTHENTICATE3
,
4815 if (!NT_STATUS_IS_OK(status
)) {
4819 if (DEBUGLEVEL
>= 10) {
4820 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3
, &r
);
4823 if (NT_STATUS_IS_ERR(status
)) {
4827 /* Return variables */
4828 *return_credentials
= *r
.out
.return_credentials
;
4829 *negotiate_flags
= *r
.out
.negotiate_flags
;
4833 return r
.out
.result
;
4836 struct rpccli_netr_DsRGetDCNameEx_state
{
4837 struct netr_DsRGetDCNameEx orig
;
4838 struct netr_DsRGetDCNameEx tmp
;
4839 TALLOC_CTX
*out_mem_ctx
;
4840 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
4843 static void rpccli_netr_DsRGetDCNameEx_done(struct tevent_req
*subreq
);
4845 struct tevent_req
*rpccli_netr_DsRGetDCNameEx_send(TALLOC_CTX
*mem_ctx
,
4846 struct tevent_context
*ev
,
4847 struct rpc_pipe_client
*cli
,
4848 const char *_server_unc
/* [in] [unique,charset(UTF16)] */,
4849 const char *_domain_name
/* [in] [unique,charset(UTF16)] */,
4850 struct GUID
*_domain_guid
/* [in] [unique] */,
4851 const char *_site_name
/* [in] [unique,charset(UTF16)] */,
4852 uint32_t _flags
/* [in] */,
4853 struct netr_DsRGetDCNameInfo
**_info
/* [out] [ref] */)
4855 struct tevent_req
*req
;
4856 struct rpccli_netr_DsRGetDCNameEx_state
*state
;
4857 struct tevent_req
*subreq
;
4859 req
= tevent_req_create(mem_ctx
, &state
,
4860 struct rpccli_netr_DsRGetDCNameEx_state
);
4864 state
->out_mem_ctx
= NULL
;
4865 state
->dispatch_recv
= cli
->dispatch_recv
;
4868 state
->orig
.in
.server_unc
= _server_unc
;
4869 state
->orig
.in
.domain_name
= _domain_name
;
4870 state
->orig
.in
.domain_guid
= _domain_guid
;
4871 state
->orig
.in
.site_name
= _site_name
;
4872 state
->orig
.in
.flags
= _flags
;
4874 /* Out parameters */
4875 state
->orig
.out
.info
= _info
;
4878 ZERO_STRUCT(state
->orig
.out
.result
);
4880 if (DEBUGLEVEL
>= 10) {
4881 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx
, &state
->orig
);
4884 state
->out_mem_ctx
= talloc_named_const(state
, 0,
4885 "rpccli_netr_DsRGetDCNameEx_out_memory");
4886 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
4887 return tevent_req_post(req
, ev
);
4890 /* make a temporary copy, that we pass to the dispatch function */
4891 state
->tmp
= state
->orig
;
4893 subreq
= cli
->dispatch_send(state
, ev
, cli
,
4894 &ndr_table_netlogon
,
4895 NDR_NETR_DSRGETDCNAMEEX
,
4897 if (tevent_req_nomem(subreq
, req
)) {
4898 return tevent_req_post(req
, ev
);
4900 tevent_req_set_callback(subreq
, rpccli_netr_DsRGetDCNameEx_done
, req
);
4904 static void rpccli_netr_DsRGetDCNameEx_done(struct tevent_req
*subreq
)
4906 struct tevent_req
*req
= tevent_req_callback_data(
4907 subreq
, struct tevent_req
);
4908 struct rpccli_netr_DsRGetDCNameEx_state
*state
= tevent_req_data(
4909 req
, struct rpccli_netr_DsRGetDCNameEx_state
);
4911 TALLOC_CTX
*mem_ctx
;
4913 if (state
->out_mem_ctx
) {
4914 mem_ctx
= state
->out_mem_ctx
;
4919 status
= state
->dispatch_recv(subreq
, mem_ctx
);
4920 TALLOC_FREE(subreq
);
4921 if (!NT_STATUS_IS_OK(status
)) {
4922 tevent_req_nterror(req
, status
);
4926 /* Copy out parameters */
4927 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
4930 state
->orig
.out
.result
= state
->tmp
.out
.result
;
4932 /* Reset temporary structure */
4933 ZERO_STRUCT(state
->tmp
);
4935 if (DEBUGLEVEL
>= 10) {
4936 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx
, &state
->orig
);
4939 tevent_req_done(req
);
4942 NTSTATUS
rpccli_netr_DsRGetDCNameEx_recv(struct tevent_req
*req
,
4943 TALLOC_CTX
*mem_ctx
,
4946 struct rpccli_netr_DsRGetDCNameEx_state
*state
= tevent_req_data(
4947 req
, struct rpccli_netr_DsRGetDCNameEx_state
);
4950 if (tevent_req_is_nterror(req
, &status
)) {
4951 tevent_req_received(req
);
4955 /* Steal possbile out parameters to the callers context */
4956 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
4959 *result
= state
->orig
.out
.result
;
4961 tevent_req_received(req
);
4962 return NT_STATUS_OK
;
4965 NTSTATUS
rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client
*cli
,
4966 TALLOC_CTX
*mem_ctx
,
4967 const char *server_unc
/* [in] [unique,charset(UTF16)] */,
4968 const char *domain_name
/* [in] [unique,charset(UTF16)] */,
4969 struct GUID
*domain_guid
/* [in] [unique] */,
4970 const char *site_name
/* [in] [unique,charset(UTF16)] */,
4971 uint32_t flags
/* [in] */,
4972 struct netr_DsRGetDCNameInfo
**info
/* [out] [ref] */,
4975 struct netr_DsRGetDCNameEx r
;
4979 r
.in
.server_unc
= server_unc
;
4980 r
.in
.domain_name
= domain_name
;
4981 r
.in
.domain_guid
= domain_guid
;
4982 r
.in
.site_name
= site_name
;
4985 if (DEBUGLEVEL
>= 10) {
4986 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx
, &r
);
4989 status
= cli
->dispatch(cli
,
4991 &ndr_table_netlogon
,
4992 NDR_NETR_DSRGETDCNAMEEX
,
4995 if (!NT_STATUS_IS_OK(status
)) {
4999 if (DEBUGLEVEL
>= 10) {
5000 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx
, &r
);
5003 if (NT_STATUS_IS_ERR(status
)) {
5007 /* Return variables */
5008 *info
= *r
.out
.info
;
5012 *werror
= r
.out
.result
;
5015 return werror_to_ntstatus(r
.out
.result
);
5018 struct rpccli_netr_DsRGetSiteName_state
{
5019 struct netr_DsRGetSiteName orig
;
5020 struct netr_DsRGetSiteName tmp
;
5021 TALLOC_CTX
*out_mem_ctx
;
5022 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5025 static void rpccli_netr_DsRGetSiteName_done(struct tevent_req
*subreq
);
5027 struct tevent_req
*rpccli_netr_DsRGetSiteName_send(TALLOC_CTX
*mem_ctx
,
5028 struct tevent_context
*ev
,
5029 struct rpc_pipe_client
*cli
,
5030 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
5031 const char **_site
/* [out] [ref,charset(UTF16)] */)
5033 struct tevent_req
*req
;
5034 struct rpccli_netr_DsRGetSiteName_state
*state
;
5035 struct tevent_req
*subreq
;
5037 req
= tevent_req_create(mem_ctx
, &state
,
5038 struct rpccli_netr_DsRGetSiteName_state
);
5042 state
->out_mem_ctx
= NULL
;
5043 state
->dispatch_recv
= cli
->dispatch_recv
;
5046 state
->orig
.in
.computer_name
= _computer_name
;
5048 /* Out parameters */
5049 state
->orig
.out
.site
= _site
;
5052 ZERO_STRUCT(state
->orig
.out
.result
);
5054 if (DEBUGLEVEL
>= 10) {
5055 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName
, &state
->orig
);
5058 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5059 "rpccli_netr_DsRGetSiteName_out_memory");
5060 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5061 return tevent_req_post(req
, ev
);
5064 /* make a temporary copy, that we pass to the dispatch function */
5065 state
->tmp
= state
->orig
;
5067 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5068 &ndr_table_netlogon
,
5069 NDR_NETR_DSRGETSITENAME
,
5071 if (tevent_req_nomem(subreq
, req
)) {
5072 return tevent_req_post(req
, ev
);
5074 tevent_req_set_callback(subreq
, rpccli_netr_DsRGetSiteName_done
, req
);
5078 static void rpccli_netr_DsRGetSiteName_done(struct tevent_req
*subreq
)
5080 struct tevent_req
*req
= tevent_req_callback_data(
5081 subreq
, struct tevent_req
);
5082 struct rpccli_netr_DsRGetSiteName_state
*state
= tevent_req_data(
5083 req
, struct rpccli_netr_DsRGetSiteName_state
);
5085 TALLOC_CTX
*mem_ctx
;
5087 if (state
->out_mem_ctx
) {
5088 mem_ctx
= state
->out_mem_ctx
;
5093 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5094 TALLOC_FREE(subreq
);
5095 if (!NT_STATUS_IS_OK(status
)) {
5096 tevent_req_nterror(req
, status
);
5100 /* Copy out parameters */
5101 *state
->orig
.out
.site
= *state
->tmp
.out
.site
;
5104 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5106 /* Reset temporary structure */
5107 ZERO_STRUCT(state
->tmp
);
5109 if (DEBUGLEVEL
>= 10) {
5110 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName
, &state
->orig
);
5113 tevent_req_done(req
);
5116 NTSTATUS
rpccli_netr_DsRGetSiteName_recv(struct tevent_req
*req
,
5117 TALLOC_CTX
*mem_ctx
,
5120 struct rpccli_netr_DsRGetSiteName_state
*state
= tevent_req_data(
5121 req
, struct rpccli_netr_DsRGetSiteName_state
);
5124 if (tevent_req_is_nterror(req
, &status
)) {
5125 tevent_req_received(req
);
5129 /* Steal possbile out parameters to the callers context */
5130 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5133 *result
= state
->orig
.out
.result
;
5135 tevent_req_received(req
);
5136 return NT_STATUS_OK
;
5139 NTSTATUS
rpccli_netr_DsRGetSiteName(struct rpc_pipe_client
*cli
,
5140 TALLOC_CTX
*mem_ctx
,
5141 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
5142 const char **site
/* [out] [ref,charset(UTF16)] */,
5145 struct netr_DsRGetSiteName r
;
5149 r
.in
.computer_name
= computer_name
;
5151 if (DEBUGLEVEL
>= 10) {
5152 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName
, &r
);
5155 status
= cli
->dispatch(cli
,
5157 &ndr_table_netlogon
,
5158 NDR_NETR_DSRGETSITENAME
,
5161 if (!NT_STATUS_IS_OK(status
)) {
5165 if (DEBUGLEVEL
>= 10) {
5166 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName
, &r
);
5169 if (NT_STATUS_IS_ERR(status
)) {
5173 /* Return variables */
5174 *site
= *r
.out
.site
;
5178 *werror
= r
.out
.result
;
5181 return werror_to_ntstatus(r
.out
.result
);
5184 struct rpccli_netr_LogonGetDomainInfo_state
{
5185 struct netr_LogonGetDomainInfo orig
;
5186 struct netr_LogonGetDomainInfo tmp
;
5187 TALLOC_CTX
*out_mem_ctx
;
5188 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5191 static void rpccli_netr_LogonGetDomainInfo_done(struct tevent_req
*subreq
);
5193 struct tevent_req
*rpccli_netr_LogonGetDomainInfo_send(TALLOC_CTX
*mem_ctx
,
5194 struct tevent_context
*ev
,
5195 struct rpc_pipe_client
*cli
,
5196 const char *_server_name
/* [in] [ref,charset(UTF16)] */,
5197 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
5198 struct netr_Authenticator
*_credential
/* [in] [ref] */,
5199 struct netr_Authenticator
*_return_authenticator
/* [in,out] [ref] */,
5200 uint32_t _level
/* [in] */,
5201 union netr_WorkstationInfo
*_query
/* [in] [ref,switch_is(level)] */,
5202 union netr_DomainInfo
*_info
/* [out] [ref,switch_is(level)] */)
5204 struct tevent_req
*req
;
5205 struct rpccli_netr_LogonGetDomainInfo_state
*state
;
5206 struct tevent_req
*subreq
;
5208 req
= tevent_req_create(mem_ctx
, &state
,
5209 struct rpccli_netr_LogonGetDomainInfo_state
);
5213 state
->out_mem_ctx
= NULL
;
5214 state
->dispatch_recv
= cli
->dispatch_recv
;
5217 state
->orig
.in
.server_name
= _server_name
;
5218 state
->orig
.in
.computer_name
= _computer_name
;
5219 state
->orig
.in
.credential
= _credential
;
5220 state
->orig
.in
.return_authenticator
= _return_authenticator
;
5221 state
->orig
.in
.level
= _level
;
5222 state
->orig
.in
.query
= _query
;
5224 /* Out parameters */
5225 state
->orig
.out
.return_authenticator
= _return_authenticator
;
5226 state
->orig
.out
.info
= _info
;
5229 ZERO_STRUCT(state
->orig
.out
.result
);
5231 if (DEBUGLEVEL
>= 10) {
5232 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo
, &state
->orig
);
5235 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5236 "rpccli_netr_LogonGetDomainInfo_out_memory");
5237 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5238 return tevent_req_post(req
, ev
);
5241 /* make a temporary copy, that we pass to the dispatch function */
5242 state
->tmp
= state
->orig
;
5244 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5245 &ndr_table_netlogon
,
5246 NDR_NETR_LOGONGETDOMAININFO
,
5248 if (tevent_req_nomem(subreq
, req
)) {
5249 return tevent_req_post(req
, ev
);
5251 tevent_req_set_callback(subreq
, rpccli_netr_LogonGetDomainInfo_done
, req
);
5255 static void rpccli_netr_LogonGetDomainInfo_done(struct tevent_req
*subreq
)
5257 struct tevent_req
*req
= tevent_req_callback_data(
5258 subreq
, struct tevent_req
);
5259 struct rpccli_netr_LogonGetDomainInfo_state
*state
= tevent_req_data(
5260 req
, struct rpccli_netr_LogonGetDomainInfo_state
);
5262 TALLOC_CTX
*mem_ctx
;
5264 if (state
->out_mem_ctx
) {
5265 mem_ctx
= state
->out_mem_ctx
;
5270 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5271 TALLOC_FREE(subreq
);
5272 if (!NT_STATUS_IS_OK(status
)) {
5273 tevent_req_nterror(req
, status
);
5277 /* Copy out parameters */
5278 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
5279 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
5282 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5284 /* Reset temporary structure */
5285 ZERO_STRUCT(state
->tmp
);
5287 if (DEBUGLEVEL
>= 10) {
5288 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo
, &state
->orig
);
5291 tevent_req_done(req
);
5294 NTSTATUS
rpccli_netr_LogonGetDomainInfo_recv(struct tevent_req
*req
,
5295 TALLOC_CTX
*mem_ctx
,
5298 struct rpccli_netr_LogonGetDomainInfo_state
*state
= tevent_req_data(
5299 req
, struct rpccli_netr_LogonGetDomainInfo_state
);
5302 if (tevent_req_is_nterror(req
, &status
)) {
5303 tevent_req_received(req
);
5307 /* Steal possbile out parameters to the callers context */
5308 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5311 *result
= state
->orig
.out
.result
;
5313 tevent_req_received(req
);
5314 return NT_STATUS_OK
;
5317 NTSTATUS
rpccli_netr_LogonGetDomainInfo(struct rpc_pipe_client
*cli
,
5318 TALLOC_CTX
*mem_ctx
,
5319 const char *server_name
/* [in] [ref,charset(UTF16)] */,
5320 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
5321 struct netr_Authenticator
*credential
/* [in] [ref] */,
5322 struct netr_Authenticator
*return_authenticator
/* [in,out] [ref] */,
5323 uint32_t level
/* [in] */,
5324 union netr_WorkstationInfo
*query
/* [in] [ref,switch_is(level)] */,
5325 union netr_DomainInfo
*info
/* [out] [ref,switch_is(level)] */)
5327 struct netr_LogonGetDomainInfo r
;
5331 r
.in
.server_name
= server_name
;
5332 r
.in
.computer_name
= computer_name
;
5333 r
.in
.credential
= credential
;
5334 r
.in
.return_authenticator
= return_authenticator
;
5338 if (DEBUGLEVEL
>= 10) {
5339 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo
, &r
);
5342 status
= cli
->dispatch(cli
,
5344 &ndr_table_netlogon
,
5345 NDR_NETR_LOGONGETDOMAININFO
,
5348 if (!NT_STATUS_IS_OK(status
)) {
5352 if (DEBUGLEVEL
>= 10) {
5353 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo
, &r
);
5356 if (NT_STATUS_IS_ERR(status
)) {
5360 /* Return variables */
5361 *return_authenticator
= *r
.out
.return_authenticator
;
5362 *info
= *r
.out
.info
;
5365 return r
.out
.result
;
5368 struct rpccli_netr_ServerPasswordSet2_state
{
5369 struct netr_ServerPasswordSet2 orig
;
5370 struct netr_ServerPasswordSet2 tmp
;
5371 TALLOC_CTX
*out_mem_ctx
;
5372 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5375 static void rpccli_netr_ServerPasswordSet2_done(struct tevent_req
*subreq
);
5377 struct tevent_req
*rpccli_netr_ServerPasswordSet2_send(TALLOC_CTX
*mem_ctx
,
5378 struct tevent_context
*ev
,
5379 struct rpc_pipe_client
*cli
,
5380 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
5381 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
5382 enum netr_SchannelType _secure_channel_type
/* [in] */,
5383 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
5384 struct netr_Authenticator
*_credential
/* [in] [ref] */,
5385 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
5386 struct netr_CryptPassword
*_new_password
/* [in] [ref] */)
5388 struct tevent_req
*req
;
5389 struct rpccli_netr_ServerPasswordSet2_state
*state
;
5390 struct tevent_req
*subreq
;
5392 req
= tevent_req_create(mem_ctx
, &state
,
5393 struct rpccli_netr_ServerPasswordSet2_state
);
5397 state
->out_mem_ctx
= NULL
;
5398 state
->dispatch_recv
= cli
->dispatch_recv
;
5401 state
->orig
.in
.server_name
= _server_name
;
5402 state
->orig
.in
.account_name
= _account_name
;
5403 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
5404 state
->orig
.in
.computer_name
= _computer_name
;
5405 state
->orig
.in
.credential
= _credential
;
5406 state
->orig
.in
.new_password
= _new_password
;
5408 /* Out parameters */
5409 state
->orig
.out
.return_authenticator
= _return_authenticator
;
5412 ZERO_STRUCT(state
->orig
.out
.result
);
5414 if (DEBUGLEVEL
>= 10) {
5415 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2
, &state
->orig
);
5418 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5419 "rpccli_netr_ServerPasswordSet2_out_memory");
5420 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5421 return tevent_req_post(req
, ev
);
5424 /* make a temporary copy, that we pass to the dispatch function */
5425 state
->tmp
= state
->orig
;
5427 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5428 &ndr_table_netlogon
,
5429 NDR_NETR_SERVERPASSWORDSET2
,
5431 if (tevent_req_nomem(subreq
, req
)) {
5432 return tevent_req_post(req
, ev
);
5434 tevent_req_set_callback(subreq
, rpccli_netr_ServerPasswordSet2_done
, req
);
5438 static void rpccli_netr_ServerPasswordSet2_done(struct tevent_req
*subreq
)
5440 struct tevent_req
*req
= tevent_req_callback_data(
5441 subreq
, struct tevent_req
);
5442 struct rpccli_netr_ServerPasswordSet2_state
*state
= tevent_req_data(
5443 req
, struct rpccli_netr_ServerPasswordSet2_state
);
5445 TALLOC_CTX
*mem_ctx
;
5447 if (state
->out_mem_ctx
) {
5448 mem_ctx
= state
->out_mem_ctx
;
5453 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5454 TALLOC_FREE(subreq
);
5455 if (!NT_STATUS_IS_OK(status
)) {
5456 tevent_req_nterror(req
, status
);
5460 /* Copy out parameters */
5461 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
5464 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5466 /* Reset temporary structure */
5467 ZERO_STRUCT(state
->tmp
);
5469 if (DEBUGLEVEL
>= 10) {
5470 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2
, &state
->orig
);
5473 tevent_req_done(req
);
5476 NTSTATUS
rpccli_netr_ServerPasswordSet2_recv(struct tevent_req
*req
,
5477 TALLOC_CTX
*mem_ctx
,
5480 struct rpccli_netr_ServerPasswordSet2_state
*state
= tevent_req_data(
5481 req
, struct rpccli_netr_ServerPasswordSet2_state
);
5484 if (tevent_req_is_nterror(req
, &status
)) {
5485 tevent_req_received(req
);
5489 /* Steal possbile out parameters to the callers context */
5490 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5493 *result
= state
->orig
.out
.result
;
5495 tevent_req_received(req
);
5496 return NT_STATUS_OK
;
5499 NTSTATUS
rpccli_netr_ServerPasswordSet2(struct rpc_pipe_client
*cli
,
5500 TALLOC_CTX
*mem_ctx
,
5501 const char *server_name
/* [in] [unique,charset(UTF16)] */,
5502 const char *account_name
/* [in] [ref,charset(UTF16)] */,
5503 enum netr_SchannelType secure_channel_type
/* [in] */,
5504 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
5505 struct netr_Authenticator
*credential
/* [in] [ref] */,
5506 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
5507 struct netr_CryptPassword
*new_password
/* [in] [ref] */)
5509 struct netr_ServerPasswordSet2 r
;
5513 r
.in
.server_name
= server_name
;
5514 r
.in
.account_name
= account_name
;
5515 r
.in
.secure_channel_type
= secure_channel_type
;
5516 r
.in
.computer_name
= computer_name
;
5517 r
.in
.credential
= credential
;
5518 r
.in
.new_password
= new_password
;
5520 if (DEBUGLEVEL
>= 10) {
5521 NDR_PRINT_IN_DEBUG(netr_ServerPasswordSet2
, &r
);
5524 status
= cli
->dispatch(cli
,
5526 &ndr_table_netlogon
,
5527 NDR_NETR_SERVERPASSWORDSET2
,
5530 if (!NT_STATUS_IS_OK(status
)) {
5534 if (DEBUGLEVEL
>= 10) {
5535 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2
, &r
);
5538 if (NT_STATUS_IS_ERR(status
)) {
5542 /* Return variables */
5543 *return_authenticator
= *r
.out
.return_authenticator
;
5546 return r
.out
.result
;
5549 struct rpccli_netr_ServerPasswordGet_state
{
5550 struct netr_ServerPasswordGet orig
;
5551 struct netr_ServerPasswordGet tmp
;
5552 TALLOC_CTX
*out_mem_ctx
;
5553 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5556 static void rpccli_netr_ServerPasswordGet_done(struct tevent_req
*subreq
);
5558 struct tevent_req
*rpccli_netr_ServerPasswordGet_send(TALLOC_CTX
*mem_ctx
,
5559 struct tevent_context
*ev
,
5560 struct rpc_pipe_client
*cli
,
5561 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
5562 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
5563 enum netr_SchannelType _secure_channel_type
/* [in] */,
5564 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
5565 struct netr_Authenticator
*_credential
/* [in] [ref] */,
5566 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
5567 struct samr_Password
*_password
/* [out] [ref] */)
5569 struct tevent_req
*req
;
5570 struct rpccli_netr_ServerPasswordGet_state
*state
;
5571 struct tevent_req
*subreq
;
5573 req
= tevent_req_create(mem_ctx
, &state
,
5574 struct rpccli_netr_ServerPasswordGet_state
);
5578 state
->out_mem_ctx
= NULL
;
5579 state
->dispatch_recv
= cli
->dispatch_recv
;
5582 state
->orig
.in
.server_name
= _server_name
;
5583 state
->orig
.in
.account_name
= _account_name
;
5584 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
5585 state
->orig
.in
.computer_name
= _computer_name
;
5586 state
->orig
.in
.credential
= _credential
;
5588 /* Out parameters */
5589 state
->orig
.out
.return_authenticator
= _return_authenticator
;
5590 state
->orig
.out
.password
= _password
;
5593 ZERO_STRUCT(state
->orig
.out
.result
);
5595 if (DEBUGLEVEL
>= 10) {
5596 NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet
, &state
->orig
);
5599 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5600 "rpccli_netr_ServerPasswordGet_out_memory");
5601 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5602 return tevent_req_post(req
, ev
);
5605 /* make a temporary copy, that we pass to the dispatch function */
5606 state
->tmp
= state
->orig
;
5608 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5609 &ndr_table_netlogon
,
5610 NDR_NETR_SERVERPASSWORDGET
,
5612 if (tevent_req_nomem(subreq
, req
)) {
5613 return tevent_req_post(req
, ev
);
5615 tevent_req_set_callback(subreq
, rpccli_netr_ServerPasswordGet_done
, req
);
5619 static void rpccli_netr_ServerPasswordGet_done(struct tevent_req
*subreq
)
5621 struct tevent_req
*req
= tevent_req_callback_data(
5622 subreq
, struct tevent_req
);
5623 struct rpccli_netr_ServerPasswordGet_state
*state
= tevent_req_data(
5624 req
, struct rpccli_netr_ServerPasswordGet_state
);
5626 TALLOC_CTX
*mem_ctx
;
5628 if (state
->out_mem_ctx
) {
5629 mem_ctx
= state
->out_mem_ctx
;
5634 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5635 TALLOC_FREE(subreq
);
5636 if (!NT_STATUS_IS_OK(status
)) {
5637 tevent_req_nterror(req
, status
);
5641 /* Copy out parameters */
5642 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
5643 *state
->orig
.out
.password
= *state
->tmp
.out
.password
;
5646 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5648 /* Reset temporary structure */
5649 ZERO_STRUCT(state
->tmp
);
5651 if (DEBUGLEVEL
>= 10) {
5652 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet
, &state
->orig
);
5655 tevent_req_done(req
);
5658 NTSTATUS
rpccli_netr_ServerPasswordGet_recv(struct tevent_req
*req
,
5659 TALLOC_CTX
*mem_ctx
,
5662 struct rpccli_netr_ServerPasswordGet_state
*state
= tevent_req_data(
5663 req
, struct rpccli_netr_ServerPasswordGet_state
);
5666 if (tevent_req_is_nterror(req
, &status
)) {
5667 tevent_req_received(req
);
5671 /* Steal possbile out parameters to the callers context */
5672 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5675 *result
= state
->orig
.out
.result
;
5677 tevent_req_received(req
);
5678 return NT_STATUS_OK
;
5681 NTSTATUS
rpccli_netr_ServerPasswordGet(struct rpc_pipe_client
*cli
,
5682 TALLOC_CTX
*mem_ctx
,
5683 const char *server_name
/* [in] [unique,charset(UTF16)] */,
5684 const char *account_name
/* [in] [ref,charset(UTF16)] */,
5685 enum netr_SchannelType secure_channel_type
/* [in] */,
5686 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
5687 struct netr_Authenticator
*credential
/* [in] [ref] */,
5688 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
5689 struct samr_Password
*password
/* [out] [ref] */,
5692 struct netr_ServerPasswordGet r
;
5696 r
.in
.server_name
= server_name
;
5697 r
.in
.account_name
= account_name
;
5698 r
.in
.secure_channel_type
= secure_channel_type
;
5699 r
.in
.computer_name
= computer_name
;
5700 r
.in
.credential
= credential
;
5702 if (DEBUGLEVEL
>= 10) {
5703 NDR_PRINT_IN_DEBUG(netr_ServerPasswordGet
, &r
);
5706 status
= cli
->dispatch(cli
,
5708 &ndr_table_netlogon
,
5709 NDR_NETR_SERVERPASSWORDGET
,
5712 if (!NT_STATUS_IS_OK(status
)) {
5716 if (DEBUGLEVEL
>= 10) {
5717 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet
, &r
);
5720 if (NT_STATUS_IS_ERR(status
)) {
5724 /* Return variables */
5725 *return_authenticator
= *r
.out
.return_authenticator
;
5726 *password
= *r
.out
.password
;
5730 *werror
= r
.out
.result
;
5733 return werror_to_ntstatus(r
.out
.result
);
5736 struct rpccli_netr_NETRLOGONSENDTOSAM_state
{
5737 struct netr_NETRLOGONSENDTOSAM orig
;
5738 struct netr_NETRLOGONSENDTOSAM tmp
;
5739 TALLOC_CTX
*out_mem_ctx
;
5740 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5743 static void rpccli_netr_NETRLOGONSENDTOSAM_done(struct tevent_req
*subreq
);
5745 struct tevent_req
*rpccli_netr_NETRLOGONSENDTOSAM_send(TALLOC_CTX
*mem_ctx
,
5746 struct tevent_context
*ev
,
5747 struct rpc_pipe_client
*cli
)
5749 struct tevent_req
*req
;
5750 struct rpccli_netr_NETRLOGONSENDTOSAM_state
*state
;
5751 struct tevent_req
*subreq
;
5753 req
= tevent_req_create(mem_ctx
, &state
,
5754 struct rpccli_netr_NETRLOGONSENDTOSAM_state
);
5758 state
->out_mem_ctx
= NULL
;
5759 state
->dispatch_recv
= cli
->dispatch_recv
;
5763 /* Out parameters */
5766 ZERO_STRUCT(state
->orig
.out
.result
);
5768 if (DEBUGLEVEL
>= 10) {
5769 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM
, &state
->orig
);
5772 /* make a temporary copy, that we pass to the dispatch function */
5773 state
->tmp
= state
->orig
;
5775 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5776 &ndr_table_netlogon
,
5777 NDR_NETR_NETRLOGONSENDTOSAM
,
5779 if (tevent_req_nomem(subreq
, req
)) {
5780 return tevent_req_post(req
, ev
);
5782 tevent_req_set_callback(subreq
, rpccli_netr_NETRLOGONSENDTOSAM_done
, req
);
5786 static void rpccli_netr_NETRLOGONSENDTOSAM_done(struct tevent_req
*subreq
)
5788 struct tevent_req
*req
= tevent_req_callback_data(
5789 subreq
, struct tevent_req
);
5790 struct rpccli_netr_NETRLOGONSENDTOSAM_state
*state
= tevent_req_data(
5791 req
, struct rpccli_netr_NETRLOGONSENDTOSAM_state
);
5793 TALLOC_CTX
*mem_ctx
;
5795 if (state
->out_mem_ctx
) {
5796 mem_ctx
= state
->out_mem_ctx
;
5801 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5802 TALLOC_FREE(subreq
);
5803 if (!NT_STATUS_IS_OK(status
)) {
5804 tevent_req_nterror(req
, status
);
5808 /* Copy out parameters */
5811 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5813 /* Reset temporary structure */
5814 ZERO_STRUCT(state
->tmp
);
5816 if (DEBUGLEVEL
>= 10) {
5817 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM
, &state
->orig
);
5820 tevent_req_done(req
);
5823 NTSTATUS
rpccli_netr_NETRLOGONSENDTOSAM_recv(struct tevent_req
*req
,
5824 TALLOC_CTX
*mem_ctx
,
5827 struct rpccli_netr_NETRLOGONSENDTOSAM_state
*state
= tevent_req_data(
5828 req
, struct rpccli_netr_NETRLOGONSENDTOSAM_state
);
5831 if (tevent_req_is_nterror(req
, &status
)) {
5832 tevent_req_received(req
);
5836 /* Steal possbile out parameters to the callers context */
5837 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
5840 *result
= state
->orig
.out
.result
;
5842 tevent_req_received(req
);
5843 return NT_STATUS_OK
;
5846 NTSTATUS
rpccli_netr_NETRLOGONSENDTOSAM(struct rpc_pipe_client
*cli
,
5847 TALLOC_CTX
*mem_ctx
,
5850 struct netr_NETRLOGONSENDTOSAM r
;
5855 if (DEBUGLEVEL
>= 10) {
5856 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM
, &r
);
5859 status
= cli
->dispatch(cli
,
5861 &ndr_table_netlogon
,
5862 NDR_NETR_NETRLOGONSENDTOSAM
,
5865 if (!NT_STATUS_IS_OK(status
)) {
5869 if (DEBUGLEVEL
>= 10) {
5870 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM
, &r
);
5873 if (NT_STATUS_IS_ERR(status
)) {
5877 /* Return variables */
5881 *werror
= r
.out
.result
;
5884 return werror_to_ntstatus(r
.out
.result
);
5887 struct rpccli_netr_DsRAddressToSitenamesW_state
{
5888 struct netr_DsRAddressToSitenamesW orig
;
5889 struct netr_DsRAddressToSitenamesW tmp
;
5890 TALLOC_CTX
*out_mem_ctx
;
5891 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
5894 static void rpccli_netr_DsRAddressToSitenamesW_done(struct tevent_req
*subreq
);
5896 struct tevent_req
*rpccli_netr_DsRAddressToSitenamesW_send(TALLOC_CTX
*mem_ctx
,
5897 struct tevent_context
*ev
,
5898 struct rpc_pipe_client
*cli
,
5899 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
5900 uint32_t _count
/* [in] [range(0,32000)] */,
5901 struct netr_DsRAddress
*_addresses
/* [in] [ref,size_is(count)] */,
5902 struct netr_DsRAddressToSitenamesWCtr
**_ctr
/* [out] [ref] */)
5904 struct tevent_req
*req
;
5905 struct rpccli_netr_DsRAddressToSitenamesW_state
*state
;
5906 struct tevent_req
*subreq
;
5908 req
= tevent_req_create(mem_ctx
, &state
,
5909 struct rpccli_netr_DsRAddressToSitenamesW_state
);
5913 state
->out_mem_ctx
= NULL
;
5914 state
->dispatch_recv
= cli
->dispatch_recv
;
5917 state
->orig
.in
.server_name
= _server_name
;
5918 state
->orig
.in
.count
= _count
;
5919 state
->orig
.in
.addresses
= _addresses
;
5921 /* Out parameters */
5922 state
->orig
.out
.ctr
= _ctr
;
5925 ZERO_STRUCT(state
->orig
.out
.result
);
5927 if (DEBUGLEVEL
>= 10) {
5928 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW
, &state
->orig
);
5931 state
->out_mem_ctx
= talloc_named_const(state
, 0,
5932 "rpccli_netr_DsRAddressToSitenamesW_out_memory");
5933 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
5934 return tevent_req_post(req
, ev
);
5937 /* make a temporary copy, that we pass to the dispatch function */
5938 state
->tmp
= state
->orig
;
5940 subreq
= cli
->dispatch_send(state
, ev
, cli
,
5941 &ndr_table_netlogon
,
5942 NDR_NETR_DSRADDRESSTOSITENAMESW
,
5944 if (tevent_req_nomem(subreq
, req
)) {
5945 return tevent_req_post(req
, ev
);
5947 tevent_req_set_callback(subreq
, rpccli_netr_DsRAddressToSitenamesW_done
, req
);
5951 static void rpccli_netr_DsRAddressToSitenamesW_done(struct tevent_req
*subreq
)
5953 struct tevent_req
*req
= tevent_req_callback_data(
5954 subreq
, struct tevent_req
);
5955 struct rpccli_netr_DsRAddressToSitenamesW_state
*state
= tevent_req_data(
5956 req
, struct rpccli_netr_DsRAddressToSitenamesW_state
);
5958 TALLOC_CTX
*mem_ctx
;
5960 if (state
->out_mem_ctx
) {
5961 mem_ctx
= state
->out_mem_ctx
;
5966 status
= state
->dispatch_recv(subreq
, mem_ctx
);
5967 TALLOC_FREE(subreq
);
5968 if (!NT_STATUS_IS_OK(status
)) {
5969 tevent_req_nterror(req
, status
);
5973 /* Copy out parameters */
5974 *state
->orig
.out
.ctr
= *state
->tmp
.out
.ctr
;
5977 state
->orig
.out
.result
= state
->tmp
.out
.result
;
5979 /* Reset temporary structure */
5980 ZERO_STRUCT(state
->tmp
);
5982 if (DEBUGLEVEL
>= 10) {
5983 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW
, &state
->orig
);
5986 tevent_req_done(req
);
5989 NTSTATUS
rpccli_netr_DsRAddressToSitenamesW_recv(struct tevent_req
*req
,
5990 TALLOC_CTX
*mem_ctx
,
5993 struct rpccli_netr_DsRAddressToSitenamesW_state
*state
= tevent_req_data(
5994 req
, struct rpccli_netr_DsRAddressToSitenamesW_state
);
5997 if (tevent_req_is_nterror(req
, &status
)) {
5998 tevent_req_received(req
);
6002 /* Steal possbile out parameters to the callers context */
6003 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6006 *result
= state
->orig
.out
.result
;
6008 tevent_req_received(req
);
6009 return NT_STATUS_OK
;
6012 NTSTATUS
rpccli_netr_DsRAddressToSitenamesW(struct rpc_pipe_client
*cli
,
6013 TALLOC_CTX
*mem_ctx
,
6014 const char *server_name
/* [in] [unique,charset(UTF16)] */,
6015 uint32_t count
/* [in] [range(0,32000)] */,
6016 struct netr_DsRAddress
*addresses
/* [in] [ref,size_is(count)] */,
6017 struct netr_DsRAddressToSitenamesWCtr
**ctr
/* [out] [ref] */,
6020 struct netr_DsRAddressToSitenamesW r
;
6024 r
.in
.server_name
= server_name
;
6026 r
.in
.addresses
= addresses
;
6028 if (DEBUGLEVEL
>= 10) {
6029 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW
, &r
);
6032 status
= cli
->dispatch(cli
,
6034 &ndr_table_netlogon
,
6035 NDR_NETR_DSRADDRESSTOSITENAMESW
,
6038 if (!NT_STATUS_IS_OK(status
)) {
6042 if (DEBUGLEVEL
>= 10) {
6043 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW
, &r
);
6046 if (NT_STATUS_IS_ERR(status
)) {
6050 /* Return variables */
6055 *werror
= r
.out
.result
;
6058 return werror_to_ntstatus(r
.out
.result
);
6061 struct rpccli_netr_DsRGetDCNameEx2_state
{
6062 struct netr_DsRGetDCNameEx2 orig
;
6063 struct netr_DsRGetDCNameEx2 tmp
;
6064 TALLOC_CTX
*out_mem_ctx
;
6065 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6068 static void rpccli_netr_DsRGetDCNameEx2_done(struct tevent_req
*subreq
);
6070 struct tevent_req
*rpccli_netr_DsRGetDCNameEx2_send(TALLOC_CTX
*mem_ctx
,
6071 struct tevent_context
*ev
,
6072 struct rpc_pipe_client
*cli
,
6073 const char *_server_unc
/* [in] [unique,charset(UTF16)] */,
6074 const char *_client_account
/* [in] [unique,charset(UTF16)] */,
6075 uint32_t _mask
/* [in] */,
6076 const char *_domain_name
/* [in] [unique,charset(UTF16)] */,
6077 struct GUID
*_domain_guid
/* [in] [unique] */,
6078 const char *_site_name
/* [in] [unique,charset(UTF16)] */,
6079 uint32_t _flags
/* [in] */,
6080 struct netr_DsRGetDCNameInfo
**_info
/* [out] [ref] */)
6082 struct tevent_req
*req
;
6083 struct rpccli_netr_DsRGetDCNameEx2_state
*state
;
6084 struct tevent_req
*subreq
;
6086 req
= tevent_req_create(mem_ctx
, &state
,
6087 struct rpccli_netr_DsRGetDCNameEx2_state
);
6091 state
->out_mem_ctx
= NULL
;
6092 state
->dispatch_recv
= cli
->dispatch_recv
;
6095 state
->orig
.in
.server_unc
= _server_unc
;
6096 state
->orig
.in
.client_account
= _client_account
;
6097 state
->orig
.in
.mask
= _mask
;
6098 state
->orig
.in
.domain_name
= _domain_name
;
6099 state
->orig
.in
.domain_guid
= _domain_guid
;
6100 state
->orig
.in
.site_name
= _site_name
;
6101 state
->orig
.in
.flags
= _flags
;
6103 /* Out parameters */
6104 state
->orig
.out
.info
= _info
;
6107 ZERO_STRUCT(state
->orig
.out
.result
);
6109 if (DEBUGLEVEL
>= 10) {
6110 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2
, &state
->orig
);
6113 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6114 "rpccli_netr_DsRGetDCNameEx2_out_memory");
6115 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6116 return tevent_req_post(req
, ev
);
6119 /* make a temporary copy, that we pass to the dispatch function */
6120 state
->tmp
= state
->orig
;
6122 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6123 &ndr_table_netlogon
,
6124 NDR_NETR_DSRGETDCNAMEEX2
,
6126 if (tevent_req_nomem(subreq
, req
)) {
6127 return tevent_req_post(req
, ev
);
6129 tevent_req_set_callback(subreq
, rpccli_netr_DsRGetDCNameEx2_done
, req
);
6133 static void rpccli_netr_DsRGetDCNameEx2_done(struct tevent_req
*subreq
)
6135 struct tevent_req
*req
= tevent_req_callback_data(
6136 subreq
, struct tevent_req
);
6137 struct rpccli_netr_DsRGetDCNameEx2_state
*state
= tevent_req_data(
6138 req
, struct rpccli_netr_DsRGetDCNameEx2_state
);
6140 TALLOC_CTX
*mem_ctx
;
6142 if (state
->out_mem_ctx
) {
6143 mem_ctx
= state
->out_mem_ctx
;
6148 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6149 TALLOC_FREE(subreq
);
6150 if (!NT_STATUS_IS_OK(status
)) {
6151 tevent_req_nterror(req
, status
);
6155 /* Copy out parameters */
6156 *state
->orig
.out
.info
= *state
->tmp
.out
.info
;
6159 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6161 /* Reset temporary structure */
6162 ZERO_STRUCT(state
->tmp
);
6164 if (DEBUGLEVEL
>= 10) {
6165 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2
, &state
->orig
);
6168 tevent_req_done(req
);
6171 NTSTATUS
rpccli_netr_DsRGetDCNameEx2_recv(struct tevent_req
*req
,
6172 TALLOC_CTX
*mem_ctx
,
6175 struct rpccli_netr_DsRGetDCNameEx2_state
*state
= tevent_req_data(
6176 req
, struct rpccli_netr_DsRGetDCNameEx2_state
);
6179 if (tevent_req_is_nterror(req
, &status
)) {
6180 tevent_req_received(req
);
6184 /* Steal possbile out parameters to the callers context */
6185 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6188 *result
= state
->orig
.out
.result
;
6190 tevent_req_received(req
);
6191 return NT_STATUS_OK
;
6194 NTSTATUS
rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client
*cli
,
6195 TALLOC_CTX
*mem_ctx
,
6196 const char *server_unc
/* [in] [unique,charset(UTF16)] */,
6197 const char *client_account
/* [in] [unique,charset(UTF16)] */,
6198 uint32_t mask
/* [in] */,
6199 const char *domain_name
/* [in] [unique,charset(UTF16)] */,
6200 struct GUID
*domain_guid
/* [in] [unique] */,
6201 const char *site_name
/* [in] [unique,charset(UTF16)] */,
6202 uint32_t flags
/* [in] */,
6203 struct netr_DsRGetDCNameInfo
**info
/* [out] [ref] */,
6206 struct netr_DsRGetDCNameEx2 r
;
6210 r
.in
.server_unc
= server_unc
;
6211 r
.in
.client_account
= client_account
;
6213 r
.in
.domain_name
= domain_name
;
6214 r
.in
.domain_guid
= domain_guid
;
6215 r
.in
.site_name
= site_name
;
6218 if (DEBUGLEVEL
>= 10) {
6219 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2
, &r
);
6222 status
= cli
->dispatch(cli
,
6224 &ndr_table_netlogon
,
6225 NDR_NETR_DSRGETDCNAMEEX2
,
6228 if (!NT_STATUS_IS_OK(status
)) {
6232 if (DEBUGLEVEL
>= 10) {
6233 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2
, &r
);
6236 if (NT_STATUS_IS_ERR(status
)) {
6240 /* Return variables */
6241 *info
= *r
.out
.info
;
6245 *werror
= r
.out
.result
;
6248 return werror_to_ntstatus(r
.out
.result
);
6251 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
{
6252 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN orig
;
6253 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN tmp
;
6254 TALLOC_CTX
*out_mem_ctx
;
6255 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6258 static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done(struct tevent_req
*subreq
);
6260 struct tevent_req
*rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_send(TALLOC_CTX
*mem_ctx
,
6261 struct tevent_context
*ev
,
6262 struct rpc_pipe_client
*cli
)
6264 struct tevent_req
*req
;
6265 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
*state
;
6266 struct tevent_req
*subreq
;
6268 req
= tevent_req_create(mem_ctx
, &state
,
6269 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
);
6273 state
->out_mem_ctx
= NULL
;
6274 state
->dispatch_recv
= cli
->dispatch_recv
;
6278 /* Out parameters */
6281 ZERO_STRUCT(state
->orig
.out
.result
);
6283 if (DEBUGLEVEL
>= 10) {
6284 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
, &state
->orig
);
6287 /* make a temporary copy, that we pass to the dispatch function */
6288 state
->tmp
= state
->orig
;
6290 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6291 &ndr_table_netlogon
,
6292 NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
6294 if (tevent_req_nomem(subreq
, req
)) {
6295 return tevent_req_post(req
, ev
);
6297 tevent_req_set_callback(subreq
, rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done
, req
);
6301 static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done(struct tevent_req
*subreq
)
6303 struct tevent_req
*req
= tevent_req_callback_data(
6304 subreq
, struct tevent_req
);
6305 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
*state
= tevent_req_data(
6306 req
, struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
);
6308 TALLOC_CTX
*mem_ctx
;
6310 if (state
->out_mem_ctx
) {
6311 mem_ctx
= state
->out_mem_ctx
;
6316 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6317 TALLOC_FREE(subreq
);
6318 if (!NT_STATUS_IS_OK(status
)) {
6319 tevent_req_nterror(req
, status
);
6323 /* Copy out parameters */
6326 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6328 /* Reset temporary structure */
6329 ZERO_STRUCT(state
->tmp
);
6331 if (DEBUGLEVEL
>= 10) {
6332 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
, &state
->orig
);
6335 tevent_req_done(req
);
6338 NTSTATUS
rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_recv(struct tevent_req
*req
,
6339 TALLOC_CTX
*mem_ctx
,
6342 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
*state
= tevent_req_data(
6343 req
, struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state
);
6346 if (tevent_req_is_nterror(req
, &status
)) {
6347 tevent_req_received(req
);
6351 /* Steal possbile out parameters to the callers context */
6352 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6355 *result
= state
->orig
.out
.result
;
6357 tevent_req_received(req
);
6358 return NT_STATUS_OK
;
6361 NTSTATUS
rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN(struct rpc_pipe_client
*cli
,
6362 TALLOC_CTX
*mem_ctx
,
6365 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r
;
6370 if (DEBUGLEVEL
>= 10) {
6371 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
, &r
);
6374 status
= cli
->dispatch(cli
,
6376 &ndr_table_netlogon
,
6377 NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN
,
6380 if (!NT_STATUS_IS_OK(status
)) {
6384 if (DEBUGLEVEL
>= 10) {
6385 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN
, &r
);
6388 if (NT_STATUS_IS_ERR(status
)) {
6392 /* Return variables */
6396 *werror
= r
.out
.result
;
6399 return werror_to_ntstatus(r
.out
.result
);
6402 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
{
6403 struct netr_NetrEnumerateTrustedDomainsEx orig
;
6404 struct netr_NetrEnumerateTrustedDomainsEx tmp
;
6405 TALLOC_CTX
*out_mem_ctx
;
6406 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6409 static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done(struct tevent_req
*subreq
);
6411 struct tevent_req
*rpccli_netr_NetrEnumerateTrustedDomainsEx_send(TALLOC_CTX
*mem_ctx
,
6412 struct tevent_context
*ev
,
6413 struct rpc_pipe_client
*cli
,
6414 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
6415 struct netr_DomainTrustList
*_dom_trust_list
/* [out] [ref] */)
6417 struct tevent_req
*req
;
6418 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
*state
;
6419 struct tevent_req
*subreq
;
6421 req
= tevent_req_create(mem_ctx
, &state
,
6422 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
);
6426 state
->out_mem_ctx
= NULL
;
6427 state
->dispatch_recv
= cli
->dispatch_recv
;
6430 state
->orig
.in
.server_name
= _server_name
;
6432 /* Out parameters */
6433 state
->orig
.out
.dom_trust_list
= _dom_trust_list
;
6436 ZERO_STRUCT(state
->orig
.out
.result
);
6438 if (DEBUGLEVEL
>= 10) {
6439 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx
, &state
->orig
);
6442 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6443 "rpccli_netr_NetrEnumerateTrustedDomainsEx_out_memory");
6444 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6445 return tevent_req_post(req
, ev
);
6448 /* make a temporary copy, that we pass to the dispatch function */
6449 state
->tmp
= state
->orig
;
6451 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6452 &ndr_table_netlogon
,
6453 NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX
,
6455 if (tevent_req_nomem(subreq
, req
)) {
6456 return tevent_req_post(req
, ev
);
6458 tevent_req_set_callback(subreq
, rpccli_netr_NetrEnumerateTrustedDomainsEx_done
, req
);
6462 static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done(struct tevent_req
*subreq
)
6464 struct tevent_req
*req
= tevent_req_callback_data(
6465 subreq
, struct tevent_req
);
6466 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
*state
= tevent_req_data(
6467 req
, struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
);
6469 TALLOC_CTX
*mem_ctx
;
6471 if (state
->out_mem_ctx
) {
6472 mem_ctx
= state
->out_mem_ctx
;
6477 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6478 TALLOC_FREE(subreq
);
6479 if (!NT_STATUS_IS_OK(status
)) {
6480 tevent_req_nterror(req
, status
);
6484 /* Copy out parameters */
6485 *state
->orig
.out
.dom_trust_list
= *state
->tmp
.out
.dom_trust_list
;
6488 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6490 /* Reset temporary structure */
6491 ZERO_STRUCT(state
->tmp
);
6493 if (DEBUGLEVEL
>= 10) {
6494 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx
, &state
->orig
);
6497 tevent_req_done(req
);
6500 NTSTATUS
rpccli_netr_NetrEnumerateTrustedDomainsEx_recv(struct tevent_req
*req
,
6501 TALLOC_CTX
*mem_ctx
,
6504 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
*state
= tevent_req_data(
6505 req
, struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state
);
6508 if (tevent_req_is_nterror(req
, &status
)) {
6509 tevent_req_received(req
);
6513 /* Steal possbile out parameters to the callers context */
6514 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6517 *result
= state
->orig
.out
.result
;
6519 tevent_req_received(req
);
6520 return NT_STATUS_OK
;
6523 NTSTATUS
rpccli_netr_NetrEnumerateTrustedDomainsEx(struct rpc_pipe_client
*cli
,
6524 TALLOC_CTX
*mem_ctx
,
6525 const char *server_name
/* [in] [unique,charset(UTF16)] */,
6526 struct netr_DomainTrustList
*dom_trust_list
/* [out] [ref] */,
6529 struct netr_NetrEnumerateTrustedDomainsEx r
;
6533 r
.in
.server_name
= server_name
;
6535 if (DEBUGLEVEL
>= 10) {
6536 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx
, &r
);
6539 status
= cli
->dispatch(cli
,
6541 &ndr_table_netlogon
,
6542 NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX
,
6545 if (!NT_STATUS_IS_OK(status
)) {
6549 if (DEBUGLEVEL
>= 10) {
6550 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx
, &r
);
6553 if (NT_STATUS_IS_ERR(status
)) {
6557 /* Return variables */
6558 *dom_trust_list
= *r
.out
.dom_trust_list
;
6562 *werror
= r
.out
.result
;
6565 return werror_to_ntstatus(r
.out
.result
);
6568 struct rpccli_netr_DsRAddressToSitenamesExW_state
{
6569 struct netr_DsRAddressToSitenamesExW orig
;
6570 struct netr_DsRAddressToSitenamesExW tmp
;
6571 TALLOC_CTX
*out_mem_ctx
;
6572 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6575 static void rpccli_netr_DsRAddressToSitenamesExW_done(struct tevent_req
*subreq
);
6577 struct tevent_req
*rpccli_netr_DsRAddressToSitenamesExW_send(TALLOC_CTX
*mem_ctx
,
6578 struct tevent_context
*ev
,
6579 struct rpc_pipe_client
*cli
,
6580 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
6581 uint32_t _count
/* [in] [range(0,32000)] */,
6582 struct netr_DsRAddress
*_addresses
/* [in] [ref,size_is(count)] */,
6583 struct netr_DsRAddressToSitenamesExWCtr
**_ctr
/* [out] [ref] */)
6585 struct tevent_req
*req
;
6586 struct rpccli_netr_DsRAddressToSitenamesExW_state
*state
;
6587 struct tevent_req
*subreq
;
6589 req
= tevent_req_create(mem_ctx
, &state
,
6590 struct rpccli_netr_DsRAddressToSitenamesExW_state
);
6594 state
->out_mem_ctx
= NULL
;
6595 state
->dispatch_recv
= cli
->dispatch_recv
;
6598 state
->orig
.in
.server_name
= _server_name
;
6599 state
->orig
.in
.count
= _count
;
6600 state
->orig
.in
.addresses
= _addresses
;
6602 /* Out parameters */
6603 state
->orig
.out
.ctr
= _ctr
;
6606 ZERO_STRUCT(state
->orig
.out
.result
);
6608 if (DEBUGLEVEL
>= 10) {
6609 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW
, &state
->orig
);
6612 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6613 "rpccli_netr_DsRAddressToSitenamesExW_out_memory");
6614 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6615 return tevent_req_post(req
, ev
);
6618 /* make a temporary copy, that we pass to the dispatch function */
6619 state
->tmp
= state
->orig
;
6621 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6622 &ndr_table_netlogon
,
6623 NDR_NETR_DSRADDRESSTOSITENAMESEXW
,
6625 if (tevent_req_nomem(subreq
, req
)) {
6626 return tevent_req_post(req
, ev
);
6628 tevent_req_set_callback(subreq
, rpccli_netr_DsRAddressToSitenamesExW_done
, req
);
6632 static void rpccli_netr_DsRAddressToSitenamesExW_done(struct tevent_req
*subreq
)
6634 struct tevent_req
*req
= tevent_req_callback_data(
6635 subreq
, struct tevent_req
);
6636 struct rpccli_netr_DsRAddressToSitenamesExW_state
*state
= tevent_req_data(
6637 req
, struct rpccli_netr_DsRAddressToSitenamesExW_state
);
6639 TALLOC_CTX
*mem_ctx
;
6641 if (state
->out_mem_ctx
) {
6642 mem_ctx
= state
->out_mem_ctx
;
6647 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6648 TALLOC_FREE(subreq
);
6649 if (!NT_STATUS_IS_OK(status
)) {
6650 tevent_req_nterror(req
, status
);
6654 /* Copy out parameters */
6655 *state
->orig
.out
.ctr
= *state
->tmp
.out
.ctr
;
6658 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6660 /* Reset temporary structure */
6661 ZERO_STRUCT(state
->tmp
);
6663 if (DEBUGLEVEL
>= 10) {
6664 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW
, &state
->orig
);
6667 tevent_req_done(req
);
6670 NTSTATUS
rpccli_netr_DsRAddressToSitenamesExW_recv(struct tevent_req
*req
,
6671 TALLOC_CTX
*mem_ctx
,
6674 struct rpccli_netr_DsRAddressToSitenamesExW_state
*state
= tevent_req_data(
6675 req
, struct rpccli_netr_DsRAddressToSitenamesExW_state
);
6678 if (tevent_req_is_nterror(req
, &status
)) {
6679 tevent_req_received(req
);
6683 /* Steal possbile out parameters to the callers context */
6684 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6687 *result
= state
->orig
.out
.result
;
6689 tevent_req_received(req
);
6690 return NT_STATUS_OK
;
6693 NTSTATUS
rpccli_netr_DsRAddressToSitenamesExW(struct rpc_pipe_client
*cli
,
6694 TALLOC_CTX
*mem_ctx
,
6695 const char *server_name
/* [in] [unique,charset(UTF16)] */,
6696 uint32_t count
/* [in] [range(0,32000)] */,
6697 struct netr_DsRAddress
*addresses
/* [in] [ref,size_is(count)] */,
6698 struct netr_DsRAddressToSitenamesExWCtr
**ctr
/* [out] [ref] */,
6701 struct netr_DsRAddressToSitenamesExW r
;
6705 r
.in
.server_name
= server_name
;
6707 r
.in
.addresses
= addresses
;
6709 if (DEBUGLEVEL
>= 10) {
6710 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW
, &r
);
6713 status
= cli
->dispatch(cli
,
6715 &ndr_table_netlogon
,
6716 NDR_NETR_DSRADDRESSTOSITENAMESEXW
,
6719 if (!NT_STATUS_IS_OK(status
)) {
6723 if (DEBUGLEVEL
>= 10) {
6724 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW
, &r
);
6727 if (NT_STATUS_IS_ERR(status
)) {
6731 /* Return variables */
6736 *werror
= r
.out
.result
;
6739 return werror_to_ntstatus(r
.out
.result
);
6742 struct rpccli_netr_DsrGetDcSiteCoverageW_state
{
6743 struct netr_DsrGetDcSiteCoverageW orig
;
6744 struct netr_DsrGetDcSiteCoverageW tmp
;
6745 TALLOC_CTX
*out_mem_ctx
;
6746 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6749 static void rpccli_netr_DsrGetDcSiteCoverageW_done(struct tevent_req
*subreq
);
6751 struct tevent_req
*rpccli_netr_DsrGetDcSiteCoverageW_send(TALLOC_CTX
*mem_ctx
,
6752 struct tevent_context
*ev
,
6753 struct rpc_pipe_client
*cli
,
6754 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
6755 struct DcSitesCtr
**_ctr
/* [out] [ref] */)
6757 struct tevent_req
*req
;
6758 struct rpccli_netr_DsrGetDcSiteCoverageW_state
*state
;
6759 struct tevent_req
*subreq
;
6761 req
= tevent_req_create(mem_ctx
, &state
,
6762 struct rpccli_netr_DsrGetDcSiteCoverageW_state
);
6766 state
->out_mem_ctx
= NULL
;
6767 state
->dispatch_recv
= cli
->dispatch_recv
;
6770 state
->orig
.in
.server_name
= _server_name
;
6772 /* Out parameters */
6773 state
->orig
.out
.ctr
= _ctr
;
6776 ZERO_STRUCT(state
->orig
.out
.result
);
6778 if (DEBUGLEVEL
>= 10) {
6779 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW
, &state
->orig
);
6782 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6783 "rpccli_netr_DsrGetDcSiteCoverageW_out_memory");
6784 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6785 return tevent_req_post(req
, ev
);
6788 /* make a temporary copy, that we pass to the dispatch function */
6789 state
->tmp
= state
->orig
;
6791 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6792 &ndr_table_netlogon
,
6793 NDR_NETR_DSRGETDCSITECOVERAGEW
,
6795 if (tevent_req_nomem(subreq
, req
)) {
6796 return tevent_req_post(req
, ev
);
6798 tevent_req_set_callback(subreq
, rpccli_netr_DsrGetDcSiteCoverageW_done
, req
);
6802 static void rpccli_netr_DsrGetDcSiteCoverageW_done(struct tevent_req
*subreq
)
6804 struct tevent_req
*req
= tevent_req_callback_data(
6805 subreq
, struct tevent_req
);
6806 struct rpccli_netr_DsrGetDcSiteCoverageW_state
*state
= tevent_req_data(
6807 req
, struct rpccli_netr_DsrGetDcSiteCoverageW_state
);
6809 TALLOC_CTX
*mem_ctx
;
6811 if (state
->out_mem_ctx
) {
6812 mem_ctx
= state
->out_mem_ctx
;
6817 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6818 TALLOC_FREE(subreq
);
6819 if (!NT_STATUS_IS_OK(status
)) {
6820 tevent_req_nterror(req
, status
);
6824 /* Copy out parameters */
6825 *state
->orig
.out
.ctr
= *state
->tmp
.out
.ctr
;
6828 state
->orig
.out
.result
= state
->tmp
.out
.result
;
6830 /* Reset temporary structure */
6831 ZERO_STRUCT(state
->tmp
);
6833 if (DEBUGLEVEL
>= 10) {
6834 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW
, &state
->orig
);
6837 tevent_req_done(req
);
6840 NTSTATUS
rpccli_netr_DsrGetDcSiteCoverageW_recv(struct tevent_req
*req
,
6841 TALLOC_CTX
*mem_ctx
,
6844 struct rpccli_netr_DsrGetDcSiteCoverageW_state
*state
= tevent_req_data(
6845 req
, struct rpccli_netr_DsrGetDcSiteCoverageW_state
);
6848 if (tevent_req_is_nterror(req
, &status
)) {
6849 tevent_req_received(req
);
6853 /* Steal possbile out parameters to the callers context */
6854 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
6857 *result
= state
->orig
.out
.result
;
6859 tevent_req_received(req
);
6860 return NT_STATUS_OK
;
6863 NTSTATUS
rpccli_netr_DsrGetDcSiteCoverageW(struct rpc_pipe_client
*cli
,
6864 TALLOC_CTX
*mem_ctx
,
6865 const char *server_name
/* [in] [unique,charset(UTF16)] */,
6866 struct DcSitesCtr
**ctr
/* [out] [ref] */,
6869 struct netr_DsrGetDcSiteCoverageW r
;
6873 r
.in
.server_name
= server_name
;
6875 if (DEBUGLEVEL
>= 10) {
6876 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW
, &r
);
6879 status
= cli
->dispatch(cli
,
6881 &ndr_table_netlogon
,
6882 NDR_NETR_DSRGETDCSITECOVERAGEW
,
6885 if (!NT_STATUS_IS_OK(status
)) {
6889 if (DEBUGLEVEL
>= 10) {
6890 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW
, &r
);
6893 if (NT_STATUS_IS_ERR(status
)) {
6897 /* Return variables */
6902 *werror
= r
.out
.result
;
6905 return werror_to_ntstatus(r
.out
.result
);
6908 struct rpccli_netr_LogonSamLogonEx_state
{
6909 struct netr_LogonSamLogonEx orig
;
6910 struct netr_LogonSamLogonEx tmp
;
6911 TALLOC_CTX
*out_mem_ctx
;
6912 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
6915 static void rpccli_netr_LogonSamLogonEx_done(struct tevent_req
*subreq
);
6917 struct tevent_req
*rpccli_netr_LogonSamLogonEx_send(TALLOC_CTX
*mem_ctx
,
6918 struct tevent_context
*ev
,
6919 struct rpc_pipe_client
*cli
,
6920 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
6921 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
6922 enum netr_LogonInfoClass _logon_level
/* [in] */,
6923 union netr_LogonLevel
*_logon
/* [in] [ref,switch_is(logon_level)] */,
6924 uint16_t _validation_level
/* [in] */,
6925 union netr_Validation
*_validation
/* [out] [ref,switch_is(validation_level)] */,
6926 uint8_t *_authoritative
/* [out] [ref] */,
6927 uint32_t *_flags
/* [in,out] [ref] */)
6929 struct tevent_req
*req
;
6930 struct rpccli_netr_LogonSamLogonEx_state
*state
;
6931 struct tevent_req
*subreq
;
6933 req
= tevent_req_create(mem_ctx
, &state
,
6934 struct rpccli_netr_LogonSamLogonEx_state
);
6938 state
->out_mem_ctx
= NULL
;
6939 state
->dispatch_recv
= cli
->dispatch_recv
;
6942 state
->orig
.in
.server_name
= _server_name
;
6943 state
->orig
.in
.computer_name
= _computer_name
;
6944 state
->orig
.in
.logon_level
= _logon_level
;
6945 state
->orig
.in
.logon
= _logon
;
6946 state
->orig
.in
.validation_level
= _validation_level
;
6947 state
->orig
.in
.flags
= _flags
;
6949 /* Out parameters */
6950 state
->orig
.out
.validation
= _validation
;
6951 state
->orig
.out
.authoritative
= _authoritative
;
6952 state
->orig
.out
.flags
= _flags
;
6955 ZERO_STRUCT(state
->orig
.out
.result
);
6957 if (DEBUGLEVEL
>= 10) {
6958 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx
, &state
->orig
);
6961 state
->out_mem_ctx
= talloc_named_const(state
, 0,
6962 "rpccli_netr_LogonSamLogonEx_out_memory");
6963 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
6964 return tevent_req_post(req
, ev
);
6967 /* make a temporary copy, that we pass to the dispatch function */
6968 state
->tmp
= state
->orig
;
6970 subreq
= cli
->dispatch_send(state
, ev
, cli
,
6971 &ndr_table_netlogon
,
6972 NDR_NETR_LOGONSAMLOGONEX
,
6974 if (tevent_req_nomem(subreq
, req
)) {
6975 return tevent_req_post(req
, ev
);
6977 tevent_req_set_callback(subreq
, rpccli_netr_LogonSamLogonEx_done
, req
);
6981 static void rpccli_netr_LogonSamLogonEx_done(struct tevent_req
*subreq
)
6983 struct tevent_req
*req
= tevent_req_callback_data(
6984 subreq
, struct tevent_req
);
6985 struct rpccli_netr_LogonSamLogonEx_state
*state
= tevent_req_data(
6986 req
, struct rpccli_netr_LogonSamLogonEx_state
);
6988 TALLOC_CTX
*mem_ctx
;
6990 if (state
->out_mem_ctx
) {
6991 mem_ctx
= state
->out_mem_ctx
;
6996 status
= state
->dispatch_recv(subreq
, mem_ctx
);
6997 TALLOC_FREE(subreq
);
6998 if (!NT_STATUS_IS_OK(status
)) {
6999 tevent_req_nterror(req
, status
);
7003 /* Copy out parameters */
7004 *state
->orig
.out
.validation
= *state
->tmp
.out
.validation
;
7005 *state
->orig
.out
.authoritative
= *state
->tmp
.out
.authoritative
;
7006 *state
->orig
.out
.flags
= *state
->tmp
.out
.flags
;
7009 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7011 /* Reset temporary structure */
7012 ZERO_STRUCT(state
->tmp
);
7014 if (DEBUGLEVEL
>= 10) {
7015 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx
, &state
->orig
);
7018 tevent_req_done(req
);
7021 NTSTATUS
rpccli_netr_LogonSamLogonEx_recv(struct tevent_req
*req
,
7022 TALLOC_CTX
*mem_ctx
,
7025 struct rpccli_netr_LogonSamLogonEx_state
*state
= tevent_req_data(
7026 req
, struct rpccli_netr_LogonSamLogonEx_state
);
7029 if (tevent_req_is_nterror(req
, &status
)) {
7030 tevent_req_received(req
);
7034 /* Steal possbile out parameters to the callers context */
7035 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7038 *result
= state
->orig
.out
.result
;
7040 tevent_req_received(req
);
7041 return NT_STATUS_OK
;
7044 NTSTATUS
rpccli_netr_LogonSamLogonEx(struct rpc_pipe_client
*cli
,
7045 TALLOC_CTX
*mem_ctx
,
7046 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7047 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
7048 enum netr_LogonInfoClass logon_level
/* [in] */,
7049 union netr_LogonLevel
*logon
/* [in] [ref,switch_is(logon_level)] */,
7050 uint16_t validation_level
/* [in] */,
7051 union netr_Validation
*validation
/* [out] [ref,switch_is(validation_level)] */,
7052 uint8_t *authoritative
/* [out] [ref] */,
7053 uint32_t *flags
/* [in,out] [ref] */)
7055 struct netr_LogonSamLogonEx r
;
7059 r
.in
.server_name
= server_name
;
7060 r
.in
.computer_name
= computer_name
;
7061 r
.in
.logon_level
= logon_level
;
7063 r
.in
.validation_level
= validation_level
;
7066 if (DEBUGLEVEL
>= 10) {
7067 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx
, &r
);
7070 status
= cli
->dispatch(cli
,
7072 &ndr_table_netlogon
,
7073 NDR_NETR_LOGONSAMLOGONEX
,
7076 if (!NT_STATUS_IS_OK(status
)) {
7080 if (DEBUGLEVEL
>= 10) {
7081 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx
, &r
);
7084 if (NT_STATUS_IS_ERR(status
)) {
7088 /* Return variables */
7089 *validation
= *r
.out
.validation
;
7090 *authoritative
= *r
.out
.authoritative
;
7091 *flags
= *r
.out
.flags
;
7094 return r
.out
.result
;
7097 struct rpccli_netr_DsrEnumerateDomainTrusts_state
{
7098 struct netr_DsrEnumerateDomainTrusts orig
;
7099 struct netr_DsrEnumerateDomainTrusts tmp
;
7100 TALLOC_CTX
*out_mem_ctx
;
7101 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7104 static void rpccli_netr_DsrEnumerateDomainTrusts_done(struct tevent_req
*subreq
);
7106 struct tevent_req
*rpccli_netr_DsrEnumerateDomainTrusts_send(TALLOC_CTX
*mem_ctx
,
7107 struct tevent_context
*ev
,
7108 struct rpc_pipe_client
*cli
,
7109 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7110 uint32_t _trust_flags
/* [in] */,
7111 struct netr_DomainTrustList
*_trusts
/* [out] [ref] */)
7113 struct tevent_req
*req
;
7114 struct rpccli_netr_DsrEnumerateDomainTrusts_state
*state
;
7115 struct tevent_req
*subreq
;
7117 req
= tevent_req_create(mem_ctx
, &state
,
7118 struct rpccli_netr_DsrEnumerateDomainTrusts_state
);
7122 state
->out_mem_ctx
= NULL
;
7123 state
->dispatch_recv
= cli
->dispatch_recv
;
7126 state
->orig
.in
.server_name
= _server_name
;
7127 state
->orig
.in
.trust_flags
= _trust_flags
;
7129 /* Out parameters */
7130 state
->orig
.out
.trusts
= _trusts
;
7133 ZERO_STRUCT(state
->orig
.out
.result
);
7135 if (DEBUGLEVEL
>= 10) {
7136 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts
, &state
->orig
);
7139 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7140 "rpccli_netr_DsrEnumerateDomainTrusts_out_memory");
7141 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7142 return tevent_req_post(req
, ev
);
7145 /* make a temporary copy, that we pass to the dispatch function */
7146 state
->tmp
= state
->orig
;
7148 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7149 &ndr_table_netlogon
,
7150 NDR_NETR_DSRENUMERATEDOMAINTRUSTS
,
7152 if (tevent_req_nomem(subreq
, req
)) {
7153 return tevent_req_post(req
, ev
);
7155 tevent_req_set_callback(subreq
, rpccli_netr_DsrEnumerateDomainTrusts_done
, req
);
7159 static void rpccli_netr_DsrEnumerateDomainTrusts_done(struct tevent_req
*subreq
)
7161 struct tevent_req
*req
= tevent_req_callback_data(
7162 subreq
, struct tevent_req
);
7163 struct rpccli_netr_DsrEnumerateDomainTrusts_state
*state
= tevent_req_data(
7164 req
, struct rpccli_netr_DsrEnumerateDomainTrusts_state
);
7166 TALLOC_CTX
*mem_ctx
;
7168 if (state
->out_mem_ctx
) {
7169 mem_ctx
= state
->out_mem_ctx
;
7174 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7175 TALLOC_FREE(subreq
);
7176 if (!NT_STATUS_IS_OK(status
)) {
7177 tevent_req_nterror(req
, status
);
7181 /* Copy out parameters */
7182 *state
->orig
.out
.trusts
= *state
->tmp
.out
.trusts
;
7185 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7187 /* Reset temporary structure */
7188 ZERO_STRUCT(state
->tmp
);
7190 if (DEBUGLEVEL
>= 10) {
7191 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts
, &state
->orig
);
7194 tevent_req_done(req
);
7197 NTSTATUS
rpccli_netr_DsrEnumerateDomainTrusts_recv(struct tevent_req
*req
,
7198 TALLOC_CTX
*mem_ctx
,
7201 struct rpccli_netr_DsrEnumerateDomainTrusts_state
*state
= tevent_req_data(
7202 req
, struct rpccli_netr_DsrEnumerateDomainTrusts_state
);
7205 if (tevent_req_is_nterror(req
, &status
)) {
7206 tevent_req_received(req
);
7210 /* Steal possbile out parameters to the callers context */
7211 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7214 *result
= state
->orig
.out
.result
;
7216 tevent_req_received(req
);
7217 return NT_STATUS_OK
;
7220 NTSTATUS
rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client
*cli
,
7221 TALLOC_CTX
*mem_ctx
,
7222 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7223 uint32_t trust_flags
/* [in] */,
7224 struct netr_DomainTrustList
*trusts
/* [out] [ref] */,
7227 struct netr_DsrEnumerateDomainTrusts r
;
7231 r
.in
.server_name
= server_name
;
7232 r
.in
.trust_flags
= trust_flags
;
7234 if (DEBUGLEVEL
>= 10) {
7235 NDR_PRINT_IN_DEBUG(netr_DsrEnumerateDomainTrusts
, &r
);
7238 status
= cli
->dispatch(cli
,
7240 &ndr_table_netlogon
,
7241 NDR_NETR_DSRENUMERATEDOMAINTRUSTS
,
7244 if (!NT_STATUS_IS_OK(status
)) {
7248 if (DEBUGLEVEL
>= 10) {
7249 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts
, &r
);
7252 if (NT_STATUS_IS_ERR(status
)) {
7256 /* Return variables */
7257 *trusts
= *r
.out
.trusts
;
7261 *werror
= r
.out
.result
;
7264 return werror_to_ntstatus(r
.out
.result
);
7267 struct rpccli_netr_DsrDeregisterDNSHostRecords_state
{
7268 struct netr_DsrDeregisterDNSHostRecords orig
;
7269 struct netr_DsrDeregisterDNSHostRecords tmp
;
7270 TALLOC_CTX
*out_mem_ctx
;
7271 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7274 static void rpccli_netr_DsrDeregisterDNSHostRecords_done(struct tevent_req
*subreq
);
7276 struct tevent_req
*rpccli_netr_DsrDeregisterDNSHostRecords_send(TALLOC_CTX
*mem_ctx
,
7277 struct tevent_context
*ev
,
7278 struct rpc_pipe_client
*cli
,
7279 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7280 const char *_domain
/* [in] [unique,charset(UTF16)] */,
7281 struct GUID
*_domain_guid
/* [in] [unique] */,
7282 struct GUID
*_dsa_guid
/* [in] [unique] */,
7283 const char *_dns_host
/* [in] [ref,charset(UTF16)] */)
7285 struct tevent_req
*req
;
7286 struct rpccli_netr_DsrDeregisterDNSHostRecords_state
*state
;
7287 struct tevent_req
*subreq
;
7289 req
= tevent_req_create(mem_ctx
, &state
,
7290 struct rpccli_netr_DsrDeregisterDNSHostRecords_state
);
7294 state
->out_mem_ctx
= NULL
;
7295 state
->dispatch_recv
= cli
->dispatch_recv
;
7298 state
->orig
.in
.server_name
= _server_name
;
7299 state
->orig
.in
.domain
= _domain
;
7300 state
->orig
.in
.domain_guid
= _domain_guid
;
7301 state
->orig
.in
.dsa_guid
= _dsa_guid
;
7302 state
->orig
.in
.dns_host
= _dns_host
;
7304 /* Out parameters */
7307 ZERO_STRUCT(state
->orig
.out
.result
);
7309 if (DEBUGLEVEL
>= 10) {
7310 NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords
, &state
->orig
);
7313 /* make a temporary copy, that we pass to the dispatch function */
7314 state
->tmp
= state
->orig
;
7316 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7317 &ndr_table_netlogon
,
7318 NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS
,
7320 if (tevent_req_nomem(subreq
, req
)) {
7321 return tevent_req_post(req
, ev
);
7323 tevent_req_set_callback(subreq
, rpccli_netr_DsrDeregisterDNSHostRecords_done
, req
);
7327 static void rpccli_netr_DsrDeregisterDNSHostRecords_done(struct tevent_req
*subreq
)
7329 struct tevent_req
*req
= tevent_req_callback_data(
7330 subreq
, struct tevent_req
);
7331 struct rpccli_netr_DsrDeregisterDNSHostRecords_state
*state
= tevent_req_data(
7332 req
, struct rpccli_netr_DsrDeregisterDNSHostRecords_state
);
7334 TALLOC_CTX
*mem_ctx
;
7336 if (state
->out_mem_ctx
) {
7337 mem_ctx
= state
->out_mem_ctx
;
7342 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7343 TALLOC_FREE(subreq
);
7344 if (!NT_STATUS_IS_OK(status
)) {
7345 tevent_req_nterror(req
, status
);
7349 /* Copy out parameters */
7352 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7354 /* Reset temporary structure */
7355 ZERO_STRUCT(state
->tmp
);
7357 if (DEBUGLEVEL
>= 10) {
7358 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords
, &state
->orig
);
7361 tevent_req_done(req
);
7364 NTSTATUS
rpccli_netr_DsrDeregisterDNSHostRecords_recv(struct tevent_req
*req
,
7365 TALLOC_CTX
*mem_ctx
,
7368 struct rpccli_netr_DsrDeregisterDNSHostRecords_state
*state
= tevent_req_data(
7369 req
, struct rpccli_netr_DsrDeregisterDNSHostRecords_state
);
7372 if (tevent_req_is_nterror(req
, &status
)) {
7373 tevent_req_received(req
);
7377 /* Steal possbile out parameters to the callers context */
7378 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7381 *result
= state
->orig
.out
.result
;
7383 tevent_req_received(req
);
7384 return NT_STATUS_OK
;
7387 NTSTATUS
rpccli_netr_DsrDeregisterDNSHostRecords(struct rpc_pipe_client
*cli
,
7388 TALLOC_CTX
*mem_ctx
,
7389 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7390 const char *domain
/* [in] [unique,charset(UTF16)] */,
7391 struct GUID
*domain_guid
/* [in] [unique] */,
7392 struct GUID
*dsa_guid
/* [in] [unique] */,
7393 const char *dns_host
/* [in] [ref,charset(UTF16)] */,
7396 struct netr_DsrDeregisterDNSHostRecords r
;
7400 r
.in
.server_name
= server_name
;
7401 r
.in
.domain
= domain
;
7402 r
.in
.domain_guid
= domain_guid
;
7403 r
.in
.dsa_guid
= dsa_guid
;
7404 r
.in
.dns_host
= dns_host
;
7406 if (DEBUGLEVEL
>= 10) {
7407 NDR_PRINT_IN_DEBUG(netr_DsrDeregisterDNSHostRecords
, &r
);
7410 status
= cli
->dispatch(cli
,
7412 &ndr_table_netlogon
,
7413 NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS
,
7416 if (!NT_STATUS_IS_OK(status
)) {
7420 if (DEBUGLEVEL
>= 10) {
7421 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords
, &r
);
7424 if (NT_STATUS_IS_ERR(status
)) {
7428 /* Return variables */
7432 *werror
= r
.out
.result
;
7435 return werror_to_ntstatus(r
.out
.result
);
7438 struct rpccli_netr_ServerTrustPasswordsGet_state
{
7439 struct netr_ServerTrustPasswordsGet orig
;
7440 struct netr_ServerTrustPasswordsGet tmp
;
7441 TALLOC_CTX
*out_mem_ctx
;
7442 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7445 static void rpccli_netr_ServerTrustPasswordsGet_done(struct tevent_req
*subreq
);
7447 struct tevent_req
*rpccli_netr_ServerTrustPasswordsGet_send(TALLOC_CTX
*mem_ctx
,
7448 struct tevent_context
*ev
,
7449 struct rpc_pipe_client
*cli
,
7450 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7451 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
7452 enum netr_SchannelType _secure_channel_type
/* [in] */,
7453 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
7454 struct netr_Authenticator
*_credential
/* [in] [ref] */,
7455 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
7456 struct samr_Password
*_password
/* [out] [ref] */,
7457 struct samr_Password
*_password2
/* [out] [ref] */)
7459 struct tevent_req
*req
;
7460 struct rpccli_netr_ServerTrustPasswordsGet_state
*state
;
7461 struct tevent_req
*subreq
;
7463 req
= tevent_req_create(mem_ctx
, &state
,
7464 struct rpccli_netr_ServerTrustPasswordsGet_state
);
7468 state
->out_mem_ctx
= NULL
;
7469 state
->dispatch_recv
= cli
->dispatch_recv
;
7472 state
->orig
.in
.server_name
= _server_name
;
7473 state
->orig
.in
.account_name
= _account_name
;
7474 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
7475 state
->orig
.in
.computer_name
= _computer_name
;
7476 state
->orig
.in
.credential
= _credential
;
7478 /* Out parameters */
7479 state
->orig
.out
.return_authenticator
= _return_authenticator
;
7480 state
->orig
.out
.password
= _password
;
7481 state
->orig
.out
.password2
= _password2
;
7484 ZERO_STRUCT(state
->orig
.out
.result
);
7486 if (DEBUGLEVEL
>= 10) {
7487 NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet
, &state
->orig
);
7490 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7491 "rpccli_netr_ServerTrustPasswordsGet_out_memory");
7492 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7493 return tevent_req_post(req
, ev
);
7496 /* make a temporary copy, that we pass to the dispatch function */
7497 state
->tmp
= state
->orig
;
7499 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7500 &ndr_table_netlogon
,
7501 NDR_NETR_SERVERTRUSTPASSWORDSGET
,
7503 if (tevent_req_nomem(subreq
, req
)) {
7504 return tevent_req_post(req
, ev
);
7506 tevent_req_set_callback(subreq
, rpccli_netr_ServerTrustPasswordsGet_done
, req
);
7510 static void rpccli_netr_ServerTrustPasswordsGet_done(struct tevent_req
*subreq
)
7512 struct tevent_req
*req
= tevent_req_callback_data(
7513 subreq
, struct tevent_req
);
7514 struct rpccli_netr_ServerTrustPasswordsGet_state
*state
= tevent_req_data(
7515 req
, struct rpccli_netr_ServerTrustPasswordsGet_state
);
7517 TALLOC_CTX
*mem_ctx
;
7519 if (state
->out_mem_ctx
) {
7520 mem_ctx
= state
->out_mem_ctx
;
7525 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7526 TALLOC_FREE(subreq
);
7527 if (!NT_STATUS_IS_OK(status
)) {
7528 tevent_req_nterror(req
, status
);
7532 /* Copy out parameters */
7533 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
7534 *state
->orig
.out
.password
= *state
->tmp
.out
.password
;
7535 *state
->orig
.out
.password2
= *state
->tmp
.out
.password2
;
7538 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7540 /* Reset temporary structure */
7541 ZERO_STRUCT(state
->tmp
);
7543 if (DEBUGLEVEL
>= 10) {
7544 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet
, &state
->orig
);
7547 tevent_req_done(req
);
7550 NTSTATUS
rpccli_netr_ServerTrustPasswordsGet_recv(struct tevent_req
*req
,
7551 TALLOC_CTX
*mem_ctx
,
7554 struct rpccli_netr_ServerTrustPasswordsGet_state
*state
= tevent_req_data(
7555 req
, struct rpccli_netr_ServerTrustPasswordsGet_state
);
7558 if (tevent_req_is_nterror(req
, &status
)) {
7559 tevent_req_received(req
);
7563 /* Steal possbile out parameters to the callers context */
7564 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7567 *result
= state
->orig
.out
.result
;
7569 tevent_req_received(req
);
7570 return NT_STATUS_OK
;
7573 NTSTATUS
rpccli_netr_ServerTrustPasswordsGet(struct rpc_pipe_client
*cli
,
7574 TALLOC_CTX
*mem_ctx
,
7575 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7576 const char *account_name
/* [in] [ref,charset(UTF16)] */,
7577 enum netr_SchannelType secure_channel_type
/* [in] */,
7578 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
7579 struct netr_Authenticator
*credential
/* [in] [ref] */,
7580 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
7581 struct samr_Password
*password
/* [out] [ref] */,
7582 struct samr_Password
*password2
/* [out] [ref] */)
7584 struct netr_ServerTrustPasswordsGet r
;
7588 r
.in
.server_name
= server_name
;
7589 r
.in
.account_name
= account_name
;
7590 r
.in
.secure_channel_type
= secure_channel_type
;
7591 r
.in
.computer_name
= computer_name
;
7592 r
.in
.credential
= credential
;
7594 if (DEBUGLEVEL
>= 10) {
7595 NDR_PRINT_IN_DEBUG(netr_ServerTrustPasswordsGet
, &r
);
7598 status
= cli
->dispatch(cli
,
7600 &ndr_table_netlogon
,
7601 NDR_NETR_SERVERTRUSTPASSWORDSGET
,
7604 if (!NT_STATUS_IS_OK(status
)) {
7608 if (DEBUGLEVEL
>= 10) {
7609 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet
, &r
);
7612 if (NT_STATUS_IS_ERR(status
)) {
7616 /* Return variables */
7617 *return_authenticator
= *r
.out
.return_authenticator
;
7618 *password
= *r
.out
.password
;
7619 *password2
= *r
.out
.password2
;
7622 return r
.out
.result
;
7625 struct rpccli_netr_DsRGetForestTrustInformation_state
{
7626 struct netr_DsRGetForestTrustInformation orig
;
7627 struct netr_DsRGetForestTrustInformation tmp
;
7628 TALLOC_CTX
*out_mem_ctx
;
7629 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7632 static void rpccli_netr_DsRGetForestTrustInformation_done(struct tevent_req
*subreq
);
7634 struct tevent_req
*rpccli_netr_DsRGetForestTrustInformation_send(TALLOC_CTX
*mem_ctx
,
7635 struct tevent_context
*ev
,
7636 struct rpc_pipe_client
*cli
,
7637 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7638 const char *_trusted_domain_name
/* [in] [unique,charset(UTF16)] */,
7639 uint32_t _flags
/* [in] */,
7640 struct lsa_ForestTrustInformation
**_forest_trust_info
/* [out] [ref] */)
7642 struct tevent_req
*req
;
7643 struct rpccli_netr_DsRGetForestTrustInformation_state
*state
;
7644 struct tevent_req
*subreq
;
7646 req
= tevent_req_create(mem_ctx
, &state
,
7647 struct rpccli_netr_DsRGetForestTrustInformation_state
);
7651 state
->out_mem_ctx
= NULL
;
7652 state
->dispatch_recv
= cli
->dispatch_recv
;
7655 state
->orig
.in
.server_name
= _server_name
;
7656 state
->orig
.in
.trusted_domain_name
= _trusted_domain_name
;
7657 state
->orig
.in
.flags
= _flags
;
7659 /* Out parameters */
7660 state
->orig
.out
.forest_trust_info
= _forest_trust_info
;
7663 ZERO_STRUCT(state
->orig
.out
.result
);
7665 if (DEBUGLEVEL
>= 10) {
7666 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation
, &state
->orig
);
7669 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7670 "rpccli_netr_DsRGetForestTrustInformation_out_memory");
7671 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7672 return tevent_req_post(req
, ev
);
7675 /* make a temporary copy, that we pass to the dispatch function */
7676 state
->tmp
= state
->orig
;
7678 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7679 &ndr_table_netlogon
,
7680 NDR_NETR_DSRGETFORESTTRUSTINFORMATION
,
7682 if (tevent_req_nomem(subreq
, req
)) {
7683 return tevent_req_post(req
, ev
);
7685 tevent_req_set_callback(subreq
, rpccli_netr_DsRGetForestTrustInformation_done
, req
);
7689 static void rpccli_netr_DsRGetForestTrustInformation_done(struct tevent_req
*subreq
)
7691 struct tevent_req
*req
= tevent_req_callback_data(
7692 subreq
, struct tevent_req
);
7693 struct rpccli_netr_DsRGetForestTrustInformation_state
*state
= tevent_req_data(
7694 req
, struct rpccli_netr_DsRGetForestTrustInformation_state
);
7696 TALLOC_CTX
*mem_ctx
;
7698 if (state
->out_mem_ctx
) {
7699 mem_ctx
= state
->out_mem_ctx
;
7704 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7705 TALLOC_FREE(subreq
);
7706 if (!NT_STATUS_IS_OK(status
)) {
7707 tevent_req_nterror(req
, status
);
7711 /* Copy out parameters */
7712 *state
->orig
.out
.forest_trust_info
= *state
->tmp
.out
.forest_trust_info
;
7715 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7717 /* Reset temporary structure */
7718 ZERO_STRUCT(state
->tmp
);
7720 if (DEBUGLEVEL
>= 10) {
7721 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation
, &state
->orig
);
7724 tevent_req_done(req
);
7727 NTSTATUS
rpccli_netr_DsRGetForestTrustInformation_recv(struct tevent_req
*req
,
7728 TALLOC_CTX
*mem_ctx
,
7731 struct rpccli_netr_DsRGetForestTrustInformation_state
*state
= tevent_req_data(
7732 req
, struct rpccli_netr_DsRGetForestTrustInformation_state
);
7735 if (tevent_req_is_nterror(req
, &status
)) {
7736 tevent_req_received(req
);
7740 /* Steal possbile out parameters to the callers context */
7741 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7744 *result
= state
->orig
.out
.result
;
7746 tevent_req_received(req
);
7747 return NT_STATUS_OK
;
7750 NTSTATUS
rpccli_netr_DsRGetForestTrustInformation(struct rpc_pipe_client
*cli
,
7751 TALLOC_CTX
*mem_ctx
,
7752 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7753 const char *trusted_domain_name
/* [in] [unique,charset(UTF16)] */,
7754 uint32_t flags
/* [in] */,
7755 struct lsa_ForestTrustInformation
**forest_trust_info
/* [out] [ref] */,
7758 struct netr_DsRGetForestTrustInformation r
;
7762 r
.in
.server_name
= server_name
;
7763 r
.in
.trusted_domain_name
= trusted_domain_name
;
7766 if (DEBUGLEVEL
>= 10) {
7767 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation
, &r
);
7770 status
= cli
->dispatch(cli
,
7772 &ndr_table_netlogon
,
7773 NDR_NETR_DSRGETFORESTTRUSTINFORMATION
,
7776 if (!NT_STATUS_IS_OK(status
)) {
7780 if (DEBUGLEVEL
>= 10) {
7781 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation
, &r
);
7784 if (NT_STATUS_IS_ERR(status
)) {
7788 /* Return variables */
7789 *forest_trust_info
= *r
.out
.forest_trust_info
;
7793 *werror
= r
.out
.result
;
7796 return werror_to_ntstatus(r
.out
.result
);
7799 struct rpccli_netr_GetForestTrustInformation_state
{
7800 struct netr_GetForestTrustInformation orig
;
7801 struct netr_GetForestTrustInformation tmp
;
7802 TALLOC_CTX
*out_mem_ctx
;
7803 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7806 static void rpccli_netr_GetForestTrustInformation_done(struct tevent_req
*subreq
);
7808 struct tevent_req
*rpccli_netr_GetForestTrustInformation_send(TALLOC_CTX
*mem_ctx
,
7809 struct tevent_context
*ev
,
7810 struct rpc_pipe_client
*cli
,
7811 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7812 const char *_trusted_domain_name
/* [in] [ref,charset(UTF16)] */,
7813 struct netr_Authenticator
*_credential
/* [in] [ref] */,
7814 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
7815 uint32_t _flags
/* [in] */,
7816 struct lsa_ForestTrustInformation
**_forest_trust_info
/* [out] [ref] */)
7818 struct tevent_req
*req
;
7819 struct rpccli_netr_GetForestTrustInformation_state
*state
;
7820 struct tevent_req
*subreq
;
7822 req
= tevent_req_create(mem_ctx
, &state
,
7823 struct rpccli_netr_GetForestTrustInformation_state
);
7827 state
->out_mem_ctx
= NULL
;
7828 state
->dispatch_recv
= cli
->dispatch_recv
;
7831 state
->orig
.in
.server_name
= _server_name
;
7832 state
->orig
.in
.trusted_domain_name
= _trusted_domain_name
;
7833 state
->orig
.in
.credential
= _credential
;
7834 state
->orig
.in
.flags
= _flags
;
7836 /* Out parameters */
7837 state
->orig
.out
.return_authenticator
= _return_authenticator
;
7838 state
->orig
.out
.forest_trust_info
= _forest_trust_info
;
7841 ZERO_STRUCT(state
->orig
.out
.result
);
7843 if (DEBUGLEVEL
>= 10) {
7844 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation
, &state
->orig
);
7847 state
->out_mem_ctx
= talloc_named_const(state
, 0,
7848 "rpccli_netr_GetForestTrustInformation_out_memory");
7849 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
7850 return tevent_req_post(req
, ev
);
7853 /* make a temporary copy, that we pass to the dispatch function */
7854 state
->tmp
= state
->orig
;
7856 subreq
= cli
->dispatch_send(state
, ev
, cli
,
7857 &ndr_table_netlogon
,
7858 NDR_NETR_GETFORESTTRUSTINFORMATION
,
7860 if (tevent_req_nomem(subreq
, req
)) {
7861 return tevent_req_post(req
, ev
);
7863 tevent_req_set_callback(subreq
, rpccli_netr_GetForestTrustInformation_done
, req
);
7867 static void rpccli_netr_GetForestTrustInformation_done(struct tevent_req
*subreq
)
7869 struct tevent_req
*req
= tevent_req_callback_data(
7870 subreq
, struct tevent_req
);
7871 struct rpccli_netr_GetForestTrustInformation_state
*state
= tevent_req_data(
7872 req
, struct rpccli_netr_GetForestTrustInformation_state
);
7874 TALLOC_CTX
*mem_ctx
;
7876 if (state
->out_mem_ctx
) {
7877 mem_ctx
= state
->out_mem_ctx
;
7882 status
= state
->dispatch_recv(subreq
, mem_ctx
);
7883 TALLOC_FREE(subreq
);
7884 if (!NT_STATUS_IS_OK(status
)) {
7885 tevent_req_nterror(req
, status
);
7889 /* Copy out parameters */
7890 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
7891 *state
->orig
.out
.forest_trust_info
= *state
->tmp
.out
.forest_trust_info
;
7894 state
->orig
.out
.result
= state
->tmp
.out
.result
;
7896 /* Reset temporary structure */
7897 ZERO_STRUCT(state
->tmp
);
7899 if (DEBUGLEVEL
>= 10) {
7900 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation
, &state
->orig
);
7903 tevent_req_done(req
);
7906 NTSTATUS
rpccli_netr_GetForestTrustInformation_recv(struct tevent_req
*req
,
7907 TALLOC_CTX
*mem_ctx
,
7910 struct rpccli_netr_GetForestTrustInformation_state
*state
= tevent_req_data(
7911 req
, struct rpccli_netr_GetForestTrustInformation_state
);
7914 if (tevent_req_is_nterror(req
, &status
)) {
7915 tevent_req_received(req
);
7919 /* Steal possbile out parameters to the callers context */
7920 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
7923 *result
= state
->orig
.out
.result
;
7925 tevent_req_received(req
);
7926 return NT_STATUS_OK
;
7929 NTSTATUS
rpccli_netr_GetForestTrustInformation(struct rpc_pipe_client
*cli
,
7930 TALLOC_CTX
*mem_ctx
,
7931 const char *server_name
/* [in] [unique,charset(UTF16)] */,
7932 const char *trusted_domain_name
/* [in] [ref,charset(UTF16)] */,
7933 struct netr_Authenticator
*credential
/* [in] [ref] */,
7934 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
7935 uint32_t flags
/* [in] */,
7936 struct lsa_ForestTrustInformation
**forest_trust_info
/* [out] [ref] */,
7939 struct netr_GetForestTrustInformation r
;
7943 r
.in
.server_name
= server_name
;
7944 r
.in
.trusted_domain_name
= trusted_domain_name
;
7945 r
.in
.credential
= credential
;
7948 if (DEBUGLEVEL
>= 10) {
7949 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation
, &r
);
7952 status
= cli
->dispatch(cli
,
7954 &ndr_table_netlogon
,
7955 NDR_NETR_GETFORESTTRUSTINFORMATION
,
7958 if (!NT_STATUS_IS_OK(status
)) {
7962 if (DEBUGLEVEL
>= 10) {
7963 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation
, &r
);
7966 if (NT_STATUS_IS_ERR(status
)) {
7970 /* Return variables */
7971 *return_authenticator
= *r
.out
.return_authenticator
;
7972 *forest_trust_info
= *r
.out
.forest_trust_info
;
7976 *werror
= r
.out
.result
;
7979 return werror_to_ntstatus(r
.out
.result
);
7982 struct rpccli_netr_LogonSamLogonWithFlags_state
{
7983 struct netr_LogonSamLogonWithFlags orig
;
7984 struct netr_LogonSamLogonWithFlags tmp
;
7985 TALLOC_CTX
*out_mem_ctx
;
7986 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
7989 static void rpccli_netr_LogonSamLogonWithFlags_done(struct tevent_req
*subreq
);
7991 struct tevent_req
*rpccli_netr_LogonSamLogonWithFlags_send(TALLOC_CTX
*mem_ctx
,
7992 struct tevent_context
*ev
,
7993 struct rpc_pipe_client
*cli
,
7994 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
7995 const char *_computer_name
/* [in] [unique,charset(UTF16)] */,
7996 struct netr_Authenticator
*_credential
/* [in] [unique] */,
7997 struct netr_Authenticator
*_return_authenticator
/* [in,out] [unique] */,
7998 enum netr_LogonInfoClass _logon_level
/* [in] */,
7999 union netr_LogonLevel
*_logon
/* [in] [ref,switch_is(logon_level)] */,
8000 uint16_t _validation_level
/* [in] */,
8001 union netr_Validation
*_validation
/* [out] [ref,switch_is(validation_level)] */,
8002 uint8_t *_authoritative
/* [out] [ref] */,
8003 uint32_t *_flags
/* [in,out] [ref] */)
8005 struct tevent_req
*req
;
8006 struct rpccli_netr_LogonSamLogonWithFlags_state
*state
;
8007 struct tevent_req
*subreq
;
8009 req
= tevent_req_create(mem_ctx
, &state
,
8010 struct rpccli_netr_LogonSamLogonWithFlags_state
);
8014 state
->out_mem_ctx
= NULL
;
8015 state
->dispatch_recv
= cli
->dispatch_recv
;
8018 state
->orig
.in
.server_name
= _server_name
;
8019 state
->orig
.in
.computer_name
= _computer_name
;
8020 state
->orig
.in
.credential
= _credential
;
8021 state
->orig
.in
.return_authenticator
= _return_authenticator
;
8022 state
->orig
.in
.logon_level
= _logon_level
;
8023 state
->orig
.in
.logon
= _logon
;
8024 state
->orig
.in
.validation_level
= _validation_level
;
8025 state
->orig
.in
.flags
= _flags
;
8027 /* Out parameters */
8028 state
->orig
.out
.return_authenticator
= _return_authenticator
;
8029 state
->orig
.out
.validation
= _validation
;
8030 state
->orig
.out
.authoritative
= _authoritative
;
8031 state
->orig
.out
.flags
= _flags
;
8034 ZERO_STRUCT(state
->orig
.out
.result
);
8036 if (DEBUGLEVEL
>= 10) {
8037 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags
, &state
->orig
);
8040 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8041 "rpccli_netr_LogonSamLogonWithFlags_out_memory");
8042 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8043 return tevent_req_post(req
, ev
);
8046 /* make a temporary copy, that we pass to the dispatch function */
8047 state
->tmp
= state
->orig
;
8049 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8050 &ndr_table_netlogon
,
8051 NDR_NETR_LOGONSAMLOGONWITHFLAGS
,
8053 if (tevent_req_nomem(subreq
, req
)) {
8054 return tevent_req_post(req
, ev
);
8056 tevent_req_set_callback(subreq
, rpccli_netr_LogonSamLogonWithFlags_done
, req
);
8060 static void rpccli_netr_LogonSamLogonWithFlags_done(struct tevent_req
*subreq
)
8062 struct tevent_req
*req
= tevent_req_callback_data(
8063 subreq
, struct tevent_req
);
8064 struct rpccli_netr_LogonSamLogonWithFlags_state
*state
= tevent_req_data(
8065 req
, struct rpccli_netr_LogonSamLogonWithFlags_state
);
8067 TALLOC_CTX
*mem_ctx
;
8069 if (state
->out_mem_ctx
) {
8070 mem_ctx
= state
->out_mem_ctx
;
8075 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8076 TALLOC_FREE(subreq
);
8077 if (!NT_STATUS_IS_OK(status
)) {
8078 tevent_req_nterror(req
, status
);
8082 /* Copy out parameters */
8083 if (state
->orig
.out
.return_authenticator
&& state
->tmp
.out
.return_authenticator
) {
8084 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
8086 *state
->orig
.out
.validation
= *state
->tmp
.out
.validation
;
8087 *state
->orig
.out
.authoritative
= *state
->tmp
.out
.authoritative
;
8088 *state
->orig
.out
.flags
= *state
->tmp
.out
.flags
;
8091 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8093 /* Reset temporary structure */
8094 ZERO_STRUCT(state
->tmp
);
8096 if (DEBUGLEVEL
>= 10) {
8097 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags
, &state
->orig
);
8100 tevent_req_done(req
);
8103 NTSTATUS
rpccli_netr_LogonSamLogonWithFlags_recv(struct tevent_req
*req
,
8104 TALLOC_CTX
*mem_ctx
,
8107 struct rpccli_netr_LogonSamLogonWithFlags_state
*state
= tevent_req_data(
8108 req
, struct rpccli_netr_LogonSamLogonWithFlags_state
);
8111 if (tevent_req_is_nterror(req
, &status
)) {
8112 tevent_req_received(req
);
8116 /* Steal possbile out parameters to the callers context */
8117 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8120 *result
= state
->orig
.out
.result
;
8122 tevent_req_received(req
);
8123 return NT_STATUS_OK
;
8126 NTSTATUS
rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client
*cli
,
8127 TALLOC_CTX
*mem_ctx
,
8128 const char *server_name
/* [in] [unique,charset(UTF16)] */,
8129 const char *computer_name
/* [in] [unique,charset(UTF16)] */,
8130 struct netr_Authenticator
*credential
/* [in] [unique] */,
8131 struct netr_Authenticator
*return_authenticator
/* [in,out] [unique] */,
8132 enum netr_LogonInfoClass logon_level
/* [in] */,
8133 union netr_LogonLevel
*logon
/* [in] [ref,switch_is(logon_level)] */,
8134 uint16_t validation_level
/* [in] */,
8135 union netr_Validation
*validation
/* [out] [ref,switch_is(validation_level)] */,
8136 uint8_t *authoritative
/* [out] [ref] */,
8137 uint32_t *flags
/* [in,out] [ref] */)
8139 struct netr_LogonSamLogonWithFlags r
;
8143 r
.in
.server_name
= server_name
;
8144 r
.in
.computer_name
= computer_name
;
8145 r
.in
.credential
= credential
;
8146 r
.in
.return_authenticator
= return_authenticator
;
8147 r
.in
.logon_level
= logon_level
;
8149 r
.in
.validation_level
= validation_level
;
8152 if (DEBUGLEVEL
>= 10) {
8153 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags
, &r
);
8156 status
= cli
->dispatch(cli
,
8158 &ndr_table_netlogon
,
8159 NDR_NETR_LOGONSAMLOGONWITHFLAGS
,
8162 if (!NT_STATUS_IS_OK(status
)) {
8166 if (DEBUGLEVEL
>= 10) {
8167 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags
, &r
);
8170 if (NT_STATUS_IS_ERR(status
)) {
8174 /* Return variables */
8175 if (return_authenticator
&& r
.out
.return_authenticator
) {
8176 *return_authenticator
= *r
.out
.return_authenticator
;
8178 *validation
= *r
.out
.validation
;
8179 *authoritative
= *r
.out
.authoritative
;
8180 *flags
= *r
.out
.flags
;
8183 return r
.out
.result
;
8186 struct rpccli_netr_ServerGetTrustInfo_state
{
8187 struct netr_ServerGetTrustInfo orig
;
8188 struct netr_ServerGetTrustInfo tmp
;
8189 TALLOC_CTX
*out_mem_ctx
;
8190 NTSTATUS (*dispatch_recv
)(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
);
8193 static void rpccli_netr_ServerGetTrustInfo_done(struct tevent_req
*subreq
);
8195 struct tevent_req
*rpccli_netr_ServerGetTrustInfo_send(TALLOC_CTX
*mem_ctx
,
8196 struct tevent_context
*ev
,
8197 struct rpc_pipe_client
*cli
,
8198 const char *_server_name
/* [in] [unique,charset(UTF16)] */,
8199 const char *_account_name
/* [in] [ref,charset(UTF16)] */,
8200 enum netr_SchannelType _secure_channel_type
/* [in] */,
8201 const char *_computer_name
/* [in] [ref,charset(UTF16)] */,
8202 struct netr_Authenticator
*_credential
/* [in] [ref] */,
8203 struct netr_Authenticator
*_return_authenticator
/* [out] [ref] */,
8204 struct samr_Password
*_new_owf_password
/* [out] [ref] */,
8205 struct samr_Password
*_old_owf_password
/* [out] [ref] */,
8206 struct netr_TrustInfo
**_trust_info
/* [out] [ref] */)
8208 struct tevent_req
*req
;
8209 struct rpccli_netr_ServerGetTrustInfo_state
*state
;
8210 struct tevent_req
*subreq
;
8212 req
= tevent_req_create(mem_ctx
, &state
,
8213 struct rpccli_netr_ServerGetTrustInfo_state
);
8217 state
->out_mem_ctx
= NULL
;
8218 state
->dispatch_recv
= cli
->dispatch_recv
;
8221 state
->orig
.in
.server_name
= _server_name
;
8222 state
->orig
.in
.account_name
= _account_name
;
8223 state
->orig
.in
.secure_channel_type
= _secure_channel_type
;
8224 state
->orig
.in
.computer_name
= _computer_name
;
8225 state
->orig
.in
.credential
= _credential
;
8227 /* Out parameters */
8228 state
->orig
.out
.return_authenticator
= _return_authenticator
;
8229 state
->orig
.out
.new_owf_password
= _new_owf_password
;
8230 state
->orig
.out
.old_owf_password
= _old_owf_password
;
8231 state
->orig
.out
.trust_info
= _trust_info
;
8234 ZERO_STRUCT(state
->orig
.out
.result
);
8236 if (DEBUGLEVEL
>= 10) {
8237 NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo
, &state
->orig
);
8240 state
->out_mem_ctx
= talloc_named_const(state
, 0,
8241 "rpccli_netr_ServerGetTrustInfo_out_memory");
8242 if (tevent_req_nomem(state
->out_mem_ctx
, req
)) {
8243 return tevent_req_post(req
, ev
);
8246 /* make a temporary copy, that we pass to the dispatch function */
8247 state
->tmp
= state
->orig
;
8249 subreq
= cli
->dispatch_send(state
, ev
, cli
,
8250 &ndr_table_netlogon
,
8251 NDR_NETR_SERVERGETTRUSTINFO
,
8253 if (tevent_req_nomem(subreq
, req
)) {
8254 return tevent_req_post(req
, ev
);
8256 tevent_req_set_callback(subreq
, rpccli_netr_ServerGetTrustInfo_done
, req
);
8260 static void rpccli_netr_ServerGetTrustInfo_done(struct tevent_req
*subreq
)
8262 struct tevent_req
*req
= tevent_req_callback_data(
8263 subreq
, struct tevent_req
);
8264 struct rpccli_netr_ServerGetTrustInfo_state
*state
= tevent_req_data(
8265 req
, struct rpccli_netr_ServerGetTrustInfo_state
);
8267 TALLOC_CTX
*mem_ctx
;
8269 if (state
->out_mem_ctx
) {
8270 mem_ctx
= state
->out_mem_ctx
;
8275 status
= state
->dispatch_recv(subreq
, mem_ctx
);
8276 TALLOC_FREE(subreq
);
8277 if (!NT_STATUS_IS_OK(status
)) {
8278 tevent_req_nterror(req
, status
);
8282 /* Copy out parameters */
8283 *state
->orig
.out
.return_authenticator
= *state
->tmp
.out
.return_authenticator
;
8284 *state
->orig
.out
.new_owf_password
= *state
->tmp
.out
.new_owf_password
;
8285 *state
->orig
.out
.old_owf_password
= *state
->tmp
.out
.old_owf_password
;
8286 *state
->orig
.out
.trust_info
= *state
->tmp
.out
.trust_info
;
8289 state
->orig
.out
.result
= state
->tmp
.out
.result
;
8291 /* Reset temporary structure */
8292 ZERO_STRUCT(state
->tmp
);
8294 if (DEBUGLEVEL
>= 10) {
8295 NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo
, &state
->orig
);
8298 tevent_req_done(req
);
8301 NTSTATUS
rpccli_netr_ServerGetTrustInfo_recv(struct tevent_req
*req
,
8302 TALLOC_CTX
*mem_ctx
,
8305 struct rpccli_netr_ServerGetTrustInfo_state
*state
= tevent_req_data(
8306 req
, struct rpccli_netr_ServerGetTrustInfo_state
);
8309 if (tevent_req_is_nterror(req
, &status
)) {
8310 tevent_req_received(req
);
8314 /* Steal possbile out parameters to the callers context */
8315 talloc_steal(mem_ctx
, state
->out_mem_ctx
);
8318 *result
= state
->orig
.out
.result
;
8320 tevent_req_received(req
);
8321 return NT_STATUS_OK
;
8324 NTSTATUS
rpccli_netr_ServerGetTrustInfo(struct rpc_pipe_client
*cli
,
8325 TALLOC_CTX
*mem_ctx
,
8326 const char *server_name
/* [in] [unique,charset(UTF16)] */,
8327 const char *account_name
/* [in] [ref,charset(UTF16)] */,
8328 enum netr_SchannelType secure_channel_type
/* [in] */,
8329 const char *computer_name
/* [in] [ref,charset(UTF16)] */,
8330 struct netr_Authenticator
*credential
/* [in] [ref] */,
8331 struct netr_Authenticator
*return_authenticator
/* [out] [ref] */,
8332 struct samr_Password
*new_owf_password
/* [out] [ref] */,
8333 struct samr_Password
*old_owf_password
/* [out] [ref] */,
8334 struct netr_TrustInfo
**trust_info
/* [out] [ref] */)
8336 struct netr_ServerGetTrustInfo r
;
8340 r
.in
.server_name
= server_name
;
8341 r
.in
.account_name
= account_name
;
8342 r
.in
.secure_channel_type
= secure_channel_type
;
8343 r
.in
.computer_name
= computer_name
;
8344 r
.in
.credential
= credential
;
8346 if (DEBUGLEVEL
>= 10) {
8347 NDR_PRINT_IN_DEBUG(netr_ServerGetTrustInfo
, &r
);
8350 status
= cli
->dispatch(cli
,
8352 &ndr_table_netlogon
,
8353 NDR_NETR_SERVERGETTRUSTINFO
,
8356 if (!NT_STATUS_IS_OK(status
)) {
8360 if (DEBUGLEVEL
>= 10) {
8361 NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo
, &r
);
8364 if (NT_STATUS_IS_ERR(status
)) {
8368 /* Return variables */
8369 *return_authenticator
= *r
.out
.return_authenticator
;
8370 *new_owf_password
= *r
.out
.new_owf_password
;
8371 *old_owf_password
= *r
.out
.old_owf_password
;
8372 *trust_info
= *r
.out
.trust_info
;
8375 return r
.out
.result
;