s3:winbind: Add async wb_lookupusergroups
[Samba/aatanasov.git] / source3 / librpc / gen_ndr / cli_wbint.c
blobde6b345a0eea567e01b498095829797ab929fb77
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_wbint.h"
9 struct rpccli_wbint_Ping_state {
10 struct wbint_Ping orig;
11 struct wbint_Ping tmp;
12 TALLOC_CTX *out_mem_ctx;
13 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
16 static void rpccli_wbint_Ping_done(struct tevent_req *subreq);
18 struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx,
19 struct tevent_context *ev,
20 struct rpc_pipe_client *cli,
21 uint32_t _in_data /* [in] */,
22 uint32_t *_out_data /* [out] [ref] */)
24 struct tevent_req *req;
25 struct rpccli_wbint_Ping_state *state;
26 struct tevent_req *subreq;
28 req = tevent_req_create(mem_ctx, &state,
29 struct rpccli_wbint_Ping_state);
30 if (req == NULL) {
31 return NULL;
33 state->out_mem_ctx = NULL;
34 state->dispatch_recv = cli->dispatch_recv;
36 /* In parameters */
37 state->orig.in.in_data = _in_data;
39 /* Out parameters */
40 state->orig.out.out_data = _out_data;
42 if (DEBUGLEVEL >= 10) {
43 NDR_PRINT_IN_DEBUG(wbint_Ping, &state->orig);
46 state->out_mem_ctx = talloc_named_const(state, 0,
47 "rpccli_wbint_Ping_out_memory");
48 if (tevent_req_nomem(state->out_mem_ctx, req)) {
49 return tevent_req_post(req, ev);
52 /* make a temporary copy, that we pass to the dispatch function */
53 state->tmp = state->orig;
55 subreq = cli->dispatch_send(state, ev, cli,
56 &ndr_table_wbint,
57 NDR_WBINT_PING,
58 &state->tmp);
59 if (tevent_req_nomem(subreq, req)) {
60 return tevent_req_post(req, ev);
62 tevent_req_set_callback(subreq, rpccli_wbint_Ping_done, req);
63 return req;
66 static void rpccli_wbint_Ping_done(struct tevent_req *subreq)
68 struct tevent_req *req = tevent_req_callback_data(
69 subreq, struct tevent_req);
70 struct rpccli_wbint_Ping_state *state = tevent_req_data(
71 req, struct rpccli_wbint_Ping_state);
72 NTSTATUS status;
73 TALLOC_CTX *mem_ctx;
75 if (state->out_mem_ctx) {
76 mem_ctx = state->out_mem_ctx;
77 } else {
78 mem_ctx = state;
81 status = state->dispatch_recv(subreq, mem_ctx);
82 TALLOC_FREE(subreq);
83 if (!NT_STATUS_IS_OK(status)) {
84 tevent_req_nterror(req, status);
85 return;
88 /* Copy out parameters */
89 *state->orig.out.out_data = *state->tmp.out.out_data;
91 /* Reset temporary structure */
92 ZERO_STRUCT(state->tmp);
94 if (DEBUGLEVEL >= 10) {
95 NDR_PRINT_OUT_DEBUG(wbint_Ping, &state->orig);
98 tevent_req_done(req);
101 NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req,
102 TALLOC_CTX *mem_ctx)
104 struct rpccli_wbint_Ping_state *state = tevent_req_data(
105 req, struct rpccli_wbint_Ping_state);
106 NTSTATUS status;
108 if (tevent_req_is_nterror(req, &status)) {
109 tevent_req_received(req);
110 return status;
113 /* Steal possbile out parameters to the callers context */
114 talloc_steal(mem_ctx, state->out_mem_ctx);
116 tevent_req_received(req);
117 return NT_STATUS_OK;
120 NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli,
121 TALLOC_CTX *mem_ctx,
122 uint32_t in_data /* [in] */,
123 uint32_t *out_data /* [out] [ref] */)
125 struct wbint_Ping r;
126 NTSTATUS status;
128 /* In parameters */
129 r.in.in_data = in_data;
131 if (DEBUGLEVEL >= 10) {
132 NDR_PRINT_IN_DEBUG(wbint_Ping, &r);
135 status = cli->dispatch(cli,
136 mem_ctx,
137 &ndr_table_wbint,
138 NDR_WBINT_PING,
139 &r);
141 if (!NT_STATUS_IS_OK(status)) {
142 return status;
145 if (DEBUGLEVEL >= 10) {
146 NDR_PRINT_OUT_DEBUG(wbint_Ping, &r);
149 if (NT_STATUS_IS_ERR(status)) {
150 return status;
153 /* Return variables */
154 *out_data = *r.out.out_data;
156 /* Return result */
157 return NT_STATUS_OK;
160 struct rpccli_wbint_LookupSid_state {
161 struct wbint_LookupSid orig;
162 struct wbint_LookupSid tmp;
163 TALLOC_CTX *out_mem_ctx;
164 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
167 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq);
169 struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx,
170 struct tevent_context *ev,
171 struct rpc_pipe_client *cli,
172 struct dom_sid *_sid /* [in] [ref] */,
173 enum lsa_SidType *_type /* [out] [ref] */,
174 const char **_domain /* [out] [ref,charset(UTF8)] */,
175 const char **_name /* [out] [ref,charset(UTF8)] */)
177 struct tevent_req *req;
178 struct rpccli_wbint_LookupSid_state *state;
179 struct tevent_req *subreq;
181 req = tevent_req_create(mem_ctx, &state,
182 struct rpccli_wbint_LookupSid_state);
183 if (req == NULL) {
184 return NULL;
186 state->out_mem_ctx = NULL;
187 state->dispatch_recv = cli->dispatch_recv;
189 /* In parameters */
190 state->orig.in.sid = _sid;
192 /* Out parameters */
193 state->orig.out.type = _type;
194 state->orig.out.domain = _domain;
195 state->orig.out.name = _name;
197 /* Result */
198 ZERO_STRUCT(state->orig.out.result);
200 if (DEBUGLEVEL >= 10) {
201 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &state->orig);
204 state->out_mem_ctx = talloc_named_const(state, 0,
205 "rpccli_wbint_LookupSid_out_memory");
206 if (tevent_req_nomem(state->out_mem_ctx, req)) {
207 return tevent_req_post(req, ev);
210 /* make a temporary copy, that we pass to the dispatch function */
211 state->tmp = state->orig;
213 subreq = cli->dispatch_send(state, ev, cli,
214 &ndr_table_wbint,
215 NDR_WBINT_LOOKUPSID,
216 &state->tmp);
217 if (tevent_req_nomem(subreq, req)) {
218 return tevent_req_post(req, ev);
220 tevent_req_set_callback(subreq, rpccli_wbint_LookupSid_done, req);
221 return req;
224 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq)
226 struct tevent_req *req = tevent_req_callback_data(
227 subreq, struct tevent_req);
228 struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
229 req, struct rpccli_wbint_LookupSid_state);
230 NTSTATUS status;
231 TALLOC_CTX *mem_ctx;
233 if (state->out_mem_ctx) {
234 mem_ctx = state->out_mem_ctx;
235 } else {
236 mem_ctx = state;
239 status = state->dispatch_recv(subreq, mem_ctx);
240 TALLOC_FREE(subreq);
241 if (!NT_STATUS_IS_OK(status)) {
242 tevent_req_nterror(req, status);
243 return;
246 /* Copy out parameters */
247 *state->orig.out.type = *state->tmp.out.type;
248 *state->orig.out.domain = *state->tmp.out.domain;
249 *state->orig.out.name = *state->tmp.out.name;
251 /* Copy result */
252 state->orig.out.result = state->tmp.out.result;
254 /* Reset temporary structure */
255 ZERO_STRUCT(state->tmp);
257 if (DEBUGLEVEL >= 10) {
258 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &state->orig);
261 tevent_req_done(req);
264 NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req,
265 TALLOC_CTX *mem_ctx,
266 NTSTATUS *result)
268 struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
269 req, struct rpccli_wbint_LookupSid_state);
270 NTSTATUS status;
272 if (tevent_req_is_nterror(req, &status)) {
273 tevent_req_received(req);
274 return status;
277 /* Steal possbile out parameters to the callers context */
278 talloc_steal(mem_ctx, state->out_mem_ctx);
280 /* Return result */
281 *result = state->orig.out.result;
283 tevent_req_received(req);
284 return NT_STATUS_OK;
287 NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli,
288 TALLOC_CTX *mem_ctx,
289 struct dom_sid *sid /* [in] [ref] */,
290 enum lsa_SidType *type /* [out] [ref] */,
291 const char **domain /* [out] [ref,charset(UTF8)] */,
292 const char **name /* [out] [ref,charset(UTF8)] */)
294 struct wbint_LookupSid r;
295 NTSTATUS status;
297 /* In parameters */
298 r.in.sid = sid;
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &r);
304 status = cli->dispatch(cli,
305 mem_ctx,
306 &ndr_table_wbint,
307 NDR_WBINT_LOOKUPSID,
308 &r);
310 if (!NT_STATUS_IS_OK(status)) {
311 return status;
314 if (DEBUGLEVEL >= 10) {
315 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &r);
318 if (NT_STATUS_IS_ERR(status)) {
319 return status;
322 /* Return variables */
323 *type = *r.out.type;
324 *domain = *r.out.domain;
325 *name = *r.out.name;
327 /* Return result */
328 return r.out.result;
331 struct rpccli_wbint_LookupName_state {
332 struct wbint_LookupName orig;
333 struct wbint_LookupName tmp;
334 TALLOC_CTX *out_mem_ctx;
335 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
338 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq);
340 struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx,
341 struct tevent_context *ev,
342 struct rpc_pipe_client *cli,
343 const char *_domain /* [in] [ref,charset(UTF8)] */,
344 const char *_name /* [in] [ref,charset(UTF8)] */,
345 uint32_t _flags /* [in] */,
346 enum lsa_SidType *_type /* [out] [ref] */,
347 struct dom_sid *_sid /* [out] [ref] */)
349 struct tevent_req *req;
350 struct rpccli_wbint_LookupName_state *state;
351 struct tevent_req *subreq;
353 req = tevent_req_create(mem_ctx, &state,
354 struct rpccli_wbint_LookupName_state);
355 if (req == NULL) {
356 return NULL;
358 state->out_mem_ctx = NULL;
359 state->dispatch_recv = cli->dispatch_recv;
361 /* In parameters */
362 state->orig.in.domain = _domain;
363 state->orig.in.name = _name;
364 state->orig.in.flags = _flags;
366 /* Out parameters */
367 state->orig.out.type = _type;
368 state->orig.out.sid = _sid;
370 /* Result */
371 ZERO_STRUCT(state->orig.out.result);
373 if (DEBUGLEVEL >= 10) {
374 NDR_PRINT_IN_DEBUG(wbint_LookupName, &state->orig);
377 state->out_mem_ctx = talloc_named_const(state, 0,
378 "rpccli_wbint_LookupName_out_memory");
379 if (tevent_req_nomem(state->out_mem_ctx, req)) {
380 return tevent_req_post(req, ev);
383 /* make a temporary copy, that we pass to the dispatch function */
384 state->tmp = state->orig;
386 subreq = cli->dispatch_send(state, ev, cli,
387 &ndr_table_wbint,
388 NDR_WBINT_LOOKUPNAME,
389 &state->tmp);
390 if (tevent_req_nomem(subreq, req)) {
391 return tevent_req_post(req, ev);
393 tevent_req_set_callback(subreq, rpccli_wbint_LookupName_done, req);
394 return req;
397 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq)
399 struct tevent_req *req = tevent_req_callback_data(
400 subreq, struct tevent_req);
401 struct rpccli_wbint_LookupName_state *state = tevent_req_data(
402 req, struct rpccli_wbint_LookupName_state);
403 NTSTATUS status;
404 TALLOC_CTX *mem_ctx;
406 if (state->out_mem_ctx) {
407 mem_ctx = state->out_mem_ctx;
408 } else {
409 mem_ctx = state;
412 status = state->dispatch_recv(subreq, mem_ctx);
413 TALLOC_FREE(subreq);
414 if (!NT_STATUS_IS_OK(status)) {
415 tevent_req_nterror(req, status);
416 return;
419 /* Copy out parameters */
420 *state->orig.out.type = *state->tmp.out.type;
421 *state->orig.out.sid = *state->tmp.out.sid;
423 /* Copy result */
424 state->orig.out.result = state->tmp.out.result;
426 /* Reset temporary structure */
427 ZERO_STRUCT(state->tmp);
429 if (DEBUGLEVEL >= 10) {
430 NDR_PRINT_OUT_DEBUG(wbint_LookupName, &state->orig);
433 tevent_req_done(req);
436 NTSTATUS rpccli_wbint_LookupName_recv(struct tevent_req *req,
437 TALLOC_CTX *mem_ctx,
438 NTSTATUS *result)
440 struct rpccli_wbint_LookupName_state *state = tevent_req_data(
441 req, struct rpccli_wbint_LookupName_state);
442 NTSTATUS status;
444 if (tevent_req_is_nterror(req, &status)) {
445 tevent_req_received(req);
446 return status;
449 /* Steal possbile out parameters to the callers context */
450 talloc_steal(mem_ctx, state->out_mem_ctx);
452 /* Return result */
453 *result = state->orig.out.result;
455 tevent_req_received(req);
456 return NT_STATUS_OK;
459 NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli,
460 TALLOC_CTX *mem_ctx,
461 const char *domain /* [in] [ref,charset(UTF8)] */,
462 const char *name /* [in] [ref,charset(UTF8)] */,
463 uint32_t flags /* [in] */,
464 enum lsa_SidType *type /* [out] [ref] */,
465 struct dom_sid *sid /* [out] [ref] */)
467 struct wbint_LookupName r;
468 NTSTATUS status;
470 /* In parameters */
471 r.in.domain = domain;
472 r.in.name = name;
473 r.in.flags = flags;
475 if (DEBUGLEVEL >= 10) {
476 NDR_PRINT_IN_DEBUG(wbint_LookupName, &r);
479 status = cli->dispatch(cli,
480 mem_ctx,
481 &ndr_table_wbint,
482 NDR_WBINT_LOOKUPNAME,
483 &r);
485 if (!NT_STATUS_IS_OK(status)) {
486 return status;
489 if (DEBUGLEVEL >= 10) {
490 NDR_PRINT_OUT_DEBUG(wbint_LookupName, &r);
493 if (NT_STATUS_IS_ERR(status)) {
494 return status;
497 /* Return variables */
498 *type = *r.out.type;
499 *sid = *r.out.sid;
501 /* Return result */
502 return r.out.result;
505 struct rpccli_wbint_Sid2Uid_state {
506 struct wbint_Sid2Uid orig;
507 struct wbint_Sid2Uid tmp;
508 TALLOC_CTX *out_mem_ctx;
509 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
512 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq);
514 struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx,
515 struct tevent_context *ev,
516 struct rpc_pipe_client *cli,
517 const char *_dom_name /* [in] [unique,charset(UTF8)] */,
518 struct dom_sid *_sid /* [in] [ref] */,
519 uint64_t *_uid /* [out] [ref] */)
521 struct tevent_req *req;
522 struct rpccli_wbint_Sid2Uid_state *state;
523 struct tevent_req *subreq;
525 req = tevent_req_create(mem_ctx, &state,
526 struct rpccli_wbint_Sid2Uid_state);
527 if (req == NULL) {
528 return NULL;
530 state->out_mem_ctx = NULL;
531 state->dispatch_recv = cli->dispatch_recv;
533 /* In parameters */
534 state->orig.in.dom_name = _dom_name;
535 state->orig.in.sid = _sid;
537 /* Out parameters */
538 state->orig.out.uid = _uid;
540 /* Result */
541 ZERO_STRUCT(state->orig.out.result);
543 if (DEBUGLEVEL >= 10) {
544 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &state->orig);
547 state->out_mem_ctx = talloc_named_const(state, 0,
548 "rpccli_wbint_Sid2Uid_out_memory");
549 if (tevent_req_nomem(state->out_mem_ctx, req)) {
550 return tevent_req_post(req, ev);
553 /* make a temporary copy, that we pass to the dispatch function */
554 state->tmp = state->orig;
556 subreq = cli->dispatch_send(state, ev, cli,
557 &ndr_table_wbint,
558 NDR_WBINT_SID2UID,
559 &state->tmp);
560 if (tevent_req_nomem(subreq, req)) {
561 return tevent_req_post(req, ev);
563 tevent_req_set_callback(subreq, rpccli_wbint_Sid2Uid_done, req);
564 return req;
567 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq)
569 struct tevent_req *req = tevent_req_callback_data(
570 subreq, struct tevent_req);
571 struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data(
572 req, struct rpccli_wbint_Sid2Uid_state);
573 NTSTATUS status;
574 TALLOC_CTX *mem_ctx;
576 if (state->out_mem_ctx) {
577 mem_ctx = state->out_mem_ctx;
578 } else {
579 mem_ctx = state;
582 status = state->dispatch_recv(subreq, mem_ctx);
583 TALLOC_FREE(subreq);
584 if (!NT_STATUS_IS_OK(status)) {
585 tevent_req_nterror(req, status);
586 return;
589 /* Copy out parameters */
590 *state->orig.out.uid = *state->tmp.out.uid;
592 /* Copy result */
593 state->orig.out.result = state->tmp.out.result;
595 /* Reset temporary structure */
596 ZERO_STRUCT(state->tmp);
598 if (DEBUGLEVEL >= 10) {
599 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &state->orig);
602 tevent_req_done(req);
605 NTSTATUS rpccli_wbint_Sid2Uid_recv(struct tevent_req *req,
606 TALLOC_CTX *mem_ctx,
607 NTSTATUS *result)
609 struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data(
610 req, struct rpccli_wbint_Sid2Uid_state);
611 NTSTATUS status;
613 if (tevent_req_is_nterror(req, &status)) {
614 tevent_req_received(req);
615 return status;
618 /* Steal possbile out parameters to the callers context */
619 talloc_steal(mem_ctx, state->out_mem_ctx);
621 /* Return result */
622 *result = state->orig.out.result;
624 tevent_req_received(req);
625 return NT_STATUS_OK;
628 NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli,
629 TALLOC_CTX *mem_ctx,
630 const char *dom_name /* [in] [unique,charset(UTF8)] */,
631 struct dom_sid *sid /* [in] [ref] */,
632 uint64_t *uid /* [out] [ref] */)
634 struct wbint_Sid2Uid r;
635 NTSTATUS status;
637 /* In parameters */
638 r.in.dom_name = dom_name;
639 r.in.sid = sid;
641 if (DEBUGLEVEL >= 10) {
642 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &r);
645 status = cli->dispatch(cli,
646 mem_ctx,
647 &ndr_table_wbint,
648 NDR_WBINT_SID2UID,
649 &r);
651 if (!NT_STATUS_IS_OK(status)) {
652 return status;
655 if (DEBUGLEVEL >= 10) {
656 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &r);
659 if (NT_STATUS_IS_ERR(status)) {
660 return status;
663 /* Return variables */
664 *uid = *r.out.uid;
666 /* Return result */
667 return r.out.result;
670 struct rpccli_wbint_Sid2Gid_state {
671 struct wbint_Sid2Gid orig;
672 struct wbint_Sid2Gid tmp;
673 TALLOC_CTX *out_mem_ctx;
674 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
677 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq);
679 struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx,
680 struct tevent_context *ev,
681 struct rpc_pipe_client *cli,
682 const char *_dom_name /* [in] [unique,charset(UTF8)] */,
683 struct dom_sid *_sid /* [in] [ref] */,
684 uint64_t *_gid /* [out] [ref] */)
686 struct tevent_req *req;
687 struct rpccli_wbint_Sid2Gid_state *state;
688 struct tevent_req *subreq;
690 req = tevent_req_create(mem_ctx, &state,
691 struct rpccli_wbint_Sid2Gid_state);
692 if (req == NULL) {
693 return NULL;
695 state->out_mem_ctx = NULL;
696 state->dispatch_recv = cli->dispatch_recv;
698 /* In parameters */
699 state->orig.in.dom_name = _dom_name;
700 state->orig.in.sid = _sid;
702 /* Out parameters */
703 state->orig.out.gid = _gid;
705 /* Result */
706 ZERO_STRUCT(state->orig.out.result);
708 if (DEBUGLEVEL >= 10) {
709 NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &state->orig);
712 state->out_mem_ctx = talloc_named_const(state, 0,
713 "rpccli_wbint_Sid2Gid_out_memory");
714 if (tevent_req_nomem(state->out_mem_ctx, req)) {
715 return tevent_req_post(req, ev);
718 /* make a temporary copy, that we pass to the dispatch function */
719 state->tmp = state->orig;
721 subreq = cli->dispatch_send(state, ev, cli,
722 &ndr_table_wbint,
723 NDR_WBINT_SID2GID,
724 &state->tmp);
725 if (tevent_req_nomem(subreq, req)) {
726 return tevent_req_post(req, ev);
728 tevent_req_set_callback(subreq, rpccli_wbint_Sid2Gid_done, req);
729 return req;
732 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq)
734 struct tevent_req *req = tevent_req_callback_data(
735 subreq, struct tevent_req);
736 struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data(
737 req, struct rpccli_wbint_Sid2Gid_state);
738 NTSTATUS status;
739 TALLOC_CTX *mem_ctx;
741 if (state->out_mem_ctx) {
742 mem_ctx = state->out_mem_ctx;
743 } else {
744 mem_ctx = state;
747 status = state->dispatch_recv(subreq, mem_ctx);
748 TALLOC_FREE(subreq);
749 if (!NT_STATUS_IS_OK(status)) {
750 tevent_req_nterror(req, status);
751 return;
754 /* Copy out parameters */
755 *state->orig.out.gid = *state->tmp.out.gid;
757 /* Copy result */
758 state->orig.out.result = state->tmp.out.result;
760 /* Reset temporary structure */
761 ZERO_STRUCT(state->tmp);
763 if (DEBUGLEVEL >= 10) {
764 NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &state->orig);
767 tevent_req_done(req);
770 NTSTATUS rpccli_wbint_Sid2Gid_recv(struct tevent_req *req,
771 TALLOC_CTX *mem_ctx,
772 NTSTATUS *result)
774 struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data(
775 req, struct rpccli_wbint_Sid2Gid_state);
776 NTSTATUS status;
778 if (tevent_req_is_nterror(req, &status)) {
779 tevent_req_received(req);
780 return status;
783 /* Steal possbile out parameters to the callers context */
784 talloc_steal(mem_ctx, state->out_mem_ctx);
786 /* Return result */
787 *result = state->orig.out.result;
789 tevent_req_received(req);
790 return NT_STATUS_OK;
793 NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli,
794 TALLOC_CTX *mem_ctx,
795 const char *dom_name /* [in] [unique,charset(UTF8)] */,
796 struct dom_sid *sid /* [in] [ref] */,
797 uint64_t *gid /* [out] [ref] */)
799 struct wbint_Sid2Gid r;
800 NTSTATUS status;
802 /* In parameters */
803 r.in.dom_name = dom_name;
804 r.in.sid = sid;
806 if (DEBUGLEVEL >= 10) {
807 NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &r);
810 status = cli->dispatch(cli,
811 mem_ctx,
812 &ndr_table_wbint,
813 NDR_WBINT_SID2GID,
814 &r);
816 if (!NT_STATUS_IS_OK(status)) {
817 return status;
820 if (DEBUGLEVEL >= 10) {
821 NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &r);
824 if (NT_STATUS_IS_ERR(status)) {
825 return status;
828 /* Return variables */
829 *gid = *r.out.gid;
831 /* Return result */
832 return r.out.result;
835 struct rpccli_wbint_Uid2Sid_state {
836 struct wbint_Uid2Sid orig;
837 struct wbint_Uid2Sid tmp;
838 TALLOC_CTX *out_mem_ctx;
839 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
842 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq);
844 struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx,
845 struct tevent_context *ev,
846 struct rpc_pipe_client *cli,
847 const char *_dom_name /* [in] [unique,charset(UTF8)] */,
848 uint64_t _uid /* [in] */,
849 struct dom_sid *_sid /* [out] [ref] */)
851 struct tevent_req *req;
852 struct rpccli_wbint_Uid2Sid_state *state;
853 struct tevent_req *subreq;
855 req = tevent_req_create(mem_ctx, &state,
856 struct rpccli_wbint_Uid2Sid_state);
857 if (req == NULL) {
858 return NULL;
860 state->out_mem_ctx = NULL;
861 state->dispatch_recv = cli->dispatch_recv;
863 /* In parameters */
864 state->orig.in.dom_name = _dom_name;
865 state->orig.in.uid = _uid;
867 /* Out parameters */
868 state->orig.out.sid = _sid;
870 /* Result */
871 ZERO_STRUCT(state->orig.out.result);
873 if (DEBUGLEVEL >= 10) {
874 NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &state->orig);
877 state->out_mem_ctx = talloc_named_const(state, 0,
878 "rpccli_wbint_Uid2Sid_out_memory");
879 if (tevent_req_nomem(state->out_mem_ctx, req)) {
880 return tevent_req_post(req, ev);
883 /* make a temporary copy, that we pass to the dispatch function */
884 state->tmp = state->orig;
886 subreq = cli->dispatch_send(state, ev, cli,
887 &ndr_table_wbint,
888 NDR_WBINT_UID2SID,
889 &state->tmp);
890 if (tevent_req_nomem(subreq, req)) {
891 return tevent_req_post(req, ev);
893 tevent_req_set_callback(subreq, rpccli_wbint_Uid2Sid_done, req);
894 return req;
897 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq)
899 struct tevent_req *req = tevent_req_callback_data(
900 subreq, struct tevent_req);
901 struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data(
902 req, struct rpccli_wbint_Uid2Sid_state);
903 NTSTATUS status;
904 TALLOC_CTX *mem_ctx;
906 if (state->out_mem_ctx) {
907 mem_ctx = state->out_mem_ctx;
908 } else {
909 mem_ctx = state;
912 status = state->dispatch_recv(subreq, mem_ctx);
913 TALLOC_FREE(subreq);
914 if (!NT_STATUS_IS_OK(status)) {
915 tevent_req_nterror(req, status);
916 return;
919 /* Copy out parameters */
920 *state->orig.out.sid = *state->tmp.out.sid;
922 /* Copy result */
923 state->orig.out.result = state->tmp.out.result;
925 /* Reset temporary structure */
926 ZERO_STRUCT(state->tmp);
928 if (DEBUGLEVEL >= 10) {
929 NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &state->orig);
932 tevent_req_done(req);
935 NTSTATUS rpccli_wbint_Uid2Sid_recv(struct tevent_req *req,
936 TALLOC_CTX *mem_ctx,
937 NTSTATUS *result)
939 struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data(
940 req, struct rpccli_wbint_Uid2Sid_state);
941 NTSTATUS status;
943 if (tevent_req_is_nterror(req, &status)) {
944 tevent_req_received(req);
945 return status;
948 /* Steal possbile out parameters to the callers context */
949 talloc_steal(mem_ctx, state->out_mem_ctx);
951 /* Return result */
952 *result = state->orig.out.result;
954 tevent_req_received(req);
955 return NT_STATUS_OK;
958 NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli,
959 TALLOC_CTX *mem_ctx,
960 const char *dom_name /* [in] [unique,charset(UTF8)] */,
961 uint64_t uid /* [in] */,
962 struct dom_sid *sid /* [out] [ref] */)
964 struct wbint_Uid2Sid r;
965 NTSTATUS status;
967 /* In parameters */
968 r.in.dom_name = dom_name;
969 r.in.uid = uid;
971 if (DEBUGLEVEL >= 10) {
972 NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &r);
975 status = cli->dispatch(cli,
976 mem_ctx,
977 &ndr_table_wbint,
978 NDR_WBINT_UID2SID,
979 &r);
981 if (!NT_STATUS_IS_OK(status)) {
982 return status;
985 if (DEBUGLEVEL >= 10) {
986 NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &r);
989 if (NT_STATUS_IS_ERR(status)) {
990 return status;
993 /* Return variables */
994 *sid = *r.out.sid;
996 /* Return result */
997 return r.out.result;
1000 struct rpccli_wbint_Gid2Sid_state {
1001 struct wbint_Gid2Sid orig;
1002 struct wbint_Gid2Sid tmp;
1003 TALLOC_CTX *out_mem_ctx;
1004 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1007 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq);
1009 struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx,
1010 struct tevent_context *ev,
1011 struct rpc_pipe_client *cli,
1012 const char *_dom_name /* [in] [unique,charset(UTF8)] */,
1013 uint64_t _gid /* [in] */,
1014 struct dom_sid *_sid /* [out] [ref] */)
1016 struct tevent_req *req;
1017 struct rpccli_wbint_Gid2Sid_state *state;
1018 struct tevent_req *subreq;
1020 req = tevent_req_create(mem_ctx, &state,
1021 struct rpccli_wbint_Gid2Sid_state);
1022 if (req == NULL) {
1023 return NULL;
1025 state->out_mem_ctx = NULL;
1026 state->dispatch_recv = cli->dispatch_recv;
1028 /* In parameters */
1029 state->orig.in.dom_name = _dom_name;
1030 state->orig.in.gid = _gid;
1032 /* Out parameters */
1033 state->orig.out.sid = _sid;
1035 /* Result */
1036 ZERO_STRUCT(state->orig.out.result);
1038 if (DEBUGLEVEL >= 10) {
1039 NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &state->orig);
1042 state->out_mem_ctx = talloc_named_const(state, 0,
1043 "rpccli_wbint_Gid2Sid_out_memory");
1044 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1045 return tevent_req_post(req, ev);
1048 /* make a temporary copy, that we pass to the dispatch function */
1049 state->tmp = state->orig;
1051 subreq = cli->dispatch_send(state, ev, cli,
1052 &ndr_table_wbint,
1053 NDR_WBINT_GID2SID,
1054 &state->tmp);
1055 if (tevent_req_nomem(subreq, req)) {
1056 return tevent_req_post(req, ev);
1058 tevent_req_set_callback(subreq, rpccli_wbint_Gid2Sid_done, req);
1059 return req;
1062 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq)
1064 struct tevent_req *req = tevent_req_callback_data(
1065 subreq, struct tevent_req);
1066 struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data(
1067 req, struct rpccli_wbint_Gid2Sid_state);
1068 NTSTATUS status;
1069 TALLOC_CTX *mem_ctx;
1071 if (state->out_mem_ctx) {
1072 mem_ctx = state->out_mem_ctx;
1073 } else {
1074 mem_ctx = state;
1077 status = state->dispatch_recv(subreq, mem_ctx);
1078 TALLOC_FREE(subreq);
1079 if (!NT_STATUS_IS_OK(status)) {
1080 tevent_req_nterror(req, status);
1081 return;
1084 /* Copy out parameters */
1085 *state->orig.out.sid = *state->tmp.out.sid;
1087 /* Copy result */
1088 state->orig.out.result = state->tmp.out.result;
1090 /* Reset temporary structure */
1091 ZERO_STRUCT(state->tmp);
1093 if (DEBUGLEVEL >= 10) {
1094 NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &state->orig);
1097 tevent_req_done(req);
1100 NTSTATUS rpccli_wbint_Gid2Sid_recv(struct tevent_req *req,
1101 TALLOC_CTX *mem_ctx,
1102 NTSTATUS *result)
1104 struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data(
1105 req, struct rpccli_wbint_Gid2Sid_state);
1106 NTSTATUS status;
1108 if (tevent_req_is_nterror(req, &status)) {
1109 tevent_req_received(req);
1110 return status;
1113 /* Steal possbile out parameters to the callers context */
1114 talloc_steal(mem_ctx, state->out_mem_ctx);
1116 /* Return result */
1117 *result = state->orig.out.result;
1119 tevent_req_received(req);
1120 return NT_STATUS_OK;
1123 NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli,
1124 TALLOC_CTX *mem_ctx,
1125 const char *dom_name /* [in] [unique,charset(UTF8)] */,
1126 uint64_t gid /* [in] */,
1127 struct dom_sid *sid /* [out] [ref] */)
1129 struct wbint_Gid2Sid r;
1130 NTSTATUS status;
1132 /* In parameters */
1133 r.in.dom_name = dom_name;
1134 r.in.gid = gid;
1136 if (DEBUGLEVEL >= 10) {
1137 NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &r);
1140 status = cli->dispatch(cli,
1141 mem_ctx,
1142 &ndr_table_wbint,
1143 NDR_WBINT_GID2SID,
1144 &r);
1146 if (!NT_STATUS_IS_OK(status)) {
1147 return status;
1150 if (DEBUGLEVEL >= 10) {
1151 NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &r);
1154 if (NT_STATUS_IS_ERR(status)) {
1155 return status;
1158 /* Return variables */
1159 *sid = *r.out.sid;
1161 /* Return result */
1162 return r.out.result;
1165 struct rpccli_wbint_QueryUser_state {
1166 struct wbint_QueryUser orig;
1167 struct wbint_QueryUser tmp;
1168 TALLOC_CTX *out_mem_ctx;
1169 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1172 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
1174 struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
1175 struct tevent_context *ev,
1176 struct rpc_pipe_client *cli,
1177 struct dom_sid *_sid /* [in] [ref] */,
1178 struct wbint_userinfo *_info /* [out] [ref] */)
1180 struct tevent_req *req;
1181 struct rpccli_wbint_QueryUser_state *state;
1182 struct tevent_req *subreq;
1184 req = tevent_req_create(mem_ctx, &state,
1185 struct rpccli_wbint_QueryUser_state);
1186 if (req == NULL) {
1187 return NULL;
1189 state->out_mem_ctx = NULL;
1190 state->dispatch_recv = cli->dispatch_recv;
1192 /* In parameters */
1193 state->orig.in.sid = _sid;
1195 /* Out parameters */
1196 state->orig.out.info = _info;
1198 /* Result */
1199 ZERO_STRUCT(state->orig.out.result);
1201 if (DEBUGLEVEL >= 10) {
1202 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &state->orig);
1205 state->out_mem_ctx = talloc_named_const(state, 0,
1206 "rpccli_wbint_QueryUser_out_memory");
1207 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1208 return tevent_req_post(req, ev);
1211 /* make a temporary copy, that we pass to the dispatch function */
1212 state->tmp = state->orig;
1214 subreq = cli->dispatch_send(state, ev, cli,
1215 &ndr_table_wbint,
1216 NDR_WBINT_QUERYUSER,
1217 &state->tmp);
1218 if (tevent_req_nomem(subreq, req)) {
1219 return tevent_req_post(req, ev);
1221 tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
1222 return req;
1225 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
1227 struct tevent_req *req = tevent_req_callback_data(
1228 subreq, struct tevent_req);
1229 struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1230 req, struct rpccli_wbint_QueryUser_state);
1231 NTSTATUS status;
1232 TALLOC_CTX *mem_ctx;
1234 if (state->out_mem_ctx) {
1235 mem_ctx = state->out_mem_ctx;
1236 } else {
1237 mem_ctx = state;
1240 status = state->dispatch_recv(subreq, mem_ctx);
1241 TALLOC_FREE(subreq);
1242 if (!NT_STATUS_IS_OK(status)) {
1243 tevent_req_nterror(req, status);
1244 return;
1247 /* Copy out parameters */
1248 *state->orig.out.info = *state->tmp.out.info;
1250 /* Copy result */
1251 state->orig.out.result = state->tmp.out.result;
1253 /* Reset temporary structure */
1254 ZERO_STRUCT(state->tmp);
1256 if (DEBUGLEVEL >= 10) {
1257 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &state->orig);
1260 tevent_req_done(req);
1263 NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
1264 TALLOC_CTX *mem_ctx,
1265 NTSTATUS *result)
1267 struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1268 req, struct rpccli_wbint_QueryUser_state);
1269 NTSTATUS status;
1271 if (tevent_req_is_nterror(req, &status)) {
1272 tevent_req_received(req);
1273 return status;
1276 /* Steal possbile out parameters to the callers context */
1277 talloc_steal(mem_ctx, state->out_mem_ctx);
1279 /* Return result */
1280 *result = state->orig.out.result;
1282 tevent_req_received(req);
1283 return NT_STATUS_OK;
1286 NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli,
1287 TALLOC_CTX *mem_ctx,
1288 struct dom_sid *sid /* [in] [ref] */,
1289 struct wbint_userinfo *info /* [out] [ref] */)
1291 struct wbint_QueryUser r;
1292 NTSTATUS status;
1294 /* In parameters */
1295 r.in.sid = sid;
1297 if (DEBUGLEVEL >= 10) {
1298 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &r);
1301 status = cli->dispatch(cli,
1302 mem_ctx,
1303 &ndr_table_wbint,
1304 NDR_WBINT_QUERYUSER,
1305 &r);
1307 if (!NT_STATUS_IS_OK(status)) {
1308 return status;
1311 if (DEBUGLEVEL >= 10) {
1312 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &r);
1315 if (NT_STATUS_IS_ERR(status)) {
1316 return status;
1319 /* Return variables */
1320 *info = *r.out.info;
1322 /* Return result */
1323 return r.out.result;
1326 struct rpccli_wbint_LookupUserAliases_state {
1327 struct wbint_LookupUserAliases orig;
1328 struct wbint_LookupUserAliases tmp;
1329 TALLOC_CTX *out_mem_ctx;
1330 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1333 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
1335 struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
1336 struct tevent_context *ev,
1337 struct rpc_pipe_client *cli,
1338 struct wbint_SidArray *_sids /* [in] [ref] */,
1339 struct wbint_RidArray *_rids /* [out] [ref] */)
1341 struct tevent_req *req;
1342 struct rpccli_wbint_LookupUserAliases_state *state;
1343 struct tevent_req *subreq;
1345 req = tevent_req_create(mem_ctx, &state,
1346 struct rpccli_wbint_LookupUserAliases_state);
1347 if (req == NULL) {
1348 return NULL;
1350 state->out_mem_ctx = NULL;
1351 state->dispatch_recv = cli->dispatch_recv;
1353 /* In parameters */
1354 state->orig.in.sids = _sids;
1356 /* Out parameters */
1357 state->orig.out.rids = _rids;
1359 /* Result */
1360 ZERO_STRUCT(state->orig.out.result);
1362 if (DEBUGLEVEL >= 10) {
1363 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &state->orig);
1366 state->out_mem_ctx = talloc_named_const(state, 0,
1367 "rpccli_wbint_LookupUserAliases_out_memory");
1368 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1369 return tevent_req_post(req, ev);
1372 /* make a temporary copy, that we pass to the dispatch function */
1373 state->tmp = state->orig;
1375 subreq = cli->dispatch_send(state, ev, cli,
1376 &ndr_table_wbint,
1377 NDR_WBINT_LOOKUPUSERALIASES,
1378 &state->tmp);
1379 if (tevent_req_nomem(subreq, req)) {
1380 return tevent_req_post(req, ev);
1382 tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
1383 return req;
1386 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
1388 struct tevent_req *req = tevent_req_callback_data(
1389 subreq, struct tevent_req);
1390 struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1391 req, struct rpccli_wbint_LookupUserAliases_state);
1392 NTSTATUS status;
1393 TALLOC_CTX *mem_ctx;
1395 if (state->out_mem_ctx) {
1396 mem_ctx = state->out_mem_ctx;
1397 } else {
1398 mem_ctx = state;
1401 status = state->dispatch_recv(subreq, mem_ctx);
1402 TALLOC_FREE(subreq);
1403 if (!NT_STATUS_IS_OK(status)) {
1404 tevent_req_nterror(req, status);
1405 return;
1408 /* Copy out parameters */
1409 *state->orig.out.rids = *state->tmp.out.rids;
1411 /* Copy result */
1412 state->orig.out.result = state->tmp.out.result;
1414 /* Reset temporary structure */
1415 ZERO_STRUCT(state->tmp);
1417 if (DEBUGLEVEL >= 10) {
1418 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &state->orig);
1421 tevent_req_done(req);
1424 NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
1425 TALLOC_CTX *mem_ctx,
1426 NTSTATUS *result)
1428 struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1429 req, struct rpccli_wbint_LookupUserAliases_state);
1430 NTSTATUS status;
1432 if (tevent_req_is_nterror(req, &status)) {
1433 tevent_req_received(req);
1434 return status;
1437 /* Steal possbile out parameters to the callers context */
1438 talloc_steal(mem_ctx, state->out_mem_ctx);
1440 /* Return result */
1441 *result = state->orig.out.result;
1443 tevent_req_received(req);
1444 return NT_STATUS_OK;
1447 NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli,
1448 TALLOC_CTX *mem_ctx,
1449 struct wbint_SidArray *sids /* [in] [ref] */,
1450 struct wbint_RidArray *rids /* [out] [ref] */)
1452 struct wbint_LookupUserAliases r;
1453 NTSTATUS status;
1455 /* In parameters */
1456 r.in.sids = sids;
1458 if (DEBUGLEVEL >= 10) {
1459 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &r);
1462 status = cli->dispatch(cli,
1463 mem_ctx,
1464 &ndr_table_wbint,
1465 NDR_WBINT_LOOKUPUSERALIASES,
1466 &r);
1468 if (!NT_STATUS_IS_OK(status)) {
1469 return status;
1472 if (DEBUGLEVEL >= 10) {
1473 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &r);
1476 if (NT_STATUS_IS_ERR(status)) {
1477 return status;
1480 /* Return variables */
1481 *rids = *r.out.rids;
1483 /* Return result */
1484 return r.out.result;
1487 struct rpccli_wbint_LookupUserGroups_state {
1488 struct wbint_LookupUserGroups orig;
1489 struct wbint_LookupUserGroups tmp;
1490 TALLOC_CTX *out_mem_ctx;
1491 NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1494 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
1496 struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
1497 struct tevent_context *ev,
1498 struct rpc_pipe_client *cli,
1499 struct dom_sid *_sid /* [in] [ref] */,
1500 struct wbint_SidArray *_sids /* [out] [ref] */)
1502 struct tevent_req *req;
1503 struct rpccli_wbint_LookupUserGroups_state *state;
1504 struct tevent_req *subreq;
1506 req = tevent_req_create(mem_ctx, &state,
1507 struct rpccli_wbint_LookupUserGroups_state);
1508 if (req == NULL) {
1509 return NULL;
1511 state->out_mem_ctx = NULL;
1512 state->dispatch_recv = cli->dispatch_recv;
1514 /* In parameters */
1515 state->orig.in.sid = _sid;
1517 /* Out parameters */
1518 state->orig.out.sids = _sids;
1520 /* Result */
1521 ZERO_STRUCT(state->orig.out.result);
1523 if (DEBUGLEVEL >= 10) {
1524 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &state->orig);
1527 state->out_mem_ctx = talloc_named_const(state, 0,
1528 "rpccli_wbint_LookupUserGroups_out_memory");
1529 if (tevent_req_nomem(state->out_mem_ctx, req)) {
1530 return tevent_req_post(req, ev);
1533 /* make a temporary copy, that we pass to the dispatch function */
1534 state->tmp = state->orig;
1536 subreq = cli->dispatch_send(state, ev, cli,
1537 &ndr_table_wbint,
1538 NDR_WBINT_LOOKUPUSERGROUPS,
1539 &state->tmp);
1540 if (tevent_req_nomem(subreq, req)) {
1541 return tevent_req_post(req, ev);
1543 tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
1544 return req;
1547 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
1549 struct tevent_req *req = tevent_req_callback_data(
1550 subreq, struct tevent_req);
1551 struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1552 req, struct rpccli_wbint_LookupUserGroups_state);
1553 NTSTATUS status;
1554 TALLOC_CTX *mem_ctx;
1556 if (state->out_mem_ctx) {
1557 mem_ctx = state->out_mem_ctx;
1558 } else {
1559 mem_ctx = state;
1562 status = state->dispatch_recv(subreq, mem_ctx);
1563 TALLOC_FREE(subreq);
1564 if (!NT_STATUS_IS_OK(status)) {
1565 tevent_req_nterror(req, status);
1566 return;
1569 /* Copy out parameters */
1570 *state->orig.out.sids = *state->tmp.out.sids;
1572 /* Copy result */
1573 state->orig.out.result = state->tmp.out.result;
1575 /* Reset temporary structure */
1576 ZERO_STRUCT(state->tmp);
1578 if (DEBUGLEVEL >= 10) {
1579 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &state->orig);
1582 tevent_req_done(req);
1585 NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
1586 TALLOC_CTX *mem_ctx,
1587 NTSTATUS *result)
1589 struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1590 req, struct rpccli_wbint_LookupUserGroups_state);
1591 NTSTATUS status;
1593 if (tevent_req_is_nterror(req, &status)) {
1594 tevent_req_received(req);
1595 return status;
1598 /* Steal possbile out parameters to the callers context */
1599 talloc_steal(mem_ctx, state->out_mem_ctx);
1601 /* Return result */
1602 *result = state->orig.out.result;
1604 tevent_req_received(req);
1605 return NT_STATUS_OK;
1608 NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli,
1609 TALLOC_CTX *mem_ctx,
1610 struct dom_sid *sid /* [in] [ref] */,
1611 struct wbint_SidArray *sids /* [out] [ref] */)
1613 struct wbint_LookupUserGroups r;
1614 NTSTATUS status;
1616 /* In parameters */
1617 r.in.sid = sid;
1619 if (DEBUGLEVEL >= 10) {
1620 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &r);
1623 status = cli->dispatch(cli,
1624 mem_ctx,
1625 &ndr_table_wbint,
1626 NDR_WBINT_LOOKUPUSERGROUPS,
1627 &r);
1629 if (!NT_STATUS_IS_OK(status)) {
1630 return status;
1633 if (DEBUGLEVEL >= 10) {
1634 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &r);
1637 if (NT_STATUS_IS_ERR(status)) {
1638 return status;
1641 /* Return variables */
1642 *sids = *r.out.sids;
1644 /* Return result */
1645 return r.out.result;