3b683a73c3f65a87cd0d2931f43f7e41fc053aa4
[sfrench/samba-autobuild/.git] / source3 / librpc / gen_ndr / cli_wbint.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_wbint.h"
8
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);
14 };
15
16 static void rpccli_wbint_Ping_done(struct tevent_req *subreq);
17
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] */)
23 {
24         struct tevent_req *req;
25         struct rpccli_wbint_Ping_state *state;
26         struct tevent_req *subreq;
27
28         req = tevent_req_create(mem_ctx, &state,
29                                 struct rpccli_wbint_Ping_state);
30         if (req == NULL) {
31                 return NULL;
32         }
33         state->out_mem_ctx = NULL;
34         state->dispatch_recv = cli->dispatch_recv;
35
36         /* In parameters */
37         state->orig.in.in_data = _in_data;
38
39         /* Out parameters */
40         state->orig.out.out_data = _out_data;
41
42         if (DEBUGLEVEL >= 10) {
43                 NDR_PRINT_IN_DEBUG(wbint_Ping, &state->orig);
44         }
45
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);
50         }
51
52         /* make a temporary copy, that we pass to the dispatch function */
53         state->tmp = state->orig;
54
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);
61         }
62         tevent_req_set_callback(subreq, rpccli_wbint_Ping_done, req);
63         return req;
64 }
65
66 static void rpccli_wbint_Ping_done(struct tevent_req *subreq)
67 {
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;
74
75         if (state->out_mem_ctx) {
76                 mem_ctx = state->out_mem_ctx;
77         } else {
78                 mem_ctx = state;
79         }
80
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;
86         }
87
88         /* Copy out parameters */
89         *state->orig.out.out_data = *state->tmp.out.out_data;
90
91         /* Reset temporary structure */
92         ZERO_STRUCT(state->tmp);
93
94         if (DEBUGLEVEL >= 10) {
95                 NDR_PRINT_OUT_DEBUG(wbint_Ping, &state->orig);
96         }
97
98         tevent_req_done(req);
99 }
100
101 NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req,
102                                 TALLOC_CTX *mem_ctx)
103 {
104         struct rpccli_wbint_Ping_state *state = tevent_req_data(
105                 req, struct rpccli_wbint_Ping_state);
106         NTSTATUS status;
107
108         if (tevent_req_is_nterror(req, &status)) {
109                 tevent_req_received(req);
110                 return status;
111         }
112
113         /* Steal possbile out parameters to the callers context */
114         talloc_steal(mem_ctx, state->out_mem_ctx);
115
116         tevent_req_received(req);
117         return NT_STATUS_OK;
118 }
119
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] */)
124 {
125         struct wbint_Ping r;
126         NTSTATUS status;
127
128         /* In parameters */
129         r.in.in_data = in_data;
130
131         if (DEBUGLEVEL >= 10) {
132                 NDR_PRINT_IN_DEBUG(wbint_Ping, &r);
133         }
134
135         status = cli->dispatch(cli,
136                                 mem_ctx,
137                                 &ndr_table_wbint,
138                                 NDR_WBINT_PING,
139                                 &r);
140
141         if (!NT_STATUS_IS_OK(status)) {
142                 return status;
143         }
144
145         if (DEBUGLEVEL >= 10) {
146                 NDR_PRINT_OUT_DEBUG(wbint_Ping, &r);
147         }
148
149         if (NT_STATUS_IS_ERR(status)) {
150                 return status;
151         }
152
153         /* Return variables */
154         *out_data = *r.out.out_data;
155
156         /* Return result */
157         return NT_STATUS_OK;
158 }
159
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);
165 };
166
167 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq);
168
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)] */)
176 {
177         struct tevent_req *req;
178         struct rpccli_wbint_LookupSid_state *state;
179         struct tevent_req *subreq;
180
181         req = tevent_req_create(mem_ctx, &state,
182                                 struct rpccli_wbint_LookupSid_state);
183         if (req == NULL) {
184                 return NULL;
185         }
186         state->out_mem_ctx = NULL;
187         state->dispatch_recv = cli->dispatch_recv;
188
189         /* In parameters */
190         state->orig.in.sid = _sid;
191
192         /* Out parameters */
193         state->orig.out.type = _type;
194         state->orig.out.domain = _domain;
195         state->orig.out.name = _name;
196
197         /* Result */
198         ZERO_STRUCT(state->orig.out.result);
199
200         if (DEBUGLEVEL >= 10) {
201                 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &state->orig);
202         }
203
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);
208         }
209
210         /* make a temporary copy, that we pass to the dispatch function */
211         state->tmp = state->orig;
212
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);
219         }
220         tevent_req_set_callback(subreq, rpccli_wbint_LookupSid_done, req);
221         return req;
222 }
223
224 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq)
225 {
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;
232
233         if (state->out_mem_ctx) {
234                 mem_ctx = state->out_mem_ctx;
235         } else {
236                 mem_ctx = state;
237         }
238
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;
244         }
245
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;
250
251         /* Copy result */
252         state->orig.out.result = state->tmp.out.result;
253
254         /* Reset temporary structure */
255         ZERO_STRUCT(state->tmp);
256
257         if (DEBUGLEVEL >= 10) {
258                 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &state->orig);
259         }
260
261         tevent_req_done(req);
262 }
263
264 NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req,
265                                      TALLOC_CTX *mem_ctx,
266                                      NTSTATUS *result)
267 {
268         struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
269                 req, struct rpccli_wbint_LookupSid_state);
270         NTSTATUS status;
271
272         if (tevent_req_is_nterror(req, &status)) {
273                 tevent_req_received(req);
274                 return status;
275         }
276
277         /* Steal possbile out parameters to the callers context */
278         talloc_steal(mem_ctx, state->out_mem_ctx);
279
280         /* Return result */
281         *result = state->orig.out.result;
282
283         tevent_req_received(req);
284         return NT_STATUS_OK;
285 }
286
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)] */)
293 {
294         struct wbint_LookupSid r;
295         NTSTATUS status;
296
297         /* In parameters */
298         r.in.sid = sid;
299
300         if (DEBUGLEVEL >= 10) {
301                 NDR_PRINT_IN_DEBUG(wbint_LookupSid, &r);
302         }
303
304         status = cli->dispatch(cli,
305                                 mem_ctx,
306                                 &ndr_table_wbint,
307                                 NDR_WBINT_LOOKUPSID,
308                                 &r);
309
310         if (!NT_STATUS_IS_OK(status)) {
311                 return status;
312         }
313
314         if (DEBUGLEVEL >= 10) {
315                 NDR_PRINT_OUT_DEBUG(wbint_LookupSid, &r);
316         }
317
318         if (NT_STATUS_IS_ERR(status)) {
319                 return status;
320         }
321
322         /* Return variables */
323         *type = *r.out.type;
324         *domain = *r.out.domain;
325         *name = *r.out.name;
326
327         /* Return result */
328         return r.out.result;
329 }
330
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);
336 };
337
338 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq);
339
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] */)
348 {
349         struct tevent_req *req;
350         struct rpccli_wbint_LookupName_state *state;
351         struct tevent_req *subreq;
352
353         req = tevent_req_create(mem_ctx, &state,
354                                 struct rpccli_wbint_LookupName_state);
355         if (req == NULL) {
356                 return NULL;
357         }
358         state->out_mem_ctx = NULL;
359         state->dispatch_recv = cli->dispatch_recv;
360
361         /* In parameters */
362         state->orig.in.domain = _domain;
363         state->orig.in.name = _name;
364         state->orig.in.flags = _flags;
365
366         /* Out parameters */
367         state->orig.out.type = _type;
368         state->orig.out.sid = _sid;
369
370         /* Result */
371         ZERO_STRUCT(state->orig.out.result);
372
373         if (DEBUGLEVEL >= 10) {
374                 NDR_PRINT_IN_DEBUG(wbint_LookupName, &state->orig);
375         }
376
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);
381         }
382
383         /* make a temporary copy, that we pass to the dispatch function */
384         state->tmp = state->orig;
385
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);
392         }
393         tevent_req_set_callback(subreq, rpccli_wbint_LookupName_done, req);
394         return req;
395 }
396
397 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq)
398 {
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;
405
406         if (state->out_mem_ctx) {
407                 mem_ctx = state->out_mem_ctx;
408         } else {
409                 mem_ctx = state;
410         }
411
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;
417         }
418
419         /* Copy out parameters */
420         *state->orig.out.type = *state->tmp.out.type;
421         *state->orig.out.sid = *state->tmp.out.sid;
422
423         /* Copy result */
424         state->orig.out.result = state->tmp.out.result;
425
426         /* Reset temporary structure */
427         ZERO_STRUCT(state->tmp);
428
429         if (DEBUGLEVEL >= 10) {
430                 NDR_PRINT_OUT_DEBUG(wbint_LookupName, &state->orig);
431         }
432
433         tevent_req_done(req);
434 }
435
436 NTSTATUS rpccli_wbint_LookupName_recv(struct tevent_req *req,
437                                       TALLOC_CTX *mem_ctx,
438                                       NTSTATUS *result)
439 {
440         struct rpccli_wbint_LookupName_state *state = tevent_req_data(
441                 req, struct rpccli_wbint_LookupName_state);
442         NTSTATUS status;
443
444         if (tevent_req_is_nterror(req, &status)) {
445                 tevent_req_received(req);
446                 return status;
447         }
448
449         /* Steal possbile out parameters to the callers context */
450         talloc_steal(mem_ctx, state->out_mem_ctx);
451
452         /* Return result */
453         *result = state->orig.out.result;
454
455         tevent_req_received(req);
456         return NT_STATUS_OK;
457 }
458
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] */)
466 {
467         struct wbint_LookupName r;
468         NTSTATUS status;
469
470         /* In parameters */
471         r.in.domain = domain;
472         r.in.name = name;
473         r.in.flags = flags;
474
475         if (DEBUGLEVEL >= 10) {
476                 NDR_PRINT_IN_DEBUG(wbint_LookupName, &r);
477         }
478
479         status = cli->dispatch(cli,
480                                 mem_ctx,
481                                 &ndr_table_wbint,
482                                 NDR_WBINT_LOOKUPNAME,
483                                 &r);
484
485         if (!NT_STATUS_IS_OK(status)) {
486                 return status;
487         }
488
489         if (DEBUGLEVEL >= 10) {
490                 NDR_PRINT_OUT_DEBUG(wbint_LookupName, &r);
491         }
492
493         if (NT_STATUS_IS_ERR(status)) {
494                 return status;
495         }
496
497         /* Return variables */
498         *type = *r.out.type;
499         *sid = *r.out.sid;
500
501         /* Return result */
502         return r.out.result;
503 }
504
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);
510 };
511
512 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq);
513
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] */)
520 {
521         struct tevent_req *req;
522         struct rpccli_wbint_Sid2Uid_state *state;
523         struct tevent_req *subreq;
524
525         req = tevent_req_create(mem_ctx, &state,
526                                 struct rpccli_wbint_Sid2Uid_state);
527         if (req == NULL) {
528                 return NULL;
529         }
530         state->out_mem_ctx = NULL;
531         state->dispatch_recv = cli->dispatch_recv;
532
533         /* In parameters */
534         state->orig.in.dom_name = _dom_name;
535         state->orig.in.sid = _sid;
536
537         /* Out parameters */
538         state->orig.out.uid = _uid;
539
540         /* Result */
541         ZERO_STRUCT(state->orig.out.result);
542
543         if (DEBUGLEVEL >= 10) {
544                 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &state->orig);
545         }
546
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);
551         }
552
553         /* make a temporary copy, that we pass to the dispatch function */
554         state->tmp = state->orig;
555
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);
562         }
563         tevent_req_set_callback(subreq, rpccli_wbint_Sid2Uid_done, req);
564         return req;
565 }
566
567 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq)
568 {
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;
575
576         if (state->out_mem_ctx) {
577                 mem_ctx = state->out_mem_ctx;
578         } else {
579                 mem_ctx = state;
580         }
581
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;
587         }
588
589         /* Copy out parameters */
590         *state->orig.out.uid = *state->tmp.out.uid;
591
592         /* Copy result */
593         state->orig.out.result = state->tmp.out.result;
594
595         /* Reset temporary structure */
596         ZERO_STRUCT(state->tmp);
597
598         if (DEBUGLEVEL >= 10) {
599                 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &state->orig);
600         }
601
602         tevent_req_done(req);
603 }
604
605 NTSTATUS rpccli_wbint_Sid2Uid_recv(struct tevent_req *req,
606                                    TALLOC_CTX *mem_ctx,
607                                    NTSTATUS *result)
608 {
609         struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data(
610                 req, struct rpccli_wbint_Sid2Uid_state);
611         NTSTATUS status;
612
613         if (tevent_req_is_nterror(req, &status)) {
614                 tevent_req_received(req);
615                 return status;
616         }
617
618         /* Steal possbile out parameters to the callers context */
619         talloc_steal(mem_ctx, state->out_mem_ctx);
620
621         /* Return result */
622         *result = state->orig.out.result;
623
624         tevent_req_received(req);
625         return NT_STATUS_OK;
626 }
627
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] */)
633 {
634         struct wbint_Sid2Uid r;
635         NTSTATUS status;
636
637         /* In parameters */
638         r.in.dom_name = dom_name;
639         r.in.sid = sid;
640
641         if (DEBUGLEVEL >= 10) {
642                 NDR_PRINT_IN_DEBUG(wbint_Sid2Uid, &r);
643         }
644
645         status = cli->dispatch(cli,
646                                 mem_ctx,
647                                 &ndr_table_wbint,
648                                 NDR_WBINT_SID2UID,
649                                 &r);
650
651         if (!NT_STATUS_IS_OK(status)) {
652                 return status;
653         }
654
655         if (DEBUGLEVEL >= 10) {
656                 NDR_PRINT_OUT_DEBUG(wbint_Sid2Uid, &r);
657         }
658
659         if (NT_STATUS_IS_ERR(status)) {
660                 return status;
661         }
662
663         /* Return variables */
664         *uid = *r.out.uid;
665
666         /* Return result */
667         return r.out.result;
668 }
669
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);
675 };
676
677 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq);
678
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] */)
685 {
686         struct tevent_req *req;
687         struct rpccli_wbint_Sid2Gid_state *state;
688         struct tevent_req *subreq;
689
690         req = tevent_req_create(mem_ctx, &state,
691                                 struct rpccli_wbint_Sid2Gid_state);
692         if (req == NULL) {
693                 return NULL;
694         }
695         state->out_mem_ctx = NULL;
696         state->dispatch_recv = cli->dispatch_recv;
697
698         /* In parameters */
699         state->orig.in.dom_name = _dom_name;
700         state->orig.in.sid = _sid;
701
702         /* Out parameters */
703         state->orig.out.gid = _gid;
704
705         /* Result */
706         ZERO_STRUCT(state->orig.out.result);
707
708         if (DEBUGLEVEL >= 10) {
709                 NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &state->orig);
710         }
711
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);
716         }
717
718         /* make a temporary copy, that we pass to the dispatch function */
719         state->tmp = state->orig;
720
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);
727         }
728         tevent_req_set_callback(subreq, rpccli_wbint_Sid2Gid_done, req);
729         return req;
730 }
731
732 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq)
733 {
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;
740
741         if (state->out_mem_ctx) {
742                 mem_ctx = state->out_mem_ctx;
743         } else {
744                 mem_ctx = state;
745         }
746
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;
752         }
753
754         /* Copy out parameters */
755         *state->orig.out.gid = *state->tmp.out.gid;
756
757         /* Copy result */
758         state->orig.out.result = state->tmp.out.result;
759
760         /* Reset temporary structure */
761         ZERO_STRUCT(state->tmp);
762
763         if (DEBUGLEVEL >= 10) {
764                 NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &state->orig);
765         }
766
767         tevent_req_done(req);
768 }
769
770 NTSTATUS rpccli_wbint_Sid2Gid_recv(struct tevent_req *req,
771                                    TALLOC_CTX *mem_ctx,
772                                    NTSTATUS *result)
773 {
774         struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data(
775                 req, struct rpccli_wbint_Sid2Gid_state);
776         NTSTATUS status;
777
778         if (tevent_req_is_nterror(req, &status)) {
779                 tevent_req_received(req);
780                 return status;
781         }
782
783         /* Steal possbile out parameters to the callers context */
784         talloc_steal(mem_ctx, state->out_mem_ctx);
785
786         /* Return result */
787         *result = state->orig.out.result;
788
789         tevent_req_received(req);
790         return NT_STATUS_OK;
791 }
792
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] */)
798 {
799         struct wbint_Sid2Gid r;
800         NTSTATUS status;
801
802         /* In parameters */
803         r.in.dom_name = dom_name;
804         r.in.sid = sid;
805
806         if (DEBUGLEVEL >= 10) {
807                 NDR_PRINT_IN_DEBUG(wbint_Sid2Gid, &r);
808         }
809
810         status = cli->dispatch(cli,
811                                 mem_ctx,
812                                 &ndr_table_wbint,
813                                 NDR_WBINT_SID2GID,
814                                 &r);
815
816         if (!NT_STATUS_IS_OK(status)) {
817                 return status;
818         }
819
820         if (DEBUGLEVEL >= 10) {
821                 NDR_PRINT_OUT_DEBUG(wbint_Sid2Gid, &r);
822         }
823
824         if (NT_STATUS_IS_ERR(status)) {
825                 return status;
826         }
827
828         /* Return variables */
829         *gid = *r.out.gid;
830
831         /* Return result */
832         return r.out.result;
833 }
834
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);
840 };
841
842 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq);
843
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] */)
850 {
851         struct tevent_req *req;
852         struct rpccli_wbint_Uid2Sid_state *state;
853         struct tevent_req *subreq;
854
855         req = tevent_req_create(mem_ctx, &state,
856                                 struct rpccli_wbint_Uid2Sid_state);
857         if (req == NULL) {
858                 return NULL;
859         }
860         state->out_mem_ctx = NULL;
861         state->dispatch_recv = cli->dispatch_recv;
862
863         /* In parameters */
864         state->orig.in.dom_name = _dom_name;
865         state->orig.in.uid = _uid;
866
867         /* Out parameters */
868         state->orig.out.sid = _sid;
869
870         /* Result */
871         ZERO_STRUCT(state->orig.out.result);
872
873         if (DEBUGLEVEL >= 10) {
874                 NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &state->orig);
875         }
876
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);
881         }
882
883         /* make a temporary copy, that we pass to the dispatch function */
884         state->tmp = state->orig;
885
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);
892         }
893         tevent_req_set_callback(subreq, rpccli_wbint_Uid2Sid_done, req);
894         return req;
895 }
896
897 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq)
898 {
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;
905
906         if (state->out_mem_ctx) {
907                 mem_ctx = state->out_mem_ctx;
908         } else {
909                 mem_ctx = state;
910         }
911
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;
917         }
918
919         /* Copy out parameters */
920         *state->orig.out.sid = *state->tmp.out.sid;
921
922         /* Copy result */
923         state->orig.out.result = state->tmp.out.result;
924
925         /* Reset temporary structure */
926         ZERO_STRUCT(state->tmp);
927
928         if (DEBUGLEVEL >= 10) {
929                 NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &state->orig);
930         }
931
932         tevent_req_done(req);
933 }
934
935 NTSTATUS rpccli_wbint_Uid2Sid_recv(struct tevent_req *req,
936                                    TALLOC_CTX *mem_ctx,
937                                    NTSTATUS *result)
938 {
939         struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data(
940                 req, struct rpccli_wbint_Uid2Sid_state);
941         NTSTATUS status;
942
943         if (tevent_req_is_nterror(req, &status)) {
944                 tevent_req_received(req);
945                 return status;
946         }
947
948         /* Steal possbile out parameters to the callers context */
949         talloc_steal(mem_ctx, state->out_mem_ctx);
950
951         /* Return result */
952         *result = state->orig.out.result;
953
954         tevent_req_received(req);
955         return NT_STATUS_OK;
956 }
957
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] */)
963 {
964         struct wbint_Uid2Sid r;
965         NTSTATUS status;
966
967         /* In parameters */
968         r.in.dom_name = dom_name;
969         r.in.uid = uid;
970
971         if (DEBUGLEVEL >= 10) {
972                 NDR_PRINT_IN_DEBUG(wbint_Uid2Sid, &r);
973         }
974
975         status = cli->dispatch(cli,
976                                 mem_ctx,
977                                 &ndr_table_wbint,
978                                 NDR_WBINT_UID2SID,
979                                 &r);
980
981         if (!NT_STATUS_IS_OK(status)) {
982                 return status;
983         }
984
985         if (DEBUGLEVEL >= 10) {
986                 NDR_PRINT_OUT_DEBUG(wbint_Uid2Sid, &r);
987         }
988
989         if (NT_STATUS_IS_ERR(status)) {
990                 return status;
991         }
992
993         /* Return variables */
994         *sid = *r.out.sid;
995
996         /* Return result */
997         return r.out.result;
998 }
999
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);
1005 };
1006
1007 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq);
1008
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] */)
1015 {
1016         struct tevent_req *req;
1017         struct rpccli_wbint_Gid2Sid_state *state;
1018         struct tevent_req *subreq;
1019
1020         req = tevent_req_create(mem_ctx, &state,
1021                                 struct rpccli_wbint_Gid2Sid_state);
1022         if (req == NULL) {
1023                 return NULL;
1024         }
1025         state->out_mem_ctx = NULL;
1026         state->dispatch_recv = cli->dispatch_recv;
1027
1028         /* In parameters */
1029         state->orig.in.dom_name = _dom_name;
1030         state->orig.in.gid = _gid;
1031
1032         /* Out parameters */
1033         state->orig.out.sid = _sid;
1034
1035         /* Result */
1036         ZERO_STRUCT(state->orig.out.result);
1037
1038         if (DEBUGLEVEL >= 10) {
1039                 NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &state->orig);
1040         }
1041
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);
1046         }
1047
1048         /* make a temporary copy, that we pass to the dispatch function */
1049         state->tmp = state->orig;
1050
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);
1057         }
1058         tevent_req_set_callback(subreq, rpccli_wbint_Gid2Sid_done, req);
1059         return req;
1060 }
1061
1062 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq)
1063 {
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;
1070
1071         if (state->out_mem_ctx) {
1072                 mem_ctx = state->out_mem_ctx;
1073         } else {
1074                 mem_ctx = state;
1075         }
1076
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;
1082         }
1083
1084         /* Copy out parameters */
1085         *state->orig.out.sid = *state->tmp.out.sid;
1086
1087         /* Copy result */
1088         state->orig.out.result = state->tmp.out.result;
1089
1090         /* Reset temporary structure */
1091         ZERO_STRUCT(state->tmp);
1092
1093         if (DEBUGLEVEL >= 10) {
1094                 NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &state->orig);
1095         }
1096
1097         tevent_req_done(req);
1098 }
1099
1100 NTSTATUS rpccli_wbint_Gid2Sid_recv(struct tevent_req *req,
1101                                    TALLOC_CTX *mem_ctx,
1102                                    NTSTATUS *result)
1103 {
1104         struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data(
1105                 req, struct rpccli_wbint_Gid2Sid_state);
1106         NTSTATUS status;
1107
1108         if (tevent_req_is_nterror(req, &status)) {
1109                 tevent_req_received(req);
1110                 return status;
1111         }
1112
1113         /* Steal possbile out parameters to the callers context */
1114         talloc_steal(mem_ctx, state->out_mem_ctx);
1115
1116         /* Return result */
1117         *result = state->orig.out.result;
1118
1119         tevent_req_received(req);
1120         return NT_STATUS_OK;
1121 }
1122
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] */)
1128 {
1129         struct wbint_Gid2Sid r;
1130         NTSTATUS status;
1131
1132         /* In parameters */
1133         r.in.dom_name = dom_name;
1134         r.in.gid = gid;
1135
1136         if (DEBUGLEVEL >= 10) {
1137                 NDR_PRINT_IN_DEBUG(wbint_Gid2Sid, &r);
1138         }
1139
1140         status = cli->dispatch(cli,
1141                                 mem_ctx,
1142                                 &ndr_table_wbint,
1143                                 NDR_WBINT_GID2SID,
1144                                 &r);
1145
1146         if (!NT_STATUS_IS_OK(status)) {
1147                 return status;
1148         }
1149
1150         if (DEBUGLEVEL >= 10) {
1151                 NDR_PRINT_OUT_DEBUG(wbint_Gid2Sid, &r);
1152         }
1153
1154         if (NT_STATUS_IS_ERR(status)) {
1155                 return status;
1156         }
1157
1158         /* Return variables */
1159         *sid = *r.out.sid;
1160
1161         /* Return result */
1162         return r.out.result;
1163 }
1164
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);
1170 };
1171
1172 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
1173
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] */)
1179 {
1180         struct tevent_req *req;
1181         struct rpccli_wbint_QueryUser_state *state;
1182         struct tevent_req *subreq;
1183
1184         req = tevent_req_create(mem_ctx, &state,
1185                                 struct rpccli_wbint_QueryUser_state);
1186         if (req == NULL) {
1187                 return NULL;
1188         }
1189         state->out_mem_ctx = NULL;
1190         state->dispatch_recv = cli->dispatch_recv;
1191
1192         /* In parameters */
1193         state->orig.in.sid = _sid;
1194
1195         /* Out parameters */
1196         state->orig.out.info = _info;
1197
1198         /* Result */
1199         ZERO_STRUCT(state->orig.out.result);
1200
1201         if (DEBUGLEVEL >= 10) {
1202                 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &state->orig);
1203         }
1204
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);
1209         }
1210
1211         /* make a temporary copy, that we pass to the dispatch function */
1212         state->tmp = state->orig;
1213
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);
1220         }
1221         tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
1222         return req;
1223 }
1224
1225 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
1226 {
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;
1233
1234         if (state->out_mem_ctx) {
1235                 mem_ctx = state->out_mem_ctx;
1236         } else {
1237                 mem_ctx = state;
1238         }
1239
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;
1245         }
1246
1247         /* Copy out parameters */
1248         *state->orig.out.info = *state->tmp.out.info;
1249
1250         /* Copy result */
1251         state->orig.out.result = state->tmp.out.result;
1252
1253         /* Reset temporary structure */
1254         ZERO_STRUCT(state->tmp);
1255
1256         if (DEBUGLEVEL >= 10) {
1257                 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &state->orig);
1258         }
1259
1260         tevent_req_done(req);
1261 }
1262
1263 NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
1264                                      TALLOC_CTX *mem_ctx,
1265                                      NTSTATUS *result)
1266 {
1267         struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1268                 req, struct rpccli_wbint_QueryUser_state);
1269         NTSTATUS status;
1270
1271         if (tevent_req_is_nterror(req, &status)) {
1272                 tevent_req_received(req);
1273                 return status;
1274         }
1275
1276         /* Steal possbile out parameters to the callers context */
1277         talloc_steal(mem_ctx, state->out_mem_ctx);
1278
1279         /* Return result */
1280         *result = state->orig.out.result;
1281
1282         tevent_req_received(req);
1283         return NT_STATUS_OK;
1284 }
1285
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] */)
1290 {
1291         struct wbint_QueryUser r;
1292         NTSTATUS status;
1293
1294         /* In parameters */
1295         r.in.sid = sid;
1296
1297         if (DEBUGLEVEL >= 10) {
1298                 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &r);
1299         }
1300
1301         status = cli->dispatch(cli,
1302                                 mem_ctx,
1303                                 &ndr_table_wbint,
1304                                 NDR_WBINT_QUERYUSER,
1305                                 &r);
1306
1307         if (!NT_STATUS_IS_OK(status)) {
1308                 return status;
1309         }
1310
1311         if (DEBUGLEVEL >= 10) {
1312                 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &r);
1313         }
1314
1315         if (NT_STATUS_IS_ERR(status)) {
1316                 return status;
1317         }
1318
1319         /* Return variables */
1320         *info = *r.out.info;
1321
1322         /* Return result */
1323         return r.out.result;
1324 }
1325
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);
1331 };
1332
1333 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
1334
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] */)
1340 {
1341         struct tevent_req *req;
1342         struct rpccli_wbint_LookupUserAliases_state *state;
1343         struct tevent_req *subreq;
1344
1345         req = tevent_req_create(mem_ctx, &state,
1346                                 struct rpccli_wbint_LookupUserAliases_state);
1347         if (req == NULL) {
1348                 return NULL;
1349         }
1350         state->out_mem_ctx = NULL;
1351         state->dispatch_recv = cli->dispatch_recv;
1352
1353         /* In parameters */
1354         state->orig.in.sids = _sids;
1355
1356         /* Out parameters */
1357         state->orig.out.rids = _rids;
1358
1359         /* Result */
1360         ZERO_STRUCT(state->orig.out.result);
1361
1362         if (DEBUGLEVEL >= 10) {
1363                 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &state->orig);
1364         }
1365
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);
1370         }
1371
1372         /* make a temporary copy, that we pass to the dispatch function */
1373         state->tmp = state->orig;
1374
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);
1381         }
1382         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
1383         return req;
1384 }
1385
1386 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
1387 {
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;
1394
1395         if (state->out_mem_ctx) {
1396                 mem_ctx = state->out_mem_ctx;
1397         } else {
1398                 mem_ctx = state;
1399         }
1400
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;
1406         }
1407
1408         /* Copy out parameters */
1409         *state->orig.out.rids = *state->tmp.out.rids;
1410
1411         /* Copy result */
1412         state->orig.out.result = state->tmp.out.result;
1413
1414         /* Reset temporary structure */
1415         ZERO_STRUCT(state->tmp);
1416
1417         if (DEBUGLEVEL >= 10) {
1418                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &state->orig);
1419         }
1420
1421         tevent_req_done(req);
1422 }
1423
1424 NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
1425                                              TALLOC_CTX *mem_ctx,
1426                                              NTSTATUS *result)
1427 {
1428         struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1429                 req, struct rpccli_wbint_LookupUserAliases_state);
1430         NTSTATUS status;
1431
1432         if (tevent_req_is_nterror(req, &status)) {
1433                 tevent_req_received(req);
1434                 return status;
1435         }
1436
1437         /* Steal possbile out parameters to the callers context */
1438         talloc_steal(mem_ctx, state->out_mem_ctx);
1439
1440         /* Return result */
1441         *result = state->orig.out.result;
1442
1443         tevent_req_received(req);
1444         return NT_STATUS_OK;
1445 }
1446
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] */)
1451 {
1452         struct wbint_LookupUserAliases r;
1453         NTSTATUS status;
1454
1455         /* In parameters */
1456         r.in.sids = sids;
1457
1458         if (DEBUGLEVEL >= 10) {
1459                 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &r);
1460         }
1461
1462         status = cli->dispatch(cli,
1463                                 mem_ctx,
1464                                 &ndr_table_wbint,
1465                                 NDR_WBINT_LOOKUPUSERALIASES,
1466                                 &r);
1467
1468         if (!NT_STATUS_IS_OK(status)) {
1469                 return status;
1470         }
1471
1472         if (DEBUGLEVEL >= 10) {
1473                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &r);
1474         }
1475
1476         if (NT_STATUS_IS_ERR(status)) {
1477                 return status;
1478         }
1479
1480         /* Return variables */
1481         *rids = *r.out.rids;
1482
1483         /* Return result */
1484         return r.out.result;
1485 }
1486
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);
1492 };
1493
1494 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
1495
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] */)
1501 {
1502         struct tevent_req *req;
1503         struct rpccli_wbint_LookupUserGroups_state *state;
1504         struct tevent_req *subreq;
1505
1506         req = tevent_req_create(mem_ctx, &state,
1507                                 struct rpccli_wbint_LookupUserGroups_state);
1508         if (req == NULL) {
1509                 return NULL;
1510         }
1511         state->out_mem_ctx = NULL;
1512         state->dispatch_recv = cli->dispatch_recv;
1513
1514         /* In parameters */
1515         state->orig.in.sid = _sid;
1516
1517         /* Out parameters */
1518         state->orig.out.sids = _sids;
1519
1520         /* Result */
1521         ZERO_STRUCT(state->orig.out.result);
1522
1523         if (DEBUGLEVEL >= 10) {
1524                 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &state->orig);
1525         }
1526
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);
1531         }
1532
1533         /* make a temporary copy, that we pass to the dispatch function */
1534         state->tmp = state->orig;
1535
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);
1542         }
1543         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
1544         return req;
1545 }
1546
1547 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
1548 {
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;
1555
1556         if (state->out_mem_ctx) {
1557                 mem_ctx = state->out_mem_ctx;
1558         } else {
1559                 mem_ctx = state;
1560         }
1561
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;
1567         }
1568
1569         /* Copy out parameters */
1570         *state->orig.out.sids = *state->tmp.out.sids;
1571
1572         /* Copy result */
1573         state->orig.out.result = state->tmp.out.result;
1574
1575         /* Reset temporary structure */
1576         ZERO_STRUCT(state->tmp);
1577
1578         if (DEBUGLEVEL >= 10) {
1579                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &state->orig);
1580         }
1581
1582         tevent_req_done(req);
1583 }
1584
1585 NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
1586                                             TALLOC_CTX *mem_ctx,
1587                                             NTSTATUS *result)
1588 {
1589         struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1590                 req, struct rpccli_wbint_LookupUserGroups_state);
1591         NTSTATUS status;
1592
1593         if (tevent_req_is_nterror(req, &status)) {
1594                 tevent_req_received(req);
1595                 return status;
1596         }
1597
1598         /* Steal possbile out parameters to the callers context */
1599         talloc_steal(mem_ctx, state->out_mem_ctx);
1600
1601         /* Return result */
1602         *result = state->orig.out.result;
1603
1604         tevent_req_received(req);
1605         return NT_STATUS_OK;
1606 }
1607
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] */)
1612 {
1613         struct wbint_LookupUserGroups r;
1614         NTSTATUS status;
1615
1616         /* In parameters */
1617         r.in.sid = sid;
1618
1619         if (DEBUGLEVEL >= 10) {
1620                 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &r);
1621         }
1622
1623         status = cli->dispatch(cli,
1624                                 mem_ctx,
1625                                 &ndr_table_wbint,
1626                                 NDR_WBINT_LOOKUPUSERGROUPS,
1627                                 &r);
1628
1629         if (!NT_STATUS_IS_OK(status)) {
1630                 return status;
1631         }
1632
1633         if (DEBUGLEVEL >= 10) {
1634                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &r);
1635         }
1636
1637         if (NT_STATUS_IS_ERR(status)) {
1638                 return status;
1639         }
1640
1641         /* Return variables */
1642         *sids = *r.out.sids;
1643
1644         /* Return result */
1645         return r.out.result;
1646 }
1647
1648 struct rpccli_wbint_QuerySequenceNumber_state {
1649         struct wbint_QuerySequenceNumber orig;
1650         struct wbint_QuerySequenceNumber tmp;
1651         TALLOC_CTX *out_mem_ctx;
1652         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1653 };
1654
1655 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
1656
1657 struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
1658                                                          struct tevent_context *ev,
1659                                                          struct rpc_pipe_client *cli,
1660                                                          uint32_t *_sequence /* [out] [ref] */)
1661 {
1662         struct tevent_req *req;
1663         struct rpccli_wbint_QuerySequenceNumber_state *state;
1664         struct tevent_req *subreq;
1665
1666         req = tevent_req_create(mem_ctx, &state,
1667                                 struct rpccli_wbint_QuerySequenceNumber_state);
1668         if (req == NULL) {
1669                 return NULL;
1670         }
1671         state->out_mem_ctx = NULL;
1672         state->dispatch_recv = cli->dispatch_recv;
1673
1674         /* In parameters */
1675
1676         /* Out parameters */
1677         state->orig.out.sequence = _sequence;
1678
1679         /* Result */
1680         ZERO_STRUCT(state->orig.out.result);
1681
1682         if (DEBUGLEVEL >= 10) {
1683                 NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &state->orig);
1684         }
1685
1686         state->out_mem_ctx = talloc_named_const(state, 0,
1687                              "rpccli_wbint_QuerySequenceNumber_out_memory");
1688         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1689                 return tevent_req_post(req, ev);
1690         }
1691
1692         /* make a temporary copy, that we pass to the dispatch function */
1693         state->tmp = state->orig;
1694
1695         subreq = cli->dispatch_send(state, ev, cli,
1696                                     &ndr_table_wbint,
1697                                     NDR_WBINT_QUERYSEQUENCENUMBER,
1698                                     &state->tmp);
1699         if (tevent_req_nomem(subreq, req)) {
1700                 return tevent_req_post(req, ev);
1701         }
1702         tevent_req_set_callback(subreq, rpccli_wbint_QuerySequenceNumber_done, req);
1703         return req;
1704 }
1705
1706 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
1707 {
1708         struct tevent_req *req = tevent_req_callback_data(
1709                 subreq, struct tevent_req);
1710         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
1711                 req, struct rpccli_wbint_QuerySequenceNumber_state);
1712         NTSTATUS status;
1713         TALLOC_CTX *mem_ctx;
1714
1715         if (state->out_mem_ctx) {
1716                 mem_ctx = state->out_mem_ctx;
1717         } else {
1718                 mem_ctx = state;
1719         }
1720
1721         status = state->dispatch_recv(subreq, mem_ctx);
1722         TALLOC_FREE(subreq);
1723         if (!NT_STATUS_IS_OK(status)) {
1724                 tevent_req_nterror(req, status);
1725                 return;
1726         }
1727
1728         /* Copy out parameters */
1729         *state->orig.out.sequence = *state->tmp.out.sequence;
1730
1731         /* Copy result */
1732         state->orig.out.result = state->tmp.out.result;
1733
1734         /* Reset temporary structure */
1735         ZERO_STRUCT(state->tmp);
1736
1737         if (DEBUGLEVEL >= 10) {
1738                 NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &state->orig);
1739         }
1740
1741         tevent_req_done(req);
1742 }
1743
1744 NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
1745                                                TALLOC_CTX *mem_ctx,
1746                                                NTSTATUS *result)
1747 {
1748         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
1749                 req, struct rpccli_wbint_QuerySequenceNumber_state);
1750         NTSTATUS status;
1751
1752         if (tevent_req_is_nterror(req, &status)) {
1753                 tevent_req_received(req);
1754                 return status;
1755         }
1756
1757         /* Steal possbile out parameters to the callers context */
1758         talloc_steal(mem_ctx, state->out_mem_ctx);
1759
1760         /* Return result */
1761         *result = state->orig.out.result;
1762
1763         tevent_req_received(req);
1764         return NT_STATUS_OK;
1765 }
1766
1767 NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
1768                                           TALLOC_CTX *mem_ctx,
1769                                           uint32_t *sequence /* [out] [ref] */)
1770 {
1771         struct wbint_QuerySequenceNumber r;
1772         NTSTATUS status;
1773
1774         /* In parameters */
1775
1776         if (DEBUGLEVEL >= 10) {
1777                 NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &r);
1778         }
1779
1780         status = cli->dispatch(cli,
1781                                 mem_ctx,
1782                                 &ndr_table_wbint,
1783                                 NDR_WBINT_QUERYSEQUENCENUMBER,
1784                                 &r);
1785
1786         if (!NT_STATUS_IS_OK(status)) {
1787                 return status;
1788         }
1789
1790         if (DEBUGLEVEL >= 10) {
1791                 NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &r);
1792         }
1793
1794         if (NT_STATUS_IS_ERR(status)) {
1795                 return status;
1796         }
1797
1798         /* Return variables */
1799         *sequence = *r.out.sequence;
1800
1801         /* Return result */
1802         return r.out.result;
1803 }
1804
1805 struct rpccli_wbint_LookupGroupMembers_state {
1806         struct wbint_LookupGroupMembers orig;
1807         struct wbint_LookupGroupMembers tmp;
1808         TALLOC_CTX *out_mem_ctx;
1809         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1810 };
1811
1812 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
1813
1814 struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
1815                                                         struct tevent_context *ev,
1816                                                         struct rpc_pipe_client *cli,
1817                                                         struct dom_sid *_sid /* [in] [ref] */,
1818                                                         enum lsa_SidType _type /* [in]  */,
1819                                                         struct wbint_Principals *_members /* [out] [ref] */)
1820 {
1821         struct tevent_req *req;
1822         struct rpccli_wbint_LookupGroupMembers_state *state;
1823         struct tevent_req *subreq;
1824
1825         req = tevent_req_create(mem_ctx, &state,
1826                                 struct rpccli_wbint_LookupGroupMembers_state);
1827         if (req == NULL) {
1828                 return NULL;
1829         }
1830         state->out_mem_ctx = NULL;
1831         state->dispatch_recv = cli->dispatch_recv;
1832
1833         /* In parameters */
1834         state->orig.in.sid = _sid;
1835         state->orig.in.type = _type;
1836
1837         /* Out parameters */
1838         state->orig.out.members = _members;
1839
1840         /* Result */
1841         ZERO_STRUCT(state->orig.out.result);
1842
1843         if (DEBUGLEVEL >= 10) {
1844                 NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &state->orig);
1845         }
1846
1847         state->out_mem_ctx = talloc_named_const(state, 0,
1848                              "rpccli_wbint_LookupGroupMembers_out_memory");
1849         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1850                 return tevent_req_post(req, ev);
1851         }
1852
1853         /* make a temporary copy, that we pass to the dispatch function */
1854         state->tmp = state->orig;
1855
1856         subreq = cli->dispatch_send(state, ev, cli,
1857                                     &ndr_table_wbint,
1858                                     NDR_WBINT_LOOKUPGROUPMEMBERS,
1859                                     &state->tmp);
1860         if (tevent_req_nomem(subreq, req)) {
1861                 return tevent_req_post(req, ev);
1862         }
1863         tevent_req_set_callback(subreq, rpccli_wbint_LookupGroupMembers_done, req);
1864         return req;
1865 }
1866
1867 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
1868 {
1869         struct tevent_req *req = tevent_req_callback_data(
1870                 subreq, struct tevent_req);
1871         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
1872                 req, struct rpccli_wbint_LookupGroupMembers_state);
1873         NTSTATUS status;
1874         TALLOC_CTX *mem_ctx;
1875
1876         if (state->out_mem_ctx) {
1877                 mem_ctx = state->out_mem_ctx;
1878         } else {
1879                 mem_ctx = state;
1880         }
1881
1882         status = state->dispatch_recv(subreq, mem_ctx);
1883         TALLOC_FREE(subreq);
1884         if (!NT_STATUS_IS_OK(status)) {
1885                 tevent_req_nterror(req, status);
1886                 return;
1887         }
1888
1889         /* Copy out parameters */
1890         *state->orig.out.members = *state->tmp.out.members;
1891
1892         /* Copy result */
1893         state->orig.out.result = state->tmp.out.result;
1894
1895         /* Reset temporary structure */
1896         ZERO_STRUCT(state->tmp);
1897
1898         if (DEBUGLEVEL >= 10) {
1899                 NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, &state->orig);
1900         }
1901
1902         tevent_req_done(req);
1903 }
1904
1905 NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
1906                                               TALLOC_CTX *mem_ctx,
1907                                               NTSTATUS *result)
1908 {
1909         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
1910                 req, struct rpccli_wbint_LookupGroupMembers_state);
1911         NTSTATUS status;
1912
1913         if (tevent_req_is_nterror(req, &status)) {
1914                 tevent_req_received(req);
1915                 return status;
1916         }
1917
1918         /* Steal possbile out parameters to the callers context */
1919         talloc_steal(mem_ctx, state->out_mem_ctx);
1920
1921         /* Return result */
1922         *result = state->orig.out.result;
1923
1924         tevent_req_received(req);
1925         return NT_STATUS_OK;
1926 }
1927
1928 NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
1929                                          TALLOC_CTX *mem_ctx,
1930                                          struct dom_sid *sid /* [in] [ref] */,
1931                                          enum lsa_SidType type /* [in]  */,
1932                                          struct wbint_Principals *members /* [out] [ref] */)
1933 {
1934         struct wbint_LookupGroupMembers r;
1935         NTSTATUS status;
1936
1937         /* In parameters */
1938         r.in.sid = sid;
1939         r.in.type = type;
1940
1941         if (DEBUGLEVEL >= 10) {
1942                 NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &r);
1943         }
1944
1945         status = cli->dispatch(cli,
1946                                 mem_ctx,
1947                                 &ndr_table_wbint,
1948                                 NDR_WBINT_LOOKUPGROUPMEMBERS,
1949                                 &r);
1950
1951         if (!NT_STATUS_IS_OK(status)) {
1952                 return status;
1953         }
1954
1955         if (DEBUGLEVEL >= 10) {
1956                 NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, &r);
1957         }
1958
1959         if (NT_STATUS_IS_ERR(status)) {
1960                 return status;
1961         }
1962
1963         /* Return variables */
1964         *members = *r.out.members;
1965
1966         /* Return result */
1967         return r.out.result;
1968 }
1969
1970 struct rpccli_wbint_QueryUserList_state {
1971         struct wbint_QueryUserList orig;
1972         struct wbint_QueryUserList tmp;
1973         TALLOC_CTX *out_mem_ctx;
1974         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1975 };
1976
1977 static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq);
1978
1979 struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
1980                                                    struct tevent_context *ev,
1981                                                    struct rpc_pipe_client *cli,
1982                                                    struct wbint_userinfos *_users /* [out] [ref] */)
1983 {
1984         struct tevent_req *req;
1985         struct rpccli_wbint_QueryUserList_state *state;
1986         struct tevent_req *subreq;
1987
1988         req = tevent_req_create(mem_ctx, &state,
1989                                 struct rpccli_wbint_QueryUserList_state);
1990         if (req == NULL) {
1991                 return NULL;
1992         }
1993         state->out_mem_ctx = NULL;
1994         state->dispatch_recv = cli->dispatch_recv;
1995
1996         /* In parameters */
1997
1998         /* Out parameters */
1999         state->orig.out.users = _users;
2000
2001         /* Result */
2002         ZERO_STRUCT(state->orig.out.result);
2003
2004         if (DEBUGLEVEL >= 10) {
2005                 NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &state->orig);
2006         }
2007
2008         state->out_mem_ctx = talloc_named_const(state, 0,
2009                              "rpccli_wbint_QueryUserList_out_memory");
2010         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2011                 return tevent_req_post(req, ev);
2012         }
2013
2014         /* make a temporary copy, that we pass to the dispatch function */
2015         state->tmp = state->orig;
2016
2017         subreq = cli->dispatch_send(state, ev, cli,
2018                                     &ndr_table_wbint,
2019                                     NDR_WBINT_QUERYUSERLIST,
2020                                     &state->tmp);
2021         if (tevent_req_nomem(subreq, req)) {
2022                 return tevent_req_post(req, ev);
2023         }
2024         tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
2025         return req;
2026 }
2027
2028 static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
2029 {
2030         struct tevent_req *req = tevent_req_callback_data(
2031                 subreq, struct tevent_req);
2032         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2033                 req, struct rpccli_wbint_QueryUserList_state);
2034         NTSTATUS status;
2035         TALLOC_CTX *mem_ctx;
2036
2037         if (state->out_mem_ctx) {
2038                 mem_ctx = state->out_mem_ctx;
2039         } else {
2040                 mem_ctx = state;
2041         }
2042
2043         status = state->dispatch_recv(subreq, mem_ctx);
2044         TALLOC_FREE(subreq);
2045         if (!NT_STATUS_IS_OK(status)) {
2046                 tevent_req_nterror(req, status);
2047                 return;
2048         }
2049
2050         /* Copy out parameters */
2051         *state->orig.out.users = *state->tmp.out.users;
2052
2053         /* Copy result */
2054         state->orig.out.result = state->tmp.out.result;
2055
2056         /* Reset temporary structure */
2057         ZERO_STRUCT(state->tmp);
2058
2059         if (DEBUGLEVEL >= 10) {
2060                 NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &state->orig);
2061         }
2062
2063         tevent_req_done(req);
2064 }
2065
2066 NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
2067                                          TALLOC_CTX *mem_ctx,
2068                                          NTSTATUS *result)
2069 {
2070         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2071                 req, struct rpccli_wbint_QueryUserList_state);
2072         NTSTATUS status;
2073
2074         if (tevent_req_is_nterror(req, &status)) {
2075                 tevent_req_received(req);
2076                 return status;
2077         }
2078
2079         /* Steal possbile out parameters to the callers context */
2080         talloc_steal(mem_ctx, state->out_mem_ctx);
2081
2082         /* Return result */
2083         *result = state->orig.out.result;
2084
2085         tevent_req_received(req);
2086         return NT_STATUS_OK;
2087 }
2088
2089 NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
2090                                     TALLOC_CTX *mem_ctx,
2091                                     struct wbint_userinfos *users /* [out] [ref] */)
2092 {
2093         struct wbint_QueryUserList r;
2094         NTSTATUS status;
2095
2096         /* In parameters */
2097
2098         if (DEBUGLEVEL >= 10) {
2099                 NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &r);
2100         }
2101
2102         status = cli->dispatch(cli,
2103                                 mem_ctx,
2104                                 &ndr_table_wbint,
2105                                 NDR_WBINT_QUERYUSERLIST,
2106                                 &r);
2107
2108         if (!NT_STATUS_IS_OK(status)) {
2109                 return status;
2110         }
2111
2112         if (DEBUGLEVEL >= 10) {
2113                 NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &r);
2114         }
2115
2116         if (NT_STATUS_IS_ERR(status)) {
2117                 return status;
2118         }
2119
2120         /* Return variables */
2121         *users = *r.out.users;
2122
2123         /* Return result */
2124         return r.out.result;
2125 }
2126
2127 struct rpccli_wbint_QueryGroupList_state {
2128         struct wbint_QueryGroupList orig;
2129         struct wbint_QueryGroupList tmp;
2130         TALLOC_CTX *out_mem_ctx;
2131         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2132 };
2133
2134 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
2135
2136 struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
2137                                                     struct tevent_context *ev,
2138                                                     struct rpc_pipe_client *cli,
2139                                                     struct wbint_Principals *_groups /* [out] [ref] */)
2140 {
2141         struct tevent_req *req;
2142         struct rpccli_wbint_QueryGroupList_state *state;
2143         struct tevent_req *subreq;
2144
2145         req = tevent_req_create(mem_ctx, &state,
2146                                 struct rpccli_wbint_QueryGroupList_state);
2147         if (req == NULL) {
2148                 return NULL;
2149         }
2150         state->out_mem_ctx = NULL;
2151         state->dispatch_recv = cli->dispatch_recv;
2152
2153         /* In parameters */
2154
2155         /* Out parameters */
2156         state->orig.out.groups = _groups;
2157
2158         /* Result */
2159         ZERO_STRUCT(state->orig.out.result);
2160
2161         if (DEBUGLEVEL >= 10) {
2162                 NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &state->orig);
2163         }
2164
2165         state->out_mem_ctx = talloc_named_const(state, 0,
2166                              "rpccli_wbint_QueryGroupList_out_memory");
2167         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2168                 return tevent_req_post(req, ev);
2169         }
2170
2171         /* make a temporary copy, that we pass to the dispatch function */
2172         state->tmp = state->orig;
2173
2174         subreq = cli->dispatch_send(state, ev, cli,
2175                                     &ndr_table_wbint,
2176                                     NDR_WBINT_QUERYGROUPLIST,
2177                                     &state->tmp);
2178         if (tevent_req_nomem(subreq, req)) {
2179                 return tevent_req_post(req, ev);
2180         }
2181         tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
2182         return req;
2183 }
2184
2185 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
2186 {
2187         struct tevent_req *req = tevent_req_callback_data(
2188                 subreq, struct tevent_req);
2189         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2190                 req, struct rpccli_wbint_QueryGroupList_state);
2191         NTSTATUS status;
2192         TALLOC_CTX *mem_ctx;
2193
2194         if (state->out_mem_ctx) {
2195                 mem_ctx = state->out_mem_ctx;
2196         } else {
2197                 mem_ctx = state;
2198         }
2199
2200         status = state->dispatch_recv(subreq, mem_ctx);
2201         TALLOC_FREE(subreq);
2202         if (!NT_STATUS_IS_OK(status)) {
2203                 tevent_req_nterror(req, status);
2204                 return;
2205         }
2206
2207         /* Copy out parameters */
2208         *state->orig.out.groups = *state->tmp.out.groups;
2209
2210         /* Copy result */
2211         state->orig.out.result = state->tmp.out.result;
2212
2213         /* Reset temporary structure */
2214         ZERO_STRUCT(state->tmp);
2215
2216         if (DEBUGLEVEL >= 10) {
2217                 NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &state->orig);
2218         }
2219
2220         tevent_req_done(req);
2221 }
2222
2223 NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
2224                                           TALLOC_CTX *mem_ctx,
2225                                           NTSTATUS *result)
2226 {
2227         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2228                 req, struct rpccli_wbint_QueryGroupList_state);
2229         NTSTATUS status;
2230
2231         if (tevent_req_is_nterror(req, &status)) {
2232                 tevent_req_received(req);
2233                 return status;
2234         }
2235
2236         /* Steal possbile out parameters to the callers context */
2237         talloc_steal(mem_ctx, state->out_mem_ctx);
2238
2239         /* Return result */
2240         *result = state->orig.out.result;
2241
2242         tevent_req_received(req);
2243         return NT_STATUS_OK;
2244 }
2245
2246 NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
2247                                      TALLOC_CTX *mem_ctx,
2248                                      struct wbint_Principals *groups /* [out] [ref] */)
2249 {
2250         struct wbint_QueryGroupList r;
2251         NTSTATUS status;
2252
2253         /* In parameters */
2254
2255         if (DEBUGLEVEL >= 10) {
2256                 NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &r);
2257         }
2258
2259         status = cli->dispatch(cli,
2260                                 mem_ctx,
2261                                 &ndr_table_wbint,
2262                                 NDR_WBINT_QUERYGROUPLIST,
2263                                 &r);
2264
2265         if (!NT_STATUS_IS_OK(status)) {
2266                 return status;
2267         }
2268
2269         if (DEBUGLEVEL >= 10) {
2270                 NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &r);
2271         }
2272
2273         if (NT_STATUS_IS_ERR(status)) {
2274                 return status;
2275         }
2276
2277         /* Return variables */
2278         *groups = *r.out.groups;
2279
2280         /* Return result */
2281         return r.out.result;
2282 }
2283
2284 struct rpccli_wbint_DsGetDcName_state {
2285         struct wbint_DsGetDcName orig;
2286         struct wbint_DsGetDcName tmp;
2287         TALLOC_CTX *out_mem_ctx;
2288         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2289 };
2290
2291 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
2292
2293 struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
2294                                                  struct tevent_context *ev,
2295                                                  struct rpc_pipe_client *cli,
2296                                                  const char *_domain_name /* [in] [ref,charset(UTF8)] */,
2297                                                  struct GUID *_domain_guid /* [in] [unique] */,
2298                                                  const char *_site_name /* [in] [unique,charset(UTF8)] */,
2299                                                  uint32_t _flags /* [in]  */,
2300                                                  struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
2301 {
2302         struct tevent_req *req;
2303         struct rpccli_wbint_DsGetDcName_state *state;
2304         struct tevent_req *subreq;
2305
2306         req = tevent_req_create(mem_ctx, &state,
2307                                 struct rpccli_wbint_DsGetDcName_state);
2308         if (req == NULL) {
2309                 return NULL;
2310         }
2311         state->out_mem_ctx = NULL;
2312         state->dispatch_recv = cli->dispatch_recv;
2313
2314         /* In parameters */
2315         state->orig.in.domain_name = _domain_name;
2316         state->orig.in.domain_guid = _domain_guid;
2317         state->orig.in.site_name = _site_name;
2318         state->orig.in.flags = _flags;
2319
2320         /* Out parameters */
2321         state->orig.out.dc_info = _dc_info;
2322
2323         /* Result */
2324         ZERO_STRUCT(state->orig.out.result);
2325
2326         if (DEBUGLEVEL >= 10) {
2327                 NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &state->orig);
2328         }
2329
2330         state->out_mem_ctx = talloc_named_const(state, 0,
2331                              "rpccli_wbint_DsGetDcName_out_memory");
2332         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2333                 return tevent_req_post(req, ev);
2334         }
2335
2336         /* make a temporary copy, that we pass to the dispatch function */
2337         state->tmp = state->orig;
2338
2339         subreq = cli->dispatch_send(state, ev, cli,
2340                                     &ndr_table_wbint,
2341                                     NDR_WBINT_DSGETDCNAME,
2342                                     &state->tmp);
2343         if (tevent_req_nomem(subreq, req)) {
2344                 return tevent_req_post(req, ev);
2345         }
2346         tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
2347         return req;
2348 }
2349
2350 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
2351 {
2352         struct tevent_req *req = tevent_req_callback_data(
2353                 subreq, struct tevent_req);
2354         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2355                 req, struct rpccli_wbint_DsGetDcName_state);
2356         NTSTATUS status;
2357         TALLOC_CTX *mem_ctx;
2358
2359         if (state->out_mem_ctx) {
2360                 mem_ctx = state->out_mem_ctx;
2361         } else {
2362                 mem_ctx = state;
2363         }
2364
2365         status = state->dispatch_recv(subreq, mem_ctx);
2366         TALLOC_FREE(subreq);
2367         if (!NT_STATUS_IS_OK(status)) {
2368                 tevent_req_nterror(req, status);
2369                 return;
2370         }
2371
2372         /* Copy out parameters */
2373         *state->orig.out.dc_info = *state->tmp.out.dc_info;
2374
2375         /* Copy result */
2376         state->orig.out.result = state->tmp.out.result;
2377
2378         /* Reset temporary structure */
2379         ZERO_STRUCT(state->tmp);
2380
2381         if (DEBUGLEVEL >= 10) {
2382                 NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &state->orig);
2383         }
2384
2385         tevent_req_done(req);
2386 }
2387
2388 NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
2389                                        TALLOC_CTX *mem_ctx,
2390                                        NTSTATUS *result)
2391 {
2392         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2393                 req, struct rpccli_wbint_DsGetDcName_state);
2394         NTSTATUS status;
2395
2396         if (tevent_req_is_nterror(req, &status)) {
2397                 tevent_req_received(req);
2398                 return status;
2399         }
2400
2401         /* Steal possbile out parameters to the callers context */
2402         talloc_steal(mem_ctx, state->out_mem_ctx);
2403
2404         /* Return result */
2405         *result = state->orig.out.result;
2406
2407         tevent_req_received(req);
2408         return NT_STATUS_OK;
2409 }
2410
2411 NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
2412                                   TALLOC_CTX *mem_ctx,
2413                                   const char *domain_name /* [in] [ref,charset(UTF8)] */,
2414                                   struct GUID *domain_guid /* [in] [unique] */,
2415                                   const char *site_name /* [in] [unique,charset(UTF8)] */,
2416                                   uint32_t flags /* [in]  */,
2417                                   struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
2418 {
2419         struct wbint_DsGetDcName r;
2420         NTSTATUS status;
2421
2422         /* In parameters */
2423         r.in.domain_name = domain_name;
2424         r.in.domain_guid = domain_guid;
2425         r.in.site_name = site_name;
2426         r.in.flags = flags;
2427
2428         if (DEBUGLEVEL >= 10) {
2429                 NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &r);
2430         }
2431
2432         status = cli->dispatch(cli,
2433                                 mem_ctx,
2434                                 &ndr_table_wbint,
2435                                 NDR_WBINT_DSGETDCNAME,
2436                                 &r);
2437
2438         if (!NT_STATUS_IS_OK(status)) {
2439                 return status;
2440         }
2441
2442         if (DEBUGLEVEL >= 10) {
2443                 NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &r);
2444         }
2445
2446         if (NT_STATUS_IS_ERR(status)) {
2447                 return status;
2448         }
2449
2450         /* Return variables */
2451         *dc_info = *r.out.dc_info;
2452
2453         /* Return result */
2454         return r.out.result;
2455 }
2456
2457 struct rpccli_wbint_LookupRids_state {
2458         struct wbint_LookupRids orig;
2459         struct wbint_LookupRids tmp;
2460         TALLOC_CTX *out_mem_ctx;
2461         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2462 };
2463
2464 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq);
2465
2466 struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
2467                                                 struct tevent_context *ev,
2468                                                 struct rpc_pipe_client *cli,
2469                                                 struct wbint_RidArray *_rids /* [in] [ref] */,
2470                                                 struct wbint_Principals *_names /* [out] [ref] */)
2471 {
2472         struct tevent_req *req;
2473         struct rpccli_wbint_LookupRids_state *state;
2474         struct tevent_req *subreq;
2475
2476         req = tevent_req_create(mem_ctx, &state,
2477                                 struct rpccli_wbint_LookupRids_state);
2478         if (req == NULL) {
2479                 return NULL;
2480         }
2481         state->out_mem_ctx = NULL;
2482         state->dispatch_recv = cli->dispatch_recv;
2483
2484         /* In parameters */
2485         state->orig.in.rids = _rids;
2486
2487         /* Out parameters */
2488         state->orig.out.names = _names;
2489
2490         /* Result */
2491         ZERO_STRUCT(state->orig.out.result);
2492
2493         if (DEBUGLEVEL >= 10) {
2494                 NDR_PRINT_IN_DEBUG(wbint_LookupRids, &state->orig);
2495         }
2496
2497         state->out_mem_ctx = talloc_named_const(state, 0,
2498                              "rpccli_wbint_LookupRids_out_memory");
2499         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2500                 return tevent_req_post(req, ev);
2501         }
2502
2503         /* make a temporary copy, that we pass to the dispatch function */
2504         state->tmp = state->orig;
2505
2506         subreq = cli->dispatch_send(state, ev, cli,
2507                                     &ndr_table_wbint,
2508                                     NDR_WBINT_LOOKUPRIDS,
2509                                     &state->tmp);
2510         if (tevent_req_nomem(subreq, req)) {
2511                 return tevent_req_post(req, ev);
2512         }
2513         tevent_req_set_callback(subreq, rpccli_wbint_LookupRids_done, req);
2514         return req;
2515 }
2516
2517 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
2518 {
2519         struct tevent_req *req = tevent_req_callback_data(
2520                 subreq, struct tevent_req);
2521         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2522                 req, struct rpccli_wbint_LookupRids_state);
2523         NTSTATUS status;
2524         TALLOC_CTX *mem_ctx;
2525
2526         if (state->out_mem_ctx) {
2527                 mem_ctx = state->out_mem_ctx;
2528         } else {
2529                 mem_ctx = state;
2530         }
2531
2532         status = state->dispatch_recv(subreq, mem_ctx);
2533         TALLOC_FREE(subreq);
2534         if (!NT_STATUS_IS_OK(status)) {
2535                 tevent_req_nterror(req, status);
2536                 return;
2537         }
2538
2539         /* Copy out parameters */
2540         *state->orig.out.names = *state->tmp.out.names;
2541
2542         /* Copy result */
2543         state->orig.out.result = state->tmp.out.result;
2544
2545         /* Reset temporary structure */
2546         ZERO_STRUCT(state->tmp);
2547
2548         if (DEBUGLEVEL >= 10) {
2549                 NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &state->orig);
2550         }
2551
2552         tevent_req_done(req);
2553 }
2554
2555 NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
2556                                       TALLOC_CTX *mem_ctx,
2557                                       NTSTATUS *result)
2558 {
2559         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2560                 req, struct rpccli_wbint_LookupRids_state);
2561         NTSTATUS status;
2562
2563         if (tevent_req_is_nterror(req, &status)) {
2564                 tevent_req_received(req);
2565                 return status;
2566         }
2567
2568         /* Steal possbile out parameters to the callers context */
2569         talloc_steal(mem_ctx, state->out_mem_ctx);
2570
2571         /* Return result */
2572         *result = state->orig.out.result;
2573
2574         tevent_req_received(req);
2575         return NT_STATUS_OK;
2576 }
2577
2578 NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli,
2579                                  TALLOC_CTX *mem_ctx,
2580                                  struct wbint_RidArray *rids /* [in] [ref] */,
2581                                  struct wbint_Principals *names /* [out] [ref] */)
2582 {
2583         struct wbint_LookupRids r;
2584         NTSTATUS status;
2585
2586         /* In parameters */
2587         r.in.rids = rids;
2588
2589         if (DEBUGLEVEL >= 10) {
2590                 NDR_PRINT_IN_DEBUG(wbint_LookupRids, &r);
2591         }
2592
2593         status = cli->dispatch(cli,
2594                                 mem_ctx,
2595                                 &ndr_table_wbint,
2596                                 NDR_WBINT_LOOKUPRIDS,
2597                                 &r);
2598
2599         if (!NT_STATUS_IS_OK(status)) {
2600                 return status;
2601         }
2602
2603         if (DEBUGLEVEL >= 10) {
2604                 NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &r);
2605         }
2606
2607         if (NT_STATUS_IS_ERR(status)) {
2608                 return status;
2609         }
2610
2611         /* Return variables */
2612         *names = *r.out.names;
2613
2614         /* Return result */
2615         return r.out.result;
2616 }
2617