s3:winbind: Convert WINBINDD_SET_HWM to the new API
[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_AllocateUid_state {
1166         struct wbint_AllocateUid orig;
1167         struct wbint_AllocateUid 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_AllocateUid_done(struct tevent_req *subreq);
1173
1174 struct tevent_req *rpccli_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx,
1175                                                  struct tevent_context *ev,
1176                                                  struct rpc_pipe_client *cli,
1177                                                  uint64_t *_uid /* [out] [ref] */)
1178 {
1179         struct tevent_req *req;
1180         struct rpccli_wbint_AllocateUid_state *state;
1181         struct tevent_req *subreq;
1182
1183         req = tevent_req_create(mem_ctx, &state,
1184                                 struct rpccli_wbint_AllocateUid_state);
1185         if (req == NULL) {
1186                 return NULL;
1187         }
1188         state->out_mem_ctx = NULL;
1189         state->dispatch_recv = cli->dispatch_recv;
1190
1191         /* In parameters */
1192
1193         /* Out parameters */
1194         state->orig.out.uid = _uid;
1195
1196         /* Result */
1197         ZERO_STRUCT(state->orig.out.result);
1198
1199         if (DEBUGLEVEL >= 10) {
1200                 NDR_PRINT_IN_DEBUG(wbint_AllocateUid, &state->orig);
1201         }
1202
1203         state->out_mem_ctx = talloc_named_const(state, 0,
1204                              "rpccli_wbint_AllocateUid_out_memory");
1205         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1206                 return tevent_req_post(req, ev);
1207         }
1208
1209         /* make a temporary copy, that we pass to the dispatch function */
1210         state->tmp = state->orig;
1211
1212         subreq = cli->dispatch_send(state, ev, cli,
1213                                     &ndr_table_wbint,
1214                                     NDR_WBINT_ALLOCATEUID,
1215                                     &state->tmp);
1216         if (tevent_req_nomem(subreq, req)) {
1217                 return tevent_req_post(req, ev);
1218         }
1219         tevent_req_set_callback(subreq, rpccli_wbint_AllocateUid_done, req);
1220         return req;
1221 }
1222
1223 static void rpccli_wbint_AllocateUid_done(struct tevent_req *subreq)
1224 {
1225         struct tevent_req *req = tevent_req_callback_data(
1226                 subreq, struct tevent_req);
1227         struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
1228                 req, struct rpccli_wbint_AllocateUid_state);
1229         NTSTATUS status;
1230         TALLOC_CTX *mem_ctx;
1231
1232         if (state->out_mem_ctx) {
1233                 mem_ctx = state->out_mem_ctx;
1234         } else {
1235                 mem_ctx = state;
1236         }
1237
1238         status = state->dispatch_recv(subreq, mem_ctx);
1239         TALLOC_FREE(subreq);
1240         if (!NT_STATUS_IS_OK(status)) {
1241                 tevent_req_nterror(req, status);
1242                 return;
1243         }
1244
1245         /* Copy out parameters */
1246         *state->orig.out.uid = *state->tmp.out.uid;
1247
1248         /* Copy result */
1249         state->orig.out.result = state->tmp.out.result;
1250
1251         /* Reset temporary structure */
1252         ZERO_STRUCT(state->tmp);
1253
1254         if (DEBUGLEVEL >= 10) {
1255                 NDR_PRINT_OUT_DEBUG(wbint_AllocateUid, &state->orig);
1256         }
1257
1258         tevent_req_done(req);
1259 }
1260
1261 NTSTATUS rpccli_wbint_AllocateUid_recv(struct tevent_req *req,
1262                                        TALLOC_CTX *mem_ctx,
1263                                        NTSTATUS *result)
1264 {
1265         struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
1266                 req, struct rpccli_wbint_AllocateUid_state);
1267         NTSTATUS status;
1268
1269         if (tevent_req_is_nterror(req, &status)) {
1270                 tevent_req_received(req);
1271                 return status;
1272         }
1273
1274         /* Steal possbile out parameters to the callers context */
1275         talloc_steal(mem_ctx, state->out_mem_ctx);
1276
1277         /* Return result */
1278         *result = state->orig.out.result;
1279
1280         tevent_req_received(req);
1281         return NT_STATUS_OK;
1282 }
1283
1284 NTSTATUS rpccli_wbint_AllocateUid(struct rpc_pipe_client *cli,
1285                                   TALLOC_CTX *mem_ctx,
1286                                   uint64_t *uid /* [out] [ref] */)
1287 {
1288         struct wbint_AllocateUid r;
1289         NTSTATUS status;
1290
1291         /* In parameters */
1292
1293         if (DEBUGLEVEL >= 10) {
1294                 NDR_PRINT_IN_DEBUG(wbint_AllocateUid, &r);
1295         }
1296
1297         status = cli->dispatch(cli,
1298                                 mem_ctx,
1299                                 &ndr_table_wbint,
1300                                 NDR_WBINT_ALLOCATEUID,
1301                                 &r);
1302
1303         if (!NT_STATUS_IS_OK(status)) {
1304                 return status;
1305         }
1306
1307         if (DEBUGLEVEL >= 10) {
1308                 NDR_PRINT_OUT_DEBUG(wbint_AllocateUid, &r);
1309         }
1310
1311         if (NT_STATUS_IS_ERR(status)) {
1312                 return status;
1313         }
1314
1315         /* Return variables */
1316         *uid = *r.out.uid;
1317
1318         /* Return result */
1319         return r.out.result;
1320 }
1321
1322 struct rpccli_wbint_AllocateGid_state {
1323         struct wbint_AllocateGid orig;
1324         struct wbint_AllocateGid tmp;
1325         TALLOC_CTX *out_mem_ctx;
1326         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1327 };
1328
1329 static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq);
1330
1331 struct tevent_req *rpccli_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx,
1332                                                  struct tevent_context *ev,
1333                                                  struct rpc_pipe_client *cli,
1334                                                  uint64_t *_gid /* [out] [ref] */)
1335 {
1336         struct tevent_req *req;
1337         struct rpccli_wbint_AllocateGid_state *state;
1338         struct tevent_req *subreq;
1339
1340         req = tevent_req_create(mem_ctx, &state,
1341                                 struct rpccli_wbint_AllocateGid_state);
1342         if (req == NULL) {
1343                 return NULL;
1344         }
1345         state->out_mem_ctx = NULL;
1346         state->dispatch_recv = cli->dispatch_recv;
1347
1348         /* In parameters */
1349
1350         /* Out parameters */
1351         state->orig.out.gid = _gid;
1352
1353         /* Result */
1354         ZERO_STRUCT(state->orig.out.result);
1355
1356         if (DEBUGLEVEL >= 10) {
1357                 NDR_PRINT_IN_DEBUG(wbint_AllocateGid, &state->orig);
1358         }
1359
1360         state->out_mem_ctx = talloc_named_const(state, 0,
1361                              "rpccli_wbint_AllocateGid_out_memory");
1362         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1363                 return tevent_req_post(req, ev);
1364         }
1365
1366         /* make a temporary copy, that we pass to the dispatch function */
1367         state->tmp = state->orig;
1368
1369         subreq = cli->dispatch_send(state, ev, cli,
1370                                     &ndr_table_wbint,
1371                                     NDR_WBINT_ALLOCATEGID,
1372                                     &state->tmp);
1373         if (tevent_req_nomem(subreq, req)) {
1374                 return tevent_req_post(req, ev);
1375         }
1376         tevent_req_set_callback(subreq, rpccli_wbint_AllocateGid_done, req);
1377         return req;
1378 }
1379
1380 static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq)
1381 {
1382         struct tevent_req *req = tevent_req_callback_data(
1383                 subreq, struct tevent_req);
1384         struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
1385                 req, struct rpccli_wbint_AllocateGid_state);
1386         NTSTATUS status;
1387         TALLOC_CTX *mem_ctx;
1388
1389         if (state->out_mem_ctx) {
1390                 mem_ctx = state->out_mem_ctx;
1391         } else {
1392                 mem_ctx = state;
1393         }
1394
1395         status = state->dispatch_recv(subreq, mem_ctx);
1396         TALLOC_FREE(subreq);
1397         if (!NT_STATUS_IS_OK(status)) {
1398                 tevent_req_nterror(req, status);
1399                 return;
1400         }
1401
1402         /* Copy out parameters */
1403         *state->orig.out.gid = *state->tmp.out.gid;
1404
1405         /* Copy result */
1406         state->orig.out.result = state->tmp.out.result;
1407
1408         /* Reset temporary structure */
1409         ZERO_STRUCT(state->tmp);
1410
1411         if (DEBUGLEVEL >= 10) {
1412                 NDR_PRINT_OUT_DEBUG(wbint_AllocateGid, &state->orig);
1413         }
1414
1415         tevent_req_done(req);
1416 }
1417
1418 NTSTATUS rpccli_wbint_AllocateGid_recv(struct tevent_req *req,
1419                                        TALLOC_CTX *mem_ctx,
1420                                        NTSTATUS *result)
1421 {
1422         struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
1423                 req, struct rpccli_wbint_AllocateGid_state);
1424         NTSTATUS status;
1425
1426         if (tevent_req_is_nterror(req, &status)) {
1427                 tevent_req_received(req);
1428                 return status;
1429         }
1430
1431         /* Steal possbile out parameters to the callers context */
1432         talloc_steal(mem_ctx, state->out_mem_ctx);
1433
1434         /* Return result */
1435         *result = state->orig.out.result;
1436
1437         tevent_req_received(req);
1438         return NT_STATUS_OK;
1439 }
1440
1441 NTSTATUS rpccli_wbint_AllocateGid(struct rpc_pipe_client *cli,
1442                                   TALLOC_CTX *mem_ctx,
1443                                   uint64_t *gid /* [out] [ref] */)
1444 {
1445         struct wbint_AllocateGid r;
1446         NTSTATUS status;
1447
1448         /* In parameters */
1449
1450         if (DEBUGLEVEL >= 10) {
1451                 NDR_PRINT_IN_DEBUG(wbint_AllocateGid, &r);
1452         }
1453
1454         status = cli->dispatch(cli,
1455                                 mem_ctx,
1456                                 &ndr_table_wbint,
1457                                 NDR_WBINT_ALLOCATEGID,
1458                                 &r);
1459
1460         if (!NT_STATUS_IS_OK(status)) {
1461                 return status;
1462         }
1463
1464         if (DEBUGLEVEL >= 10) {
1465                 NDR_PRINT_OUT_DEBUG(wbint_AllocateGid, &r);
1466         }
1467
1468         if (NT_STATUS_IS_ERR(status)) {
1469                 return status;
1470         }
1471
1472         /* Return variables */
1473         *gid = *r.out.gid;
1474
1475         /* Return result */
1476         return r.out.result;
1477 }
1478
1479 struct rpccli_wbint_QueryUser_state {
1480         struct wbint_QueryUser orig;
1481         struct wbint_QueryUser tmp;
1482         TALLOC_CTX *out_mem_ctx;
1483         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1484 };
1485
1486 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
1487
1488 struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
1489                                                struct tevent_context *ev,
1490                                                struct rpc_pipe_client *cli,
1491                                                struct dom_sid *_sid /* [in] [ref] */,
1492                                                struct wbint_userinfo *_info /* [out] [ref] */)
1493 {
1494         struct tevent_req *req;
1495         struct rpccli_wbint_QueryUser_state *state;
1496         struct tevent_req *subreq;
1497
1498         req = tevent_req_create(mem_ctx, &state,
1499                                 struct rpccli_wbint_QueryUser_state);
1500         if (req == NULL) {
1501                 return NULL;
1502         }
1503         state->out_mem_ctx = NULL;
1504         state->dispatch_recv = cli->dispatch_recv;
1505
1506         /* In parameters */
1507         state->orig.in.sid = _sid;
1508
1509         /* Out parameters */
1510         state->orig.out.info = _info;
1511
1512         /* Result */
1513         ZERO_STRUCT(state->orig.out.result);
1514
1515         if (DEBUGLEVEL >= 10) {
1516                 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &state->orig);
1517         }
1518
1519         state->out_mem_ctx = talloc_named_const(state, 0,
1520                              "rpccli_wbint_QueryUser_out_memory");
1521         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1522                 return tevent_req_post(req, ev);
1523         }
1524
1525         /* make a temporary copy, that we pass to the dispatch function */
1526         state->tmp = state->orig;
1527
1528         subreq = cli->dispatch_send(state, ev, cli,
1529                                     &ndr_table_wbint,
1530                                     NDR_WBINT_QUERYUSER,
1531                                     &state->tmp);
1532         if (tevent_req_nomem(subreq, req)) {
1533                 return tevent_req_post(req, ev);
1534         }
1535         tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
1536         return req;
1537 }
1538
1539 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
1540 {
1541         struct tevent_req *req = tevent_req_callback_data(
1542                 subreq, struct tevent_req);
1543         struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1544                 req, struct rpccli_wbint_QueryUser_state);
1545         NTSTATUS status;
1546         TALLOC_CTX *mem_ctx;
1547
1548         if (state->out_mem_ctx) {
1549                 mem_ctx = state->out_mem_ctx;
1550         } else {
1551                 mem_ctx = state;
1552         }
1553
1554         status = state->dispatch_recv(subreq, mem_ctx);
1555         TALLOC_FREE(subreq);
1556         if (!NT_STATUS_IS_OK(status)) {
1557                 tevent_req_nterror(req, status);
1558                 return;
1559         }
1560
1561         /* Copy out parameters */
1562         *state->orig.out.info = *state->tmp.out.info;
1563
1564         /* Copy result */
1565         state->orig.out.result = state->tmp.out.result;
1566
1567         /* Reset temporary structure */
1568         ZERO_STRUCT(state->tmp);
1569
1570         if (DEBUGLEVEL >= 10) {
1571                 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &state->orig);
1572         }
1573
1574         tevent_req_done(req);
1575 }
1576
1577 NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
1578                                      TALLOC_CTX *mem_ctx,
1579                                      NTSTATUS *result)
1580 {
1581         struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1582                 req, struct rpccli_wbint_QueryUser_state);
1583         NTSTATUS status;
1584
1585         if (tevent_req_is_nterror(req, &status)) {
1586                 tevent_req_received(req);
1587                 return status;
1588         }
1589
1590         /* Steal possbile out parameters to the callers context */
1591         talloc_steal(mem_ctx, state->out_mem_ctx);
1592
1593         /* Return result */
1594         *result = state->orig.out.result;
1595
1596         tevent_req_received(req);
1597         return NT_STATUS_OK;
1598 }
1599
1600 NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli,
1601                                 TALLOC_CTX *mem_ctx,
1602                                 struct dom_sid *sid /* [in] [ref] */,
1603                                 struct wbint_userinfo *info /* [out] [ref] */)
1604 {
1605         struct wbint_QueryUser r;
1606         NTSTATUS status;
1607
1608         /* In parameters */
1609         r.in.sid = sid;
1610
1611         if (DEBUGLEVEL >= 10) {
1612                 NDR_PRINT_IN_DEBUG(wbint_QueryUser, &r);
1613         }
1614
1615         status = cli->dispatch(cli,
1616                                 mem_ctx,
1617                                 &ndr_table_wbint,
1618                                 NDR_WBINT_QUERYUSER,
1619                                 &r);
1620
1621         if (!NT_STATUS_IS_OK(status)) {
1622                 return status;
1623         }
1624
1625         if (DEBUGLEVEL >= 10) {
1626                 NDR_PRINT_OUT_DEBUG(wbint_QueryUser, &r);
1627         }
1628
1629         if (NT_STATUS_IS_ERR(status)) {
1630                 return status;
1631         }
1632
1633         /* Return variables */
1634         *info = *r.out.info;
1635
1636         /* Return result */
1637         return r.out.result;
1638 }
1639
1640 struct rpccli_wbint_LookupUserAliases_state {
1641         struct wbint_LookupUserAliases orig;
1642         struct wbint_LookupUserAliases tmp;
1643         TALLOC_CTX *out_mem_ctx;
1644         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1645 };
1646
1647 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
1648
1649 struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
1650                                                        struct tevent_context *ev,
1651                                                        struct rpc_pipe_client *cli,
1652                                                        struct wbint_SidArray *_sids /* [in] [ref] */,
1653                                                        struct wbint_RidArray *_rids /* [out] [ref] */)
1654 {
1655         struct tevent_req *req;
1656         struct rpccli_wbint_LookupUserAliases_state *state;
1657         struct tevent_req *subreq;
1658
1659         req = tevent_req_create(mem_ctx, &state,
1660                                 struct rpccli_wbint_LookupUserAliases_state);
1661         if (req == NULL) {
1662                 return NULL;
1663         }
1664         state->out_mem_ctx = NULL;
1665         state->dispatch_recv = cli->dispatch_recv;
1666
1667         /* In parameters */
1668         state->orig.in.sids = _sids;
1669
1670         /* Out parameters */
1671         state->orig.out.rids = _rids;
1672
1673         /* Result */
1674         ZERO_STRUCT(state->orig.out.result);
1675
1676         if (DEBUGLEVEL >= 10) {
1677                 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &state->orig);
1678         }
1679
1680         state->out_mem_ctx = talloc_named_const(state, 0,
1681                              "rpccli_wbint_LookupUserAliases_out_memory");
1682         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1683                 return tevent_req_post(req, ev);
1684         }
1685
1686         /* make a temporary copy, that we pass to the dispatch function */
1687         state->tmp = state->orig;
1688
1689         subreq = cli->dispatch_send(state, ev, cli,
1690                                     &ndr_table_wbint,
1691                                     NDR_WBINT_LOOKUPUSERALIASES,
1692                                     &state->tmp);
1693         if (tevent_req_nomem(subreq, req)) {
1694                 return tevent_req_post(req, ev);
1695         }
1696         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
1697         return req;
1698 }
1699
1700 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
1701 {
1702         struct tevent_req *req = tevent_req_callback_data(
1703                 subreq, struct tevent_req);
1704         struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1705                 req, struct rpccli_wbint_LookupUserAliases_state);
1706         NTSTATUS status;
1707         TALLOC_CTX *mem_ctx;
1708
1709         if (state->out_mem_ctx) {
1710                 mem_ctx = state->out_mem_ctx;
1711         } else {
1712                 mem_ctx = state;
1713         }
1714
1715         status = state->dispatch_recv(subreq, mem_ctx);
1716         TALLOC_FREE(subreq);
1717         if (!NT_STATUS_IS_OK(status)) {
1718                 tevent_req_nterror(req, status);
1719                 return;
1720         }
1721
1722         /* Copy out parameters */
1723         *state->orig.out.rids = *state->tmp.out.rids;
1724
1725         /* Copy result */
1726         state->orig.out.result = state->tmp.out.result;
1727
1728         /* Reset temporary structure */
1729         ZERO_STRUCT(state->tmp);
1730
1731         if (DEBUGLEVEL >= 10) {
1732                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &state->orig);
1733         }
1734
1735         tevent_req_done(req);
1736 }
1737
1738 NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
1739                                              TALLOC_CTX *mem_ctx,
1740                                              NTSTATUS *result)
1741 {
1742         struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1743                 req, struct rpccli_wbint_LookupUserAliases_state);
1744         NTSTATUS status;
1745
1746         if (tevent_req_is_nterror(req, &status)) {
1747                 tevent_req_received(req);
1748                 return status;
1749         }
1750
1751         /* Steal possbile out parameters to the callers context */
1752         talloc_steal(mem_ctx, state->out_mem_ctx);
1753
1754         /* Return result */
1755         *result = state->orig.out.result;
1756
1757         tevent_req_received(req);
1758         return NT_STATUS_OK;
1759 }
1760
1761 NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli,
1762                                         TALLOC_CTX *mem_ctx,
1763                                         struct wbint_SidArray *sids /* [in] [ref] */,
1764                                         struct wbint_RidArray *rids /* [out] [ref] */)
1765 {
1766         struct wbint_LookupUserAliases r;
1767         NTSTATUS status;
1768
1769         /* In parameters */
1770         r.in.sids = sids;
1771
1772         if (DEBUGLEVEL >= 10) {
1773                 NDR_PRINT_IN_DEBUG(wbint_LookupUserAliases, &r);
1774         }
1775
1776         status = cli->dispatch(cli,
1777                                 mem_ctx,
1778                                 &ndr_table_wbint,
1779                                 NDR_WBINT_LOOKUPUSERALIASES,
1780                                 &r);
1781
1782         if (!NT_STATUS_IS_OK(status)) {
1783                 return status;
1784         }
1785
1786         if (DEBUGLEVEL >= 10) {
1787                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserAliases, &r);
1788         }
1789
1790         if (NT_STATUS_IS_ERR(status)) {
1791                 return status;
1792         }
1793
1794         /* Return variables */
1795         *rids = *r.out.rids;
1796
1797         /* Return result */
1798         return r.out.result;
1799 }
1800
1801 struct rpccli_wbint_LookupUserGroups_state {
1802         struct wbint_LookupUserGroups orig;
1803         struct wbint_LookupUserGroups tmp;
1804         TALLOC_CTX *out_mem_ctx;
1805         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1806 };
1807
1808 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
1809
1810 struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
1811                                                       struct tevent_context *ev,
1812                                                       struct rpc_pipe_client *cli,
1813                                                       struct dom_sid *_sid /* [in] [ref] */,
1814                                                       struct wbint_SidArray *_sids /* [out] [ref] */)
1815 {
1816         struct tevent_req *req;
1817         struct rpccli_wbint_LookupUserGroups_state *state;
1818         struct tevent_req *subreq;
1819
1820         req = tevent_req_create(mem_ctx, &state,
1821                                 struct rpccli_wbint_LookupUserGroups_state);
1822         if (req == NULL) {
1823                 return NULL;
1824         }
1825         state->out_mem_ctx = NULL;
1826         state->dispatch_recv = cli->dispatch_recv;
1827
1828         /* In parameters */
1829         state->orig.in.sid = _sid;
1830
1831         /* Out parameters */
1832         state->orig.out.sids = _sids;
1833
1834         /* Result */
1835         ZERO_STRUCT(state->orig.out.result);
1836
1837         if (DEBUGLEVEL >= 10) {
1838                 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &state->orig);
1839         }
1840
1841         state->out_mem_ctx = talloc_named_const(state, 0,
1842                              "rpccli_wbint_LookupUserGroups_out_memory");
1843         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1844                 return tevent_req_post(req, ev);
1845         }
1846
1847         /* make a temporary copy, that we pass to the dispatch function */
1848         state->tmp = state->orig;
1849
1850         subreq = cli->dispatch_send(state, ev, cli,
1851                                     &ndr_table_wbint,
1852                                     NDR_WBINT_LOOKUPUSERGROUPS,
1853                                     &state->tmp);
1854         if (tevent_req_nomem(subreq, req)) {
1855                 return tevent_req_post(req, ev);
1856         }
1857         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
1858         return req;
1859 }
1860
1861 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
1862 {
1863         struct tevent_req *req = tevent_req_callback_data(
1864                 subreq, struct tevent_req);
1865         struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1866                 req, struct rpccli_wbint_LookupUserGroups_state);
1867         NTSTATUS status;
1868         TALLOC_CTX *mem_ctx;
1869
1870         if (state->out_mem_ctx) {
1871                 mem_ctx = state->out_mem_ctx;
1872         } else {
1873                 mem_ctx = state;
1874         }
1875
1876         status = state->dispatch_recv(subreq, mem_ctx);
1877         TALLOC_FREE(subreq);
1878         if (!NT_STATUS_IS_OK(status)) {
1879                 tevent_req_nterror(req, status);
1880                 return;
1881         }
1882
1883         /* Copy out parameters */
1884         *state->orig.out.sids = *state->tmp.out.sids;
1885
1886         /* Copy result */
1887         state->orig.out.result = state->tmp.out.result;
1888
1889         /* Reset temporary structure */
1890         ZERO_STRUCT(state->tmp);
1891
1892         if (DEBUGLEVEL >= 10) {
1893                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &state->orig);
1894         }
1895
1896         tevent_req_done(req);
1897 }
1898
1899 NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
1900                                             TALLOC_CTX *mem_ctx,
1901                                             NTSTATUS *result)
1902 {
1903         struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1904                 req, struct rpccli_wbint_LookupUserGroups_state);
1905         NTSTATUS status;
1906
1907         if (tevent_req_is_nterror(req, &status)) {
1908                 tevent_req_received(req);
1909                 return status;
1910         }
1911
1912         /* Steal possbile out parameters to the callers context */
1913         talloc_steal(mem_ctx, state->out_mem_ctx);
1914
1915         /* Return result */
1916         *result = state->orig.out.result;
1917
1918         tevent_req_received(req);
1919         return NT_STATUS_OK;
1920 }
1921
1922 NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli,
1923                                        TALLOC_CTX *mem_ctx,
1924                                        struct dom_sid *sid /* [in] [ref] */,
1925                                        struct wbint_SidArray *sids /* [out] [ref] */)
1926 {
1927         struct wbint_LookupUserGroups r;
1928         NTSTATUS status;
1929
1930         /* In parameters */
1931         r.in.sid = sid;
1932
1933         if (DEBUGLEVEL >= 10) {
1934                 NDR_PRINT_IN_DEBUG(wbint_LookupUserGroups, &r);
1935         }
1936
1937         status = cli->dispatch(cli,
1938                                 mem_ctx,
1939                                 &ndr_table_wbint,
1940                                 NDR_WBINT_LOOKUPUSERGROUPS,
1941                                 &r);
1942
1943         if (!NT_STATUS_IS_OK(status)) {
1944                 return status;
1945         }
1946
1947         if (DEBUGLEVEL >= 10) {
1948                 NDR_PRINT_OUT_DEBUG(wbint_LookupUserGroups, &r);
1949         }
1950
1951         if (NT_STATUS_IS_ERR(status)) {
1952                 return status;
1953         }
1954
1955         /* Return variables */
1956         *sids = *r.out.sids;
1957
1958         /* Return result */
1959         return r.out.result;
1960 }
1961
1962 struct rpccli_wbint_QuerySequenceNumber_state {
1963         struct wbint_QuerySequenceNumber orig;
1964         struct wbint_QuerySequenceNumber tmp;
1965         TALLOC_CTX *out_mem_ctx;
1966         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1967 };
1968
1969 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
1970
1971 struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
1972                                                          struct tevent_context *ev,
1973                                                          struct rpc_pipe_client *cli,
1974                                                          uint32_t *_sequence /* [out] [ref] */)
1975 {
1976         struct tevent_req *req;
1977         struct rpccli_wbint_QuerySequenceNumber_state *state;
1978         struct tevent_req *subreq;
1979
1980         req = tevent_req_create(mem_ctx, &state,
1981                                 struct rpccli_wbint_QuerySequenceNumber_state);
1982         if (req == NULL) {
1983                 return NULL;
1984         }
1985         state->out_mem_ctx = NULL;
1986         state->dispatch_recv = cli->dispatch_recv;
1987
1988         /* In parameters */
1989
1990         /* Out parameters */
1991         state->orig.out.sequence = _sequence;
1992
1993         /* Result */
1994         ZERO_STRUCT(state->orig.out.result);
1995
1996         if (DEBUGLEVEL >= 10) {
1997                 NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &state->orig);
1998         }
1999
2000         state->out_mem_ctx = talloc_named_const(state, 0,
2001                              "rpccli_wbint_QuerySequenceNumber_out_memory");
2002         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2003                 return tevent_req_post(req, ev);
2004         }
2005
2006         /* make a temporary copy, that we pass to the dispatch function */
2007         state->tmp = state->orig;
2008
2009         subreq = cli->dispatch_send(state, ev, cli,
2010                                     &ndr_table_wbint,
2011                                     NDR_WBINT_QUERYSEQUENCENUMBER,
2012                                     &state->tmp);
2013         if (tevent_req_nomem(subreq, req)) {
2014                 return tevent_req_post(req, ev);
2015         }
2016         tevent_req_set_callback(subreq, rpccli_wbint_QuerySequenceNumber_done, req);
2017         return req;
2018 }
2019
2020 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
2021 {
2022         struct tevent_req *req = tevent_req_callback_data(
2023                 subreq, struct tevent_req);
2024         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
2025                 req, struct rpccli_wbint_QuerySequenceNumber_state);
2026         NTSTATUS status;
2027         TALLOC_CTX *mem_ctx;
2028
2029         if (state->out_mem_ctx) {
2030                 mem_ctx = state->out_mem_ctx;
2031         } else {
2032                 mem_ctx = state;
2033         }
2034
2035         status = state->dispatch_recv(subreq, mem_ctx);
2036         TALLOC_FREE(subreq);
2037         if (!NT_STATUS_IS_OK(status)) {
2038                 tevent_req_nterror(req, status);
2039                 return;
2040         }
2041
2042         /* Copy out parameters */
2043         *state->orig.out.sequence = *state->tmp.out.sequence;
2044
2045         /* Copy result */
2046         state->orig.out.result = state->tmp.out.result;
2047
2048         /* Reset temporary structure */
2049         ZERO_STRUCT(state->tmp);
2050
2051         if (DEBUGLEVEL >= 10) {
2052                 NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &state->orig);
2053         }
2054
2055         tevent_req_done(req);
2056 }
2057
2058 NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
2059                                                TALLOC_CTX *mem_ctx,
2060                                                NTSTATUS *result)
2061 {
2062         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
2063                 req, struct rpccli_wbint_QuerySequenceNumber_state);
2064         NTSTATUS status;
2065
2066         if (tevent_req_is_nterror(req, &status)) {
2067                 tevent_req_received(req);
2068                 return status;
2069         }
2070
2071         /* Steal possbile out parameters to the callers context */
2072         talloc_steal(mem_ctx, state->out_mem_ctx);
2073
2074         /* Return result */
2075         *result = state->orig.out.result;
2076
2077         tevent_req_received(req);
2078         return NT_STATUS_OK;
2079 }
2080
2081 NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
2082                                           TALLOC_CTX *mem_ctx,
2083                                           uint32_t *sequence /* [out] [ref] */)
2084 {
2085         struct wbint_QuerySequenceNumber r;
2086         NTSTATUS status;
2087
2088         /* In parameters */
2089
2090         if (DEBUGLEVEL >= 10) {
2091                 NDR_PRINT_IN_DEBUG(wbint_QuerySequenceNumber, &r);
2092         }
2093
2094         status = cli->dispatch(cli,
2095                                 mem_ctx,
2096                                 &ndr_table_wbint,
2097                                 NDR_WBINT_QUERYSEQUENCENUMBER,
2098                                 &r);
2099
2100         if (!NT_STATUS_IS_OK(status)) {
2101                 return status;
2102         }
2103
2104         if (DEBUGLEVEL >= 10) {
2105                 NDR_PRINT_OUT_DEBUG(wbint_QuerySequenceNumber, &r);
2106         }
2107
2108         if (NT_STATUS_IS_ERR(status)) {
2109                 return status;
2110         }
2111
2112         /* Return variables */
2113         *sequence = *r.out.sequence;
2114
2115         /* Return result */
2116         return r.out.result;
2117 }
2118
2119 struct rpccli_wbint_LookupGroupMembers_state {
2120         struct wbint_LookupGroupMembers orig;
2121         struct wbint_LookupGroupMembers tmp;
2122         TALLOC_CTX *out_mem_ctx;
2123         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2124 };
2125
2126 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
2127
2128 struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
2129                                                         struct tevent_context *ev,
2130                                                         struct rpc_pipe_client *cli,
2131                                                         struct dom_sid *_sid /* [in] [ref] */,
2132                                                         enum lsa_SidType _type /* [in]  */,
2133                                                         struct wbint_Principals *_members /* [out] [ref] */)
2134 {
2135         struct tevent_req *req;
2136         struct rpccli_wbint_LookupGroupMembers_state *state;
2137         struct tevent_req *subreq;
2138
2139         req = tevent_req_create(mem_ctx, &state,
2140                                 struct rpccli_wbint_LookupGroupMembers_state);
2141         if (req == NULL) {
2142                 return NULL;
2143         }
2144         state->out_mem_ctx = NULL;
2145         state->dispatch_recv = cli->dispatch_recv;
2146
2147         /* In parameters */
2148         state->orig.in.sid = _sid;
2149         state->orig.in.type = _type;
2150
2151         /* Out parameters */
2152         state->orig.out.members = _members;
2153
2154         /* Result */
2155         ZERO_STRUCT(state->orig.out.result);
2156
2157         if (DEBUGLEVEL >= 10) {
2158                 NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &state->orig);
2159         }
2160
2161         state->out_mem_ctx = talloc_named_const(state, 0,
2162                              "rpccli_wbint_LookupGroupMembers_out_memory");
2163         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2164                 return tevent_req_post(req, ev);
2165         }
2166
2167         /* make a temporary copy, that we pass to the dispatch function */
2168         state->tmp = state->orig;
2169
2170         subreq = cli->dispatch_send(state, ev, cli,
2171                                     &ndr_table_wbint,
2172                                     NDR_WBINT_LOOKUPGROUPMEMBERS,
2173                                     &state->tmp);
2174         if (tevent_req_nomem(subreq, req)) {
2175                 return tevent_req_post(req, ev);
2176         }
2177         tevent_req_set_callback(subreq, rpccli_wbint_LookupGroupMembers_done, req);
2178         return req;
2179 }
2180
2181 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
2182 {
2183         struct tevent_req *req = tevent_req_callback_data(
2184                 subreq, struct tevent_req);
2185         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
2186                 req, struct rpccli_wbint_LookupGroupMembers_state);
2187         NTSTATUS status;
2188         TALLOC_CTX *mem_ctx;
2189
2190         if (state->out_mem_ctx) {
2191                 mem_ctx = state->out_mem_ctx;
2192         } else {
2193                 mem_ctx = state;
2194         }
2195
2196         status = state->dispatch_recv(subreq, mem_ctx);
2197         TALLOC_FREE(subreq);
2198         if (!NT_STATUS_IS_OK(status)) {
2199                 tevent_req_nterror(req, status);
2200                 return;
2201         }
2202
2203         /* Copy out parameters */
2204         *state->orig.out.members = *state->tmp.out.members;
2205
2206         /* Copy result */
2207         state->orig.out.result = state->tmp.out.result;
2208
2209         /* Reset temporary structure */
2210         ZERO_STRUCT(state->tmp);
2211
2212         if (DEBUGLEVEL >= 10) {
2213                 NDR_PRINT_OUT_DEBUG(wbint_LookupGroupMembers, &state->orig);
2214         }
2215
2216         tevent_req_done(req);
2217 }
2218
2219 NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
2220                                               TALLOC_CTX *mem_ctx,
2221                                               NTSTATUS *result)
2222 {
2223         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
2224                 req, struct rpccli_wbint_LookupGroupMembers_state);
2225         NTSTATUS status;
2226
2227         if (tevent_req_is_nterror(req, &status)) {
2228                 tevent_req_received(req);
2229                 return status;
2230         }
2231
2232         /* Steal possbile out parameters to the callers context */
2233         talloc_steal(mem_ctx, state->out_mem_ctx);
2234
2235         /* Return result */
2236         *result = state->orig.out.result;
2237
2238         tevent_req_received(req);
2239         return NT_STATUS_OK;
2240 }
2241
2242 NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
2243                                          TALLOC_CTX *mem_ctx,
2244                                          struct dom_sid *sid /* [in] [ref] */,
2245                                          enum lsa_SidType type /* [in]  */,
2246                                          struct wbint_Principals *members /* [out] [ref] */)
2247 {
2248         struct wbint_LookupGroupMembers r;
2249         NTSTATUS status;
2250
2251         /* In parameters */
2252         r.in.sid = sid;
2253         r.in.type = type;
2254
2255         if (DEBUGLEVEL >= 10) {
2256                 NDR_PRINT_IN_DEBUG(wbint_LookupGroupMembers, &r);
2257         }
2258
2259         status = cli->dispatch(cli,
2260                                 mem_ctx,
2261                                 &ndr_table_wbint,
2262                                 NDR_WBINT_LOOKUPGROUPMEMBERS,
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_LookupGroupMembers, &r);
2271         }
2272
2273         if (NT_STATUS_IS_ERR(status)) {
2274                 return status;
2275         }
2276
2277         /* Return variables */
2278         *members = *r.out.members;
2279
2280         /* Return result */
2281         return r.out.result;
2282 }
2283
2284 struct rpccli_wbint_QueryUserList_state {
2285         struct wbint_QueryUserList orig;
2286         struct wbint_QueryUserList 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_QueryUserList_done(struct tevent_req *subreq);
2292
2293 struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
2294                                                    struct tevent_context *ev,
2295                                                    struct rpc_pipe_client *cli,
2296                                                    struct wbint_userinfos *_users /* [out] [ref] */)
2297 {
2298         struct tevent_req *req;
2299         struct rpccli_wbint_QueryUserList_state *state;
2300         struct tevent_req *subreq;
2301
2302         req = tevent_req_create(mem_ctx, &state,
2303                                 struct rpccli_wbint_QueryUserList_state);
2304         if (req == NULL) {
2305                 return NULL;
2306         }
2307         state->out_mem_ctx = NULL;
2308         state->dispatch_recv = cli->dispatch_recv;
2309
2310         /* In parameters */
2311
2312         /* Out parameters */
2313         state->orig.out.users = _users;
2314
2315         /* Result */
2316         ZERO_STRUCT(state->orig.out.result);
2317
2318         if (DEBUGLEVEL >= 10) {
2319                 NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &state->orig);
2320         }
2321
2322         state->out_mem_ctx = talloc_named_const(state, 0,
2323                              "rpccli_wbint_QueryUserList_out_memory");
2324         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2325                 return tevent_req_post(req, ev);
2326         }
2327
2328         /* make a temporary copy, that we pass to the dispatch function */
2329         state->tmp = state->orig;
2330
2331         subreq = cli->dispatch_send(state, ev, cli,
2332                                     &ndr_table_wbint,
2333                                     NDR_WBINT_QUERYUSERLIST,
2334                                     &state->tmp);
2335         if (tevent_req_nomem(subreq, req)) {
2336                 return tevent_req_post(req, ev);
2337         }
2338         tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
2339         return req;
2340 }
2341
2342 static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
2343 {
2344         struct tevent_req *req = tevent_req_callback_data(
2345                 subreq, struct tevent_req);
2346         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2347                 req, struct rpccli_wbint_QueryUserList_state);
2348         NTSTATUS status;
2349         TALLOC_CTX *mem_ctx;
2350
2351         if (state->out_mem_ctx) {
2352                 mem_ctx = state->out_mem_ctx;
2353         } else {
2354                 mem_ctx = state;
2355         }
2356
2357         status = state->dispatch_recv(subreq, mem_ctx);
2358         TALLOC_FREE(subreq);
2359         if (!NT_STATUS_IS_OK(status)) {
2360                 tevent_req_nterror(req, status);
2361                 return;
2362         }
2363
2364         /* Copy out parameters */
2365         *state->orig.out.users = *state->tmp.out.users;
2366
2367         /* Copy result */
2368         state->orig.out.result = state->tmp.out.result;
2369
2370         /* Reset temporary structure */
2371         ZERO_STRUCT(state->tmp);
2372
2373         if (DEBUGLEVEL >= 10) {
2374                 NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &state->orig);
2375         }
2376
2377         tevent_req_done(req);
2378 }
2379
2380 NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
2381                                          TALLOC_CTX *mem_ctx,
2382                                          NTSTATUS *result)
2383 {
2384         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2385                 req, struct rpccli_wbint_QueryUserList_state);
2386         NTSTATUS status;
2387
2388         if (tevent_req_is_nterror(req, &status)) {
2389                 tevent_req_received(req);
2390                 return status;
2391         }
2392
2393         /* Steal possbile out parameters to the callers context */
2394         talloc_steal(mem_ctx, state->out_mem_ctx);
2395
2396         /* Return result */
2397         *result = state->orig.out.result;
2398
2399         tevent_req_received(req);
2400         return NT_STATUS_OK;
2401 }
2402
2403 NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
2404                                     TALLOC_CTX *mem_ctx,
2405                                     struct wbint_userinfos *users /* [out] [ref] */)
2406 {
2407         struct wbint_QueryUserList r;
2408         NTSTATUS status;
2409
2410         /* In parameters */
2411
2412         if (DEBUGLEVEL >= 10) {
2413                 NDR_PRINT_IN_DEBUG(wbint_QueryUserList, &r);
2414         }
2415
2416         status = cli->dispatch(cli,
2417                                 mem_ctx,
2418                                 &ndr_table_wbint,
2419                                 NDR_WBINT_QUERYUSERLIST,
2420                                 &r);
2421
2422         if (!NT_STATUS_IS_OK(status)) {
2423                 return status;
2424         }
2425
2426         if (DEBUGLEVEL >= 10) {
2427                 NDR_PRINT_OUT_DEBUG(wbint_QueryUserList, &r);
2428         }
2429
2430         if (NT_STATUS_IS_ERR(status)) {
2431                 return status;
2432         }
2433
2434         /* Return variables */
2435         *users = *r.out.users;
2436
2437         /* Return result */
2438         return r.out.result;
2439 }
2440
2441 struct rpccli_wbint_QueryGroupList_state {
2442         struct wbint_QueryGroupList orig;
2443         struct wbint_QueryGroupList tmp;
2444         TALLOC_CTX *out_mem_ctx;
2445         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2446 };
2447
2448 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
2449
2450 struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
2451                                                     struct tevent_context *ev,
2452                                                     struct rpc_pipe_client *cli,
2453                                                     struct wbint_Principals *_groups /* [out] [ref] */)
2454 {
2455         struct tevent_req *req;
2456         struct rpccli_wbint_QueryGroupList_state *state;
2457         struct tevent_req *subreq;
2458
2459         req = tevent_req_create(mem_ctx, &state,
2460                                 struct rpccli_wbint_QueryGroupList_state);
2461         if (req == NULL) {
2462                 return NULL;
2463         }
2464         state->out_mem_ctx = NULL;
2465         state->dispatch_recv = cli->dispatch_recv;
2466
2467         /* In parameters */
2468
2469         /* Out parameters */
2470         state->orig.out.groups = _groups;
2471
2472         /* Result */
2473         ZERO_STRUCT(state->orig.out.result);
2474
2475         if (DEBUGLEVEL >= 10) {
2476                 NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &state->orig);
2477         }
2478
2479         state->out_mem_ctx = talloc_named_const(state, 0,
2480                              "rpccli_wbint_QueryGroupList_out_memory");
2481         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2482                 return tevent_req_post(req, ev);
2483         }
2484
2485         /* make a temporary copy, that we pass to the dispatch function */
2486         state->tmp = state->orig;
2487
2488         subreq = cli->dispatch_send(state, ev, cli,
2489                                     &ndr_table_wbint,
2490                                     NDR_WBINT_QUERYGROUPLIST,
2491                                     &state->tmp);
2492         if (tevent_req_nomem(subreq, req)) {
2493                 return tevent_req_post(req, ev);
2494         }
2495         tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
2496         return req;
2497 }
2498
2499 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
2500 {
2501         struct tevent_req *req = tevent_req_callback_data(
2502                 subreq, struct tevent_req);
2503         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2504                 req, struct rpccli_wbint_QueryGroupList_state);
2505         NTSTATUS status;
2506         TALLOC_CTX *mem_ctx;
2507
2508         if (state->out_mem_ctx) {
2509                 mem_ctx = state->out_mem_ctx;
2510         } else {
2511                 mem_ctx = state;
2512         }
2513
2514         status = state->dispatch_recv(subreq, mem_ctx);
2515         TALLOC_FREE(subreq);
2516         if (!NT_STATUS_IS_OK(status)) {
2517                 tevent_req_nterror(req, status);
2518                 return;
2519         }
2520
2521         /* Copy out parameters */
2522         *state->orig.out.groups = *state->tmp.out.groups;
2523
2524         /* Copy result */
2525         state->orig.out.result = state->tmp.out.result;
2526
2527         /* Reset temporary structure */
2528         ZERO_STRUCT(state->tmp);
2529
2530         if (DEBUGLEVEL >= 10) {
2531                 NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &state->orig);
2532         }
2533
2534         tevent_req_done(req);
2535 }
2536
2537 NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
2538                                           TALLOC_CTX *mem_ctx,
2539                                           NTSTATUS *result)
2540 {
2541         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2542                 req, struct rpccli_wbint_QueryGroupList_state);
2543         NTSTATUS status;
2544
2545         if (tevent_req_is_nterror(req, &status)) {
2546                 tevent_req_received(req);
2547                 return status;
2548         }
2549
2550         /* Steal possbile out parameters to the callers context */
2551         talloc_steal(mem_ctx, state->out_mem_ctx);
2552
2553         /* Return result */
2554         *result = state->orig.out.result;
2555
2556         tevent_req_received(req);
2557         return NT_STATUS_OK;
2558 }
2559
2560 NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
2561                                      TALLOC_CTX *mem_ctx,
2562                                      struct wbint_Principals *groups /* [out] [ref] */)
2563 {
2564         struct wbint_QueryGroupList r;
2565         NTSTATUS status;
2566
2567         /* In parameters */
2568
2569         if (DEBUGLEVEL >= 10) {
2570                 NDR_PRINT_IN_DEBUG(wbint_QueryGroupList, &r);
2571         }
2572
2573         status = cli->dispatch(cli,
2574                                 mem_ctx,
2575                                 &ndr_table_wbint,
2576                                 NDR_WBINT_QUERYGROUPLIST,
2577                                 &r);
2578
2579         if (!NT_STATUS_IS_OK(status)) {
2580                 return status;
2581         }
2582
2583         if (DEBUGLEVEL >= 10) {
2584                 NDR_PRINT_OUT_DEBUG(wbint_QueryGroupList, &r);
2585         }
2586
2587         if (NT_STATUS_IS_ERR(status)) {
2588                 return status;
2589         }
2590
2591         /* Return variables */
2592         *groups = *r.out.groups;
2593
2594         /* Return result */
2595         return r.out.result;
2596 }
2597
2598 struct rpccli_wbint_DsGetDcName_state {
2599         struct wbint_DsGetDcName orig;
2600         struct wbint_DsGetDcName tmp;
2601         TALLOC_CTX *out_mem_ctx;
2602         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2603 };
2604
2605 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
2606
2607 struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
2608                                                  struct tevent_context *ev,
2609                                                  struct rpc_pipe_client *cli,
2610                                                  const char *_domain_name /* [in] [ref,charset(UTF8)] */,
2611                                                  struct GUID *_domain_guid /* [in] [unique] */,
2612                                                  const char *_site_name /* [in] [unique,charset(UTF8)] */,
2613                                                  uint32_t _flags /* [in]  */,
2614                                                  struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
2615 {
2616         struct tevent_req *req;
2617         struct rpccli_wbint_DsGetDcName_state *state;
2618         struct tevent_req *subreq;
2619
2620         req = tevent_req_create(mem_ctx, &state,
2621                                 struct rpccli_wbint_DsGetDcName_state);
2622         if (req == NULL) {
2623                 return NULL;
2624         }
2625         state->out_mem_ctx = NULL;
2626         state->dispatch_recv = cli->dispatch_recv;
2627
2628         /* In parameters */
2629         state->orig.in.domain_name = _domain_name;
2630         state->orig.in.domain_guid = _domain_guid;
2631         state->orig.in.site_name = _site_name;
2632         state->orig.in.flags = _flags;
2633
2634         /* Out parameters */
2635         state->orig.out.dc_info = _dc_info;
2636
2637         /* Result */
2638         ZERO_STRUCT(state->orig.out.result);
2639
2640         if (DEBUGLEVEL >= 10) {
2641                 NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &state->orig);
2642         }
2643
2644         state->out_mem_ctx = talloc_named_const(state, 0,
2645                              "rpccli_wbint_DsGetDcName_out_memory");
2646         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2647                 return tevent_req_post(req, ev);
2648         }
2649
2650         /* make a temporary copy, that we pass to the dispatch function */
2651         state->tmp = state->orig;
2652
2653         subreq = cli->dispatch_send(state, ev, cli,
2654                                     &ndr_table_wbint,
2655                                     NDR_WBINT_DSGETDCNAME,
2656                                     &state->tmp);
2657         if (tevent_req_nomem(subreq, req)) {
2658                 return tevent_req_post(req, ev);
2659         }
2660         tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
2661         return req;
2662 }
2663
2664 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
2665 {
2666         struct tevent_req *req = tevent_req_callback_data(
2667                 subreq, struct tevent_req);
2668         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2669                 req, struct rpccli_wbint_DsGetDcName_state);
2670         NTSTATUS status;
2671         TALLOC_CTX *mem_ctx;
2672
2673         if (state->out_mem_ctx) {
2674                 mem_ctx = state->out_mem_ctx;
2675         } else {
2676                 mem_ctx = state;
2677         }
2678
2679         status = state->dispatch_recv(subreq, mem_ctx);
2680         TALLOC_FREE(subreq);
2681         if (!NT_STATUS_IS_OK(status)) {
2682                 tevent_req_nterror(req, status);
2683                 return;
2684         }
2685
2686         /* Copy out parameters */
2687         *state->orig.out.dc_info = *state->tmp.out.dc_info;
2688
2689         /* Copy result */
2690         state->orig.out.result = state->tmp.out.result;
2691
2692         /* Reset temporary structure */
2693         ZERO_STRUCT(state->tmp);
2694
2695         if (DEBUGLEVEL >= 10) {
2696                 NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &state->orig);
2697         }
2698
2699         tevent_req_done(req);
2700 }
2701
2702 NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
2703                                        TALLOC_CTX *mem_ctx,
2704                                        NTSTATUS *result)
2705 {
2706         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2707                 req, struct rpccli_wbint_DsGetDcName_state);
2708         NTSTATUS status;
2709
2710         if (tevent_req_is_nterror(req, &status)) {
2711                 tevent_req_received(req);
2712                 return status;
2713         }
2714
2715         /* Steal possbile out parameters to the callers context */
2716         talloc_steal(mem_ctx, state->out_mem_ctx);
2717
2718         /* Return result */
2719         *result = state->orig.out.result;
2720
2721         tevent_req_received(req);
2722         return NT_STATUS_OK;
2723 }
2724
2725 NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
2726                                   TALLOC_CTX *mem_ctx,
2727                                   const char *domain_name /* [in] [ref,charset(UTF8)] */,
2728                                   struct GUID *domain_guid /* [in] [unique] */,
2729                                   const char *site_name /* [in] [unique,charset(UTF8)] */,
2730                                   uint32_t flags /* [in]  */,
2731                                   struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
2732 {
2733         struct wbint_DsGetDcName r;
2734         NTSTATUS status;
2735
2736         /* In parameters */
2737         r.in.domain_name = domain_name;
2738         r.in.domain_guid = domain_guid;
2739         r.in.site_name = site_name;
2740         r.in.flags = flags;
2741
2742         if (DEBUGLEVEL >= 10) {
2743                 NDR_PRINT_IN_DEBUG(wbint_DsGetDcName, &r);
2744         }
2745
2746         status = cli->dispatch(cli,
2747                                 mem_ctx,
2748                                 &ndr_table_wbint,
2749                                 NDR_WBINT_DSGETDCNAME,
2750                                 &r);
2751
2752         if (!NT_STATUS_IS_OK(status)) {
2753                 return status;
2754         }
2755
2756         if (DEBUGLEVEL >= 10) {
2757                 NDR_PRINT_OUT_DEBUG(wbint_DsGetDcName, &r);
2758         }
2759
2760         if (NT_STATUS_IS_ERR(status)) {
2761                 return status;
2762         }
2763
2764         /* Return variables */
2765         *dc_info = *r.out.dc_info;
2766
2767         /* Return result */
2768         return r.out.result;
2769 }
2770
2771 struct rpccli_wbint_LookupRids_state {
2772         struct wbint_LookupRids orig;
2773         struct wbint_LookupRids tmp;
2774         TALLOC_CTX *out_mem_ctx;
2775         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2776 };
2777
2778 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq);
2779
2780 struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
2781                                                 struct tevent_context *ev,
2782                                                 struct rpc_pipe_client *cli,
2783                                                 struct wbint_RidArray *_rids /* [in] [ref] */,
2784                                                 struct wbint_Principals *_names /* [out] [ref] */)
2785 {
2786         struct tevent_req *req;
2787         struct rpccli_wbint_LookupRids_state *state;
2788         struct tevent_req *subreq;
2789
2790         req = tevent_req_create(mem_ctx, &state,
2791                                 struct rpccli_wbint_LookupRids_state);
2792         if (req == NULL) {
2793                 return NULL;
2794         }
2795         state->out_mem_ctx = NULL;
2796         state->dispatch_recv = cli->dispatch_recv;
2797
2798         /* In parameters */
2799         state->orig.in.rids = _rids;
2800
2801         /* Out parameters */
2802         state->orig.out.names = _names;
2803
2804         /* Result */
2805         ZERO_STRUCT(state->orig.out.result);
2806
2807         if (DEBUGLEVEL >= 10) {
2808                 NDR_PRINT_IN_DEBUG(wbint_LookupRids, &state->orig);
2809         }
2810
2811         state->out_mem_ctx = talloc_named_const(state, 0,
2812                              "rpccli_wbint_LookupRids_out_memory");
2813         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2814                 return tevent_req_post(req, ev);
2815         }
2816
2817         /* make a temporary copy, that we pass to the dispatch function */
2818         state->tmp = state->orig;
2819
2820         subreq = cli->dispatch_send(state, ev, cli,
2821                                     &ndr_table_wbint,
2822                                     NDR_WBINT_LOOKUPRIDS,
2823                                     &state->tmp);
2824         if (tevent_req_nomem(subreq, req)) {
2825                 return tevent_req_post(req, ev);
2826         }
2827         tevent_req_set_callback(subreq, rpccli_wbint_LookupRids_done, req);
2828         return req;
2829 }
2830
2831 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
2832 {
2833         struct tevent_req *req = tevent_req_callback_data(
2834                 subreq, struct tevent_req);
2835         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2836                 req, struct rpccli_wbint_LookupRids_state);
2837         NTSTATUS status;
2838         TALLOC_CTX *mem_ctx;
2839
2840         if (state->out_mem_ctx) {
2841                 mem_ctx = state->out_mem_ctx;
2842         } else {
2843                 mem_ctx = state;
2844         }
2845
2846         status = state->dispatch_recv(subreq, mem_ctx);
2847         TALLOC_FREE(subreq);
2848         if (!NT_STATUS_IS_OK(status)) {
2849                 tevent_req_nterror(req, status);
2850                 return;
2851         }
2852
2853         /* Copy out parameters */
2854         *state->orig.out.names = *state->tmp.out.names;
2855
2856         /* Copy result */
2857         state->orig.out.result = state->tmp.out.result;
2858
2859         /* Reset temporary structure */
2860         ZERO_STRUCT(state->tmp);
2861
2862         if (DEBUGLEVEL >= 10) {
2863                 NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &state->orig);
2864         }
2865
2866         tevent_req_done(req);
2867 }
2868
2869 NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
2870                                       TALLOC_CTX *mem_ctx,
2871                                       NTSTATUS *result)
2872 {
2873         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2874                 req, struct rpccli_wbint_LookupRids_state);
2875         NTSTATUS status;
2876
2877         if (tevent_req_is_nterror(req, &status)) {
2878                 tevent_req_received(req);
2879                 return status;
2880         }
2881
2882         /* Steal possbile out parameters to the callers context */
2883         talloc_steal(mem_ctx, state->out_mem_ctx);
2884
2885         /* Return result */
2886         *result = state->orig.out.result;
2887
2888         tevent_req_received(req);
2889         return NT_STATUS_OK;
2890 }
2891
2892 NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli,
2893                                  TALLOC_CTX *mem_ctx,
2894                                  struct wbint_RidArray *rids /* [in] [ref] */,
2895                                  struct wbint_Principals *names /* [out] [ref] */)
2896 {
2897         struct wbint_LookupRids r;
2898         NTSTATUS status;
2899
2900         /* In parameters */
2901         r.in.rids = rids;
2902
2903         if (DEBUGLEVEL >= 10) {
2904                 NDR_PRINT_IN_DEBUG(wbint_LookupRids, &r);
2905         }
2906
2907         status = cli->dispatch(cli,
2908                                 mem_ctx,
2909                                 &ndr_table_wbint,
2910                                 NDR_WBINT_LOOKUPRIDS,
2911                                 &r);
2912
2913         if (!NT_STATUS_IS_OK(status)) {
2914                 return status;
2915         }
2916
2917         if (DEBUGLEVEL >= 10) {
2918                 NDR_PRINT_OUT_DEBUG(wbint_LookupRids, &r);
2919         }
2920
2921         if (NT_STATUS_IS_ERR(status)) {
2922                 return status;
2923         }
2924
2925         /* Return variables */
2926         *names = *r.out.names;
2927
2928         /* Return result */
2929         return r.out.result;
2930 }
2931
2932 struct rpccli_wbint_CheckMachineAccount_state {
2933         struct wbint_CheckMachineAccount orig;
2934         struct wbint_CheckMachineAccount tmp;
2935         TALLOC_CTX *out_mem_ctx;
2936         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2937 };
2938
2939 static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq);
2940
2941 struct tevent_req *rpccli_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx,
2942                                                          struct tevent_context *ev,
2943                                                          struct rpc_pipe_client *cli)
2944 {
2945         struct tevent_req *req;
2946         struct rpccli_wbint_CheckMachineAccount_state *state;
2947         struct tevent_req *subreq;
2948
2949         req = tevent_req_create(mem_ctx, &state,
2950                                 struct rpccli_wbint_CheckMachineAccount_state);
2951         if (req == NULL) {
2952                 return NULL;
2953         }
2954         state->out_mem_ctx = NULL;
2955         state->dispatch_recv = cli->dispatch_recv;
2956
2957         /* In parameters */
2958
2959         /* Out parameters */
2960
2961         /* Result */
2962         ZERO_STRUCT(state->orig.out.result);
2963
2964         if (DEBUGLEVEL >= 10) {
2965                 NDR_PRINT_IN_DEBUG(wbint_CheckMachineAccount, &state->orig);
2966         }
2967
2968         /* make a temporary copy, that we pass to the dispatch function */
2969         state->tmp = state->orig;
2970
2971         subreq = cli->dispatch_send(state, ev, cli,
2972                                     &ndr_table_wbint,
2973                                     NDR_WBINT_CHECKMACHINEACCOUNT,
2974                                     &state->tmp);
2975         if (tevent_req_nomem(subreq, req)) {
2976                 return tevent_req_post(req, ev);
2977         }
2978         tevent_req_set_callback(subreq, rpccli_wbint_CheckMachineAccount_done, req);
2979         return req;
2980 }
2981
2982 static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq)
2983 {
2984         struct tevent_req *req = tevent_req_callback_data(
2985                 subreq, struct tevent_req);
2986         struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
2987                 req, struct rpccli_wbint_CheckMachineAccount_state);
2988         NTSTATUS status;
2989         TALLOC_CTX *mem_ctx;
2990
2991         if (state->out_mem_ctx) {
2992                 mem_ctx = state->out_mem_ctx;
2993         } else {
2994                 mem_ctx = state;
2995         }
2996
2997         status = state->dispatch_recv(subreq, mem_ctx);
2998         TALLOC_FREE(subreq);
2999         if (!NT_STATUS_IS_OK(status)) {
3000                 tevent_req_nterror(req, status);
3001                 return;
3002         }
3003
3004         /* Copy out parameters */
3005
3006         /* Copy result */
3007         state->orig.out.result = state->tmp.out.result;
3008
3009         /* Reset temporary structure */
3010         ZERO_STRUCT(state->tmp);
3011
3012         if (DEBUGLEVEL >= 10) {
3013                 NDR_PRINT_OUT_DEBUG(wbint_CheckMachineAccount, &state->orig);
3014         }
3015
3016         tevent_req_done(req);
3017 }
3018
3019 NTSTATUS rpccli_wbint_CheckMachineAccount_recv(struct tevent_req *req,
3020                                                TALLOC_CTX *mem_ctx,
3021                                                NTSTATUS *result)
3022 {
3023         struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
3024                 req, struct rpccli_wbint_CheckMachineAccount_state);
3025         NTSTATUS status;
3026
3027         if (tevent_req_is_nterror(req, &status)) {
3028                 tevent_req_received(req);
3029                 return status;
3030         }
3031
3032         /* Steal possbile out parameters to the callers context */
3033         talloc_steal(mem_ctx, state->out_mem_ctx);
3034
3035         /* Return result */
3036         *result = state->orig.out.result;
3037
3038         tevent_req_received(req);
3039         return NT_STATUS_OK;
3040 }
3041
3042 NTSTATUS rpccli_wbint_CheckMachineAccount(struct rpc_pipe_client *cli,
3043                                           TALLOC_CTX *mem_ctx)
3044 {
3045         struct wbint_CheckMachineAccount r;
3046         NTSTATUS status;
3047
3048         /* In parameters */
3049
3050         if (DEBUGLEVEL >= 10) {
3051                 NDR_PRINT_IN_DEBUG(wbint_CheckMachineAccount, &r);
3052         }
3053
3054         status = cli->dispatch(cli,
3055                                 mem_ctx,
3056                                 &ndr_table_wbint,
3057                                 NDR_WBINT_CHECKMACHINEACCOUNT,
3058                                 &r);
3059
3060         if (!NT_STATUS_IS_OK(status)) {
3061                 return status;
3062         }
3063
3064         if (DEBUGLEVEL >= 10) {
3065                 NDR_PRINT_OUT_DEBUG(wbint_CheckMachineAccount, &r);
3066         }
3067
3068         if (NT_STATUS_IS_ERR(status)) {
3069                 return status;
3070         }
3071
3072         /* Return variables */
3073
3074         /* Return result */
3075         return r.out.result;
3076 }
3077
3078 struct rpccli_wbint_SetMapping_state {
3079         struct wbint_SetMapping orig;
3080         struct wbint_SetMapping tmp;
3081         TALLOC_CTX *out_mem_ctx;
3082         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3083 };
3084
3085 static void rpccli_wbint_SetMapping_done(struct tevent_req *subreq);
3086
3087 struct tevent_req *rpccli_wbint_SetMapping_send(TALLOC_CTX *mem_ctx,
3088                                                 struct tevent_context *ev,
3089                                                 struct rpc_pipe_client *cli,
3090                                                 struct dom_sid *_sid /* [in] [ref] */,
3091           &n