void functions can't return a value. Found by the Solaris compiler.
[Samba/fernandojvsilva.git] / librpc / gen_ndr / cli_netlogon.c
blobb173804c621e179ee03c400b43b00391d6668f24
1 /*
2 * Unix SMB/CIFS implementation.
3 * client auto-generated by pidl. DO NOT MODIFY!
4 */
6 #include "includes.h"
7 #include "../librpc/gen_ndr/cli_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);
32 if (req == NULL) {
33 return NULL;
35 state->out_mem_ctx = NULL;
36 state->dispatch_recv = cli->dispatch_recv;
38 /* In parameters */
39 state->orig.in.server_name = _server_name;
40 state->orig.in.account_name = _account_name;
41 state->orig.in.workstation = _workstation;
43 /* Out parameters */
44 state->orig.out.info = _info;
46 /* Result */
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,
63 &ndr_table_netlogon,
64 NDR_NETR_LOGONUASLOGON,
65 &state->tmp);
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);
70 return 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);
79 NTSTATUS status;
80 TALLOC_CTX *mem_ctx;
82 if (state->out_mem_ctx) {
83 mem_ctx = state->out_mem_ctx;
84 } else {
85 mem_ctx = state;
88 status = state->dispatch_recv(subreq, mem_ctx);
89 TALLOC_FREE(subreq);
90 if (!NT_STATUS_IS_OK(status)) {
91 tevent_req_nterror(req, status);
92 return;
95 /* Copy out parameters */
96 *state->orig.out.info = *state->tmp.out.info;
98 /* Copy result */
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,
112 TALLOC_CTX *mem_ctx,
113 WERROR *result)
115 struct rpccli_netr_LogonUasLogon_state *state = tevent_req_data(
116 req, struct rpccli_netr_LogonUasLogon_state);
117 NTSTATUS status;
119 if (tevent_req_is_nterror(req, &status)) {
120 tevent_req_received(req);
121 return status;
124 /* Steal possbile out parameters to the callers context */
125 talloc_steal(mem_ctx, state->out_mem_ctx);
127 /* Return result */
128 *result = state->orig.out.result;
130 tevent_req_received(req);
131 return NT_STATUS_OK;
134 NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli,
135 TALLOC_CTX *mem_ctx,
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] */,
140 WERROR *werror)
142 struct netr_LogonUasLogon r;
143 NTSTATUS status;
145 /* In parameters */
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,
155 mem_ctx,
156 &ndr_table_netlogon,
157 NDR_NETR_LOGONUASLOGON,
158 &r);
160 if (!NT_STATUS_IS_OK(status)) {
161 return status;
164 if (DEBUGLEVEL >= 10) {
165 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogon, &r);
168 if (NT_STATUS_IS_ERR(status)) {
169 return status;
172 /* Return variables */
173 *info = *r.out.info;
175 /* Return result */
176 if (werror) {
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);
206 if (req == NULL) {
207 return NULL;
209 state->out_mem_ctx = NULL;
210 state->dispatch_recv = cli->dispatch_recv;
212 /* In parameters */
213 state->orig.in.server_name = _server_name;
214 state->orig.in.account_name = _account_name;
215 state->orig.in.workstation = _workstation;
217 /* Out parameters */
218 state->orig.out.info = _info;
220 /* Result */
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,
237 &ndr_table_netlogon,
238 NDR_NETR_LOGONUASLOGOFF,
239 &state->tmp);
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);
244 return 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);
253 NTSTATUS status;
254 TALLOC_CTX *mem_ctx;
256 if (state->out_mem_ctx) {
257 mem_ctx = state->out_mem_ctx;
258 } else {
259 mem_ctx = state;
262 status = state->dispatch_recv(subreq, mem_ctx);
263 TALLOC_FREE(subreq);
264 if (!NT_STATUS_IS_OK(status)) {
265 tevent_req_nterror(req, status);
266 return;
269 /* Copy out parameters */
270 *state->orig.out.info = *state->tmp.out.info;
272 /* Copy result */
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,
286 TALLOC_CTX *mem_ctx,
287 WERROR *result)
289 struct rpccli_netr_LogonUasLogoff_state *state = tevent_req_data(
290 req, struct rpccli_netr_LogonUasLogoff_state);
291 NTSTATUS status;
293 if (tevent_req_is_nterror(req, &status)) {
294 tevent_req_received(req);
295 return status;
298 /* Steal possbile out parameters to the callers context */
299 talloc_steal(mem_ctx, state->out_mem_ctx);
301 /* Return result */
302 *result = state->orig.out.result;
304 tevent_req_received(req);
305 return NT_STATUS_OK;
308 NTSTATUS rpccli_netr_LogonUasLogoff(struct rpc_pipe_client *cli,
309 TALLOC_CTX *mem_ctx,
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] */,
314 WERROR *werror)
316 struct netr_LogonUasLogoff r;
317 NTSTATUS status;
319 /* In parameters */
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,
329 mem_ctx,
330 &ndr_table_netlogon,
331 NDR_NETR_LOGONUASLOGOFF,
332 &r);
334 if (!NT_STATUS_IS_OK(status)) {
335 return status;
338 if (DEBUGLEVEL >= 10) {
339 NDR_PRINT_OUT_DEBUG(netr_LogonUasLogoff, &r);
342 if (NT_STATUS_IS_ERR(status)) {
343 return status;
346 /* Return variables */
347 *info = *r.out.info;
349 /* Return result */
350 if (werror) {
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);
385 if (req == NULL) {
386 return NULL;
388 state->out_mem_ctx = NULL;
389 state->dispatch_recv = cli->dispatch_recv;
391 /* In parameters */
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;
400 /* Out parameters */
401 state->orig.out.return_authenticator = _return_authenticator;
402 state->orig.out.validation = _validation;
403 state->orig.out.authoritative = _authoritative;
405 /* Result */
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,
422 &ndr_table_netlogon,
423 NDR_NETR_LOGONSAMLOGON,
424 &state->tmp);
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);
429 return 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);
438 NTSTATUS status;
439 TALLOC_CTX *mem_ctx;
441 if (state->out_mem_ctx) {
442 mem_ctx = state->out_mem_ctx;
443 } else {
444 mem_ctx = state;
447 status = state->dispatch_recv(subreq, mem_ctx);
448 TALLOC_FREE(subreq);
449 if (!NT_STATUS_IS_OK(status)) {
450 tevent_req_nterror(req, status);
451 return;
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;
461 /* Copy result */
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,
475 TALLOC_CTX *mem_ctx,
476 NTSTATUS *result)
478 struct rpccli_netr_LogonSamLogon_state *state = tevent_req_data(
479 req, struct rpccli_netr_LogonSamLogon_state);
480 NTSTATUS status;
482 if (tevent_req_is_nterror(req, &status)) {
483 tevent_req_received(req);
484 return status;
487 /* Steal possbile out parameters to the callers context */
488 talloc_steal(mem_ctx, state->out_mem_ctx);
490 /* Return result */
491 *result = state->orig.out.result;
493 tevent_req_received(req);
494 return NT_STATUS_OK;
497 NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli,
498 TALLOC_CTX *mem_ctx,
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;
510 NTSTATUS status;
512 /* In parameters */
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;
518 r.in.logon = logon;
519 r.in.validation_level = validation_level;
521 if (DEBUGLEVEL >= 10) {
522 NDR_PRINT_IN_DEBUG(netr_LogonSamLogon, &r);
525 status = cli->dispatch(cli,
526 mem_ctx,
527 &ndr_table_netlogon,
528 NDR_NETR_LOGONSAMLOGON,
529 &r);
531 if (!NT_STATUS_IS_OK(status)) {
532 return status;
535 if (DEBUGLEVEL >= 10) {
536 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogon, &r);
539 if (NT_STATUS_IS_ERR(status)) {
540 return 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;
550 /* Return result */
551 return r.out.result;
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);
579 if (req == NULL) {
580 return NULL;
582 state->out_mem_ctx = NULL;
583 state->dispatch_recv = cli->dispatch_recv;
585 /* In parameters */
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;
593 /* Out parameters */
594 state->orig.out.return_authenticator = _return_authenticator;
596 /* Result */
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,
613 &ndr_table_netlogon,
614 NDR_NETR_LOGONSAMLOGOFF,
615 &state->tmp);
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);
620 return 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);
629 NTSTATUS status;
630 TALLOC_CTX *mem_ctx;
632 if (state->out_mem_ctx) {
633 mem_ctx = state->out_mem_ctx;
634 } else {
635 mem_ctx = state;
638 status = state->dispatch_recv(subreq, mem_ctx);
639 TALLOC_FREE(subreq);
640 if (!NT_STATUS_IS_OK(status)) {
641 tevent_req_nterror(req, status);
642 return;
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;
650 /* Copy result */
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,
664 TALLOC_CTX *mem_ctx,
665 NTSTATUS *result)
667 struct rpccli_netr_LogonSamLogoff_state *state = tevent_req_data(
668 req, struct rpccli_netr_LogonSamLogoff_state);
669 NTSTATUS status;
671 if (tevent_req_is_nterror(req, &status)) {
672 tevent_req_received(req);
673 return status;
676 /* Steal possbile out parameters to the callers context */
677 talloc_steal(mem_ctx, state->out_mem_ctx);
679 /* Return result */
680 *result = state->orig.out.result;
682 tevent_req_received(req);
683 return NT_STATUS_OK;
686 NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli,
687 TALLOC_CTX *mem_ctx,
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;
696 NTSTATUS status;
698 /* In parameters */
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;
704 r.in.logon = logon;
706 if (DEBUGLEVEL >= 10) {
707 NDR_PRINT_IN_DEBUG(netr_LogonSamLogoff, &r);
710 status = cli->dispatch(cli,
711 mem_ctx,
712 &ndr_table_netlogon,
713 NDR_NETR_LOGONSAMLOGOFF,
714 &r);
716 if (!NT_STATUS_IS_OK(status)) {
717 return status;
720 if (DEBUGLEVEL >= 10) {
721 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogoff, &r);
724 if (NT_STATUS_IS_ERR(status)) {
725 return status;
728 /* Return variables */
729 if (return_authenticator && r.out.return_authenticator) {
730 *return_authenticator = *r.out.return_authenticator;
733 /* Return result */
734 return r.out.result;
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);
760 if (req == NULL) {
761 return NULL;
763 state->out_mem_ctx = NULL;
764 state->dispatch_recv = cli->dispatch_recv;
766 /* In parameters */
767 state->orig.in.server_name = _server_name;
768 state->orig.in.computer_name = _computer_name;
769 state->orig.in.credentials = _credentials;
771 /* Out parameters */
772 state->orig.out.return_credentials = _return_credentials;
774 /* Result */
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,
791 &ndr_table_netlogon,
792 NDR_NETR_SERVERREQCHALLENGE,
793 &state->tmp);
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);
798 return 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);
807 NTSTATUS status;
808 TALLOC_CTX *mem_ctx;
810 if (state->out_mem_ctx) {
811 mem_ctx = state->out_mem_ctx;
812 } else {
813 mem_ctx = state;
816 status = state->dispatch_recv(subreq, mem_ctx);
817 TALLOC_FREE(subreq);
818 if (!NT_STATUS_IS_OK(status)) {
819 tevent_req_nterror(req, status);
820 return;
823 /* Copy out parameters */
824 *state->orig.out.return_credentials = *state->tmp.out.return_credentials;
826 /* Copy result */
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,
840 TALLOC_CTX *mem_ctx,
841 NTSTATUS *result)
843 struct rpccli_netr_ServerReqChallenge_state *state = tevent_req_data(
844 req, struct rpccli_netr_ServerReqChallenge_state);
845 NTSTATUS status;
847 if (tevent_req_is_nterror(req, &status)) {
848 tevent_req_received(req);
849 return status;
852 /* Steal possbile out parameters to the callers context */
853 talloc_steal(mem_ctx, state->out_mem_ctx);
855 /* Return result */
856 *result = state->orig.out.result;
858 tevent_req_received(req);
859 return NT_STATUS_OK;
862 NTSTATUS rpccli_netr_ServerReqChallenge(struct rpc_pipe_client *cli,
863 TALLOC_CTX *mem_ctx,
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;
870 NTSTATUS status;
872 /* In parameters */
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,
882 mem_ctx,
883 &ndr_table_netlogon,
884 NDR_NETR_SERVERREQCHALLENGE,
885 &r);
887 if (!NT_STATUS_IS_OK(status)) {
888 return status;
891 if (DEBUGLEVEL >= 10) {
892 NDR_PRINT_OUT_DEBUG(netr_ServerReqChallenge, &r);
895 if (NT_STATUS_IS_ERR(status)) {
896 return status;
899 /* Return variables */
900 *return_credentials = *r.out.return_credentials;
902 /* Return result */
903 return r.out.result;
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);
931 if (req == NULL) {
932 return NULL;
934 state->out_mem_ctx = NULL;
935 state->dispatch_recv = cli->dispatch_recv;
937 /* In parameters */
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;
944 /* Out parameters */
945 state->orig.out.return_credentials = _return_credentials;
947 /* Result */
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,
964 &ndr_table_netlogon,
965 NDR_NETR_SERVERAUTHENTICATE,
966 &state->tmp);
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);
971 return 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);
980 NTSTATUS status;
981 TALLOC_CTX *mem_ctx;
983 if (state->out_mem_ctx) {
984 mem_ctx = state->out_mem_ctx;
985 } else {
986 mem_ctx = state;
989 status = state->dispatch_recv(subreq, mem_ctx);
990 TALLOC_FREE(subreq);
991 if (!NT_STATUS_IS_OK(status)) {
992 tevent_req_nterror(req, status);
993 return;
996 /* Copy out parameters */
997 *state->orig.out.return_credentials = *state->tmp.out.return_credentials;
999 /* Copy result */
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,
1014 NTSTATUS *result)
1016 struct rpccli_netr_ServerAuthenticate_state *state = tevent_req_data(
1017 req, struct rpccli_netr_ServerAuthenticate_state);
1018 NTSTATUS status;
1020 if (tevent_req_is_nterror(req, &status)) {
1021 tevent_req_received(req);
1022 return status;
1025 /* Steal possbile out parameters to the callers context */
1026 talloc_steal(mem_ctx, state->out_mem_ctx);
1028 /* Return result */
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;
1045 NTSTATUS status;
1047 /* In parameters */
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,
1059 mem_ctx,
1060 &ndr_table_netlogon,
1061 NDR_NETR_SERVERAUTHENTICATE,
1062 &r);
1064 if (!NT_STATUS_IS_OK(status)) {
1065 return status;
1068 if (DEBUGLEVEL >= 10) {
1069 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate, &r);
1072 if (NT_STATUS_IS_ERR(status)) {
1073 return status;
1076 /* Return variables */
1077 *return_credentials = *r.out.return_credentials;
1079 /* Return result */
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);
1109 if (req == NULL) {
1110 return NULL;
1112 state->out_mem_ctx = NULL;
1113 state->dispatch_recv = cli->dispatch_recv;
1115 /* In parameters */
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;
1126 /* Result */
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,
1145 &state->tmp);
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);
1150 return 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);
1159 NTSTATUS status;
1160 TALLOC_CTX *mem_ctx;
1162 if (state->out_mem_ctx) {
1163 mem_ctx = state->out_mem_ctx;
1164 } else {
1165 mem_ctx = state;
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);
1172 return;
1175 /* Copy out parameters */
1176 *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
1178 /* Copy result */
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,
1193 NTSTATUS *result)
1195 struct rpccli_netr_ServerPasswordSet_state *state = tevent_req_data(
1196 req, struct rpccli_netr_ServerPasswordSet_state);
1197 NTSTATUS status;
1199 if (tevent_req_is_nterror(req, &status)) {
1200 tevent_req_received(req);
1201 return status;
1204 /* Steal possbile out parameters to the callers context */
1205 talloc_steal(mem_ctx, state->out_mem_ctx);
1207 /* Return result */
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;
1225 NTSTATUS status;
1227 /* In parameters */
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,
1240 mem_ctx,
1241 &ndr_table_netlogon,
1242 NDR_NETR_SERVERPASSWORDSET,
1243 &r);
1245 if (!NT_STATUS_IS_OK(status)) {
1246 return status;
1249 if (DEBUGLEVEL >= 10) {
1250 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet, &r);
1253 if (NT_STATUS_IS_ERR(status)) {
1254 return status;
1257 /* Return variables */
1258 *return_authenticator = *r.out.return_authenticator;
1260 /* Return result */
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);
1291 if (req == NULL) {
1292 return NULL;
1294 state->out_mem_ctx = NULL;
1295 state->dispatch_recv = cli->dispatch_recv;
1297 /* In parameters */
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;
1311 /* Result */
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,
1330 &state->tmp);
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);
1335 return 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);
1344 NTSTATUS status;
1345 TALLOC_CTX *mem_ctx;
1347 if (state->out_mem_ctx) {
1348 mem_ctx = state->out_mem_ctx;
1349 } else {
1350 mem_ctx = state;
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);
1357 return;
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;
1365 /* Copy result */
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,
1380 NTSTATUS *result)
1382 struct rpccli_netr_DatabaseDeltas_state *state = tevent_req_data(
1383 req, struct rpccli_netr_DatabaseDeltas_state);
1384 NTSTATUS status;
1386 if (tevent_req_is_nterror(req, &status)) {
1387 tevent_req_received(req);
1388 return status;
1391 /* Steal possbile out parameters to the callers context */
1392 talloc_steal(mem_ctx, state->out_mem_ctx);
1394 /* Return result */
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;
1413 NTSTATUS status;
1415 /* In parameters */
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,
1429 mem_ctx,
1430 &ndr_table_netlogon,
1431 NDR_NETR_DATABASEDELTAS,
1432 &r);
1434 if (!NT_STATUS_IS_OK(status)) {
1435 return status;
1438 if (DEBUGLEVEL >= 10) {
1439 NDR_PRINT_OUT_DEBUG(netr_DatabaseDeltas, &r);
1442 if (NT_STATUS_IS_ERR(status)) {
1443 return 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;
1451 /* Return result */
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);
1482 if (req == NULL) {
1483 return NULL;
1485 state->out_mem_ctx = NULL;
1486 state->dispatch_recv = cli->dispatch_recv;
1488 /* In parameters */
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;
1502 /* Result */
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,
1521 &state->tmp);
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);
1526 return 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);
1535 NTSTATUS status;
1536 TALLOC_CTX *mem_ctx;
1538 if (state->out_mem_ctx) {
1539 mem_ctx = state->out_mem_ctx;
1540 } else {
1541 mem_ctx = state;
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);
1548 return;
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;
1556 /* Copy result */
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,
1571 NTSTATUS *result)
1573 struct rpccli_netr_DatabaseSync_state *state = tevent_req_data(
1574 req, struct rpccli_netr_DatabaseSync_state);
1575 NTSTATUS status;
1577 if (tevent_req_is_nterror(req, &status)) {
1578 tevent_req_received(req);
1579 return status;
1582 /* Steal possbile out parameters to the callers context */
1583 talloc_steal(mem_ctx, state->out_mem_ctx);
1585 /* Return result */
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;
1604 NTSTATUS status;
1606 /* In parameters */
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,
1620 mem_ctx,
1621 &ndr_table_netlogon,
1622 NDR_NETR_DATABASESYNC,
1623 &r);
1625 if (!NT_STATUS_IS_OK(status)) {
1626 return status;
1629 if (DEBUGLEVEL >= 10) {
1630 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync, &r);
1633 if (NT_STATUS_IS_ERR(status)) {
1634 return 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;
1642 /* Return result */
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);
1677 if (req == NULL) {
1678 return NULL;
1680 state->out_mem_ctx = NULL;
1681 state->dispatch_recv = cli->dispatch_recv;
1683 /* In parameters */
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;
1700 /* Result */
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,
1719 &state->tmp);
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);
1724 return 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);
1733 NTSTATUS status;
1734 TALLOC_CTX *mem_ctx;
1736 if (state->out_mem_ctx) {
1737 mem_ctx = state->out_mem_ctx;
1738 } else {
1739 mem_ctx = state;
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);
1746 return;
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;
1756 /* Copy result */
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,
1771 NTSTATUS *result)
1773 struct rpccli_netr_AccountDeltas_state *state = tevent_req_data(
1774 req, struct rpccli_netr_AccountDeltas_state);
1775 NTSTATUS status;
1777 if (tevent_req_is_nterror(req, &status)) {
1778 tevent_req_received(req);
1779 return status;
1782 /* Steal possbile out parameters to the callers context */
1783 talloc_steal(mem_ctx, state->out_mem_ctx);
1785 /* Return result */
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;
1808 NTSTATUS status;
1810 /* In parameters */
1811 r.in.logon_server = logon_server;
1812 r.in.computername = computername;
1813 r.in.credential = credential;
1814 r.in.return_authenticator = return_authenticator;
1815 r.in.uas = uas;
1816 r.in.count = count;
1817 r.in.level = level;
1818 r.in.buffersize = buffersize;
1820 if (DEBUGLEVEL >= 10) {
1821 NDR_PRINT_IN_DEBUG(netr_AccountDeltas, &r);
1824 status = cli->dispatch(cli,
1825 mem_ctx,
1826 &ndr_table_netlogon,
1827 NDR_NETR_ACCOUNTDELTAS,
1828 &r);
1830 if (!NT_STATUS_IS_OK(status)) {
1831 return status;
1834 if (DEBUGLEVEL >= 10) {
1835 NDR_PRINT_OUT_DEBUG(netr_AccountDeltas, &r);
1838 if (NT_STATUS_IS_ERR(status)) {
1839 return 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;
1849 /* Return result */
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);
1884 if (req == NULL) {
1885 return NULL;
1887 state->out_mem_ctx = NULL;
1888 state->dispatch_recv = cli->dispatch_recv;
1890 /* In parameters */
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;
1908 /* Result */
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,
1927 &state->tmp);
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);
1932 return 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);
1941 NTSTATUS status;
1942 TALLOC_CTX *mem_ctx;
1944 if (state->out_mem_ctx) {
1945 mem_ctx = state->out_mem_ctx;
1946 } else {
1947 mem_ctx = state;
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);
1954 return;
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;
1965 /* Copy result */
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,
1980 NTSTATUS *result)
1982 struct rpccli_netr_AccountSync_state *state = tevent_req_data(
1983 req, struct rpccli_netr_AccountSync_state);
1984 NTSTATUS status;
1986 if (tevent_req_is_nterror(req, &status)) {
1987 tevent_req_received(req);
1988 return status;
1991 /* Steal possbile out parameters to the callers context */
1992 talloc_steal(mem_ctx, state->out_mem_ctx);
1994 /* Return result */
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;
2017 NTSTATUS status;
2019 /* In parameters */
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;
2025 r.in.level = level;
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,
2034 mem_ctx,
2035 &ndr_table_netlogon,
2036 NDR_NETR_ACCOUNTSYNC,
2037 &r);
2039 if (!NT_STATUS_IS_OK(status)) {
2040 return status;
2043 if (DEBUGLEVEL >= 10) {
2044 NDR_PRINT_OUT_DEBUG(netr_AccountSync, &r);
2047 if (NT_STATUS_IS_ERR(status)) {
2048 return 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;
2059 /* Return result */
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);
2085 if (req == NULL) {
2086 return NULL;
2088 state->out_mem_ctx = NULL;
2089 state->dispatch_recv = cli->dispatch_recv;
2091 /* In parameters */
2092 state->orig.in.logon_server = _logon_server;
2093 state->orig.in.domainname = _domainname;
2095 /* Out parameters */
2096 state->orig.out.dcname = _dcname;
2098 /* Result */
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,
2116 NDR_NETR_GETDCNAME,
2117 &state->tmp);
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);
2122 return 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);
2131 NTSTATUS status;
2132 TALLOC_CTX *mem_ctx;
2134 if (state->out_mem_ctx) {
2135 mem_ctx = state->out_mem_ctx;
2136 } else {
2137 mem_ctx = state;
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);
2144 return;
2147 /* Copy out parameters */
2148 *state->orig.out.dcname = *state->tmp.out.dcname;
2150 /* Copy result */
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,
2165 WERROR *result)
2167 struct rpccli_netr_GetDcName_state *state = tevent_req_data(
2168 req, struct rpccli_netr_GetDcName_state);
2169 NTSTATUS status;
2171 if (tevent_req_is_nterror(req, &status)) {
2172 tevent_req_received(req);
2173 return status;
2176 /* Steal possbile out parameters to the callers context */
2177 talloc_steal(mem_ctx, state->out_mem_ctx);
2179 /* Return result */
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)] */,
2191 WERROR *werror)
2193 struct netr_GetDcName r;
2194 NTSTATUS status;
2196 /* In parameters */
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,
2205 mem_ctx,
2206 &ndr_table_netlogon,
2207 NDR_NETR_GETDCNAME,
2208 &r);
2210 if (!NT_STATUS_IS_OK(status)) {
2211 return status;
2214 if (DEBUGLEVEL >= 10) {
2215 NDR_PRINT_OUT_DEBUG(netr_GetDcName, &r);
2218 if (NT_STATUS_IS_ERR(status)) {
2219 return status;
2222 /* Return variables */
2223 *dcname = *r.out.dcname;
2225 /* Return result */
2226 if (werror) {
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);
2256 if (req == NULL) {
2257 return NULL;
2259 state->out_mem_ctx = NULL;
2260 state->dispatch_recv = cli->dispatch_recv;
2262 /* In parameters */
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;
2270 /* Result */
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,
2289 &state->tmp);
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);
2294 return 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);
2303 NTSTATUS status;
2304 TALLOC_CTX *mem_ctx;
2306 if (state->out_mem_ctx) {
2307 mem_ctx = state->out_mem_ctx;
2308 } else {
2309 mem_ctx = state;
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);
2316 return;
2319 /* Copy out parameters */
2320 *state->orig.out.query = *state->tmp.out.query;
2322 /* Copy result */
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,
2337 WERROR *result)
2339 struct rpccli_netr_LogonControl_state *state = tevent_req_data(
2340 req, struct rpccli_netr_LogonControl_state);
2341 NTSTATUS status;
2343 if (tevent_req_is_nterror(req, &status)) {
2344 tevent_req_received(req);
2345 return status;
2348 /* Steal possbile out parameters to the callers context */
2349 talloc_steal(mem_ctx, state->out_mem_ctx);
2351 /* Return result */
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)] */,
2364 WERROR *werror)
2366 struct netr_LogonControl r;
2367 NTSTATUS status;
2369 /* In parameters */
2370 r.in.logon_server = logon_server;
2371 r.in.function_code = function_code;
2372 r.in.level = level;
2374 if (DEBUGLEVEL >= 10) {
2375 NDR_PRINT_IN_DEBUG(netr_LogonControl, &r);
2378 status = cli->dispatch(cli,
2379 mem_ctx,
2380 &ndr_table_netlogon,
2381 NDR_NETR_LOGONCONTROL,
2382 &r);
2384 if (!NT_STATUS_IS_OK(status)) {
2385 return status;
2388 if (DEBUGLEVEL >= 10) {
2389 NDR_PRINT_OUT_DEBUG(netr_LogonControl, &r);
2392 if (NT_STATUS_IS_ERR(status)) {
2393 return status;
2396 /* Return variables */
2397 *query = *r.out.query;
2399 /* Return result */
2400 if (werror) {
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);
2429 if (req == NULL) {
2430 return NULL;
2432 state->out_mem_ctx = NULL;
2433 state->dispatch_recv = cli->dispatch_recv;
2435 /* In parameters */
2436 state->orig.in.logon_server = _logon_server;
2437 state->orig.in.domainname = _domainname;
2439 /* Out parameters */
2440 state->orig.out.dcname = _dcname;
2442 /* Result */
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,
2461 &state->tmp);
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);
2466 return 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);
2475 NTSTATUS status;
2476 TALLOC_CTX *mem_ctx;
2478 if (state->out_mem_ctx) {
2479 mem_ctx = state->out_mem_ctx;
2480 } else {
2481 mem_ctx = state;
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);
2488 return;
2491 /* Copy out parameters */
2492 *state->orig.out.dcname = *state->tmp.out.dcname;
2494 /* Copy result */
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,
2509 WERROR *result)
2511 struct rpccli_netr_GetAnyDCName_state *state = tevent_req_data(
2512 req, struct rpccli_netr_GetAnyDCName_state);
2513 NTSTATUS status;
2515 if (tevent_req_is_nterror(req, &status)) {
2516 tevent_req_received(req);
2517 return status;
2520 /* Steal possbile out parameters to the callers context */
2521 talloc_steal(mem_ctx, state->out_mem_ctx);
2523 /* Return result */
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)] */,
2535 WERROR *werror)
2537 struct netr_GetAnyDCName r;
2538 NTSTATUS status;
2540 /* In parameters */
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,
2549 mem_ctx,
2550 &ndr_table_netlogon,
2551 NDR_NETR_GETANYDCNAME,
2552 &r);
2554 if (!NT_STATUS_IS_OK(status)) {
2555 return status;
2558 if (DEBUGLEVEL >= 10) {
2559 NDR_PRINT_OUT_DEBUG(netr_GetAnyDCName, &r);
2562 if (NT_STATUS_IS_ERR(status)) {
2563 return status;
2566 /* Return variables */
2567 *dcname = *r.out.dcname;
2569 /* Return result */
2570 if (werror) {
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);
2601 if (req == NULL) {
2602 return NULL;
2604 state->out_mem_ctx = NULL;
2605 state->dispatch_recv = cli->dispatch_recv;
2607 /* In parameters */
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;
2616 /* Result */
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,
2635 &state->tmp);
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);
2640 return 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);
2649 NTSTATUS status;
2650 TALLOC_CTX *mem_ctx;
2652 if (state->out_mem_ctx) {
2653 mem_ctx = state->out_mem_ctx;
2654 } else {
2655 mem_ctx = state;
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);
2662 return;
2665 /* Copy out parameters */
2666 *state->orig.out.query = *state->tmp.out.query;
2668 /* Copy result */
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,
2683 WERROR *result)
2685 struct rpccli_netr_LogonControl2_state *state = tevent_req_data(
2686 req, struct rpccli_netr_LogonControl2_state);
2687 NTSTATUS status;
2689 if (tevent_req_is_nterror(req, &status)) {
2690 tevent_req_received(req);
2691 return status;
2694 /* Steal possbile out parameters to the callers context */
2695 talloc_steal(mem_ctx, state->out_mem_ctx);
2697 /* Return result */
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)] */,
2711 WERROR *werror)
2713 struct netr_LogonControl2 r;
2714 NTSTATUS status;
2716 /* In parameters */
2717 r.in.logon_server = logon_server;
2718 r.in.function_code = function_code;
2719 r.in.level = level;
2720 r.in.data = data;
2722 if (DEBUGLEVEL >= 10) {
2723 NDR_PRINT_IN_DEBUG(netr_LogonControl2, &r);
2726 status = cli->dispatch(cli,
2727 mem_ctx,
2728 &ndr_table_netlogon,
2729 NDR_NETR_LOGONCONTROL2,
2730 &r);
2732 if (!NT_STATUS_IS_OK(status)) {
2733 return status;
2736 if (DEBUGLEVEL >= 10) {
2737 NDR_PRINT_OUT_DEBUG(netr_LogonControl2, &r);
2740 if (NT_STATUS_IS_ERR(status)) {
2741 return status;
2744 /* Return variables */
2745 *query = *r.out.query;
2747 /* Return result */
2748 if (werror) {
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);
2781 if (req == NULL) {
2782 return NULL;
2784 state->out_mem_ctx = NULL;
2785 state->dispatch_recv = cli->dispatch_recv;
2787 /* In parameters */
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;
2799 /* Result */
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,
2818 &state->tmp);
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);
2823 return 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);
2832 NTSTATUS status;
2833 TALLOC_CTX *mem_ctx;
2835 if (state->out_mem_ctx) {
2836 mem_ctx = state->out_mem_ctx;
2837 } else {
2838 mem_ctx = state;
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);
2845 return;
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;
2852 /* Copy result */
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,
2867 NTSTATUS *result)
2869 struct rpccli_netr_ServerAuthenticate2_state *state = tevent_req_data(
2870 req, struct rpccli_netr_ServerAuthenticate2_state);
2871 NTSTATUS status;
2873 if (tevent_req_is_nterror(req, &status)) {
2874 tevent_req_received(req);
2875 return status;
2878 /* Steal possbile out parameters to the callers context */
2879 talloc_steal(mem_ctx, state->out_mem_ctx);
2881 /* Return result */
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;
2899 NTSTATUS status;
2901 /* In parameters */
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,
2914 mem_ctx,
2915 &ndr_table_netlogon,
2916 NDR_NETR_SERVERAUTHENTICATE2,
2917 &r);
2919 if (!NT_STATUS_IS_OK(status)) {
2920 return status;
2923 if (DEBUGLEVEL >= 10) {
2924 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate2, &r);
2927 if (NT_STATUS_IS_ERR(status)) {
2928 return status;
2931 /* Return variables */
2932 *return_credentials = *r.out.return_credentials;
2933 *negotiate_flags = *r.out.negotiate_flags;
2935 /* Return result */
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);
2967 if (req == NULL) {
2968 return NULL;
2970 state->out_mem_ctx = NULL;
2971 state->dispatch_recv = cli->dispatch_recv;
2973 /* In parameters */
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;
2988 /* Result */
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,
3007 &state->tmp);
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);
3012 return 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);
3021 NTSTATUS status;
3022 TALLOC_CTX *mem_ctx;
3024 if (state->out_mem_ctx) {
3025 mem_ctx = state->out_mem_ctx;
3026 } else {
3027 mem_ctx = state;
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);
3034 return;
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;
3042 /* Copy result */
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,
3057 NTSTATUS *result)
3059 struct rpccli_netr_DatabaseSync2_state *state = tevent_req_data(
3060 req, struct rpccli_netr_DatabaseSync2_state);
3061 NTSTATUS status;
3063 if (tevent_req_is_nterror(req, &status)) {
3064 tevent_req_received(req);
3065 return status;
3068 /* Steal possbile out parameters to the callers context */
3069 talloc_steal(mem_ctx, state->out_mem_ctx);
3071 /* Return result */
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;
3091 NTSTATUS status;
3093 /* In parameters */
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,
3108 mem_ctx,
3109 &ndr_table_netlogon,
3110 NDR_NETR_DATABASESYNC2,
3111 &r);
3113 if (!NT_STATUS_IS_OK(status)) {
3114 return status;
3117 if (DEBUGLEVEL >= 10) {
3118 NDR_PRINT_OUT_DEBUG(netr_DatabaseSync2, &r);
3121 if (NT_STATUS_IS_ERR(status)) {
3122 return 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;
3130 /* Return result */
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);
3160 if (req == NULL) {
3161 return NULL;
3163 state->out_mem_ctx = NULL;
3164 state->dispatch_recv = cli->dispatch_recv;
3166 /* In parameters */
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;
3178 /* Result */
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,
3197 &state->tmp);
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);
3202 return 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);
3211 NTSTATUS status;
3212 TALLOC_CTX *mem_ctx;
3214 if (state->out_mem_ctx) {
3215 mem_ctx = state->out_mem_ctx;
3216 } else {
3217 mem_ctx = state;
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);
3224 return;
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;
3231 /* Copy result */
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,
3246 NTSTATUS *result)
3248 struct rpccli_netr_DatabaseRedo_state *state = tevent_req_data(
3249 req, struct rpccli_netr_DatabaseRedo_state);
3250 NTSTATUS status;
3252 if (tevent_req_is_nterror(req, &status)) {
3253 tevent_req_received(req);
3254 return status;
3257 /* Steal possbile out parameters to the callers context */
3258 talloc_steal(mem_ctx, state->out_mem_ctx);
3260 /* Return result */
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;
3278 NTSTATUS status;
3280 /* In parameters */
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,
3293 mem_ctx,
3294 &ndr_table_netlogon,
3295 NDR_NETR_DATABASEREDO,
3296 &r);
3298 if (!NT_STATUS_IS_OK(status)) {
3299 return status;
3302 if (DEBUGLEVEL >= 10) {
3303 NDR_PRINT_OUT_DEBUG(netr_DatabaseRedo, &r);
3306 if (NT_STATUS_IS_ERR(status)) {
3307 return status;
3310 /* Return variables */
3311 *return_authenticator = *r.out.return_authenticator;
3312 *delta_enum_array = *r.out.delta_enum_array;
3314 /* Return result */
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);
3342 if (req == NULL) {
3343 return NULL;
3345 state->out_mem_ctx = NULL;
3346 state->dispatch_recv = cli->dispatch_recv;
3348 /* In parameters */
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;
3357 /* Result */
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,
3376 &state->tmp);
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);
3381 return 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);
3390 NTSTATUS status;
3391 TALLOC_CTX *mem_ctx;
3393 if (state->out_mem_ctx) {
3394 mem_ctx = state->out_mem_ctx;
3395 } else {
3396 mem_ctx = state;
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);
3403 return;
3406 /* Copy out parameters */
3407 *state->orig.out.query = *state->tmp.out.query;
3409 /* Copy result */
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,
3424 WERROR *result)
3426 struct rpccli_netr_LogonControl2Ex_state *state = tevent_req_data(
3427 req, struct rpccli_netr_LogonControl2Ex_state);
3428 NTSTATUS status;
3430 if (tevent_req_is_nterror(req, &status)) {
3431 tevent_req_received(req);
3432 return status;
3435 /* Steal possbile out parameters to the callers context */
3436 talloc_steal(mem_ctx, state->out_mem_ctx);
3438 /* Return result */
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)] */,
3452 WERROR *werror)
3454 struct netr_LogonControl2Ex r;
3455 NTSTATUS status;
3457 /* In parameters */
3458 r.in.logon_server = logon_server;
3459 r.in.function_code = function_code;
3460 r.in.level = level;
3461 r.in.data = data;
3463 if (DEBUGLEVEL >= 10) {
3464 NDR_PRINT_IN_DEBUG(netr_LogonControl2Ex, &r);
3467 status = cli->dispatch(cli,
3468 mem_ctx,
3469 &ndr_table_netlogon,
3470 NDR_NETR_LOGONCONTROL2EX,
3471 &r);
3473 if (!NT_STATUS_IS_OK(status)) {
3474 return status;
3477 if (DEBUGLEVEL >= 10) {
3478 NDR_PRINT_OUT_DEBUG(netr_LogonControl2Ex, &r);
3481 if (NT_STATUS_IS_ERR(status)) {
3482 return status;
3485 /* Return variables */
3486 *query = *r.out.query;
3488 /* Return result */
3489 if (werror) {
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);
3517 if (req == NULL) {
3518 return NULL;
3520 state->out_mem_ctx = NULL;
3521 state->dispatch_recv = cli->dispatch_recv;
3523 /* In parameters */
3524 state->orig.in.server_name = _server_name;
3526 /* Out parameters */
3527 state->orig.out.trusted_domains_blob = _trusted_domains_blob;
3529 /* Result */
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,
3548 &state->tmp);
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);
3553 return 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);
3562 NTSTATUS status;
3563 TALLOC_CTX *mem_ctx;
3565 if (state->out_mem_ctx) {
3566 mem_ctx = state->out_mem_ctx;
3567 } else {
3568 mem_ctx = state;
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);
3575 return;
3578 /* Copy out parameters */
3579 *state->orig.out.trusted_domains_blob = *state->tmp.out.trusted_domains_blob;
3581 /* Copy result */
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,
3596 WERROR *result)
3598 struct rpccli_netr_NetrEnumerateTrustedDomains_state *state = tevent_req_data(
3599 req, struct rpccli_netr_NetrEnumerateTrustedDomains_state);
3600 NTSTATUS status;
3602 if (tevent_req_is_nterror(req, &status)) {
3603 tevent_req_received(req);
3604 return status;
3607 /* Steal possbile out parameters to the callers context */
3608 talloc_steal(mem_ctx, state->out_mem_ctx);
3610 /* Return result */
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] */,
3621 WERROR *werror)
3623 struct netr_NetrEnumerateTrustedDomains r;
3624 NTSTATUS status;
3626 /* In parameters */
3627 r.in.server_name = server_name;
3629 if (DEBUGLEVEL >= 10) {
3630 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
3633 status = cli->dispatch(cli,
3634 mem_ctx,
3635 &ndr_table_netlogon,
3636 NDR_NETR_NETRENUMERATETRUSTEDDOMAINS,
3637 &r);
3639 if (!NT_STATUS_IS_OK(status)) {
3640 return status;
3643 if (DEBUGLEVEL >= 10) {
3644 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomains, &r);
3647 if (NT_STATUS_IS_ERR(status)) {
3648 return status;
3651 /* Return variables */
3652 *trusted_domains_blob = *r.out.trusted_domains_blob;
3654 /* Return result */
3655 if (werror) {
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);
3687 if (req == NULL) {
3688 return NULL;
3690 state->out_mem_ctx = NULL;
3691 state->dispatch_recv = cli->dispatch_recv;
3693 /* In parameters */
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;
3703 /* Result */
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,
3722 &state->tmp);
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);
3727 return 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);
3736 NTSTATUS status;
3737 TALLOC_CTX *mem_ctx;
3739 if (state->out_mem_ctx) {
3740 mem_ctx = state->out_mem_ctx;
3741 } else {
3742 mem_ctx = state;
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);
3749 return;
3752 /* Copy out parameters */
3753 *state->orig.out.info = *state->tmp.out.info;
3755 /* Copy result */
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,
3770 WERROR *result)
3772 struct rpccli_netr_DsRGetDCName_state *state = tevent_req_data(
3773 req, struct rpccli_netr_DsRGetDCName_state);
3774 NTSTATUS status;
3776 if (tevent_req_is_nterror(req, &status)) {
3777 tevent_req_received(req);
3778 return status;
3781 /* Steal possbile out parameters to the callers context */
3782 talloc_steal(mem_ctx, state->out_mem_ctx);
3784 /* Return result */
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] */,
3799 WERROR *werror)
3801 struct netr_DsRGetDCName r;
3802 NTSTATUS status;
3804 /* In parameters */
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;
3809 r.in.flags = flags;
3811 if (DEBUGLEVEL >= 10) {
3812 NDR_PRINT_IN_DEBUG(netr_DsRGetDCName, &r);
3815 status = cli->dispatch(cli,
3816 mem_ctx,
3817 &ndr_table_netlogon,
3818 NDR_NETR_DSRGETDCNAME,
3819 &r);
3821 if (!NT_STATUS_IS_OK(status)) {
3822 return status;
3825 if (DEBUGLEVEL >= 10) {
3826 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCName, &r);
3829 if (NT_STATUS_IS_ERR(status)) {
3830 return status;
3833 /* Return variables */
3834 *info = *r.out.info;
3836 /* Return result */
3837 if (werror) {
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);
3869 if (req == NULL) {
3870 return NULL;
3872 state->out_mem_ctx = NULL;
3873 state->dispatch_recv = cli->dispatch_recv;
3875 /* In parameters */
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;
3886 /* Result */
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,
3905 &state->tmp);
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);
3910 return 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);
3919 NTSTATUS status;
3920 TALLOC_CTX *mem_ctx;
3922 if (state->out_mem_ctx) {
3923 mem_ctx = state->out_mem_ctx;
3924 } else {
3925 mem_ctx = state;
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);
3932 return;
3935 /* Copy out parameters */
3936 *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
3937 *state->orig.out.capabilities = *state->tmp.out.capabilities;
3939 /* Copy result */
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,
3954 NTSTATUS *result)
3956 struct rpccli_netr_LogonGetCapabilities_state *state = tevent_req_data(
3957 req, struct rpccli_netr_LogonGetCapabilities_state);
3958 NTSTATUS status;
3960 if (tevent_req_is_nterror(req, &status)) {
3961 tevent_req_received(req);
3962 return status;
3965 /* Steal possbile out parameters to the callers context */
3966 talloc_steal(mem_ctx, state->out_mem_ctx);
3968 /* Return result */
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;
3985 NTSTATUS status;
3987 /* In parameters */
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,
3999 mem_ctx,
4000 &ndr_table_netlogon,
4001 NDR_NETR_LOGONGETCAPABILITIES,
4002 &r);
4004 if (!NT_STATUS_IS_OK(status)) {
4005 return status;
4008 if (DEBUGLEVEL >= 10) {
4009 NDR_PRINT_OUT_DEBUG(netr_LogonGetCapabilities, &r);
4012 if (NT_STATUS_IS_ERR(status)) {
4013 return status;
4016 /* Return variables */
4017 *return_authenticator = *r.out.return_authenticator;
4018 *capabilities = *r.out.capabilities;
4020 /* Return result */
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);
4043 if (req == NULL) {
4044 return NULL;
4046 state->out_mem_ctx = NULL;
4047 state->dispatch_recv = cli->dispatch_recv;
4049 /* In parameters */
4051 /* Out parameters */
4053 /* Result */
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,
4066 &state->tmp);
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);
4071 return 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);
4080 NTSTATUS status;
4081 TALLOC_CTX *mem_ctx;
4083 if (state->out_mem_ctx) {
4084 mem_ctx = state->out_mem_ctx;
4085 } else {
4086 mem_ctx = state;
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);
4093 return;
4096 /* Copy out parameters */
4098 /* Copy result */
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,
4113 WERROR *result)
4115 struct rpccli_netr_NETRLOGONSETSERVICEBITS_state *state = tevent_req_data(
4116 req, struct rpccli_netr_NETRLOGONSETSERVICEBITS_state);
4117 NTSTATUS status;
4119 if (tevent_req_is_nterror(req, &status)) {
4120 tevent_req_received(req);
4121 return status;
4124 /* Steal possbile out parameters to the callers context */
4125 talloc_steal(mem_ctx, state->out_mem_ctx);
4127 /* Return result */
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,
4136 WERROR *werror)
4138 struct netr_NETRLOGONSETSERVICEBITS r;
4139 NTSTATUS status;
4141 /* In parameters */
4143 if (DEBUGLEVEL >= 10) {
4144 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
4147 status = cli->dispatch(cli,
4148 mem_ctx,
4149 &ndr_table_netlogon,
4150 NDR_NETR_NETRLOGONSETSERVICEBITS,
4151 &r);
4153 if (!NT_STATUS_IS_OK(status)) {
4154 return status;
4157 if (DEBUGLEVEL >= 10) {
4158 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSETSERVICEBITS, &r);
4161 if (NT_STATUS_IS_ERR(status)) {
4162 return status;
4165 /* Return variables */
4167 /* Return result */
4168 if (werror) {
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);
4197 if (req == NULL) {
4198 return NULL;
4200 state->out_mem_ctx = NULL;
4201 state->dispatch_recv = cli->dispatch_recv;
4203 /* In parameters */
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;
4210 /* Result */
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,
4229 &state->tmp);
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);
4234 return 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);
4243 NTSTATUS status;
4244 TALLOC_CTX *mem_ctx;
4246 if (state->out_mem_ctx) {
4247 mem_ctx = state->out_mem_ctx;
4248 } else {
4249 mem_ctx = state;
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);
4256 return;
4259 /* Copy out parameters */
4260 *state->orig.out.rid = *state->tmp.out.rid;
4262 /* Copy result */
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,
4277 WERROR *result)
4279 struct rpccli_netr_LogonGetTrustRid_state *state = tevent_req_data(
4280 req, struct rpccli_netr_LogonGetTrustRid_state);
4281 NTSTATUS status;
4283 if (tevent_req_is_nterror(req, &status)) {
4284 tevent_req_received(req);
4285 return status;
4288 /* Steal possbile out parameters to the callers context */
4289 talloc_steal(mem_ctx, state->out_mem_ctx);
4291 /* Return result */
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] */,
4303 WERROR *werror)
4305 struct netr_LogonGetTrustRid r;
4306 NTSTATUS status;
4308 /* In parameters */
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,
4317 mem_ctx,
4318 &ndr_table_netlogon,
4319 NDR_NETR_LOGONGETTRUSTRID,
4320 &r);
4322 if (!NT_STATUS_IS_OK(status)) {
4323 return status;
4326 if (DEBUGLEVEL >= 10) {
4327 NDR_PRINT_OUT_DEBUG(netr_LogonGetTrustRid, &r);
4330 if (NT_STATUS_IS_ERR(status)) {
4331 return status;
4334 /* Return variables */
4335 *rid = *r.out.rid;
4337 /* Return result */
4338 if (werror) {
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);
4364 if (req == NULL) {
4365 return NULL;
4367 state->out_mem_ctx = NULL;
4368 state->dispatch_recv = cli->dispatch_recv;
4370 /* In parameters */
4372 /* Out parameters */
4374 /* Result */
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,
4387 &state->tmp);
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);
4392 return 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);
4401 NTSTATUS status;
4402 TALLOC_CTX *mem_ctx;
4404 if (state->out_mem_ctx) {
4405 mem_ctx = state->out_mem_ctx;
4406 } else {
4407 mem_ctx = state;
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);
4414 return;
4417 /* Copy out parameters */
4419 /* Copy result */
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,
4434 WERROR *result)
4436 struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state *state = tevent_req_data(
4437 req, struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state);
4438 NTSTATUS status;
4440 if (tevent_req_is_nterror(req, &status)) {
4441 tevent_req_received(req);
4442 return status;
4445 /* Steal possbile out parameters to the callers context */
4446 talloc_steal(mem_ctx, state->out_mem_ctx);
4448 /* Return result */
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,
4457 WERROR *werror)
4459 struct netr_NETRLOGONCOMPUTESERVERDIGEST r;
4460 NTSTATUS status;
4462 /* In parameters */
4464 if (DEBUGLEVEL >= 10) {
4465 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
4468 status = cli->dispatch(cli,
4469 mem_ctx,
4470 &ndr_table_netlogon,
4471 NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST,
4472 &r);
4474 if (!NT_STATUS_IS_OK(status)) {
4475 return status;
4478 if (DEBUGLEVEL >= 10) {
4479 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTESERVERDIGEST, &r);
4482 if (NT_STATUS_IS_ERR(status)) {
4483 return status;
4486 /* Return variables */
4488 /* Return result */
4489 if (werror) {
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);
4515 if (req == NULL) {
4516 return NULL;
4518 state->out_mem_ctx = NULL;
4519 state->dispatch_recv = cli->dispatch_recv;
4521 /* In parameters */
4523 /* Out parameters */
4525 /* Result */
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,
4538 &state->tmp);
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);
4543 return 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);
4552 NTSTATUS status;
4553 TALLOC_CTX *mem_ctx;
4555 if (state->out_mem_ctx) {
4556 mem_ctx = state->out_mem_ctx;
4557 } else {
4558 mem_ctx = state;
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);
4565 return;
4568 /* Copy out parameters */
4570 /* Copy result */
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,
4585 WERROR *result)
4587 struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state *state = tevent_req_data(
4588 req, struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state);
4589 NTSTATUS status;
4591 if (tevent_req_is_nterror(req, &status)) {
4592 tevent_req_received(req);
4593 return status;
4596 /* Steal possbile out parameters to the callers context */
4597 talloc_steal(mem_ctx, state->out_mem_ctx);
4599 /* Return result */
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,
4608 WERROR *werror)
4610 struct netr_NETRLOGONCOMPUTECLIENTDIGEST r;
4611 NTSTATUS status;
4613 /* In parameters */
4615 if (DEBUGLEVEL >= 10) {
4616 NDR_PRINT_IN_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
4619 status = cli->dispatch(cli,
4620 mem_ctx,
4621 &ndr_table_netlogon,
4622 NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST,
4623 &r);
4625 if (!NT_STATUS_IS_OK(status)) {
4626 return status;
4629 if (DEBUGLEVEL >= 10) {
4630 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONCOMPUTECLIENTDIGEST, &r);
4633 if (NT_STATUS_IS_ERR(status)) {
4634 return status;
4637 /* Return variables */
4639 /* Return result */
4640 if (werror) {
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);
4674 if (req == NULL) {
4675 return NULL;
4677 state->out_mem_ctx = NULL;
4678 state->dispatch_recv = cli->dispatch_recv;
4680 /* In parameters */
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;
4693 /* Result */
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,
4712 &state->tmp);
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);
4717 return 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);
4726 NTSTATUS status;
4727 TALLOC_CTX *mem_ctx;
4729 if (state->out_mem_ctx) {
4730 mem_ctx = state->out_mem_ctx;
4731 } else {
4732 mem_ctx = state;
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);
4739 return;
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;
4747 /* Copy result */
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,
4762 NTSTATUS *result)
4764 struct rpccli_netr_ServerAuthenticate3_state *state = tevent_req_data(
4765 req, struct rpccli_netr_ServerAuthenticate3_state);
4766 NTSTATUS status;
4768 if (tevent_req_is_nterror(req, &status)) {
4769 tevent_req_received(req);
4770 return status;
4773 /* Steal possbile out parameters to the callers context */
4774 talloc_steal(mem_ctx, state->out_mem_ctx);
4776 /* Return result */
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;
4795 NTSTATUS status;
4797 /* In parameters */
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,
4810 mem_ctx,
4811 &ndr_table_netlogon,
4812 NDR_NETR_SERVERAUTHENTICATE3,
4813 &r);
4815 if (!NT_STATUS_IS_OK(status)) {
4816 return status;
4819 if (DEBUGLEVEL >= 10) {
4820 NDR_PRINT_OUT_DEBUG(netr_ServerAuthenticate3, &r);
4823 if (NT_STATUS_IS_ERR(status)) {
4824 return status;
4827 /* Return variables */
4828 *return_credentials = *r.out.return_credentials;
4829 *negotiate_flags = *r.out.negotiate_flags;
4830 *rid = *r.out.rid;
4832 /* Return result */
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);
4861 if (req == NULL) {
4862 return NULL;
4864 state->out_mem_ctx = NULL;
4865 state->dispatch_recv = cli->dispatch_recv;
4867 /* In parameters */
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;
4877 /* Result */
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,
4896 &state->tmp);
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);
4901 return 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);
4910 NTSTATUS status;
4911 TALLOC_CTX *mem_ctx;
4913 if (state->out_mem_ctx) {
4914 mem_ctx = state->out_mem_ctx;
4915 } else {
4916 mem_ctx = state;
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);
4923 return;
4926 /* Copy out parameters */
4927 *state->orig.out.info = *state->tmp.out.info;
4929 /* Copy result */
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,
4944 WERROR *result)
4946 struct rpccli_netr_DsRGetDCNameEx_state *state = tevent_req_data(
4947 req, struct rpccli_netr_DsRGetDCNameEx_state);
4948 NTSTATUS status;
4950 if (tevent_req_is_nterror(req, &status)) {
4951 tevent_req_received(req);
4952 return status;
4955 /* Steal possbile out parameters to the callers context */
4956 talloc_steal(mem_ctx, state->out_mem_ctx);
4958 /* Return result */
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] */,
4973 WERROR *werror)
4975 struct netr_DsRGetDCNameEx r;
4976 NTSTATUS status;
4978 /* In parameters */
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;
4983 r.in.flags = flags;
4985 if (DEBUGLEVEL >= 10) {
4986 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx, &r);
4989 status = cli->dispatch(cli,
4990 mem_ctx,
4991 &ndr_table_netlogon,
4992 NDR_NETR_DSRGETDCNAMEEX,
4993 &r);
4995 if (!NT_STATUS_IS_OK(status)) {
4996 return status;
4999 if (DEBUGLEVEL >= 10) {
5000 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx, &r);
5003 if (NT_STATUS_IS_ERR(status)) {
5004 return status;
5007 /* Return variables */
5008 *info = *r.out.info;
5010 /* Return result */
5011 if (werror) {
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);
5039 if (req == NULL) {
5040 return NULL;
5042 state->out_mem_ctx = NULL;
5043 state->dispatch_recv = cli->dispatch_recv;
5045 /* In parameters */
5046 state->orig.in.computer_name = _computer_name;
5048 /* Out parameters */
5049 state->orig.out.site = _site;
5051 /* Result */
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,
5070 &state->tmp);
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);
5075 return 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);
5084 NTSTATUS status;
5085 TALLOC_CTX *mem_ctx;
5087 if (state->out_mem_ctx) {
5088 mem_ctx = state->out_mem_ctx;
5089 } else {
5090 mem_ctx = state;
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);
5097 return;
5100 /* Copy out parameters */
5101 *state->orig.out.site = *state->tmp.out.site;
5103 /* Copy result */
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,
5118 WERROR *result)
5120 struct rpccli_netr_DsRGetSiteName_state *state = tevent_req_data(
5121 req, struct rpccli_netr_DsRGetSiteName_state);
5122 NTSTATUS status;
5124 if (tevent_req_is_nterror(req, &status)) {
5125 tevent_req_received(req);
5126 return status;
5129 /* Steal possbile out parameters to the callers context */
5130 talloc_steal(mem_ctx, state->out_mem_ctx);
5132 /* Return result */
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)] */,
5143 WERROR *werror)
5145 struct netr_DsRGetSiteName r;
5146 NTSTATUS status;
5148 /* In parameters */
5149 r.in.computer_name = computer_name;
5151 if (DEBUGLEVEL >= 10) {
5152 NDR_PRINT_IN_DEBUG(netr_DsRGetSiteName, &r);
5155 status = cli->dispatch(cli,
5156 mem_ctx,
5157 &ndr_table_netlogon,
5158 NDR_NETR_DSRGETSITENAME,
5159 &r);
5161 if (!NT_STATUS_IS_OK(status)) {
5162 return status;
5165 if (DEBUGLEVEL >= 10) {
5166 NDR_PRINT_OUT_DEBUG(netr_DsRGetSiteName, &r);
5169 if (NT_STATUS_IS_ERR(status)) {
5170 return status;
5173 /* Return variables */
5174 *site = *r.out.site;
5176 /* Return result */
5177 if (werror) {
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);
5210 if (req == NULL) {
5211 return NULL;
5213 state->out_mem_ctx = NULL;
5214 state->dispatch_recv = cli->dispatch_recv;
5216 /* In parameters */
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;
5228 /* Result */
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,
5247 &state->tmp);
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);
5252 return 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);
5261 NTSTATUS status;
5262 TALLOC_CTX *mem_ctx;
5264 if (state->out_mem_ctx) {
5265 mem_ctx = state->out_mem_ctx;
5266 } else {
5267 mem_ctx = state;
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);
5274 return;
5277 /* Copy out parameters */
5278 *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
5279 *state->orig.out.info = *state->tmp.out.info;
5281 /* Copy result */
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,
5296 NTSTATUS *result)
5298 struct rpccli_netr_LogonGetDomainInfo_state *state = tevent_req_data(
5299 req, struct rpccli_netr_LogonGetDomainInfo_state);
5300 NTSTATUS status;
5302 if (tevent_req_is_nterror(req, &status)) {
5303 tevent_req_received(req);
5304 return status;
5307 /* Steal possbile out parameters to the callers context */
5308 talloc_steal(mem_ctx, state->out_mem_ctx);
5310 /* Return result */
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;
5328 NTSTATUS status;
5330 /* In parameters */
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;
5335 r.in.level = level;
5336 r.in.query = query;
5338 if (DEBUGLEVEL >= 10) {
5339 NDR_PRINT_IN_DEBUG(netr_LogonGetDomainInfo, &r);
5342 status = cli->dispatch(cli,
5343 mem_ctx,
5344 &ndr_table_netlogon,
5345 NDR_NETR_LOGONGETDOMAININFO,
5346 &r);
5348 if (!NT_STATUS_IS_OK(status)) {
5349 return status;
5352 if (DEBUGLEVEL >= 10) {
5353 NDR_PRINT_OUT_DEBUG(netr_LogonGetDomainInfo, &r);
5356 if (NT_STATUS_IS_ERR(status)) {
5357 return status;
5360 /* Return variables */
5361 *return_authenticator = *r.out.return_authenticator;
5362 *info = *r.out.info;
5364 /* Return result */
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);
5394 if (req == NULL) {
5395 return NULL;
5397 state->out_mem_ctx = NULL;
5398 state->dispatch_recv = cli->dispatch_recv;
5400 /* In parameters */
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;
5411 /* Result */
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,
5430 &state->tmp);
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);
5435 return 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);
5444 NTSTATUS status;
5445 TALLOC_CTX *mem_ctx;
5447 if (state->out_mem_ctx) {
5448 mem_ctx = state->out_mem_ctx;
5449 } else {
5450 mem_ctx = state;
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);
5457 return;
5460 /* Copy out parameters */
5461 *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
5463 /* Copy result */
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,
5478 NTSTATUS *result)
5480 struct rpccli_netr_ServerPasswordSet2_state *state = tevent_req_data(
5481 req, struct rpccli_netr_ServerPasswordSet2_state);
5482 NTSTATUS status;
5484 if (tevent_req_is_nterror(req, &status)) {
5485 tevent_req_received(req);
5486 return status;
5489 /* Steal possbile out parameters to the callers context */
5490 talloc_steal(mem_ctx, state->out_mem_ctx);
5492 /* Return result */
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;
5510 NTSTATUS status;
5512 /* In parameters */
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,
5525 mem_ctx,
5526 &ndr_table_netlogon,
5527 NDR_NETR_SERVERPASSWORDSET2,
5528 &r);
5530 if (!NT_STATUS_IS_OK(status)) {
5531 return status;
5534 if (DEBUGLEVEL >= 10) {
5535 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordSet2, &r);
5538 if (NT_STATUS_IS_ERR(status)) {
5539 return status;
5542 /* Return variables */
5543 *return_authenticator = *r.out.return_authenticator;
5545 /* Return result */
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);
5575 if (req == NULL) {
5576 return NULL;
5578 state->out_mem_ctx = NULL;
5579 state->dispatch_recv = cli->dispatch_recv;
5581 /* In parameters */
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;
5592 /* Result */
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,
5611 &state->tmp);
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);
5616 return 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);
5625 NTSTATUS status;
5626 TALLOC_CTX *mem_ctx;
5628 if (state->out_mem_ctx) {
5629 mem_ctx = state->out_mem_ctx;
5630 } else {
5631 mem_ctx = state;
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);
5638 return;
5641 /* Copy out parameters */
5642 *state->orig.out.return_authenticator = *state->tmp.out.return_authenticator;
5643 *state->orig.out.password = *state->tmp.out.password;
5645 /* Copy result */
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,
5660 WERROR *result)
5662 struct rpccli_netr_ServerPasswordGet_state *state = tevent_req_data(
5663 req, struct rpccli_netr_ServerPasswordGet_state);
5664 NTSTATUS status;
5666 if (tevent_req_is_nterror(req, &status)) {
5667 tevent_req_received(req);
5668 return status;
5671 /* Steal possbile out parameters to the callers context */
5672 talloc_steal(mem_ctx, state->out_mem_ctx);
5674 /* Return result */
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] */,
5690 WERROR *werror)
5692 struct netr_ServerPasswordGet r;
5693 NTSTATUS status;
5695 /* In parameters */
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,
5707 mem_ctx,
5708 &ndr_table_netlogon,
5709 NDR_NETR_SERVERPASSWORDGET,
5710 &r);
5712 if (!NT_STATUS_IS_OK(status)) {
5713 return status;
5716 if (DEBUGLEVEL >= 10) {
5717 NDR_PRINT_OUT_DEBUG(netr_ServerPasswordGet, &r);
5720 if (NT_STATUS_IS_ERR(status)) {
5721 return status;
5724 /* Return variables */
5725 *return_authenticator = *r.out.return_authenticator;
5726 *password = *r.out.password;
5728 /* Return result */
5729 if (werror) {
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);
5755 if (req == NULL) {
5756 return NULL;
5758 state->out_mem_ctx = NULL;
5759 state->dispatch_recv = cli->dispatch_recv;
5761 /* In parameters */
5763 /* Out parameters */
5765 /* Result */
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,
5778 &state->tmp);
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);
5783 return 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);
5792 NTSTATUS status;
5793 TALLOC_CTX *mem_ctx;
5795 if (state->out_mem_ctx) {
5796 mem_ctx = state->out_mem_ctx;
5797 } else {
5798 mem_ctx = state;
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);
5805 return;
5808 /* Copy out parameters */
5810 /* Copy result */
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,
5825 WERROR *result)
5827 struct rpccli_netr_NETRLOGONSENDTOSAM_state *state = tevent_req_data(
5828 req, struct rpccli_netr_NETRLOGONSENDTOSAM_state);
5829 NTSTATUS status;
5831 if (tevent_req_is_nterror(req, &status)) {
5832 tevent_req_received(req);
5833 return status;
5836 /* Steal possbile out parameters to the callers context */
5837 talloc_steal(mem_ctx, state->out_mem_ctx);
5839 /* Return result */
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,
5848 WERROR *werror)
5850 struct netr_NETRLOGONSENDTOSAM r;
5851 NTSTATUS status;
5853 /* In parameters */
5855 if (DEBUGLEVEL >= 10) {
5856 NDR_PRINT_IN_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
5859 status = cli->dispatch(cli,
5860 mem_ctx,
5861 &ndr_table_netlogon,
5862 NDR_NETR_NETRLOGONSENDTOSAM,
5863 &r);
5865 if (!NT_STATUS_IS_OK(status)) {
5866 return status;
5869 if (DEBUGLEVEL >= 10) {
5870 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONSENDTOSAM, &r);
5873 if (NT_STATUS_IS_ERR(status)) {
5874 return status;
5877 /* Return variables */
5879 /* Return result */
5880 if (werror) {
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);
5910 if (req == NULL) {
5911 return NULL;
5913 state->out_mem_ctx = NULL;
5914 state->dispatch_recv = cli->dispatch_recv;
5916 /* In parameters */
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;
5924 /* Result */
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,
5943 &state->tmp);
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);
5948 return 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);
5957 NTSTATUS status;
5958 TALLOC_CTX *mem_ctx;
5960 if (state->out_mem_ctx) {
5961 mem_ctx = state->out_mem_ctx;
5962 } else {
5963 mem_ctx = state;
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);
5970 return;
5973 /* Copy out parameters */
5974 *state->orig.out.ctr = *state->tmp.out.ctr;
5976 /* Copy result */
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,
5991 WERROR *result)
5993 struct rpccli_netr_DsRAddressToSitenamesW_state *state = tevent_req_data(
5994 req, struct rpccli_netr_DsRAddressToSitenamesW_state);
5995 NTSTATUS status;
5997 if (tevent_req_is_nterror(req, &status)) {
5998 tevent_req_received(req);
5999 return status;
6002 /* Steal possbile out parameters to the callers context */
6003 talloc_steal(mem_ctx, state->out_mem_ctx);
6005 /* Return result */
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] */,
6018 WERROR *werror)
6020 struct netr_DsRAddressToSitenamesW r;
6021 NTSTATUS status;
6023 /* In parameters */
6024 r.in.server_name = server_name;
6025 r.in.count = count;
6026 r.in.addresses = addresses;
6028 if (DEBUGLEVEL >= 10) {
6029 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesW, &r);
6032 status = cli->dispatch(cli,
6033 mem_ctx,
6034 &ndr_table_netlogon,
6035 NDR_NETR_DSRADDRESSTOSITENAMESW,
6036 &r);
6038 if (!NT_STATUS_IS_OK(status)) {
6039 return status;
6042 if (DEBUGLEVEL >= 10) {
6043 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesW, &r);
6046 if (NT_STATUS_IS_ERR(status)) {
6047 return status;
6050 /* Return variables */
6051 *ctr = *r.out.ctr;
6053 /* Return result */
6054 if (werror) {
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);
6088 if (req == NULL) {
6089 return NULL;
6091 state->out_mem_ctx = NULL;
6092 state->dispatch_recv = cli->dispatch_recv;
6094 /* In parameters */
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;
6106 /* Result */
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,
6125 &state->tmp);
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);
6130 return 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);
6139 NTSTATUS status;
6140 TALLOC_CTX *mem_ctx;
6142 if (state->out_mem_ctx) {
6143 mem_ctx = state->out_mem_ctx;
6144 } else {
6145 mem_ctx = state;
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);
6152 return;
6155 /* Copy out parameters */
6156 *state->orig.out.info = *state->tmp.out.info;
6158 /* Copy result */
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,
6173 WERROR *result)
6175 struct rpccli_netr_DsRGetDCNameEx2_state *state = tevent_req_data(
6176 req, struct rpccli_netr_DsRGetDCNameEx2_state);
6177 NTSTATUS status;
6179 if (tevent_req_is_nterror(req, &status)) {
6180 tevent_req_received(req);
6181 return status;
6184 /* Steal possbile out parameters to the callers context */
6185 talloc_steal(mem_ctx, state->out_mem_ctx);
6187 /* Return result */
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] */,
6204 WERROR *werror)
6206 struct netr_DsRGetDCNameEx2 r;
6207 NTSTATUS status;
6209 /* In parameters */
6210 r.in.server_unc = server_unc;
6211 r.in.client_account = client_account;
6212 r.in.mask = mask;
6213 r.in.domain_name = domain_name;
6214 r.in.domain_guid = domain_guid;
6215 r.in.site_name = site_name;
6216 r.in.flags = flags;
6218 if (DEBUGLEVEL >= 10) {
6219 NDR_PRINT_IN_DEBUG(netr_DsRGetDCNameEx2, &r);
6222 status = cli->dispatch(cli,
6223 mem_ctx,
6224 &ndr_table_netlogon,
6225 NDR_NETR_DSRGETDCNAMEEX2,
6226 &r);
6228 if (!NT_STATUS_IS_OK(status)) {
6229 return status;
6232 if (DEBUGLEVEL >= 10) {
6233 NDR_PRINT_OUT_DEBUG(netr_DsRGetDCNameEx2, &r);
6236 if (NT_STATUS_IS_ERR(status)) {
6237 return status;
6240 /* Return variables */
6241 *info = *r.out.info;
6243 /* Return result */
6244 if (werror) {
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);
6270 if (req == NULL) {
6271 return NULL;
6273 state->out_mem_ctx = NULL;
6274 state->dispatch_recv = cli->dispatch_recv;
6276 /* In parameters */
6278 /* Out parameters */
6280 /* Result */
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,
6293 &state->tmp);
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);
6298 return 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);
6307 NTSTATUS status;
6308 TALLOC_CTX *mem_ctx;
6310 if (state->out_mem_ctx) {
6311 mem_ctx = state->out_mem_ctx;
6312 } else {
6313 mem_ctx = state;
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);
6320 return;
6323 /* Copy out parameters */
6325 /* Copy result */
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,
6340 WERROR *result)
6342 struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state *state = tevent_req_data(
6343 req, struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state);
6344 NTSTATUS status;
6346 if (tevent_req_is_nterror(req, &status)) {
6347 tevent_req_received(req);
6348 return status;
6351 /* Steal possbile out parameters to the callers context */
6352 talloc_steal(mem_ctx, state->out_mem_ctx);
6354 /* Return result */
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,
6363 WERROR *werror)
6365 struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r;
6366 NTSTATUS status;
6368 /* In parameters */
6370 if (DEBUGLEVEL >= 10) {
6371 NDR_PRINT_IN_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
6374 status = cli->dispatch(cli,
6375 mem_ctx,
6376 &ndr_table_netlogon,
6377 NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN,
6378 &r);
6380 if (!NT_STATUS_IS_OK(status)) {
6381 return status;
6384 if (DEBUGLEVEL >= 10) {
6385 NDR_PRINT_OUT_DEBUG(netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN, &r);
6388 if (NT_STATUS_IS_ERR(status)) {
6389 return status;
6392 /* Return variables */
6394 /* Return result */
6395 if (werror) {
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);
6423 if (req == NULL) {
6424 return NULL;
6426 state->out_mem_ctx = NULL;
6427 state->dispatch_recv = cli->dispatch_recv;
6429 /* In parameters */
6430 state->orig.in.server_name = _server_name;
6432 /* Out parameters */
6433 state->orig.out.dom_trust_list = _dom_trust_list;
6435 /* Result */
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,
6454 &state->tmp);
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);
6459 return 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);
6468 NTSTATUS status;
6469 TALLOC_CTX *mem_ctx;
6471 if (state->out_mem_ctx) {
6472 mem_ctx = state->out_mem_ctx;
6473 } else {
6474 mem_ctx = state;
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);
6481 return;
6484 /* Copy out parameters */
6485 *state->orig.out.dom_trust_list = *state->tmp.out.dom_trust_list;
6487 /* Copy result */
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,
6502 WERROR *result)
6504 struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state *state = tevent_req_data(
6505 req, struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state);
6506 NTSTATUS status;
6508 if (tevent_req_is_nterror(req, &status)) {
6509 tevent_req_received(req);
6510 return status;
6513 /* Steal possbile out parameters to the callers context */
6514 talloc_steal(mem_ctx, state->out_mem_ctx);
6516 /* Return result */
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] */,
6527 WERROR *werror)
6529 struct netr_NetrEnumerateTrustedDomainsEx r;
6530 NTSTATUS status;
6532 /* In parameters */
6533 r.in.server_name = server_name;
6535 if (DEBUGLEVEL >= 10) {
6536 NDR_PRINT_IN_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r);
6539 status = cli->dispatch(cli,
6540 mem_ctx,
6541 &ndr_table_netlogon,
6542 NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX,
6543 &r);
6545 if (!NT_STATUS_IS_OK(status)) {
6546 return status;
6549 if (DEBUGLEVEL >= 10) {
6550 NDR_PRINT_OUT_DEBUG(netr_NetrEnumerateTrustedDomainsEx, &r);
6553 if (NT_STATUS_IS_ERR(status)) {
6554 return status;
6557 /* Return variables */
6558 *dom_trust_list = *r.out.dom_trust_list;
6560 /* Return result */
6561 if (werror) {
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);
6591 if (req == NULL) {
6592 return NULL;
6594 state->out_mem_ctx = NULL;
6595 state->dispatch_recv = cli->dispatch_recv;
6597 /* In parameters */
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;
6605 /* Result */
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,
6624 &state->tmp);
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);
6629 return 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);
6638 NTSTATUS status;
6639 TALLOC_CTX *mem_ctx;
6641 if (state->out_mem_ctx) {
6642 mem_ctx = state->out_mem_ctx;
6643 } else {
6644 mem_ctx = state;
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);
6651 return;
6654 /* Copy out parameters */
6655 *state->orig.out.ctr = *state->tmp.out.ctr;
6657 /* Copy result */
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,
6672 WERROR *result)
6674 struct rpccli_netr_DsRAddressToSitenamesExW_state *state = tevent_req_data(
6675 req, struct rpccli_netr_DsRAddressToSitenamesExW_state);
6676 NTSTATUS status;
6678 if (tevent_req_is_nterror(req, &status)) {
6679 tevent_req_received(req);
6680 return status;
6683 /* Steal possbile out parameters to the callers context */
6684 talloc_steal(mem_ctx, state->out_mem_ctx);
6686 /* Return result */
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] */,
6699 WERROR *werror)
6701 struct netr_DsRAddressToSitenamesExW r;
6702 NTSTATUS status;
6704 /* In parameters */
6705 r.in.server_name = server_name;
6706 r.in.count = count;
6707 r.in.addresses = addresses;
6709 if (DEBUGLEVEL >= 10) {
6710 NDR_PRINT_IN_DEBUG(netr_DsRAddressToSitenamesExW, &r);
6713 status = cli->dispatch(cli,
6714 mem_ctx,
6715 &ndr_table_netlogon,
6716 NDR_NETR_DSRADDRESSTOSITENAMESEXW,
6717 &r);
6719 if (!NT_STATUS_IS_OK(status)) {
6720 return status;
6723 if (DEBUGLEVEL >= 10) {
6724 NDR_PRINT_OUT_DEBUG(netr_DsRAddressToSitenamesExW, &r);
6727 if (NT_STATUS_IS_ERR(status)) {
6728 return status;
6731 /* Return variables */
6732 *ctr = *r.out.ctr;
6734 /* Return result */
6735 if (werror) {
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);
6763 if (req == NULL) {
6764 return NULL;
6766 state->out_mem_ctx = NULL;
6767 state->dispatch_recv = cli->dispatch_recv;
6769 /* In parameters */
6770 state->orig.in.server_name = _server_name;
6772 /* Out parameters */
6773 state->orig.out.ctr = _ctr;
6775 /* Result */
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,
6794 &state->tmp);
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);
6799 return 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);
6808 NTSTATUS status;
6809 TALLOC_CTX *mem_ctx;
6811 if (state->out_mem_ctx) {
6812 mem_ctx = state->out_mem_ctx;
6813 } else {
6814 mem_ctx = state;
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);
6821 return;
6824 /* Copy out parameters */
6825 *state->orig.out.ctr = *state->tmp.out.ctr;
6827 /* Copy result */
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,
6842 WERROR *result)
6844 struct rpccli_netr_DsrGetDcSiteCoverageW_state *state = tevent_req_data(
6845 req, struct rpccli_netr_DsrGetDcSiteCoverageW_state);
6846 NTSTATUS status;
6848 if (tevent_req_is_nterror(req, &status)) {
6849 tevent_req_received(req);
6850 return status;
6853 /* Steal possbile out parameters to the callers context */
6854 talloc_steal(mem_ctx, state->out_mem_ctx);
6856 /* Return result */
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] */,
6867 WERROR *werror)
6869 struct netr_DsrGetDcSiteCoverageW r;
6870 NTSTATUS status;
6872 /* In parameters */
6873 r.in.server_name = server_name;
6875 if (DEBUGLEVEL >= 10) {
6876 NDR_PRINT_IN_DEBUG(netr_DsrGetDcSiteCoverageW, &r);
6879 status = cli->dispatch(cli,
6880 mem_ctx,
6881 &ndr_table_netlogon,
6882 NDR_NETR_DSRGETDCSITECOVERAGEW,
6883 &r);
6885 if (!NT_STATUS_IS_OK(status)) {
6886 return status;
6889 if (DEBUGLEVEL >= 10) {
6890 NDR_PRINT_OUT_DEBUG(netr_DsrGetDcSiteCoverageW, &r);
6893 if (NT_STATUS_IS_ERR(status)) {
6894 return status;
6897 /* Return variables */
6898 *ctr = *r.out.ctr;
6900 /* Return result */
6901 if (werror) {
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);
6935 if (req == NULL) {
6936 return NULL;
6938 state->out_mem_ctx = NULL;
6939 state->dispatch_recv = cli->dispatch_recv;
6941 /* In parameters */
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;
6954 /* Result */
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,
6973 &state->tmp);
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);
6978 return 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);
6987 NTSTATUS status;
6988 TALLOC_CTX *mem_ctx;
6990 if (state->out_mem_ctx) {
6991 mem_ctx = state->out_mem_ctx;
6992 } else {
6993 mem_ctx = state;
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);
7000 return;
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;
7008 /* Copy result */
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,
7023 NTSTATUS *result)
7025 struct rpccli_netr_LogonSamLogonEx_state *state = tevent_req_data(
7026 req, struct rpccli_netr_LogonSamLogonEx_state);
7027 NTSTATUS status;
7029 if (tevent_req_is_nterror(req, &status)) {
7030 tevent_req_received(req);
7031 return status;
7034 /* Steal possbile out parameters to the callers context */
7035 talloc_steal(mem_ctx, state->out_mem_ctx);
7037 /* Return result */
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;
7056 NTSTATUS status;
7058 /* In parameters */
7059 r.in.server_name = server_name;
7060 r.in.computer_name = computer_name;
7061 r.in.logon_level = logon_level;
7062 r.in.logon = logon;
7063 r.in.validation_level = validation_level;
7064 r.in.flags = flags;
7066 if (DEBUGLEVEL >= 10) {
7067 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonEx, &r);
7070 status = cli->dispatch(cli,
7071 mem_ctx,
7072 &ndr_table_netlogon,
7073 NDR_NETR_LOGONSAMLOGONEX,
7074 &r);
7076 if (!NT_STATUS_IS_OK(status)) {
7077 return status;
7080 if (DEBUGLEVEL >= 10) {
7081 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonEx, &r);
7084 if (NT_STATUS_IS_ERR(status)) {
7085 return status;
7088 /* Return variables */
7089 *validation = *r.out.validation;
7090 *authoritative = *r.out.authoritative;
7091 *flags = *r.out.flags;
7093 /* Return result */
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);
7119 if (req == NULL) {
7120 return NULL;
7122 state->out_mem_ctx = NULL;
7123 state->dispatch_recv = cli->dispatch_recv;
7125 /* In parameters */
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;
7132 /* Result */
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,
7151 &state->tmp);
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);
7156 return 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);
7165 NTSTATUS status;
7166 TALLOC_CTX *mem_ctx;
7168 if (state->out_mem_ctx) {
7169 mem_ctx = state->out_mem_ctx;
7170 } else {
7171 mem_ctx = state;
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);
7178 return;
7181 /* Copy out parameters */
7182 *state->orig.out.trusts = *state->tmp.out.trusts;
7184 /* Copy result */
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,
7199 WERROR *result)
7201 struct rpccli_netr_DsrEnumerateDomainTrusts_state *state = tevent_req_data(
7202 req, struct rpccli_netr_DsrEnumerateDomainTrusts_state);
7203 NTSTATUS status;
7205 if (tevent_req_is_nterror(req, &status)) {
7206 tevent_req_received(req);
7207 return status;
7210 /* Steal possbile out parameters to the callers context */
7211 talloc_steal(mem_ctx, state->out_mem_ctx);
7213 /* Return result */
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] */,
7225 WERROR *werror)
7227 struct netr_DsrEnumerateDomainTrusts r;
7228 NTSTATUS status;
7230 /* In parameters */
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,
7239 mem_ctx,
7240 &ndr_table_netlogon,
7241 NDR_NETR_DSRENUMERATEDOMAINTRUSTS,
7242 &r);
7244 if (!NT_STATUS_IS_OK(status)) {
7245 return status;
7248 if (DEBUGLEVEL >= 10) {
7249 NDR_PRINT_OUT_DEBUG(netr_DsrEnumerateDomainTrusts, &r);
7252 if (NT_STATUS_IS_ERR(status)) {
7253 return status;
7256 /* Return variables */
7257 *trusts = *r.out.trusts;
7259 /* Return result */
7260 if (werror) {
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);
7291 if (req == NULL) {
7292 return NULL;
7294 state->out_mem_ctx = NULL;
7295 state->dispatch_recv = cli->dispatch_recv;
7297 /* In parameters */
7298 state->orig.in.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 */
7306 /* Result */
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,
7319 &state->tmp);
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);
7324 return 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);
7333 NTSTATUS status;
7334 TALLOC_CTX *mem_ctx;
7336 if (state->out_mem_ctx) {
7337 mem_ctx = state->out_mem_ctx;
7338 } else {
7339 mem_ctx = state;
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);
7346 return;
7349 /* Copy out parameters */
7351 /* Copy result */
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,
7366 WERROR *result)
7368 struct rpccli_netr_DsrDeregisterDNSHostRecords_state *state = tevent_req_data(
7369 req, struct rpccli_netr_DsrDeregisterDNSHostRecords_state);
7370 NTSTATUS status;
7372 if (tevent_req_is_nterror(req, &status)) {
7373 tevent_req_received(req);
7374 return status;
7377 /* Steal possbile out parameters to the callers context */
7378 talloc_steal(mem_ctx, state->out_mem_ctx);
7380 /* Return result */
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)] */,
7394 WERROR *werror)
7396 struct netr_DsrDeregisterDNSHostRecords r;
7397 NTSTATUS status;
7399 /* In parameters */
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,
7411 mem_ctx,
7412 &ndr_table_netlogon,
7413 NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS,
7414 &r);
7416 if (!NT_STATUS_IS_OK(status)) {
7417 return status;
7420 if (DEBUGLEVEL >= 10) {
7421 NDR_PRINT_OUT_DEBUG(netr_DsrDeregisterDNSHostRecords, &r);
7424 if (NT_STATUS_IS_ERR(status)) {
7425 return status;
7428 /* Return variables */
7430 /* Return result */
7431 if (werror) {
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);
7465 if (req == NULL) {
7466 return NULL;
7468 state->out_mem_ctx = NULL;
7469 state->dispatch_recv = cli->dispatch_recv;
7471 /* In parameters */
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;
7483 /* Result */
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,
7502 &state->tmp);
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);
7507 return 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);
7516 NTSTATUS status;
7517 TALLOC_CTX *mem_ctx;
7519 if (state->out_mem_ctx) {
7520 mem_ctx = state->out_mem_ctx;
7521 } else {
7522 mem_ctx = state;
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);
7529 return;
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;
7537 /* Copy result */
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,
7552 NTSTATUS *result)
7554 struct rpccli_netr_ServerTrustPasswordsGet_state *state = tevent_req_data(
7555 req, struct rpccli_netr_ServerTrustPasswordsGet_state);
7556 NTSTATUS status;
7558 if (tevent_req_is_nterror(req, &status)) {
7559 tevent_req_received(req);
7560 return status;
7563 /* Steal possbile out parameters to the callers context */
7564 talloc_steal(mem_ctx, state->out_mem_ctx);
7566 /* Return result */
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;
7585 NTSTATUS status;
7587 /* In parameters */
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,
7599 mem_ctx,
7600 &ndr_table_netlogon,
7601 NDR_NETR_SERVERTRUSTPASSWORDSGET,
7602 &r);
7604 if (!NT_STATUS_IS_OK(status)) {
7605 return status;
7608 if (DEBUGLEVEL >= 10) {
7609 NDR_PRINT_OUT_DEBUG(netr_ServerTrustPasswordsGet, &r);
7612 if (NT_STATUS_IS_ERR(status)) {
7613 return status;
7616 /* Return variables */
7617 *return_authenticator = *r.out.return_authenticator;
7618 *password = *r.out.password;
7619 *password2 = *r.out.password2;
7621 /* Return result */
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);
7648 if (req == NULL) {
7649 return NULL;
7651 state->out_mem_ctx = NULL;
7652 state->dispatch_recv = cli->dispatch_recv;
7654 /* In parameters */
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;
7662 /* Result */
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,
7681 &state->tmp);
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);
7686 return 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);
7695 NTSTATUS status;
7696 TALLOC_CTX *mem_ctx;
7698 if (state->out_mem_ctx) {
7699 mem_ctx = state->out_mem_ctx;
7700 } else {
7701 mem_ctx = state;
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);
7708 return;
7711 /* Copy out parameters */
7712 *state->orig.out.forest_trust_info = *state->tmp.out.forest_trust_info;
7714 /* Copy result */
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,
7729 WERROR *result)
7731 struct rpccli_netr_DsRGetForestTrustInformation_state *state = tevent_req_data(
7732 req, struct rpccli_netr_DsRGetForestTrustInformation_state);
7733 NTSTATUS status;
7735 if (tevent_req_is_nterror(req, &status)) {
7736 tevent_req_received(req);
7737 return status;
7740 /* Steal possbile out parameters to the callers context */
7741 talloc_steal(mem_ctx, state->out_mem_ctx);
7743 /* Return result */
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] */,
7756 WERROR *werror)
7758 struct netr_DsRGetForestTrustInformation r;
7759 NTSTATUS status;
7761 /* In parameters */
7762 r.in.server_name = server_name;
7763 r.in.trusted_domain_name = trusted_domain_name;
7764 r.in.flags = flags;
7766 if (DEBUGLEVEL >= 10) {
7767 NDR_PRINT_IN_DEBUG(netr_DsRGetForestTrustInformation, &r);
7770 status = cli->dispatch(cli,
7771 mem_ctx,
7772 &ndr_table_netlogon,
7773 NDR_NETR_DSRGETFORESTTRUSTINFORMATION,
7774 &r);
7776 if (!NT_STATUS_IS_OK(status)) {
7777 return status;
7780 if (DEBUGLEVEL >= 10) {
7781 NDR_PRINT_OUT_DEBUG(netr_DsRGetForestTrustInformation, &r);
7784 if (NT_STATUS_IS_ERR(status)) {
7785 return status;
7788 /* Return variables */
7789 *forest_trust_info = *r.out.forest_trust_info;
7791 /* Return result */
7792 if (werror) {
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);
7824 if (req == NULL) {
7825 return NULL;
7827 state->out_mem_ctx = NULL;
7828 state->dispatch_recv = cli->dispatch_recv;
7830 /* In parameters */
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;
7840 /* Result */
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,
7859 &state->tmp);
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);
7864 return 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);
7873 NTSTATUS status;
7874 TALLOC_CTX *mem_ctx;
7876 if (state->out_mem_ctx) {
7877 mem_ctx = state->out_mem_ctx;
7878 } else {
7879 mem_ctx = state;
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);
7886 return;
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;
7893 /* Copy result */
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,
7908 WERROR *result)
7910 struct rpccli_netr_GetForestTrustInformation_state *state = tevent_req_data(
7911 req, struct rpccli_netr_GetForestTrustInformation_state);
7912 NTSTATUS status;
7914 if (tevent_req_is_nterror(req, &status)) {
7915 tevent_req_received(req);
7916 return status;
7919 /* Steal possbile out parameters to the callers context */
7920 talloc_steal(mem_ctx, state->out_mem_ctx);
7922 /* Return result */
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] */,
7937 WERROR *werror)
7939 struct netr_GetForestTrustInformation r;
7940 NTSTATUS status;
7942 /* In parameters */
7943 r.in.server_name = server_name;
7944 r.in.trusted_domain_name = trusted_domain_name;
7945 r.in.credential = credential;
7946 r.in.flags = flags;
7948 if (DEBUGLEVEL >= 10) {
7949 NDR_PRINT_IN_DEBUG(netr_GetForestTrustInformation, &r);
7952 status = cli->dispatch(cli,
7953 mem_ctx,
7954 &ndr_table_netlogon,
7955 NDR_NETR_GETFORESTTRUSTINFORMATION,
7956 &r);
7958 if (!NT_STATUS_IS_OK(status)) {
7959 return status;
7962 if (DEBUGLEVEL >= 10) {
7963 NDR_PRINT_OUT_DEBUG(netr_GetForestTrustInformation, &r);
7966 if (NT_STATUS_IS_ERR(status)) {
7967 return status;
7970 /* Return variables */
7971 *return_authenticator = *r.out.return_authenticator;
7972 *forest_trust_info = *r.out.forest_trust_info;
7974 /* Return result */
7975 if (werror) {
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);
8011 if (req == NULL) {
8012 return NULL;
8014 state->out_mem_ctx = NULL;
8015 state->dispatch_recv = cli->dispatch_recv;
8017 /* In parameters */
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;
8033 /* Result */
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,
8052 &state->tmp);
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);
8057 return 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);
8066 NTSTATUS status;
8067 TALLOC_CTX *mem_ctx;
8069 if (state->out_mem_ctx) {
8070 mem_ctx = state->out_mem_ctx;
8071 } else {
8072 mem_ctx = state;
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);
8079 return;
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;
8090 /* Copy result */
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,
8105 NTSTATUS *result)
8107 struct rpccli_netr_LogonSamLogonWithFlags_state *state = tevent_req_data(
8108 req, struct rpccli_netr_LogonSamLogonWithFlags_state);
8109 NTSTATUS status;
8111 if (tevent_req_is_nterror(req, &status)) {
8112 tevent_req_received(req);
8113 return status;
8116 /* Steal possbile out parameters to the callers context */
8117 talloc_steal(mem_ctx, state->out_mem_ctx);
8119 /* Return result */
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;
8140 NTSTATUS status;
8142 /* In parameters */
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;
8148 r.in.logon = logon;
8149 r.in.validation_level = validation_level;
8150 r.in.flags = flags;
8152 if (DEBUGLEVEL >= 10) {
8153 NDR_PRINT_IN_DEBUG(netr_LogonSamLogonWithFlags, &r);
8156 status = cli->dispatch(cli,
8157 mem_ctx,
8158 &ndr_table_netlogon,
8159 NDR_NETR_LOGONSAMLOGONWITHFLAGS,
8160 &r);
8162 if (!NT_STATUS_IS_OK(status)) {
8163 return status;
8166 if (DEBUGLEVEL >= 10) {
8167 NDR_PRINT_OUT_DEBUG(netr_LogonSamLogonWithFlags, &r);
8170 if (NT_STATUS_IS_ERR(status)) {
8171 return 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;
8182 /* Return result */
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);
8214 if (req == NULL) {
8215 return NULL;
8217 state->out_mem_ctx = NULL;
8218 state->dispatch_recv = cli->dispatch_recv;
8220 /* In parameters */
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;
8233 /* Result */
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,
8252 &state->tmp);
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);
8257 return 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);
8266 NTSTATUS status;
8267 TALLOC_CTX *mem_ctx;
8269 if (state->out_mem_ctx) {
8270 mem_ctx = state->out_mem_ctx;
8271 } else {
8272 mem_ctx = state;
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);
8279 return;
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;
8288 /* Copy result */
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,
8303 NTSTATUS *result)
8305 struct rpccli_netr_ServerGetTrustInfo_state *state = tevent_req_data(
8306 req, struct rpccli_netr_ServerGetTrustInfo_state);
8307 NTSTATUS status;
8309 if (tevent_req_is_nterror(req, &status)) {
8310 tevent_req_received(req);
8311 return status;
8314 /* Steal possbile out parameters to the callers context */
8315 talloc_steal(mem_ctx, state->out_mem_ctx);
8317 /* Return result */
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;
8337 NTSTATUS status;
8339 /* In parameters */
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,
8351 mem_ctx,
8352 &ndr_table_netlogon,
8353 NDR_NETR_SERVERGETTRUSTINFO,
8354 &r);
8356 if (!NT_STATUS_IS_OK(status)) {
8357 return status;
8360 if (DEBUGLEVEL >= 10) {
8361 NDR_PRINT_OUT_DEBUG(netr_ServerGetTrustInfo, &r);
8364 if (NT_STATUS_IS_ERR(status)) {
8365 return 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;
8374 /* Return result */
8375 return r.out.result;