git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / source3 / librpc / gen_ndr / ndr_wbint_c.c
1 /* client functions auto-generated by pidl */
2
3 #include "includes.h"
4 #include <tevent.h>
5 #include "lib/util/tevent_ntstatus.h"
6 #include "bin/default/source3/librpc/gen_ndr/ndr_wbint.h"
7 #include "bin/default/source3/librpc/gen_ndr/ndr_wbint_c.h"
8
9 /* wbint - client functions generated by pidl */
10
11 struct dcerpc_wbint_Ping_r_state {
12         TALLOC_CTX *out_mem_ctx;
13 };
14
15 static void dcerpc_wbint_Ping_r_done(struct tevent_req *subreq);
16
17 struct tevent_req *dcerpc_wbint_Ping_r_send(TALLOC_CTX *mem_ctx,
18         struct tevent_context *ev,
19         struct dcerpc_binding_handle *h,
20         struct wbint_Ping *r)
21 {
22         struct tevent_req *req;
23         struct dcerpc_wbint_Ping_r_state *state;
24         struct tevent_req *subreq;
25
26         req = tevent_req_create(mem_ctx, &state,
27                                 struct dcerpc_wbint_Ping_r_state);
28         if (req == NULL) {
29                 return NULL;
30         }
31
32         state->out_mem_ctx = talloc_new(state);
33         if (tevent_req_nomem(state->out_mem_ctx, req)) {
34                 return tevent_req_post(req, ev);
35         }
36
37         subreq = dcerpc_binding_handle_call_send(state, ev, h,
38                         NULL, &ndr_table_wbint,
39                         NDR_WBINT_PING, state->out_mem_ctx, r);
40         if (tevent_req_nomem(subreq, req)) {
41                 return tevent_req_post(req, ev);
42         }
43         tevent_req_set_callback(subreq, dcerpc_wbint_Ping_r_done, req);
44
45         return req;
46 }
47
48 static void dcerpc_wbint_Ping_r_done(struct tevent_req *subreq)
49 {
50         struct tevent_req *req =
51                 tevent_req_callback_data(subreq,
52                 struct tevent_req);
53         NTSTATUS status;
54
55         status = dcerpc_binding_handle_call_recv(subreq);
56         TALLOC_FREE(subreq);
57         if (tevent_req_nterror(req, status)) {
58                 return;
59         }
60
61         tevent_req_done(req);
62 }
63
64 NTSTATUS dcerpc_wbint_Ping_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
65 {
66         struct dcerpc_wbint_Ping_r_state *state =
67                 tevent_req_data(req,
68                 struct dcerpc_wbint_Ping_r_state);
69         NTSTATUS status;
70
71         if (tevent_req_is_nterror(req, &status)) {
72                 tevent_req_received(req);
73                 return status;
74         }
75
76         talloc_steal(mem_ctx, state->out_mem_ctx);
77
78         tevent_req_received(req);
79         return NT_STATUS_OK;
80 }
81
82 NTSTATUS dcerpc_wbint_Ping_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Ping *r)
83 {
84         NTSTATUS status;
85
86         status = dcerpc_binding_handle_call(h,
87                         NULL, &ndr_table_wbint,
88                         NDR_WBINT_PING, mem_ctx, r);
89
90         return status;
91 }
92
93 struct dcerpc_wbint_Ping_state {
94         struct wbint_Ping orig;
95         struct wbint_Ping tmp;
96         TALLOC_CTX *out_mem_ctx;
97 };
98
99 static void dcerpc_wbint_Ping_done(struct tevent_req *subreq);
100
101 struct tevent_req *dcerpc_wbint_Ping_send(TALLOC_CTX *mem_ctx,
102                                           struct tevent_context *ev,
103                                           struct dcerpc_binding_handle *h,
104                                           uint32_t _in_data /* [in]  */,
105                                           uint32_t *_out_data /* [out] [ref] */)
106 {
107         struct tevent_req *req;
108         struct dcerpc_wbint_Ping_state *state;
109         struct tevent_req *subreq;
110
111         req = tevent_req_create(mem_ctx, &state,
112                                 struct dcerpc_wbint_Ping_state);
113         if (req == NULL) {
114                 return NULL;
115         }
116         state->out_mem_ctx = NULL;
117
118         /* In parameters */
119         state->orig.in.in_data = _in_data;
120
121         /* Out parameters */
122         state->orig.out.out_data = _out_data;
123
124         state->out_mem_ctx = talloc_named_const(state, 0,
125                              "dcerpc_wbint_Ping_out_memory");
126         if (tevent_req_nomem(state->out_mem_ctx, req)) {
127                 return tevent_req_post(req, ev);
128         }
129
130         /* make a temporary copy, that we pass to the dispatch function */
131         state->tmp = state->orig;
132
133         subreq = dcerpc_wbint_Ping_r_send(state, ev, h, &state->tmp);
134         if (tevent_req_nomem(subreq, req)) {
135                 return tevent_req_post(req, ev);
136         }
137         tevent_req_set_callback(subreq, dcerpc_wbint_Ping_done, req);
138         return req;
139 }
140
141 static void dcerpc_wbint_Ping_done(struct tevent_req *subreq)
142 {
143         struct tevent_req *req = tevent_req_callback_data(
144                 subreq, struct tevent_req);
145         struct dcerpc_wbint_Ping_state *state = tevent_req_data(
146                 req, struct dcerpc_wbint_Ping_state);
147         NTSTATUS status;
148         TALLOC_CTX *mem_ctx;
149
150         if (state->out_mem_ctx) {
151                 mem_ctx = state->out_mem_ctx;
152         } else {
153                 mem_ctx = state;
154         }
155
156         status = dcerpc_wbint_Ping_r_recv(subreq, mem_ctx);
157         TALLOC_FREE(subreq);
158         if (tevent_req_nterror(req, status)) {
159                 return;
160         }
161
162         /* Copy out parameters */
163         *state->orig.out.out_data = *state->tmp.out.out_data;
164
165         /* Reset temporary structure */
166         ZERO_STRUCT(state->tmp);
167
168         tevent_req_done(req);
169 }
170
171 NTSTATUS dcerpc_wbint_Ping_recv(struct tevent_req *req,
172                                 TALLOC_CTX *mem_ctx)
173 {
174         struct dcerpc_wbint_Ping_state *state = tevent_req_data(
175                 req, struct dcerpc_wbint_Ping_state);
176         NTSTATUS status;
177
178         if (tevent_req_is_nterror(req, &status)) {
179                 tevent_req_received(req);
180                 return status;
181         }
182
183         /* Steal possible out parameters to the callers context */
184         talloc_steal(mem_ctx, state->out_mem_ctx);
185
186         tevent_req_received(req);
187         return NT_STATUS_OK;
188 }
189
190 NTSTATUS dcerpc_wbint_Ping(struct dcerpc_binding_handle *h,
191                            TALLOC_CTX *mem_ctx,
192                            uint32_t _in_data /* [in]  */,
193                            uint32_t *_out_data /* [out] [ref] */)
194 {
195         struct wbint_Ping r;
196         NTSTATUS status;
197
198         /* In parameters */
199         r.in.in_data = _in_data;
200
201         status = dcerpc_wbint_Ping_r(h, mem_ctx, &r);
202         if (!NT_STATUS_IS_OK(status)) {
203                 return status;
204         }
205
206         /* Return variables */
207         *_out_data = *r.out.out_data;
208
209         /* Return result */
210
211         return NT_STATUS_OK;
212 }
213
214 struct dcerpc_wbint_LookupSid_r_state {
215         TALLOC_CTX *out_mem_ctx;
216 };
217
218 static void dcerpc_wbint_LookupSid_r_done(struct tevent_req *subreq);
219
220 struct tevent_req *dcerpc_wbint_LookupSid_r_send(TALLOC_CTX *mem_ctx,
221         struct tevent_context *ev,
222         struct dcerpc_binding_handle *h,
223         struct wbint_LookupSid *r)
224 {
225         struct tevent_req *req;
226         struct dcerpc_wbint_LookupSid_r_state *state;
227         struct tevent_req *subreq;
228
229         req = tevent_req_create(mem_ctx, &state,
230                                 struct dcerpc_wbint_LookupSid_r_state);
231         if (req == NULL) {
232                 return NULL;
233         }
234
235         state->out_mem_ctx = talloc_new(state);
236         if (tevent_req_nomem(state->out_mem_ctx, req)) {
237                 return tevent_req_post(req, ev);
238         }
239
240         subreq = dcerpc_binding_handle_call_send(state, ev, h,
241                         NULL, &ndr_table_wbint,
242                         NDR_WBINT_LOOKUPSID, state->out_mem_ctx, r);
243         if (tevent_req_nomem(subreq, req)) {
244                 return tevent_req_post(req, ev);
245         }
246         tevent_req_set_callback(subreq, dcerpc_wbint_LookupSid_r_done, req);
247
248         return req;
249 }
250
251 static void dcerpc_wbint_LookupSid_r_done(struct tevent_req *subreq)
252 {
253         struct tevent_req *req =
254                 tevent_req_callback_data(subreq,
255                 struct tevent_req);
256         NTSTATUS status;
257
258         status = dcerpc_binding_handle_call_recv(subreq);
259         TALLOC_FREE(subreq);
260         if (tevent_req_nterror(req, status)) {
261                 return;
262         }
263
264         tevent_req_done(req);
265 }
266
267 NTSTATUS dcerpc_wbint_LookupSid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
268 {
269         struct dcerpc_wbint_LookupSid_r_state *state =
270                 tevent_req_data(req,
271                 struct dcerpc_wbint_LookupSid_r_state);
272         NTSTATUS status;
273
274         if (tevent_req_is_nterror(req, &status)) {
275                 tevent_req_received(req);
276                 return status;
277         }
278
279         talloc_steal(mem_ctx, state->out_mem_ctx);
280
281         tevent_req_received(req);
282         return NT_STATUS_OK;
283 }
284
285 NTSTATUS dcerpc_wbint_LookupSid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupSid *r)
286 {
287         NTSTATUS status;
288
289         status = dcerpc_binding_handle_call(h,
290                         NULL, &ndr_table_wbint,
291                         NDR_WBINT_LOOKUPSID, mem_ctx, r);
292
293         return status;
294 }
295
296 struct dcerpc_wbint_LookupSid_state {
297         struct wbint_LookupSid orig;
298         struct wbint_LookupSid tmp;
299         TALLOC_CTX *out_mem_ctx;
300 };
301
302 static void dcerpc_wbint_LookupSid_done(struct tevent_req *subreq);
303
304 struct tevent_req *dcerpc_wbint_LookupSid_send(TALLOC_CTX *mem_ctx,
305                                                struct tevent_context *ev,
306                                                struct dcerpc_binding_handle *h,
307                                                struct dom_sid *_sid /* [in] [ref] */,
308                                                enum lsa_SidType *_type /* [out] [ref] */,
309                                                const char **_domain /* [out] [ref,charset(UTF8)] */,
310                                                const char **_name /* [out] [ref,charset(UTF8)] */)
311 {
312         struct tevent_req *req;
313         struct dcerpc_wbint_LookupSid_state *state;
314         struct tevent_req *subreq;
315
316         req = tevent_req_create(mem_ctx, &state,
317                                 struct dcerpc_wbint_LookupSid_state);
318         if (req == NULL) {
319                 return NULL;
320         }
321         state->out_mem_ctx = NULL;
322
323         /* In parameters */
324         state->orig.in.sid = _sid;
325
326         /* Out parameters */
327         state->orig.out.type = _type;
328         state->orig.out.domain = _domain;
329         state->orig.out.name = _name;
330
331         /* Result */
332         ZERO_STRUCT(state->orig.out.result);
333
334         state->out_mem_ctx = talloc_named_const(state, 0,
335                              "dcerpc_wbint_LookupSid_out_memory");
336         if (tevent_req_nomem(state->out_mem_ctx, req)) {
337                 return tevent_req_post(req, ev);
338         }
339
340         /* make a temporary copy, that we pass to the dispatch function */
341         state->tmp = state->orig;
342
343         subreq = dcerpc_wbint_LookupSid_r_send(state, ev, h, &state->tmp);
344         if (tevent_req_nomem(subreq, req)) {
345                 return tevent_req_post(req, ev);
346         }
347         tevent_req_set_callback(subreq, dcerpc_wbint_LookupSid_done, req);
348         return req;
349 }
350
351 static void dcerpc_wbint_LookupSid_done(struct tevent_req *subreq)
352 {
353         struct tevent_req *req = tevent_req_callback_data(
354                 subreq, struct tevent_req);
355         struct dcerpc_wbint_LookupSid_state *state = tevent_req_data(
356                 req, struct dcerpc_wbint_LookupSid_state);
357         NTSTATUS status;
358         TALLOC_CTX *mem_ctx;
359
360         if (state->out_mem_ctx) {
361                 mem_ctx = state->out_mem_ctx;
362         } else {
363                 mem_ctx = state;
364         }
365
366         status = dcerpc_wbint_LookupSid_r_recv(subreq, mem_ctx);
367         TALLOC_FREE(subreq);
368         if (tevent_req_nterror(req, status)) {
369                 return;
370         }
371
372         /* Copy out parameters */
373         *state->orig.out.type = *state->tmp.out.type;
374         *state->orig.out.domain = *state->tmp.out.domain;
375         *state->orig.out.name = *state->tmp.out.name;
376
377         /* Copy result */
378         state->orig.out.result = state->tmp.out.result;
379
380         /* Reset temporary structure */
381         ZERO_STRUCT(state->tmp);
382
383         tevent_req_done(req);
384 }
385
386 NTSTATUS dcerpc_wbint_LookupSid_recv(struct tevent_req *req,
387                                      TALLOC_CTX *mem_ctx,
388                                      NTSTATUS *result)
389 {
390         struct dcerpc_wbint_LookupSid_state *state = tevent_req_data(
391                 req, struct dcerpc_wbint_LookupSid_state);
392         NTSTATUS status;
393
394         if (tevent_req_is_nterror(req, &status)) {
395                 tevent_req_received(req);
396                 return status;
397         }
398
399         /* Steal possible out parameters to the callers context */
400         talloc_steal(mem_ctx, state->out_mem_ctx);
401
402         /* Return result */
403         *result = state->orig.out.result;
404
405         tevent_req_received(req);
406         return NT_STATUS_OK;
407 }
408
409 NTSTATUS dcerpc_wbint_LookupSid(struct dcerpc_binding_handle *h,
410                                 TALLOC_CTX *mem_ctx,
411                                 struct dom_sid *_sid /* [in] [ref] */,
412                                 enum lsa_SidType *_type /* [out] [ref] */,
413                                 const char **_domain /* [out] [ref,charset(UTF8)] */,
414                                 const char **_name /* [out] [ref,charset(UTF8)] */,
415                                 NTSTATUS *result)
416 {
417         struct wbint_LookupSid r;
418         NTSTATUS status;
419
420         /* In parameters */
421         r.in.sid = _sid;
422
423         status = dcerpc_wbint_LookupSid_r(h, mem_ctx, &r);
424         if (!NT_STATUS_IS_OK(status)) {
425                 return status;
426         }
427
428         /* Return variables */
429         *_type = *r.out.type;
430         *_domain = *r.out.domain;
431         *_name = *r.out.name;
432
433         /* Return result */
434         *result = r.out.result;
435
436         return NT_STATUS_OK;
437 }
438
439 struct dcerpc_wbint_LookupSids_r_state {
440         TALLOC_CTX *out_mem_ctx;
441 };
442
443 static void dcerpc_wbint_LookupSids_r_done(struct tevent_req *subreq);
444
445 struct tevent_req *dcerpc_wbint_LookupSids_r_send(TALLOC_CTX *mem_ctx,
446         struct tevent_context *ev,
447         struct dcerpc_binding_handle *h,
448         struct wbint_LookupSids *r)
449 {
450         struct tevent_req *req;
451         struct dcerpc_wbint_LookupSids_r_state *state;
452         struct tevent_req *subreq;
453
454         req = tevent_req_create(mem_ctx, &state,
455                                 struct dcerpc_wbint_LookupSids_r_state);
456         if (req == NULL) {
457                 return NULL;
458         }
459
460         state->out_mem_ctx = talloc_new(state);
461         if (tevent_req_nomem(state->out_mem_ctx, req)) {
462                 return tevent_req_post(req, ev);
463         }
464
465         subreq = dcerpc_binding_handle_call_send(state, ev, h,
466                         NULL, &ndr_table_wbint,
467                         NDR_WBINT_LOOKUPSIDS, state->out_mem_ctx, r);
468         if (tevent_req_nomem(subreq, req)) {
469                 return tevent_req_post(req, ev);
470         }
471         tevent_req_set_callback(subreq, dcerpc_wbint_LookupSids_r_done, req);
472
473         return req;
474 }
475
476 static void dcerpc_wbint_LookupSids_r_done(struct tevent_req *subreq)
477 {
478         struct tevent_req *req =
479                 tevent_req_callback_data(subreq,
480                 struct tevent_req);
481         NTSTATUS status;
482
483         status = dcerpc_binding_handle_call_recv(subreq);
484         TALLOC_FREE(subreq);
485         if (tevent_req_nterror(req, status)) {
486                 return;
487         }
488
489         tevent_req_done(req);
490 }
491
492 NTSTATUS dcerpc_wbint_LookupSids_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
493 {
494         struct dcerpc_wbint_LookupSids_r_state *state =
495                 tevent_req_data(req,
496                 struct dcerpc_wbint_LookupSids_r_state);
497         NTSTATUS status;
498
499         if (tevent_req_is_nterror(req, &status)) {
500                 tevent_req_received(req);
501                 return status;
502         }
503
504         talloc_steal(mem_ctx, state->out_mem_ctx);
505
506         tevent_req_received(req);
507         return NT_STATUS_OK;
508 }
509
510 NTSTATUS dcerpc_wbint_LookupSids_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupSids *r)
511 {
512         NTSTATUS status;
513
514         status = dcerpc_binding_handle_call(h,
515                         NULL, &ndr_table_wbint,
516                         NDR_WBINT_LOOKUPSIDS, mem_ctx, r);
517
518         return status;
519 }
520
521 struct dcerpc_wbint_LookupSids_state {
522         struct wbint_LookupSids orig;
523         struct wbint_LookupSids tmp;
524         TALLOC_CTX *out_mem_ctx;
525 };
526
527 static void dcerpc_wbint_LookupSids_done(struct tevent_req *subreq);
528
529 struct tevent_req *dcerpc_wbint_LookupSids_send(TALLOC_CTX *mem_ctx,
530                                                 struct tevent_context *ev,
531                                                 struct dcerpc_binding_handle *h,
532                                                 struct lsa_SidArray *_sids /* [in] [ref] */,
533                                                 struct lsa_RefDomainList *_domains /* [out] [ref] */,
534                                                 struct lsa_TransNameArray *_names /* [out] [ref] */)
535 {
536         struct tevent_req *req;
537         struct dcerpc_wbint_LookupSids_state *state;
538         struct tevent_req *subreq;
539
540         req = tevent_req_create(mem_ctx, &state,
541                                 struct dcerpc_wbint_LookupSids_state);
542         if (req == NULL) {
543                 return NULL;
544         }
545         state->out_mem_ctx = NULL;
546
547         /* In parameters */
548         state->orig.in.sids = _sids;
549
550         /* Out parameters */
551         state->orig.out.domains = _domains;
552         state->orig.out.names = _names;
553
554         /* Result */
555         ZERO_STRUCT(state->orig.out.result);
556
557         state->out_mem_ctx = talloc_named_const(state, 0,
558                              "dcerpc_wbint_LookupSids_out_memory");
559         if (tevent_req_nomem(state->out_mem_ctx, req)) {
560                 return tevent_req_post(req, ev);
561         }
562
563         /* make a temporary copy, that we pass to the dispatch function */
564         state->tmp = state->orig;
565
566         subreq = dcerpc_wbint_LookupSids_r_send(state, ev, h, &state->tmp);
567         if (tevent_req_nomem(subreq, req)) {
568                 return tevent_req_post(req, ev);
569         }
570         tevent_req_set_callback(subreq, dcerpc_wbint_LookupSids_done, req);
571         return req;
572 }
573
574 static void dcerpc_wbint_LookupSids_done(struct tevent_req *subreq)
575 {
576         struct tevent_req *req = tevent_req_callback_data(
577                 subreq, struct tevent_req);
578         struct dcerpc_wbint_LookupSids_state *state = tevent_req_data(
579                 req, struct dcerpc_wbint_LookupSids_state);
580         NTSTATUS status;
581         TALLOC_CTX *mem_ctx;
582
583         if (state->out_mem_ctx) {
584                 mem_ctx = state->out_mem_ctx;
585         } else {
586                 mem_ctx = state;
587         }
588
589         status = dcerpc_wbint_LookupSids_r_recv(subreq, mem_ctx);
590         TALLOC_FREE(subreq);
591         if (tevent_req_nterror(req, status)) {
592                 return;
593         }
594
595         /* Copy out parameters */
596         *state->orig.out.domains = *state->tmp.out.domains;
597         *state->orig.out.names = *state->tmp.out.names;
598
599         /* Copy result */
600         state->orig.out.result = state->tmp.out.result;
601
602         /* Reset temporary structure */
603         ZERO_STRUCT(state->tmp);
604
605         tevent_req_done(req);
606 }
607
608 NTSTATUS dcerpc_wbint_LookupSids_recv(struct tevent_req *req,
609                                       TALLOC_CTX *mem_ctx,
610                                       NTSTATUS *result)
611 {
612         struct dcerpc_wbint_LookupSids_state *state = tevent_req_data(
613                 req, struct dcerpc_wbint_LookupSids_state);
614         NTSTATUS status;
615
616         if (tevent_req_is_nterror(req, &status)) {
617                 tevent_req_received(req);
618                 return status;
619         }
620
621         /* Steal possible out parameters to the callers context */
622         talloc_steal(mem_ctx, state->out_mem_ctx);
623
624         /* Return result */
625         *result = state->orig.out.result;
626
627         tevent_req_received(req);
628         return NT_STATUS_OK;
629 }
630
631 NTSTATUS dcerpc_wbint_LookupSids(struct dcerpc_binding_handle *h,
632                                  TALLOC_CTX *mem_ctx,
633                                  struct lsa_SidArray *_sids /* [in] [ref] */,
634                                  struct lsa_RefDomainList *_domains /* [out] [ref] */,
635                                  struct lsa_TransNameArray *_names /* [out] [ref] */,
636                                  NTSTATUS *result)
637 {
638         struct wbint_LookupSids r;
639         NTSTATUS status;
640
641         /* In parameters */
642         r.in.sids = _sids;
643
644         status = dcerpc_wbint_LookupSids_r(h, mem_ctx, &r);
645         if (!NT_STATUS_IS_OK(status)) {
646                 return status;
647         }
648
649         /* Return variables */
650         *_domains = *r.out.domains;
651         *_names = *r.out.names;
652
653         /* Return result */
654         *result = r.out.result;
655
656         return NT_STATUS_OK;
657 }
658
659 struct dcerpc_wbint_LookupName_r_state {
660         TALLOC_CTX *out_mem_ctx;
661 };
662
663 static void dcerpc_wbint_LookupName_r_done(struct tevent_req *subreq);
664
665 struct tevent_req *dcerpc_wbint_LookupName_r_send(TALLOC_CTX *mem_ctx,
666         struct tevent_context *ev,
667         struct dcerpc_binding_handle *h,
668         struct wbint_LookupName *r)
669 {
670         struct tevent_req *req;
671         struct dcerpc_wbint_LookupName_r_state *state;
672         struct tevent_req *subreq;
673
674         req = tevent_req_create(mem_ctx, &state,
675                                 struct dcerpc_wbint_LookupName_r_state);
676         if (req == NULL) {
677                 return NULL;
678         }
679
680         state->out_mem_ctx = talloc_new(state);
681         if (tevent_req_nomem(state->out_mem_ctx, req)) {
682                 return tevent_req_post(req, ev);
683         }
684
685         subreq = dcerpc_binding_handle_call_send(state, ev, h,
686                         NULL, &ndr_table_wbint,
687                         NDR_WBINT_LOOKUPNAME, state->out_mem_ctx, r);
688         if (tevent_req_nomem(subreq, req)) {
689                 return tevent_req_post(req, ev);
690         }
691         tevent_req_set_callback(subreq, dcerpc_wbint_LookupName_r_done, req);
692
693         return req;
694 }
695
696 static void dcerpc_wbint_LookupName_r_done(struct tevent_req *subreq)
697 {
698         struct tevent_req *req =
699                 tevent_req_callback_data(subreq,
700                 struct tevent_req);
701         NTSTATUS status;
702
703         status = dcerpc_binding_handle_call_recv(subreq);
704         TALLOC_FREE(subreq);
705         if (tevent_req_nterror(req, status)) {
706                 return;
707         }
708
709         tevent_req_done(req);
710 }
711
712 NTSTATUS dcerpc_wbint_LookupName_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
713 {
714         struct dcerpc_wbint_LookupName_r_state *state =
715                 tevent_req_data(req,
716                 struct dcerpc_wbint_LookupName_r_state);
717         NTSTATUS status;
718
719         if (tevent_req_is_nterror(req, &status)) {
720                 tevent_req_received(req);
721                 return status;
722         }
723
724         talloc_steal(mem_ctx, state->out_mem_ctx);
725
726         tevent_req_received(req);
727         return NT_STATUS_OK;
728 }
729
730 NTSTATUS dcerpc_wbint_LookupName_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupName *r)
731 {
732         NTSTATUS status;
733
734         status = dcerpc_binding_handle_call(h,
735                         NULL, &ndr_table_wbint,
736                         NDR_WBINT_LOOKUPNAME, mem_ctx, r);
737
738         return status;
739 }
740
741 struct dcerpc_wbint_LookupName_state {
742         struct wbint_LookupName orig;
743         struct wbint_LookupName tmp;
744         TALLOC_CTX *out_mem_ctx;
745 };
746
747 static void dcerpc_wbint_LookupName_done(struct tevent_req *subreq);
748
749 struct tevent_req *dcerpc_wbint_LookupName_send(TALLOC_CTX *mem_ctx,
750                                                 struct tevent_context *ev,
751                                                 struct dcerpc_binding_handle *h,
752                                                 const char *_domain /* [in] [ref,charset(UTF8)] */,
753                                                 const char *_name /* [in] [ref,charset(UTF8)] */,
754                                                 uint32_t _flags /* [in]  */,
755                                                 enum lsa_SidType *_type /* [out] [ref] */,
756                                                 struct dom_sid *_sid /* [out] [ref] */)
757 {
758         struct tevent_req *req;
759         struct dcerpc_wbint_LookupName_state *state;
760         struct tevent_req *subreq;
761
762         req = tevent_req_create(mem_ctx, &state,
763                                 struct dcerpc_wbint_LookupName_state);
764         if (req == NULL) {
765                 return NULL;
766         }
767         state->out_mem_ctx = NULL;
768
769         /* In parameters */
770         state->orig.in.domain = _domain;
771         state->orig.in.name = _name;
772         state->orig.in.flags = _flags;
773
774         /* Out parameters */
775         state->orig.out.type = _type;
776         state->orig.out.sid = _sid;
777
778         /* Result */
779         ZERO_STRUCT(state->orig.out.result);
780
781         state->out_mem_ctx = talloc_named_const(state, 0,
782                              "dcerpc_wbint_LookupName_out_memory");
783         if (tevent_req_nomem(state->out_mem_ctx, req)) {
784                 return tevent_req_post(req, ev);
785         }
786
787         /* make a temporary copy, that we pass to the dispatch function */
788         state->tmp = state->orig;
789
790         subreq = dcerpc_wbint_LookupName_r_send(state, ev, h, &state->tmp);
791         if (tevent_req_nomem(subreq, req)) {
792                 return tevent_req_post(req, ev);
793         }
794         tevent_req_set_callback(subreq, dcerpc_wbint_LookupName_done, req);
795         return req;
796 }
797
798 static void dcerpc_wbint_LookupName_done(struct tevent_req *subreq)
799 {
800         struct tevent_req *req = tevent_req_callback_data(
801                 subreq, struct tevent_req);
802         struct dcerpc_wbint_LookupName_state *state = tevent_req_data(
803                 req, struct dcerpc_wbint_LookupName_state);
804         NTSTATUS status;
805         TALLOC_CTX *mem_ctx;
806
807         if (state->out_mem_ctx) {
808                 mem_ctx = state->out_mem_ctx;
809         } else {
810                 mem_ctx = state;
811         }
812
813         status = dcerpc_wbint_LookupName_r_recv(subreq, mem_ctx);
814         TALLOC_FREE(subreq);
815         if (tevent_req_nterror(req, status)) {
816                 return;
817         }
818
819         /* Copy out parameters */
820         *state->orig.out.type = *state->tmp.out.type;
821         *state->orig.out.sid = *state->tmp.out.sid;
822
823         /* Copy result */
824         state->orig.out.result = state->tmp.out.result;
825
826         /* Reset temporary structure */
827         ZERO_STRUCT(state->tmp);
828
829         tevent_req_done(req);
830 }
831
832 NTSTATUS dcerpc_wbint_LookupName_recv(struct tevent_req *req,
833                                       TALLOC_CTX *mem_ctx,
834                                       NTSTATUS *result)
835 {
836         struct dcerpc_wbint_LookupName_state *state = tevent_req_data(
837                 req, struct dcerpc_wbint_LookupName_state);
838         NTSTATUS status;
839
840         if (tevent_req_is_nterror(req, &status)) {
841                 tevent_req_received(req);
842                 return status;
843         }
844
845         /* Steal possible out parameters to the callers context */
846         talloc_steal(mem_ctx, state->out_mem_ctx);
847
848         /* Return result */
849         *result = state->orig.out.result;
850
851         tevent_req_received(req);
852         return NT_STATUS_OK;
853 }
854
855 NTSTATUS dcerpc_wbint_LookupName(struct dcerpc_binding_handle *h,
856                                  TALLOC_CTX *mem_ctx,
857                                  const char *_domain /* [in] [ref,charset(UTF8)] */,
858                                  const char *_name /* [in] [ref,charset(UTF8)] */,
859                                  uint32_t _flags /* [in]  */,
860                                  enum lsa_SidType *_type /* [out] [ref] */,
861                                  struct dom_sid *_sid /* [out] [ref] */,
862                                  NTSTATUS *result)
863 {
864         struct wbint_LookupName r;
865         NTSTATUS status;
866
867         /* In parameters */
868         r.in.domain = _domain;
869         r.in.name = _name;
870         r.in.flags = _flags;
871
872         status = dcerpc_wbint_LookupName_r(h, mem_ctx, &r);
873         if (!NT_STATUS_IS_OK(status)) {
874                 return status;
875         }
876
877         /* Return variables */
878         *_type = *r.out.type;
879         *_sid = *r.out.sid;
880
881         /* Return result */
882         *result = r.out.result;
883
884         return NT_STATUS_OK;
885 }
886
887 struct dcerpc_wbint_Sids2UnixIDs_r_state {
888         TALLOC_CTX *out_mem_ctx;
889 };
890
891 static void dcerpc_wbint_Sids2UnixIDs_r_done(struct tevent_req *subreq);
892
893 struct tevent_req *dcerpc_wbint_Sids2UnixIDs_r_send(TALLOC_CTX *mem_ctx,
894         struct tevent_context *ev,
895         struct dcerpc_binding_handle *h,
896         struct wbint_Sids2UnixIDs *r)
897 {
898         struct tevent_req *req;
899         struct dcerpc_wbint_Sids2UnixIDs_r_state *state;
900         struct tevent_req *subreq;
901
902         req = tevent_req_create(mem_ctx, &state,
903                                 struct dcerpc_wbint_Sids2UnixIDs_r_state);
904         if (req == NULL) {
905                 return NULL;
906         }
907
908         state->out_mem_ctx = talloc_new(state);
909         if (tevent_req_nomem(state->out_mem_ctx, req)) {
910                 return tevent_req_post(req, ev);
911         }
912
913         subreq = dcerpc_binding_handle_call_send(state, ev, h,
914                         NULL, &ndr_table_wbint,
915                         NDR_WBINT_SIDS2UNIXIDS, state->out_mem_ctx, r);
916         if (tevent_req_nomem(subreq, req)) {
917                 return tevent_req_post(req, ev);
918         }
919         tevent_req_set_callback(subreq, dcerpc_wbint_Sids2UnixIDs_r_done, req);
920
921         return req;
922 }
923
924 static void dcerpc_wbint_Sids2UnixIDs_r_done(struct tevent_req *subreq)
925 {
926         struct tevent_req *req =
927                 tevent_req_callback_data(subreq,
928                 struct tevent_req);
929         NTSTATUS status;
930
931         status = dcerpc_binding_handle_call_recv(subreq);
932         TALLOC_FREE(subreq);
933         if (tevent_req_nterror(req, status)) {
934                 return;
935         }
936
937         tevent_req_done(req);
938 }
939
940 NTSTATUS dcerpc_wbint_Sids2UnixIDs_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
941 {
942         struct dcerpc_wbint_Sids2UnixIDs_r_state *state =
943                 tevent_req_data(req,
944                 struct dcerpc_wbint_Sids2UnixIDs_r_state);
945         NTSTATUS status;
946
947         if (tevent_req_is_nterror(req, &status)) {
948                 tevent_req_received(req);
949                 return status;
950         }
951
952         talloc_steal(mem_ctx, state->out_mem_ctx);
953
954         tevent_req_received(req);
955         return NT_STATUS_OK;
956 }
957
958 NTSTATUS dcerpc_wbint_Sids2UnixIDs_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Sids2UnixIDs *r)
959 {
960         NTSTATUS status;
961
962         status = dcerpc_binding_handle_call(h,
963                         NULL, &ndr_table_wbint,
964                         NDR_WBINT_SIDS2UNIXIDS, mem_ctx, r);
965
966         return status;
967 }
968
969 struct dcerpc_wbint_Sids2UnixIDs_state {
970         struct wbint_Sids2UnixIDs orig;
971         struct wbint_Sids2UnixIDs tmp;
972         TALLOC_CTX *out_mem_ctx;
973 };
974
975 static void dcerpc_wbint_Sids2UnixIDs_done(struct tevent_req *subreq);
976
977 struct tevent_req *dcerpc_wbint_Sids2UnixIDs_send(TALLOC_CTX *mem_ctx,
978                                                   struct tevent_context *ev,
979                                                   struct dcerpc_binding_handle *h,
980                                                   struct lsa_RefDomainList *_domains /* [in] [ref] */,
981                                                   struct wbint_TransIDArray *_ids /* [in,out] [ref] */)
982 {
983         struct tevent_req *req;
984         struct dcerpc_wbint_Sids2UnixIDs_state *state;
985         struct tevent_req *subreq;
986
987         req = tevent_req_create(mem_ctx, &state,
988                                 struct dcerpc_wbint_Sids2UnixIDs_state);
989         if (req == NULL) {
990                 return NULL;
991         }
992         state->out_mem_ctx = NULL;
993
994         /* In parameters */
995         state->orig.in.domains = _domains;
996         state->orig.in.ids = _ids;
997
998         /* Out parameters */
999         state->orig.out.ids = _ids;
1000
1001         /* Result */
1002         ZERO_STRUCT(state->orig.out.result);
1003
1004         state->out_mem_ctx = talloc_named_const(state, 0,
1005                              "dcerpc_wbint_Sids2UnixIDs_out_memory");
1006         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1007                 return tevent_req_post(req, ev);
1008         }
1009
1010         /* make a temporary copy, that we pass to the dispatch function */
1011         state->tmp = state->orig;
1012
1013         subreq = dcerpc_wbint_Sids2UnixIDs_r_send(state, ev, h, &state->tmp);
1014         if (tevent_req_nomem(subreq, req)) {
1015                 return tevent_req_post(req, ev);
1016         }
1017         tevent_req_set_callback(subreq, dcerpc_wbint_Sids2UnixIDs_done, req);
1018         return req;
1019 }
1020
1021 static void dcerpc_wbint_Sids2UnixIDs_done(struct tevent_req *subreq)
1022 {
1023         struct tevent_req *req = tevent_req_callback_data(
1024                 subreq, struct tevent_req);
1025         struct dcerpc_wbint_Sids2UnixIDs_state *state = tevent_req_data(
1026                 req, struct dcerpc_wbint_Sids2UnixIDs_state);
1027         NTSTATUS status;
1028         TALLOC_CTX *mem_ctx;
1029
1030         if (state->out_mem_ctx) {
1031                 mem_ctx = state->out_mem_ctx;
1032         } else {
1033                 mem_ctx = state;
1034         }
1035
1036         status = dcerpc_wbint_Sids2UnixIDs_r_recv(subreq, mem_ctx);
1037         TALLOC_FREE(subreq);
1038         if (tevent_req_nterror(req, status)) {
1039                 return;
1040         }
1041
1042         /* Copy out parameters */
1043         *state->orig.out.ids = *state->tmp.out.ids;
1044
1045         /* Copy result */
1046         state->orig.out.result = state->tmp.out.result;
1047
1048         /* Reset temporary structure */
1049         ZERO_STRUCT(state->tmp);
1050
1051         tevent_req_done(req);
1052 }
1053
1054 NTSTATUS dcerpc_wbint_Sids2UnixIDs_recv(struct tevent_req *req,
1055                                         TALLOC_CTX *mem_ctx,
1056                                         NTSTATUS *result)
1057 {
1058         struct dcerpc_wbint_Sids2UnixIDs_state *state = tevent_req_data(
1059                 req, struct dcerpc_wbint_Sids2UnixIDs_state);
1060         NTSTATUS status;
1061
1062         if (tevent_req_is_nterror(req, &status)) {
1063                 tevent_req_received(req);
1064                 return status;
1065         }
1066
1067         /* Steal possible out parameters to the callers context */
1068         talloc_steal(mem_ctx, state->out_mem_ctx);
1069
1070         /* Return result */
1071         *result = state->orig.out.result;
1072
1073         tevent_req_received(req);
1074         return NT_STATUS_OK;
1075 }
1076
1077 NTSTATUS dcerpc_wbint_Sids2UnixIDs(struct dcerpc_binding_handle *h,
1078                                    TALLOC_CTX *mem_ctx,
1079                                    struct lsa_RefDomainList *_domains /* [in] [ref] */,
1080                                    struct wbint_TransIDArray *_ids /* [in,out] [ref] */,
1081                                    NTSTATUS *result)
1082 {
1083         struct wbint_Sids2UnixIDs r;
1084         NTSTATUS status;
1085
1086         /* In parameters */
1087         r.in.domains = _domains;
1088         r.in.ids = _ids;
1089
1090         status = dcerpc_wbint_Sids2UnixIDs_r(h, mem_ctx, &r);
1091         if (!NT_STATUS_IS_OK(status)) {
1092                 return status;
1093         }
1094
1095         /* Return variables */
1096         *_ids = *r.out.ids;
1097
1098         /* Return result */
1099         *result = r.out.result;
1100
1101         return NT_STATUS_OK;
1102 }
1103
1104 struct dcerpc_wbint_Uid2Sid_r_state {
1105         TALLOC_CTX *out_mem_ctx;
1106 };
1107
1108 static void dcerpc_wbint_Uid2Sid_r_done(struct tevent_req *subreq);
1109
1110 struct tevent_req *dcerpc_wbint_Uid2Sid_r_send(TALLOC_CTX *mem_ctx,
1111         struct tevent_context *ev,
1112         struct dcerpc_binding_handle *h,
1113         struct wbint_Uid2Sid *r)
1114 {
1115         struct tevent_req *req;
1116         struct dcerpc_wbint_Uid2Sid_r_state *state;
1117         struct tevent_req *subreq;
1118
1119         req = tevent_req_create(mem_ctx, &state,
1120                                 struct dcerpc_wbint_Uid2Sid_r_state);
1121         if (req == NULL) {
1122                 return NULL;
1123         }
1124
1125         state->out_mem_ctx = talloc_new(state);
1126         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1127                 return tevent_req_post(req, ev);
1128         }
1129
1130         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1131                         NULL, &ndr_table_wbint,
1132                         NDR_WBINT_UID2SID, state->out_mem_ctx, r);
1133         if (tevent_req_nomem(subreq, req)) {
1134                 return tevent_req_post(req, ev);
1135         }
1136         tevent_req_set_callback(subreq, dcerpc_wbint_Uid2Sid_r_done, req);
1137
1138         return req;
1139 }
1140
1141 static void dcerpc_wbint_Uid2Sid_r_done(struct tevent_req *subreq)
1142 {
1143         struct tevent_req *req =
1144                 tevent_req_callback_data(subreq,
1145                 struct tevent_req);
1146         NTSTATUS status;
1147
1148         status = dcerpc_binding_handle_call_recv(subreq);
1149         TALLOC_FREE(subreq);
1150         if (tevent_req_nterror(req, status)) {
1151                 return;
1152         }
1153
1154         tevent_req_done(req);
1155 }
1156
1157 NTSTATUS dcerpc_wbint_Uid2Sid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1158 {
1159         struct dcerpc_wbint_Uid2Sid_r_state *state =
1160                 tevent_req_data(req,
1161                 struct dcerpc_wbint_Uid2Sid_r_state);
1162         NTSTATUS status;
1163
1164         if (tevent_req_is_nterror(req, &status)) {
1165                 tevent_req_received(req);
1166                 return status;
1167         }
1168
1169         talloc_steal(mem_ctx, state->out_mem_ctx);
1170
1171         tevent_req_received(req);
1172         return NT_STATUS_OK;
1173 }
1174
1175 NTSTATUS dcerpc_wbint_Uid2Sid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Uid2Sid *r)
1176 {
1177         NTSTATUS status;
1178
1179         status = dcerpc_binding_handle_call(h,
1180                         NULL, &ndr_table_wbint,
1181                         NDR_WBINT_UID2SID, mem_ctx, r);
1182
1183         return status;
1184 }
1185
1186 struct dcerpc_wbint_Uid2Sid_state {
1187         struct wbint_Uid2Sid orig;
1188         struct wbint_Uid2Sid tmp;
1189         TALLOC_CTX *out_mem_ctx;
1190 };
1191
1192 static void dcerpc_wbint_Uid2Sid_done(struct tevent_req *subreq);
1193
1194 struct tevent_req *dcerpc_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx,
1195                                              struct tevent_context *ev,
1196                                              struct dcerpc_binding_handle *h,
1197                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
1198                                              uint64_t _uid /* [in]  */,
1199                                              struct dom_sid *_sid /* [out] [ref] */)
1200 {
1201         struct tevent_req *req;
1202         struct dcerpc_wbint_Uid2Sid_state *state;
1203         struct tevent_req *subreq;
1204
1205         req = tevent_req_create(mem_ctx, &state,
1206                                 struct dcerpc_wbint_Uid2Sid_state);
1207         if (req == NULL) {
1208                 return NULL;
1209         }
1210         state->out_mem_ctx = NULL;
1211
1212         /* In parameters */
1213         state->orig.in.dom_name = _dom_name;
1214         state->orig.in.uid = _uid;
1215
1216         /* Out parameters */
1217         state->orig.out.sid = _sid;
1218
1219         /* Result */
1220         ZERO_STRUCT(state->orig.out.result);
1221
1222         state->out_mem_ctx = talloc_named_const(state, 0,
1223                              "dcerpc_wbint_Uid2Sid_out_memory");
1224         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1225                 return tevent_req_post(req, ev);
1226         }
1227
1228         /* make a temporary copy, that we pass to the dispatch function */
1229         state->tmp = state->orig;
1230
1231         subreq = dcerpc_wbint_Uid2Sid_r_send(state, ev, h, &state->tmp);
1232         if (tevent_req_nomem(subreq, req)) {
1233                 return tevent_req_post(req, ev);
1234         }
1235         tevent_req_set_callback(subreq, dcerpc_wbint_Uid2Sid_done, req);
1236         return req;
1237 }
1238
1239 static void dcerpc_wbint_Uid2Sid_done(struct tevent_req *subreq)
1240 {
1241         struct tevent_req *req = tevent_req_callback_data(
1242                 subreq, struct tevent_req);
1243         struct dcerpc_wbint_Uid2Sid_state *state = tevent_req_data(
1244                 req, struct dcerpc_wbint_Uid2Sid_state);
1245         NTSTATUS status;
1246         TALLOC_CTX *mem_ctx;
1247
1248         if (state->out_mem_ctx) {
1249                 mem_ctx = state->out_mem_ctx;
1250         } else {
1251                 mem_ctx = state;
1252         }
1253
1254         status = dcerpc_wbint_Uid2Sid_r_recv(subreq, mem_ctx);
1255         TALLOC_FREE(subreq);
1256         if (tevent_req_nterror(req, status)) {
1257                 return;
1258         }
1259
1260         /* Copy out parameters */
1261         *state->orig.out.sid = *state->tmp.out.sid;
1262
1263         /* Copy result */
1264         state->orig.out.result = state->tmp.out.result;
1265
1266         /* Reset temporary structure */
1267         ZERO_STRUCT(state->tmp);
1268
1269         tevent_req_done(req);
1270 }
1271
1272 NTSTATUS dcerpc_wbint_Uid2Sid_recv(struct tevent_req *req,
1273                                    TALLOC_CTX *mem_ctx,
1274                                    NTSTATUS *result)
1275 {
1276         struct dcerpc_wbint_Uid2Sid_state *state = tevent_req_data(
1277                 req, struct dcerpc_wbint_Uid2Sid_state);
1278         NTSTATUS status;
1279
1280         if (tevent_req_is_nterror(req, &status)) {
1281                 tevent_req_received(req);
1282                 return status;
1283         }
1284
1285         /* Steal possible out parameters to the callers context */
1286         talloc_steal(mem_ctx, state->out_mem_ctx);
1287
1288         /* Return result */
1289         *result = state->orig.out.result;
1290
1291         tevent_req_received(req);
1292         return NT_STATUS_OK;
1293 }
1294
1295 NTSTATUS dcerpc_wbint_Uid2Sid(struct dcerpc_binding_handle *h,
1296                               TALLOC_CTX *mem_ctx,
1297                               const char *_dom_name /* [in] [unique,charset(UTF8)] */,
1298                               uint64_t _uid /* [in]  */,
1299                               struct dom_sid *_sid /* [out] [ref] */,
1300                               NTSTATUS *result)
1301 {
1302         struct wbint_Uid2Sid r;
1303         NTSTATUS status;
1304
1305         /* In parameters */
1306         r.in.dom_name = _dom_name;
1307         r.in.uid = _uid;
1308
1309         status = dcerpc_wbint_Uid2Sid_r(h, mem_ctx, &r);
1310         if (!NT_STATUS_IS_OK(status)) {
1311                 return status;
1312         }
1313
1314         /* Return variables */
1315         *_sid = *r.out.sid;
1316
1317         /* Return result */
1318         *result = r.out.result;
1319
1320         return NT_STATUS_OK;
1321 }
1322
1323 struct dcerpc_wbint_Gid2Sid_r_state {
1324         TALLOC_CTX *out_mem_ctx;
1325 };
1326
1327 static void dcerpc_wbint_Gid2Sid_r_done(struct tevent_req *subreq);
1328
1329 struct tevent_req *dcerpc_wbint_Gid2Sid_r_send(TALLOC_CTX *mem_ctx,
1330         struct tevent_context *ev,
1331         struct dcerpc_binding_handle *h,
1332         struct wbint_Gid2Sid *r)
1333 {
1334         struct tevent_req *req;
1335         struct dcerpc_wbint_Gid2Sid_r_state *state;
1336         struct tevent_req *subreq;
1337
1338         req = tevent_req_create(mem_ctx, &state,
1339                                 struct dcerpc_wbint_Gid2Sid_r_state);
1340         if (req == NULL) {
1341                 return NULL;
1342         }
1343
1344         state->out_mem_ctx = talloc_new(state);
1345         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1346                 return tevent_req_post(req, ev);
1347         }
1348
1349         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1350                         NULL, &ndr_table_wbint,
1351                         NDR_WBINT_GID2SID, state->out_mem_ctx, r);
1352         if (tevent_req_nomem(subreq, req)) {
1353                 return tevent_req_post(req, ev);
1354         }
1355         tevent_req_set_callback(subreq, dcerpc_wbint_Gid2Sid_r_done, req);
1356
1357         return req;
1358 }
1359
1360 static void dcerpc_wbint_Gid2Sid_r_done(struct tevent_req *subreq)
1361 {
1362         struct tevent_req *req =
1363                 tevent_req_callback_data(subreq,
1364                 struct tevent_req);
1365         NTSTATUS status;
1366
1367         status = dcerpc_binding_handle_call_recv(subreq);
1368         TALLOC_FREE(subreq);
1369         if (tevent_req_nterror(req, status)) {
1370                 return;
1371         }
1372
1373         tevent_req_done(req);
1374 }
1375
1376 NTSTATUS dcerpc_wbint_Gid2Sid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1377 {
1378         struct dcerpc_wbint_Gid2Sid_r_state *state =
1379                 tevent_req_data(req,
1380                 struct dcerpc_wbint_Gid2Sid_r_state);
1381         NTSTATUS status;
1382
1383         if (tevent_req_is_nterror(req, &status)) {
1384                 tevent_req_received(req);
1385                 return status;
1386         }
1387
1388         talloc_steal(mem_ctx, state->out_mem_ctx);
1389
1390         tevent_req_received(req);
1391         return NT_STATUS_OK;
1392 }
1393
1394 NTSTATUS dcerpc_wbint_Gid2Sid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_Gid2Sid *r)
1395 {
1396         NTSTATUS status;
1397
1398         status = dcerpc_binding_handle_call(h,
1399                         NULL, &ndr_table_wbint,
1400                         NDR_WBINT_GID2SID, mem_ctx, r);
1401
1402         return status;
1403 }
1404
1405 struct dcerpc_wbint_Gid2Sid_state {
1406         struct wbint_Gid2Sid orig;
1407         struct wbint_Gid2Sid tmp;
1408         TALLOC_CTX *out_mem_ctx;
1409 };
1410
1411 static void dcerpc_wbint_Gid2Sid_done(struct tevent_req *subreq);
1412
1413 struct tevent_req *dcerpc_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx,
1414                                              struct tevent_context *ev,
1415                                              struct dcerpc_binding_handle *h,
1416                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
1417                                              uint64_t _gid /* [in]  */,
1418                                              struct dom_sid *_sid /* [out] [ref] */)
1419 {
1420         struct tevent_req *req;
1421         struct dcerpc_wbint_Gid2Sid_state *state;
1422         struct tevent_req *subreq;
1423
1424         req = tevent_req_create(mem_ctx, &state,
1425                                 struct dcerpc_wbint_Gid2Sid_state);
1426         if (req == NULL) {
1427                 return NULL;
1428         }
1429         state->out_mem_ctx = NULL;
1430
1431         /* In parameters */
1432         state->orig.in.dom_name = _dom_name;
1433         state->orig.in.gid = _gid;
1434
1435         /* Out parameters */
1436         state->orig.out.sid = _sid;
1437
1438         /* Result */
1439         ZERO_STRUCT(state->orig.out.result);
1440
1441         state->out_mem_ctx = talloc_named_const(state, 0,
1442                              "dcerpc_wbint_Gid2Sid_out_memory");
1443         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1444                 return tevent_req_post(req, ev);
1445         }
1446
1447         /* make a temporary copy, that we pass to the dispatch function */
1448         state->tmp = state->orig;
1449
1450         subreq = dcerpc_wbint_Gid2Sid_r_send(state, ev, h, &state->tmp);
1451         if (tevent_req_nomem(subreq, req)) {
1452                 return tevent_req_post(req, ev);
1453         }
1454         tevent_req_set_callback(subreq, dcerpc_wbint_Gid2Sid_done, req);
1455         return req;
1456 }
1457
1458 static void dcerpc_wbint_Gid2Sid_done(struct tevent_req *subreq)
1459 {
1460         struct tevent_req *req = tevent_req_callback_data(
1461                 subreq, struct tevent_req);
1462         struct dcerpc_wbint_Gid2Sid_state *state = tevent_req_data(
1463                 req, struct dcerpc_wbint_Gid2Sid_state);
1464         NTSTATUS status;
1465         TALLOC_CTX *mem_ctx;
1466
1467         if (state->out_mem_ctx) {
1468                 mem_ctx = state->out_mem_ctx;
1469         } else {
1470                 mem_ctx = state;
1471         }
1472
1473         status = dcerpc_wbint_Gid2Sid_r_recv(subreq, mem_ctx);
1474         TALLOC_FREE(subreq);
1475         if (tevent_req_nterror(req, status)) {
1476                 return;
1477         }
1478
1479         /* Copy out parameters */
1480         *state->orig.out.sid = *state->tmp.out.sid;
1481
1482         /* Copy result */
1483         state->orig.out.result = state->tmp.out.result;
1484
1485         /* Reset temporary structure */
1486         ZERO_STRUCT(state->tmp);
1487
1488         tevent_req_done(req);
1489 }
1490
1491 NTSTATUS dcerpc_wbint_Gid2Sid_recv(struct tevent_req *req,
1492                                    TALLOC_CTX *mem_ctx,
1493                                    NTSTATUS *result)
1494 {
1495         struct dcerpc_wbint_Gid2Sid_state *state = tevent_req_data(
1496                 req, struct dcerpc_wbint_Gid2Sid_state);
1497         NTSTATUS status;
1498
1499         if (tevent_req_is_nterror(req, &status)) {
1500                 tevent_req_received(req);
1501                 return status;
1502         }
1503
1504         /* Steal possible out parameters to the callers context */
1505         talloc_steal(mem_ctx, state->out_mem_ctx);
1506
1507         /* Return result */
1508         *result = state->orig.out.result;
1509
1510         tevent_req_received(req);
1511         return NT_STATUS_OK;
1512 }
1513
1514 NTSTATUS dcerpc_wbint_Gid2Sid(struct dcerpc_binding_handle *h,
1515                               TALLOC_CTX *mem_ctx,
1516                               const char *_dom_name /* [in] [unique,charset(UTF8)] */,
1517                               uint64_t _gid /* [in]  */,
1518                               struct dom_sid *_sid /* [out] [ref] */,
1519                               NTSTATUS *result)
1520 {
1521         struct wbint_Gid2Sid r;
1522         NTSTATUS status;
1523
1524         /* In parameters */
1525         r.in.dom_name = _dom_name;
1526         r.in.gid = _gid;
1527
1528         status = dcerpc_wbint_Gid2Sid_r(h, mem_ctx, &r);
1529         if (!NT_STATUS_IS_OK(status)) {
1530                 return status;
1531         }
1532
1533         /* Return variables */
1534         *_sid = *r.out.sid;
1535
1536         /* Return result */
1537         *result = r.out.result;
1538
1539         return NT_STATUS_OK;
1540 }
1541
1542 struct dcerpc_wbint_AllocateUid_r_state {
1543         TALLOC_CTX *out_mem_ctx;
1544 };
1545
1546 static void dcerpc_wbint_AllocateUid_r_done(struct tevent_req *subreq);
1547
1548 struct tevent_req *dcerpc_wbint_AllocateUid_r_send(TALLOC_CTX *mem_ctx,
1549         struct tevent_context *ev,
1550         struct dcerpc_binding_handle *h,
1551         struct wbint_AllocateUid *r)
1552 {
1553         struct tevent_req *req;
1554         struct dcerpc_wbint_AllocateUid_r_state *state;
1555         struct tevent_req *subreq;
1556
1557         req = tevent_req_create(mem_ctx, &state,
1558                                 struct dcerpc_wbint_AllocateUid_r_state);
1559         if (req == NULL) {
1560                 return NULL;
1561         }
1562
1563         state->out_mem_ctx = talloc_new(state);
1564         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1565                 return tevent_req_post(req, ev);
1566         }
1567
1568         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1569                         NULL, &ndr_table_wbint,
1570                         NDR_WBINT_ALLOCATEUID, state->out_mem_ctx, r);
1571         if (tevent_req_nomem(subreq, req)) {
1572                 return tevent_req_post(req, ev);
1573         }
1574         tevent_req_set_callback(subreq, dcerpc_wbint_AllocateUid_r_done, req);
1575
1576         return req;
1577 }
1578
1579 static void dcerpc_wbint_AllocateUid_r_done(struct tevent_req *subreq)
1580 {
1581         struct tevent_req *req =
1582                 tevent_req_callback_data(subreq,
1583                 struct tevent_req);
1584         NTSTATUS status;
1585
1586         status = dcerpc_binding_handle_call_recv(subreq);
1587         TALLOC_FREE(subreq);
1588         if (tevent_req_nterror(req, status)) {
1589                 return;
1590         }
1591
1592         tevent_req_done(req);
1593 }
1594
1595 NTSTATUS dcerpc_wbint_AllocateUid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1596 {
1597         struct dcerpc_wbint_AllocateUid_r_state *state =
1598                 tevent_req_data(req,
1599                 struct dcerpc_wbint_AllocateUid_r_state);
1600         NTSTATUS status;
1601
1602         if (tevent_req_is_nterror(req, &status)) {
1603                 tevent_req_received(req);
1604                 return status;
1605         }
1606
1607         talloc_steal(mem_ctx, state->out_mem_ctx);
1608
1609         tevent_req_received(req);
1610         return NT_STATUS_OK;
1611 }
1612
1613 NTSTATUS dcerpc_wbint_AllocateUid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_AllocateUid *r)
1614 {
1615         NTSTATUS status;
1616
1617         status = dcerpc_binding_handle_call(h,
1618                         NULL, &ndr_table_wbint,
1619                         NDR_WBINT_ALLOCATEUID, mem_ctx, r);
1620
1621         return status;
1622 }
1623
1624 struct dcerpc_wbint_AllocateUid_state {
1625         struct wbint_AllocateUid orig;
1626         struct wbint_AllocateUid tmp;
1627         TALLOC_CTX *out_mem_ctx;
1628 };
1629
1630 static void dcerpc_wbint_AllocateUid_done(struct tevent_req *subreq);
1631
1632 struct tevent_req *dcerpc_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx,
1633                                                  struct tevent_context *ev,
1634                                                  struct dcerpc_binding_handle *h,
1635                                                  uint64_t *_uid /* [out] [ref] */)
1636 {
1637         struct tevent_req *req;
1638         struct dcerpc_wbint_AllocateUid_state *state;
1639         struct tevent_req *subreq;
1640
1641         req = tevent_req_create(mem_ctx, &state,
1642                                 struct dcerpc_wbint_AllocateUid_state);
1643         if (req == NULL) {
1644                 return NULL;
1645         }
1646         state->out_mem_ctx = NULL;
1647
1648         /* In parameters */
1649
1650         /* Out parameters */
1651         state->orig.out.uid = _uid;
1652
1653         /* Result */
1654         ZERO_STRUCT(state->orig.out.result);
1655
1656         state->out_mem_ctx = talloc_named_const(state, 0,
1657                              "dcerpc_wbint_AllocateUid_out_memory");
1658         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1659                 return tevent_req_post(req, ev);
1660         }
1661
1662         /* make a temporary copy, that we pass to the dispatch function */
1663         state->tmp = state->orig;
1664
1665         subreq = dcerpc_wbint_AllocateUid_r_send(state, ev, h, &state->tmp);
1666         if (tevent_req_nomem(subreq, req)) {
1667                 return tevent_req_post(req, ev);
1668         }
1669         tevent_req_set_callback(subreq, dcerpc_wbint_AllocateUid_done, req);
1670         return req;
1671 }
1672
1673 static void dcerpc_wbint_AllocateUid_done(struct tevent_req *subreq)
1674 {
1675         struct tevent_req *req = tevent_req_callback_data(
1676                 subreq, struct tevent_req);
1677         struct dcerpc_wbint_AllocateUid_state *state = tevent_req_data(
1678                 req, struct dcerpc_wbint_AllocateUid_state);
1679         NTSTATUS status;
1680         TALLOC_CTX *mem_ctx;
1681
1682         if (state->out_mem_ctx) {
1683                 mem_ctx = state->out_mem_ctx;
1684         } else {
1685                 mem_ctx = state;
1686         }
1687
1688         status = dcerpc_wbint_AllocateUid_r_recv(subreq, mem_ctx);
1689         TALLOC_FREE(subreq);
1690         if (tevent_req_nterror(req, status)) {
1691                 return;
1692         }
1693
1694         /* Copy out parameters */
1695         *state->orig.out.uid = *state->tmp.out.uid;
1696
1697         /* Copy result */
1698         state->orig.out.result = state->tmp.out.result;
1699
1700         /* Reset temporary structure */
1701         ZERO_STRUCT(state->tmp);
1702
1703         tevent_req_done(req);
1704 }
1705
1706 NTSTATUS dcerpc_wbint_AllocateUid_recv(struct tevent_req *req,
1707                                        TALLOC_CTX *mem_ctx,
1708                                        NTSTATUS *result)
1709 {
1710         struct dcerpc_wbint_AllocateUid_state *state = tevent_req_data(
1711                 req, struct dcerpc_wbint_AllocateUid_state);
1712         NTSTATUS status;
1713
1714         if (tevent_req_is_nterror(req, &status)) {
1715                 tevent_req_received(req);
1716                 return status;
1717         }
1718
1719         /* Steal possible out parameters to the callers context */
1720         talloc_steal(mem_ctx, state->out_mem_ctx);
1721
1722         /* Return result */
1723         *result = state->orig.out.result;
1724
1725         tevent_req_received(req);
1726         return NT_STATUS_OK;
1727 }
1728
1729 NTSTATUS dcerpc_wbint_AllocateUid(struct dcerpc_binding_handle *h,
1730                                   TALLOC_CTX *mem_ctx,
1731                                   uint64_t *_uid /* [out] [ref] */,
1732                                   NTSTATUS *result)
1733 {
1734         struct wbint_AllocateUid r;
1735         NTSTATUS status;
1736
1737         /* In parameters */
1738
1739         status = dcerpc_wbint_AllocateUid_r(h, mem_ctx, &r);
1740         if (!NT_STATUS_IS_OK(status)) {
1741                 return status;
1742         }
1743
1744         /* Return variables */
1745         *_uid = *r.out.uid;
1746
1747         /* Return result */
1748         *result = r.out.result;
1749
1750         return NT_STATUS_OK;
1751 }
1752
1753 struct dcerpc_wbint_AllocateGid_r_state {
1754         TALLOC_CTX *out_mem_ctx;
1755 };
1756
1757 static void dcerpc_wbint_AllocateGid_r_done(struct tevent_req *subreq);
1758
1759 struct tevent_req *dcerpc_wbint_AllocateGid_r_send(TALLOC_CTX *mem_ctx,
1760         struct tevent_context *ev,
1761         struct dcerpc_binding_handle *h,
1762         struct wbint_AllocateGid *r)
1763 {
1764         struct tevent_req *req;
1765         struct dcerpc_wbint_AllocateGid_r_state *state;
1766         struct tevent_req *subreq;
1767
1768         req = tevent_req_create(mem_ctx, &state,
1769                                 struct dcerpc_wbint_AllocateGid_r_state);
1770         if (req == NULL) {
1771                 return NULL;
1772         }
1773
1774         state->out_mem_ctx = talloc_new(state);
1775         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1776                 return tevent_req_post(req, ev);
1777         }
1778
1779         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1780                         NULL, &ndr_table_wbint,
1781                         NDR_WBINT_ALLOCATEGID, state->out_mem_ctx, r);
1782         if (tevent_req_nomem(subreq, req)) {
1783                 return tevent_req_post(req, ev);
1784         }
1785         tevent_req_set_callback(subreq, dcerpc_wbint_AllocateGid_r_done, req);
1786
1787         return req;
1788 }
1789
1790 static void dcerpc_wbint_AllocateGid_r_done(struct tevent_req *subreq)
1791 {
1792         struct tevent_req *req =
1793                 tevent_req_callback_data(subreq,
1794                 struct tevent_req);
1795         NTSTATUS status;
1796
1797         status = dcerpc_binding_handle_call_recv(subreq);
1798         TALLOC_FREE(subreq);
1799         if (tevent_req_nterror(req, status)) {
1800                 return;
1801         }
1802
1803         tevent_req_done(req);
1804 }
1805
1806 NTSTATUS dcerpc_wbint_AllocateGid_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
1807 {
1808         struct dcerpc_wbint_AllocateGid_r_state *state =
1809                 tevent_req_data(req,
1810                 struct dcerpc_wbint_AllocateGid_r_state);
1811         NTSTATUS status;
1812
1813         if (tevent_req_is_nterror(req, &status)) {
1814                 tevent_req_received(req);
1815                 return status;
1816         }
1817
1818         talloc_steal(mem_ctx, state->out_mem_ctx);
1819
1820         tevent_req_received(req);
1821         return NT_STATUS_OK;
1822 }
1823
1824 NTSTATUS dcerpc_wbint_AllocateGid_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_AllocateGid *r)
1825 {
1826         NTSTATUS status;
1827
1828         status = dcerpc_binding_handle_call(h,
1829                         NULL, &ndr_table_wbint,
1830                         NDR_WBINT_ALLOCATEGID, mem_ctx, r);
1831
1832         return status;
1833 }
1834
1835 struct dcerpc_wbint_AllocateGid_state {
1836         struct wbint_AllocateGid orig;
1837         struct wbint_AllocateGid tmp;
1838         TALLOC_CTX *out_mem_ctx;
1839 };
1840
1841 static void dcerpc_wbint_AllocateGid_done(struct tevent_req *subreq);
1842
1843 struct tevent_req *dcerpc_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx,
1844                                                  struct tevent_context *ev,
1845                                                  struct dcerpc_binding_handle *h,
1846                                                  uint64_t *_gid /* [out] [ref] */)
1847 {
1848         struct tevent_req *req;
1849         struct dcerpc_wbint_AllocateGid_state *state;
1850         struct tevent_req *subreq;
1851
1852         req = tevent_req_create(mem_ctx, &state,
1853                                 struct dcerpc_wbint_AllocateGid_state);
1854         if (req == NULL) {
1855                 return NULL;
1856         }
1857         state->out_mem_ctx = NULL;
1858
1859         /* In parameters */
1860
1861         /* Out parameters */
1862         state->orig.out.gid = _gid;
1863
1864         /* Result */
1865         ZERO_STRUCT(state->orig.out.result);
1866
1867         state->out_mem_ctx = talloc_named_const(state, 0,
1868                              "dcerpc_wbint_AllocateGid_out_memory");
1869         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1870                 return tevent_req_post(req, ev);
1871         }
1872
1873         /* make a temporary copy, that we pass to the dispatch function */
1874         state->tmp = state->orig;
1875
1876         subreq = dcerpc_wbint_AllocateGid_r_send(state, ev, h, &state->tmp);
1877         if (tevent_req_nomem(subreq, req)) {
1878                 return tevent_req_post(req, ev);
1879         }
1880         tevent_req_set_callback(subreq, dcerpc_wbint_AllocateGid_done, req);
1881         return req;
1882 }
1883
1884 static void dcerpc_wbint_AllocateGid_done(struct tevent_req *subreq)
1885 {
1886         struct tevent_req *req = tevent_req_callback_data(
1887                 subreq, struct tevent_req);
1888         struct dcerpc_wbint_AllocateGid_state *state = tevent_req_data(
1889                 req, struct dcerpc_wbint_AllocateGid_state);
1890         NTSTATUS status;
1891         TALLOC_CTX *mem_ctx;
1892
1893         if (state->out_mem_ctx) {
1894                 mem_ctx = state->out_mem_ctx;
1895         } else {
1896                 mem_ctx = state;
1897         }
1898
1899         status = dcerpc_wbint_AllocateGid_r_recv(subreq, mem_ctx);
1900         TALLOC_FREE(subreq);
1901         if (tevent_req_nterror(req, status)) {
1902                 return;
1903         }
1904
1905         /* Copy out parameters */
1906         *state->orig.out.gid = *state->tmp.out.gid;
1907
1908         /* Copy result */
1909         state->orig.out.result = state->tmp.out.result;
1910
1911         /* Reset temporary structure */
1912         ZERO_STRUCT(state->tmp);
1913
1914         tevent_req_done(req);
1915 }
1916
1917 NTSTATUS dcerpc_wbint_AllocateGid_recv(struct tevent_req *req,
1918                                        TALLOC_CTX *mem_ctx,
1919                                        NTSTATUS *result)
1920 {
1921         struct dcerpc_wbint_AllocateGid_state *state = tevent_req_data(
1922                 req, struct dcerpc_wbint_AllocateGid_state);
1923         NTSTATUS status;
1924
1925         if (tevent_req_is_nterror(req, &status)) {
1926                 tevent_req_received(req);
1927                 return status;
1928         }
1929
1930         /* Steal possible out parameters to the callers context */
1931         talloc_steal(mem_ctx, state->out_mem_ctx);
1932
1933         /* Return result */
1934         *result = state->orig.out.result;
1935
1936         tevent_req_received(req);
1937         return NT_STATUS_OK;
1938 }
1939
1940 NTSTATUS dcerpc_wbint_AllocateGid(struct dcerpc_binding_handle *h,
1941                                   TALLOC_CTX *mem_ctx,
1942                                   uint64_t *_gid /* [out] [ref] */,
1943                                   NTSTATUS *result)
1944 {
1945         struct wbint_AllocateGid r;
1946         NTSTATUS status;
1947
1948         /* In parameters */
1949
1950         status = dcerpc_wbint_AllocateGid_r(h, mem_ctx, &r);
1951         if (!NT_STATUS_IS_OK(status)) {
1952                 return status;
1953         }
1954
1955         /* Return variables */
1956         *_gid = *r.out.gid;
1957
1958         /* Return result */
1959         *result = r.out.result;
1960
1961         return NT_STATUS_OK;
1962 }
1963
1964 struct dcerpc_wbint_QueryUser_r_state {
1965         TALLOC_CTX *out_mem_ctx;
1966 };
1967
1968 static void dcerpc_wbint_QueryUser_r_done(struct tevent_req *subreq);
1969
1970 struct tevent_req *dcerpc_wbint_QueryUser_r_send(TALLOC_CTX *mem_ctx,
1971         struct tevent_context *ev,
1972         struct dcerpc_binding_handle *h,
1973         struct wbint_QueryUser *r)
1974 {
1975         struct tevent_req *req;
1976         struct dcerpc_wbint_QueryUser_r_state *state;
1977         struct tevent_req *subreq;
1978
1979         req = tevent_req_create(mem_ctx, &state,
1980                                 struct dcerpc_wbint_QueryUser_r_state);
1981         if (req == NULL) {
1982                 return NULL;
1983         }
1984
1985         state->out_mem_ctx = talloc_new(state);
1986         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1987                 return tevent_req_post(req, ev);
1988         }
1989
1990         subreq = dcerpc_binding_handle_call_send(state, ev, h,
1991                         NULL, &ndr_table_wbint,
1992                         NDR_WBINT_QUERYUSER, state->out_mem_ctx, r);
1993         if (tevent_req_nomem(subreq, req)) {
1994                 return tevent_req_post(req, ev);
1995         }
1996         tevent_req_set_callback(subreq, dcerpc_wbint_QueryUser_r_done, req);
1997
1998         return req;
1999 }
2000
2001 static void dcerpc_wbint_QueryUser_r_done(struct tevent_req *subreq)
2002 {
2003         struct tevent_req *req =
2004                 tevent_req_callback_data(subreq,
2005                 struct tevent_req);
2006         NTSTATUS status;
2007
2008         status = dcerpc_binding_handle_call_recv(subreq);
2009         TALLOC_FREE(subreq);
2010         if (tevent_req_nterror(req, status)) {
2011                 return;
2012         }
2013
2014         tevent_req_done(req);
2015 }
2016
2017 NTSTATUS dcerpc_wbint_QueryUser_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2018 {
2019         struct dcerpc_wbint_QueryUser_r_state *state =
2020                 tevent_req_data(req,
2021                 struct dcerpc_wbint_QueryUser_r_state);
2022         NTSTATUS status;
2023
2024         if (tevent_req_is_nterror(req, &status)) {
2025                 tevent_req_received(req);
2026                 return status;
2027         }
2028
2029         talloc_steal(mem_ctx, state->out_mem_ctx);
2030
2031         tevent_req_received(req);
2032         return NT_STATUS_OK;
2033 }
2034
2035 NTSTATUS dcerpc_wbint_QueryUser_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_QueryUser *r)
2036 {
2037         NTSTATUS status;
2038
2039         status = dcerpc_binding_handle_call(h,
2040                         NULL, &ndr_table_wbint,
2041                         NDR_WBINT_QUERYUSER, mem_ctx, r);
2042
2043         return status;
2044 }
2045
2046 struct dcerpc_wbint_QueryUser_state {
2047         struct wbint_QueryUser orig;
2048         struct wbint_QueryUser tmp;
2049         TALLOC_CTX *out_mem_ctx;
2050 };
2051
2052 static void dcerpc_wbint_QueryUser_done(struct tevent_req *subreq);
2053
2054 struct tevent_req *dcerpc_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
2055                                                struct tevent_context *ev,
2056                                                struct dcerpc_binding_handle *h,
2057                                                struct dom_sid *_sid /* [in] [ref] */,
2058                                                struct wbint_userinfo *_info /* [out] [ref] */)
2059 {
2060         struct tevent_req *req;
2061         struct dcerpc_wbint_QueryUser_state *state;
2062         struct tevent_req *subreq;
2063
2064         req = tevent_req_create(mem_ctx, &state,
2065                                 struct dcerpc_wbint_QueryUser_state);
2066         if (req == NULL) {
2067                 return NULL;
2068         }
2069         state->out_mem_ctx = NULL;
2070
2071         /* In parameters */
2072         state->orig.in.sid = _sid;
2073
2074         /* Out parameters */
2075         state->orig.out.info = _info;
2076
2077         /* Result */
2078         ZERO_STRUCT(state->orig.out.result);
2079
2080         state->out_mem_ctx = talloc_named_const(state, 0,
2081                              "dcerpc_wbint_QueryUser_out_memory");
2082         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2083                 return tevent_req_post(req, ev);
2084         }
2085
2086         /* make a temporary copy, that we pass to the dispatch function */
2087         state->tmp = state->orig;
2088
2089         subreq = dcerpc_wbint_QueryUser_r_send(state, ev, h, &state->tmp);
2090         if (tevent_req_nomem(subreq, req)) {
2091                 return tevent_req_post(req, ev);
2092         }
2093         tevent_req_set_callback(subreq, dcerpc_wbint_QueryUser_done, req);
2094         return req;
2095 }
2096
2097 static void dcerpc_wbint_QueryUser_done(struct tevent_req *subreq)
2098 {
2099         struct tevent_req *req = tevent_req_callback_data(
2100                 subreq, struct tevent_req);
2101         struct dcerpc_wbint_QueryUser_state *state = tevent_req_data(
2102                 req, struct dcerpc_wbint_QueryUser_state);
2103         NTSTATUS status;
2104         TALLOC_CTX *mem_ctx;
2105
2106         if (state->out_mem_ctx) {
2107                 mem_ctx = state->out_mem_ctx;
2108         } else {
2109                 mem_ctx = state;
2110         }
2111
2112         status = dcerpc_wbint_QueryUser_r_recv(subreq, mem_ctx);
2113         TALLOC_FREE(subreq);
2114         if (tevent_req_nterror(req, status)) {
2115                 return;
2116         }
2117
2118         /* Copy out parameters */
2119         *state->orig.out.info = *state->tmp.out.info;
2120
2121         /* Copy result */
2122         state->orig.out.result = state->tmp.out.result;
2123
2124         /* Reset temporary structure */
2125         ZERO_STRUCT(state->tmp);
2126
2127         tevent_req_done(req);
2128 }
2129
2130 NTSTATUS dcerpc_wbint_QueryUser_recv(struct tevent_req *req,
2131                                      TALLOC_CTX *mem_ctx,
2132                                      NTSTATUS *result)
2133 {
2134         struct dcerpc_wbint_QueryUser_state *state = tevent_req_data(
2135                 req, struct dcerpc_wbint_QueryUser_state);
2136         NTSTATUS status;
2137
2138         if (tevent_req_is_nterror(req, &status)) {
2139                 tevent_req_received(req);
2140                 return status;
2141         }
2142
2143         /* Steal possible out parameters to the callers context */
2144         talloc_steal(mem_ctx, state->out_mem_ctx);
2145
2146         /* Return result */
2147         *result = state->orig.out.result;
2148
2149         tevent_req_received(req);
2150         return NT_STATUS_OK;
2151 }
2152
2153 NTSTATUS dcerpc_wbint_QueryUser(struct dcerpc_binding_handle *h,
2154                                 TALLOC_CTX *mem_ctx,
2155                                 struct dom_sid *_sid /* [in] [ref] */,
2156                                 struct wbint_userinfo *_info /* [out] [ref] */,
2157                                 NTSTATUS *result)
2158 {
2159         struct wbint_QueryUser r;
2160         NTSTATUS status;
2161
2162         /* In parameters */
2163         r.in.sid = _sid;
2164
2165         status = dcerpc_wbint_QueryUser_r(h, mem_ctx, &r);
2166         if (!NT_STATUS_IS_OK(status)) {
2167                 return status;
2168         }
2169
2170         /* Return variables */
2171         *_info = *r.out.info;
2172
2173         /* Return result */
2174         *result = r.out.result;
2175
2176         return NT_STATUS_OK;
2177 }
2178
2179 struct dcerpc_wbint_LookupUserAliases_r_state {
2180         TALLOC_CTX *out_mem_ctx;
2181 };
2182
2183 static void dcerpc_wbint_LookupUserAliases_r_done(struct tevent_req *subreq);
2184
2185 struct tevent_req *dcerpc_wbint_LookupUserAliases_r_send(TALLOC_CTX *mem_ctx,
2186         struct tevent_context *ev,
2187         struct dcerpc_binding_handle *h,
2188         struct wbint_LookupUserAliases *r)
2189 {
2190         struct tevent_req *req;
2191         struct dcerpc_wbint_LookupUserAliases_r_state *state;
2192         struct tevent_req *subreq;
2193
2194         req = tevent_req_create(mem_ctx, &state,
2195                                 struct dcerpc_wbint_LookupUserAliases_r_state);
2196         if (req == NULL) {
2197                 return NULL;
2198         }
2199
2200         state->out_mem_ctx = talloc_new(state);
2201         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2202                 return tevent_req_post(req, ev);
2203         }
2204
2205         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2206                         NULL, &ndr_table_wbint,
2207                         NDR_WBINT_LOOKUPUSERALIASES, state->out_mem_ctx, r);
2208         if (tevent_req_nomem(subreq, req)) {
2209                 return tevent_req_post(req, ev);
2210         }
2211         tevent_req_set_callback(subreq, dcerpc_wbint_LookupUserAliases_r_done, req);
2212
2213         return req;
2214 }
2215
2216 static void dcerpc_wbint_LookupUserAliases_r_done(struct tevent_req *subreq)
2217 {
2218         struct tevent_req *req =
2219                 tevent_req_callback_data(subreq,
2220                 struct tevent_req);
2221         NTSTATUS status;
2222
2223         status = dcerpc_binding_handle_call_recv(subreq);
2224         TALLOC_FREE(subreq);
2225         if (tevent_req_nterror(req, status)) {
2226                 return;
2227         }
2228
2229         tevent_req_done(req);
2230 }
2231
2232 NTSTATUS dcerpc_wbint_LookupUserAliases_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2233 {
2234         struct dcerpc_wbint_LookupUserAliases_r_state *state =
2235                 tevent_req_data(req,
2236                 struct dcerpc_wbint_LookupUserAliases_r_state);
2237         NTSTATUS status;
2238
2239         if (tevent_req_is_nterror(req, &status)) {
2240                 tevent_req_received(req);
2241                 return status;
2242         }
2243
2244         talloc_steal(mem_ctx, state->out_mem_ctx);
2245
2246         tevent_req_received(req);
2247         return NT_STATUS_OK;
2248 }
2249
2250 NTSTATUS dcerpc_wbint_LookupUserAliases_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupUserAliases *r)
2251 {
2252         NTSTATUS status;
2253
2254         status = dcerpc_binding_handle_call(h,
2255                         NULL, &ndr_table_wbint,
2256                         NDR_WBINT_LOOKUPUSERALIASES, mem_ctx, r);
2257
2258         return status;
2259 }
2260
2261 struct dcerpc_wbint_LookupUserAliases_state {
2262         struct wbint_LookupUserAliases orig;
2263         struct wbint_LookupUserAliases tmp;
2264         TALLOC_CTX *out_mem_ctx;
2265 };
2266
2267 static void dcerpc_wbint_LookupUserAliases_done(struct tevent_req *subreq);
2268
2269 struct tevent_req *dcerpc_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
2270                                                        struct tevent_context *ev,
2271                                                        struct dcerpc_binding_handle *h,
2272                                                        struct wbint_SidArray *_sids /* [in] [ref] */,
2273                                                        struct wbint_RidArray *_rids /* [out] [ref] */)
2274 {
2275         struct tevent_req *req;
2276         struct dcerpc_wbint_LookupUserAliases_state *state;
2277         struct tevent_req *subreq;
2278
2279         req = tevent_req_create(mem_ctx, &state,
2280                                 struct dcerpc_wbint_LookupUserAliases_state);
2281         if (req == NULL) {
2282                 return NULL;
2283         }
2284         state->out_mem_ctx = NULL;
2285
2286         /* In parameters */
2287         state->orig.in.sids = _sids;
2288
2289         /* Out parameters */
2290         state->orig.out.rids = _rids;
2291
2292         /* Result */
2293         ZERO_STRUCT(state->orig.out.result);
2294
2295         state->out_mem_ctx = talloc_named_const(state, 0,
2296                              "dcerpc_wbint_LookupUserAliases_out_memory");
2297         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2298                 return tevent_req_post(req, ev);
2299         }
2300
2301         /* make a temporary copy, that we pass to the dispatch function */
2302         state->tmp = state->orig;
2303
2304         subreq = dcerpc_wbint_LookupUserAliases_r_send(state, ev, h, &state->tmp);
2305         if (tevent_req_nomem(subreq, req)) {
2306                 return tevent_req_post(req, ev);
2307         }
2308         tevent_req_set_callback(subreq, dcerpc_wbint_LookupUserAliases_done, req);
2309         return req;
2310 }
2311
2312 static void dcerpc_wbint_LookupUserAliases_done(struct tevent_req *subreq)
2313 {
2314         struct tevent_req *req = tevent_req_callback_data(
2315                 subreq, struct tevent_req);
2316         struct dcerpc_wbint_LookupUserAliases_state *state = tevent_req_data(
2317                 req, struct dcerpc_wbint_LookupUserAliases_state);
2318         NTSTATUS status;
2319         TALLOC_CTX *mem_ctx;
2320
2321         if (state->out_mem_ctx) {
2322                 mem_ctx = state->out_mem_ctx;
2323         } else {
2324                 mem_ctx = state;
2325         }
2326
2327         status = dcerpc_wbint_LookupUserAliases_r_recv(subreq, mem_ctx);
2328         TALLOC_FREE(subreq);
2329         if (tevent_req_nterror(req, status)) {
2330                 return;
2331         }
2332
2333         /* Copy out parameters */
2334         *state->orig.out.rids = *state->tmp.out.rids;
2335
2336         /* Copy result */
2337         state->orig.out.result = state->tmp.out.result;
2338
2339         /* Reset temporary structure */
2340         ZERO_STRUCT(state->tmp);
2341
2342         tevent_req_done(req);
2343 }
2344
2345 NTSTATUS dcerpc_wbint_LookupUserAliases_recv(struct tevent_req *req,
2346                                              TALLOC_CTX *mem_ctx,
2347                                              NTSTATUS *result)
2348 {
2349         struct dcerpc_wbint_LookupUserAliases_state *state = tevent_req_data(
2350                 req, struct dcerpc_wbint_LookupUserAliases_state);
2351         NTSTATUS status;
2352
2353         if (tevent_req_is_nterror(req, &status)) {
2354                 tevent_req_received(req);
2355                 return status;
2356         }
2357
2358         /* Steal possible out parameters to the callers context */
2359         talloc_steal(mem_ctx, state->out_mem_ctx);
2360
2361         /* Return result */
2362         *result = state->orig.out.result;
2363
2364         tevent_req_received(req);
2365         return NT_STATUS_OK;
2366 }
2367
2368 NTSTATUS dcerpc_wbint_LookupUserAliases(struct dcerpc_binding_handle *h,
2369                                         TALLOC_CTX *mem_ctx,
2370                                         struct wbint_SidArray *_sids /* [in] [ref] */,
2371                                         struct wbint_RidArray *_rids /* [out] [ref] */,
2372                                         NTSTATUS *result)
2373 {
2374         struct wbint_LookupUserAliases r;
2375         NTSTATUS status;
2376
2377         /* In parameters */
2378         r.in.sids = _sids;
2379
2380         status = dcerpc_wbint_LookupUserAliases_r(h, mem_ctx, &r);
2381         if (!NT_STATUS_IS_OK(status)) {
2382                 return status;
2383         }
2384
2385         /* Return variables */
2386         *_rids = *r.out.rids;
2387
2388         /* Return result */
2389         *result = r.out.result;
2390
2391         return NT_STATUS_OK;
2392 }
2393
2394 struct dcerpc_wbint_LookupUserGroups_r_state {
2395         TALLOC_CTX *out_mem_ctx;
2396 };
2397
2398 static void dcerpc_wbint_LookupUserGroups_r_done(struct tevent_req *subreq);
2399
2400 struct tevent_req *dcerpc_wbint_LookupUserGroups_r_send(TALLOC_CTX *mem_ctx,
2401         struct tevent_context *ev,
2402         struct dcerpc_binding_handle *h,
2403         struct wbint_LookupUserGroups *r)
2404 {
2405         struct tevent_req *req;
2406         struct dcerpc_wbint_LookupUserGroups_r_state *state;
2407         struct tevent_req *subreq;
2408
2409         req = tevent_req_create(mem_ctx, &state,
2410                                 struct dcerpc_wbint_LookupUserGroups_r_state);
2411         if (req == NULL) {
2412                 return NULL;
2413         }
2414
2415         state->out_mem_ctx = talloc_new(state);
2416         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2417                 return tevent_req_post(req, ev);
2418         }
2419
2420         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2421                         NULL, &ndr_table_wbint,
2422                         NDR_WBINT_LOOKUPUSERGROUPS, state->out_mem_ctx, r);
2423         if (tevent_req_nomem(subreq, req)) {
2424                 return tevent_req_post(req, ev);
2425         }
2426         tevent_req_set_callback(subreq, dcerpc_wbint_LookupUserGroups_r_done, req);
2427
2428         return req;
2429 }
2430
2431 static void dcerpc_wbint_LookupUserGroups_r_done(struct tevent_req *subreq)
2432 {
2433         struct tevent_req *req =
2434                 tevent_req_callback_data(subreq,
2435                 struct tevent_req);
2436         NTSTATUS status;
2437
2438         status = dcerpc_binding_handle_call_recv(subreq);
2439         TALLOC_FREE(subreq);
2440         if (tevent_req_nterror(req, status)) {
2441                 return;
2442         }
2443
2444         tevent_req_done(req);
2445 }
2446
2447 NTSTATUS dcerpc_wbint_LookupUserGroups_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2448 {
2449         struct dcerpc_wbint_LookupUserGroups_r_state *state =
2450                 tevent_req_data(req,
2451                 struct dcerpc_wbint_LookupUserGroups_r_state);
2452         NTSTATUS status;
2453
2454         if (tevent_req_is_nterror(req, &status)) {
2455                 tevent_req_received(req);
2456                 return status;
2457         }
2458
2459         talloc_steal(mem_ctx, state->out_mem_ctx);
2460
2461         tevent_req_received(req);
2462         return NT_STATUS_OK;
2463 }
2464
2465 NTSTATUS dcerpc_wbint_LookupUserGroups_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupUserGroups *r)
2466 {
2467         NTSTATUS status;
2468
2469         status = dcerpc_binding_handle_call(h,
2470                         NULL, &ndr_table_wbint,
2471                         NDR_WBINT_LOOKUPUSERGROUPS, mem_ctx, r);
2472
2473         return status;
2474 }
2475
2476 struct dcerpc_wbint_LookupUserGroups_state {
2477         struct wbint_LookupUserGroups orig;
2478         struct wbint_LookupUserGroups tmp;
2479         TALLOC_CTX *out_mem_ctx;
2480 };
2481
2482 static void dcerpc_wbint_LookupUserGroups_done(struct tevent_req *subreq);
2483
2484 struct tevent_req *dcerpc_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
2485                                                       struct tevent_context *ev,
2486                                                       struct dcerpc_binding_handle *h,
2487                                                       struct dom_sid *_sid /* [in] [ref] */,
2488                                                       struct wbint_SidArray *_sids /* [out] [ref] */)
2489 {
2490         struct tevent_req *req;
2491         struct dcerpc_wbint_LookupUserGroups_state *state;
2492         struct tevent_req *subreq;
2493
2494         req = tevent_req_create(mem_ctx, &state,
2495                                 struct dcerpc_wbint_LookupUserGroups_state);
2496         if (req == NULL) {
2497                 return NULL;
2498         }
2499         state->out_mem_ctx = NULL;
2500
2501         /* In parameters */
2502         state->orig.in.sid = _sid;
2503
2504         /* Out parameters */
2505         state->orig.out.sids = _sids;
2506
2507         /* Result */
2508         ZERO_STRUCT(state->orig.out.result);
2509
2510         state->out_mem_ctx = talloc_named_const(state, 0,
2511                              "dcerpc_wbint_LookupUserGroups_out_memory");
2512         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2513                 return tevent_req_post(req, ev);
2514         }
2515
2516         /* make a temporary copy, that we pass to the dispatch function */
2517         state->tmp = state->orig;
2518
2519         subreq = dcerpc_wbint_LookupUserGroups_r_send(state, ev, h, &state->tmp);
2520         if (tevent_req_nomem(subreq, req)) {
2521                 return tevent_req_post(req, ev);
2522         }
2523         tevent_req_set_callback(subreq, dcerpc_wbint_LookupUserGroups_done, req);
2524         return req;
2525 }
2526
2527 static void dcerpc_wbint_LookupUserGroups_done(struct tevent_req *subreq)
2528 {
2529         struct tevent_req *req = tevent_req_callback_data(
2530                 subreq, struct tevent_req);
2531         struct dcerpc_wbint_LookupUserGroups_state *state = tevent_req_data(
2532                 req, struct dcerpc_wbint_LookupUserGroups_state);
2533         NTSTATUS status;
2534         TALLOC_CTX *mem_ctx;
2535
2536         if (state->out_mem_ctx) {
2537                 mem_ctx = state->out_mem_ctx;
2538         } else {
2539                 mem_ctx = state;
2540         }
2541
2542         status = dcerpc_wbint_LookupUserGroups_r_recv(subreq, mem_ctx);
2543         TALLOC_FREE(subreq);
2544         if (tevent_req_nterror(req, status)) {
2545                 return;
2546         }
2547
2548         /* Copy out parameters */
2549         *state->orig.out.sids = *state->tmp.out.sids;
2550
2551         /* Copy result */
2552         state->orig.out.result = state->tmp.out.result;
2553
2554         /* Reset temporary structure */
2555         ZERO_STRUCT(state->tmp);
2556
2557         tevent_req_done(req);
2558 }
2559
2560 NTSTATUS dcerpc_wbint_LookupUserGroups_recv(struct tevent_req *req,
2561                                             TALLOC_CTX *mem_ctx,
2562                                             NTSTATUS *result)
2563 {
2564         struct dcerpc_wbint_LookupUserGroups_state *state = tevent_req_data(
2565                 req, struct dcerpc_wbint_LookupUserGroups_state);
2566         NTSTATUS status;
2567
2568         if (tevent_req_is_nterror(req, &status)) {
2569                 tevent_req_received(req);
2570                 return status;
2571         }
2572
2573         /* Steal possible out parameters to the callers context */
2574         talloc_steal(mem_ctx, state->out_mem_ctx);
2575
2576         /* Return result */
2577         *result = state->orig.out.result;
2578
2579         tevent_req_received(req);
2580         return NT_STATUS_OK;
2581 }
2582
2583 NTSTATUS dcerpc_wbint_LookupUserGroups(struct dcerpc_binding_handle *h,
2584                                        TALLOC_CTX *mem_ctx,
2585                                        struct dom_sid *_sid /* [in] [ref] */,
2586                                        struct wbint_SidArray *_sids /* [out] [ref] */,
2587                                        NTSTATUS *result)
2588 {
2589         struct wbint_LookupUserGroups r;
2590         NTSTATUS status;
2591
2592         /* In parameters */
2593         r.in.sid = _sid;
2594
2595         status = dcerpc_wbint_LookupUserGroups_r(h, mem_ctx, &r);
2596         if (!NT_STATUS_IS_OK(status)) {
2597                 return status;
2598         }
2599
2600         /* Return variables */
2601         *_sids = *r.out.sids;
2602
2603         /* Return result */
2604         *result = r.out.result;
2605
2606         return NT_STATUS_OK;
2607 }
2608
2609 struct dcerpc_wbint_QuerySequenceNumber_r_state {
2610         TALLOC_CTX *out_mem_ctx;
2611 };
2612
2613 static void dcerpc_wbint_QuerySequenceNumber_r_done(struct tevent_req *subreq);
2614
2615 struct tevent_req *dcerpc_wbint_QuerySequenceNumber_r_send(TALLOC_CTX *mem_ctx,
2616         struct tevent_context *ev,
2617         struct dcerpc_binding_handle *h,
2618         struct wbint_QuerySequenceNumber *r)
2619 {
2620         struct tevent_req *req;
2621         struct dcerpc_wbint_QuerySequenceNumber_r_state *state;
2622         struct tevent_req *subreq;
2623
2624         req = tevent_req_create(mem_ctx, &state,
2625                                 struct dcerpc_wbint_QuerySequenceNumber_r_state);
2626         if (req == NULL) {
2627                 return NULL;
2628         }
2629
2630         state->out_mem_ctx = talloc_new(state);
2631         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2632                 return tevent_req_post(req, ev);
2633         }
2634
2635         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2636                         NULL, &ndr_table_wbint,
2637                         NDR_WBINT_QUERYSEQUENCENUMBER, state->out_mem_ctx, r);
2638         if (tevent_req_nomem(subreq, req)) {
2639                 return tevent_req_post(req, ev);
2640         }
2641         tevent_req_set_callback(subreq, dcerpc_wbint_QuerySequenceNumber_r_done, req);
2642
2643         return req;
2644 }
2645
2646 static void dcerpc_wbint_QuerySequenceNumber_r_done(struct tevent_req *subreq)
2647 {
2648         struct tevent_req *req =
2649                 tevent_req_callback_data(subreq,
2650                 struct tevent_req);
2651         NTSTATUS status;
2652
2653         status = dcerpc_binding_handle_call_recv(subreq);
2654         TALLOC_FREE(subreq);
2655         if (tevent_req_nterror(req, status)) {
2656                 return;
2657         }
2658
2659         tevent_req_done(req);
2660 }
2661
2662 NTSTATUS dcerpc_wbint_QuerySequenceNumber_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2663 {
2664         struct dcerpc_wbint_QuerySequenceNumber_r_state *state =
2665                 tevent_req_data(req,
2666                 struct dcerpc_wbint_QuerySequenceNumber_r_state);
2667         NTSTATUS status;
2668
2669         if (tevent_req_is_nterror(req, &status)) {
2670                 tevent_req_received(req);
2671                 return status;
2672         }
2673
2674         talloc_steal(mem_ctx, state->out_mem_ctx);
2675
2676         tevent_req_received(req);
2677         return NT_STATUS_OK;
2678 }
2679
2680 NTSTATUS dcerpc_wbint_QuerySequenceNumber_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_QuerySequenceNumber *r)
2681 {
2682         NTSTATUS status;
2683
2684         status = dcerpc_binding_handle_call(h,
2685                         NULL, &ndr_table_wbint,
2686                         NDR_WBINT_QUERYSEQUENCENUMBER, mem_ctx, r);
2687
2688         return status;
2689 }
2690
2691 struct dcerpc_wbint_QuerySequenceNumber_state {
2692         struct wbint_QuerySequenceNumber orig;
2693         struct wbint_QuerySequenceNumber tmp;
2694         TALLOC_CTX *out_mem_ctx;
2695 };
2696
2697 static void dcerpc_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
2698
2699 struct tevent_req *dcerpc_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
2700                                                          struct tevent_context *ev,
2701                                                          struct dcerpc_binding_handle *h,
2702                                                          uint32_t *_sequence /* [out] [ref] */)
2703 {
2704         struct tevent_req *req;
2705         struct dcerpc_wbint_QuerySequenceNumber_state *state;
2706         struct tevent_req *subreq;
2707
2708         req = tevent_req_create(mem_ctx, &state,
2709                                 struct dcerpc_wbint_QuerySequenceNumber_state);
2710         if (req == NULL) {
2711                 return NULL;
2712         }
2713         state->out_mem_ctx = NULL;
2714
2715         /* In parameters */
2716
2717         /* Out parameters */
2718         state->orig.out.sequence = _sequence;
2719
2720         /* Result */
2721         ZERO_STRUCT(state->orig.out.result);
2722
2723         state->out_mem_ctx = talloc_named_const(state, 0,
2724                              "dcerpc_wbint_QuerySequenceNumber_out_memory");
2725         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2726                 return tevent_req_post(req, ev);
2727         }
2728
2729         /* make a temporary copy, that we pass to the dispatch function */
2730         state->tmp = state->orig;
2731
2732         subreq = dcerpc_wbint_QuerySequenceNumber_r_send(state, ev, h, &state->tmp);
2733         if (tevent_req_nomem(subreq, req)) {
2734                 return tevent_req_post(req, ev);
2735         }
2736         tevent_req_set_callback(subreq, dcerpc_wbint_QuerySequenceNumber_done, req);
2737         return req;
2738 }
2739
2740 static void dcerpc_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
2741 {
2742         struct tevent_req *req = tevent_req_callback_data(
2743                 subreq, struct tevent_req);
2744         struct dcerpc_wbint_QuerySequenceNumber_state *state = tevent_req_data(
2745                 req, struct dcerpc_wbint_QuerySequenceNumber_state);
2746         NTSTATUS status;
2747         TALLOC_CTX *mem_ctx;
2748
2749         if (state->out_mem_ctx) {
2750                 mem_ctx = state->out_mem_ctx;
2751         } else {
2752                 mem_ctx = state;
2753         }
2754
2755         status = dcerpc_wbint_QuerySequenceNumber_r_recv(subreq, mem_ctx);
2756         TALLOC_FREE(subreq);
2757         if (tevent_req_nterror(req, status)) {
2758                 return;
2759         }
2760
2761         /* Copy out parameters */
2762         *state->orig.out.sequence = *state->tmp.out.sequence;
2763
2764         /* Copy result */
2765         state->orig.out.result = state->tmp.out.result;
2766
2767         /* Reset temporary structure */
2768         ZERO_STRUCT(state->tmp);
2769
2770         tevent_req_done(req);
2771 }
2772
2773 NTSTATUS dcerpc_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
2774                                                TALLOC_CTX *mem_ctx,
2775                                                NTSTATUS *result)
2776 {
2777         struct dcerpc_wbint_QuerySequenceNumber_state *state = tevent_req_data(
2778                 req, struct dcerpc_wbint_QuerySequenceNumber_state);
2779         NTSTATUS status;
2780
2781         if (tevent_req_is_nterror(req, &status)) {
2782                 tevent_req_received(req);
2783                 return status;
2784         }
2785
2786         /* Steal possible out parameters to the callers context */
2787         talloc_steal(mem_ctx, state->out_mem_ctx);
2788
2789         /* Return result */
2790         *result = state->orig.out.result;
2791
2792         tevent_req_received(req);
2793         return NT_STATUS_OK;
2794 }
2795
2796 NTSTATUS dcerpc_wbint_QuerySequenceNumber(struct dcerpc_binding_handle *h,
2797                                           TALLOC_CTX *mem_ctx,
2798                                           uint32_t *_sequence /* [out] [ref] */,
2799                                           NTSTATUS *result)
2800 {
2801         struct wbint_QuerySequenceNumber r;
2802         NTSTATUS status;
2803
2804         /* In parameters */
2805
2806         status = dcerpc_wbint_QuerySequenceNumber_r(h, mem_ctx, &r);
2807         if (!NT_STATUS_IS_OK(status)) {
2808                 return status;
2809         }
2810
2811         /* Return variables */
2812         *_sequence = *r.out.sequence;
2813
2814         /* Return result */
2815         *result = r.out.result;
2816
2817         return NT_STATUS_OK;
2818 }
2819
2820 struct dcerpc_wbint_LookupGroupMembers_r_state {
2821         TALLOC_CTX *out_mem_ctx;
2822 };
2823
2824 static void dcerpc_wbint_LookupGroupMembers_r_done(struct tevent_req *subreq);
2825
2826 struct tevent_req *dcerpc_wbint_LookupGroupMembers_r_send(TALLOC_CTX *mem_ctx,
2827         struct tevent_context *ev,
2828         struct dcerpc_binding_handle *h,
2829         struct wbint_LookupGroupMembers *r)
2830 {
2831         struct tevent_req *req;
2832         struct dcerpc_wbint_LookupGroupMembers_r_state *state;
2833         struct tevent_req *subreq;
2834
2835         req = tevent_req_create(mem_ctx, &state,
2836                                 struct dcerpc_wbint_LookupGroupMembers_r_state);
2837         if (req == NULL) {
2838                 return NULL;
2839         }
2840
2841         state->out_mem_ctx = talloc_new(state);
2842         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2843                 return tevent_req_post(req, ev);
2844         }
2845
2846         subreq = dcerpc_binding_handle_call_send(state, ev, h,
2847                         NULL, &ndr_table_wbint,
2848                         NDR_WBINT_LOOKUPGROUPMEMBERS, state->out_mem_ctx, r);
2849         if (tevent_req_nomem(subreq, req)) {
2850                 return tevent_req_post(req, ev);
2851         }
2852         tevent_req_set_callback(subreq, dcerpc_wbint_LookupGroupMembers_r_done, req);
2853
2854         return req;
2855 }
2856
2857 static void dcerpc_wbint_LookupGroupMembers_r_done(struct tevent_req *subreq)
2858 {
2859         struct tevent_req *req =
2860                 tevent_req_callback_data(subreq,
2861                 struct tevent_req);
2862         NTSTATUS status;
2863
2864         status = dcerpc_binding_handle_call_recv(subreq);
2865         TALLOC_FREE(subreq);
2866         if (tevent_req_nterror(req, status)) {
2867                 return;
2868         }
2869
2870         tevent_req_done(req);
2871 }
2872
2873 NTSTATUS dcerpc_wbint_LookupGroupMembers_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
2874 {
2875         struct dcerpc_wbint_LookupGroupMembers_r_state *state =
2876                 tevent_req_data(req,
2877                 struct dcerpc_wbint_LookupGroupMembers_r_state);
2878         NTSTATUS status;
2879
2880         if (tevent_req_is_nterror(req, &status)) {
2881                 tevent_req_received(req);
2882                 return status;
2883         }
2884
2885         talloc_steal(mem_ctx, state->out_mem_ctx);
2886
2887         tevent_req_received(req);
2888         return NT_STATUS_OK;
2889 }
2890
2891 NTSTATUS dcerpc_wbint_LookupGroupMembers_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupGroupMembers *r)
2892 {
2893         NTSTATUS status;
2894
2895         status = dcerpc_binding_handle_call(h,
2896                         NULL, &ndr_table_wbint,
2897                         NDR_WBINT_LOOKUPGROUPMEMBERS, mem_ctx, r);
2898
2899         return status;
2900 }
2901
2902 struct dcerpc_wbint_LookupGroupMembers_state {
2903         struct wbint_LookupGroupMembers orig;
2904         struct wbint_LookupGroupMembers tmp;
2905         TALLOC_CTX *out_mem_ctx;
2906 };
2907
2908 static void dcerpc_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
2909
2910 struct tevent_req *dcerpc_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
2911                                                         struct tevent_context *ev,
2912                                                         struct dcerpc_binding_handle *h,
2913                                                         struct dom_sid *_sid /* [in] [ref] */,
2914                                                         enum lsa_SidType _type /* [in]  */,
2915                                                         struct wbint_Principals *_members /* [out] [ref] */)
2916 {
2917         struct tevent_req *req;
2918         struct dcerpc_wbint_LookupGroupMembers_state *state;
2919         struct tevent_req *subreq;
2920
2921         req = tevent_req_create(mem_ctx, &state,
2922                                 struct dcerpc_wbint_LookupGroupMembers_state);
2923         if (req == NULL) {
2924                 return NULL;
2925         }
2926         state->out_mem_ctx = NULL;
2927
2928         /* In parameters */
2929         state->orig.in.sid = _sid;
2930         state->orig.in.type = _type;
2931
2932         /* Out parameters */
2933         state->orig.out.members = _members;
2934
2935         /* Result */
2936         ZERO_STRUCT(state->orig.out.result);
2937
2938         state->out_mem_ctx = talloc_named_const(state, 0,
2939                              "dcerpc_wbint_LookupGroupMembers_out_memory");
2940         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2941                 return tevent_req_post(req, ev);
2942         }
2943
2944         /* make a temporary copy, that we pass to the dispatch function */
2945         state->tmp = state->orig;
2946
2947         subreq = dcerpc_wbint_LookupGroupMembers_r_send(state, ev, h, &state->tmp);
2948         if (tevent_req_nomem(subreq, req)) {
2949                 return tevent_req_post(req, ev);
2950         }
2951         tevent_req_set_callback(subreq, dcerpc_wbint_LookupGroupMembers_done, req);
2952         return req;
2953 }
2954
2955 static void dcerpc_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
2956 {
2957         struct tevent_req *req = tevent_req_callback_data(
2958                 subreq, struct tevent_req);
2959         struct dcerpc_wbint_LookupGroupMembers_state *state = tevent_req_data(
2960                 req, struct dcerpc_wbint_LookupGroupMembers_state);
2961         NTSTATUS status;
2962         TALLOC_CTX *mem_ctx;
2963
2964         if (state->out_mem_ctx) {
2965                 mem_ctx = state->out_mem_ctx;
2966         } else {
2967                 mem_ctx = state;
2968         }
2969
2970         status = dcerpc_wbint_LookupGroupMembers_r_recv(subreq, mem_ctx);
2971         TALLOC_FREE(subreq);
2972         if (tevent_req_nterror(req, status)) {
2973                 return;
2974         }
2975
2976         /* Copy out parameters */
2977         *state->orig.out.members = *state->tmp.out.members;
2978
2979         /* Copy result */
2980         state->orig.out.result = state->tmp.out.result;
2981
2982         /* Reset temporary structure */
2983         ZERO_STRUCT(state->tmp);
2984
2985         tevent_req_done(req);
2986 }
2987
2988 NTSTATUS dcerpc_wbint_LookupGroupMembers_recv(struct tevent_req *req,
2989                                               TALLOC_CTX *mem_ctx,
2990                                               NTSTATUS *result)
2991 {
2992         struct dcerpc_wbint_LookupGroupMembers_state *state = tevent_req_data(
2993                 req, struct dcerpc_wbint_LookupGroupMembers_state);
2994         NTSTATUS status;
2995
2996         if (tevent_req_is_nterror(req, &status)) {
2997                 tevent_req_received(req);
2998                 return status;
2999         }
3000
3001         /* Steal possible out parameters to the callers context */
3002         talloc_steal(mem_ctx, state->out_mem_ctx);
3003
3004         /* Return result */
3005         *result = state->orig.out.result;
3006
3007         tevent_req_received(req);
3008         return NT_STATUS_OK;
3009 }
3010
3011 NTSTATUS dcerpc_wbint_LookupGroupMembers(struct dcerpc_binding_handle *h,
3012                                          TALLOC_CTX *mem_ctx,
3013                                          struct dom_sid *_sid /* [in] [ref] */,
3014                                          enum lsa_SidType _type /* [in]  */,
3015                                          struct wbint_Principals *_members /* [out] [ref] */,
3016                                          NTSTATUS *result)
3017 {
3018         struct wbint_LookupGroupMembers r;
3019         NTSTATUS status;
3020
3021         /* In parameters */
3022         r.in.sid = _sid;
3023         r.in.type = _type;
3024
3025         status = dcerpc_wbint_LookupGroupMembers_r(h, mem_ctx, &r);
3026         if (!NT_STATUS_IS_OK(status)) {
3027                 return status;
3028         }
3029
3030         /* Return variables */
3031         *_members = *r.out.members;
3032
3033         /* Return result */
3034         *result = r.out.result;
3035
3036         return NT_STATUS_OK;
3037 }
3038
3039 struct dcerpc_wbint_QueryUserList_r_state {
3040         TALLOC_CTX *out_mem_ctx;
3041 };
3042
3043 static void dcerpc_wbint_QueryUserList_r_done(struct tevent_req *subreq);
3044
3045 struct tevent_req *dcerpc_wbint_QueryUserList_r_send(TALLOC_CTX *mem_ctx,
3046         struct tevent_context *ev,
3047         struct dcerpc_binding_handle *h,
3048         struct wbint_QueryUserList *r)
3049 {
3050         struct tevent_req *req;
3051         struct dcerpc_wbint_QueryUserList_r_state *state;
3052         struct tevent_req *subreq;
3053
3054         req = tevent_req_create(mem_ctx, &state,
3055                                 struct dcerpc_wbint_QueryUserList_r_state);
3056         if (req == NULL) {
3057                 return NULL;
3058         }
3059
3060         state->out_mem_ctx = talloc_new(state);
3061         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3062                 return tevent_req_post(req, ev);
3063         }
3064
3065         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3066                         NULL, &ndr_table_wbint,
3067                         NDR_WBINT_QUERYUSERLIST, state->out_mem_ctx, r);
3068         if (tevent_req_nomem(subreq, req)) {
3069                 return tevent_req_post(req, ev);
3070         }
3071         tevent_req_set_callback(subreq, dcerpc_wbint_QueryUserList_r_done, req);
3072
3073         return req;
3074 }
3075
3076 static void dcerpc_wbint_QueryUserList_r_done(struct tevent_req *subreq)
3077 {
3078         struct tevent_req *req =
3079                 tevent_req_callback_data(subreq,
3080                 struct tevent_req);
3081         NTSTATUS status;
3082
3083         status = dcerpc_binding_handle_call_recv(subreq);
3084         TALLOC_FREE(subreq);
3085         if (tevent_req_nterror(req, status)) {
3086                 return;
3087         }
3088
3089         tevent_req_done(req);
3090 }
3091
3092 NTSTATUS dcerpc_wbint_QueryUserList_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3093 {
3094         struct dcerpc_wbint_QueryUserList_r_state *state =
3095                 tevent_req_data(req,
3096                 struct dcerpc_wbint_QueryUserList_r_state);
3097         NTSTATUS status;
3098
3099         if (tevent_req_is_nterror(req, &status)) {
3100                 tevent_req_received(req);
3101                 return status;
3102         }
3103
3104         talloc_steal(mem_ctx, state->out_mem_ctx);
3105
3106         tevent_req_received(req);
3107         return NT_STATUS_OK;
3108 }
3109
3110 NTSTATUS dcerpc_wbint_QueryUserList_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_QueryUserList *r)
3111 {
3112         NTSTATUS status;
3113
3114         status = dcerpc_binding_handle_call(h,
3115                         NULL, &ndr_table_wbint,
3116                         NDR_WBINT_QUERYUSERLIST, mem_ctx, r);
3117
3118         return status;
3119 }
3120
3121 struct dcerpc_wbint_QueryUserList_state {
3122         struct wbint_QueryUserList orig;
3123         struct wbint_QueryUserList tmp;
3124         TALLOC_CTX *out_mem_ctx;
3125 };
3126
3127 static void dcerpc_wbint_QueryUserList_done(struct tevent_req *subreq);
3128
3129 struct tevent_req *dcerpc_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
3130                                                    struct tevent_context *ev,
3131                                                    struct dcerpc_binding_handle *h,
3132                                                    struct wbint_userinfos *_users /* [out] [ref] */)
3133 {
3134         struct tevent_req *req;
3135         struct dcerpc_wbint_QueryUserList_state *state;
3136         struct tevent_req *subreq;
3137
3138         req = tevent_req_create(mem_ctx, &state,
3139                                 struct dcerpc_wbint_QueryUserList_state);
3140         if (req == NULL) {
3141                 return NULL;
3142         }
3143         state->out_mem_ctx = NULL;
3144
3145         /* In parameters */
3146
3147         /* Out parameters */
3148         state->orig.out.users = _users;
3149
3150         /* Result */
3151         ZERO_STRUCT(state->orig.out.result);
3152
3153         state->out_mem_ctx = talloc_named_const(state, 0,
3154                              "dcerpc_wbint_QueryUserList_out_memory");
3155         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3156                 return tevent_req_post(req, ev);
3157         }
3158
3159         /* make a temporary copy, that we pass to the dispatch function */
3160         state->tmp = state->orig;
3161
3162         subreq = dcerpc_wbint_QueryUserList_r_send(state, ev, h, &state->tmp);
3163         if (tevent_req_nomem(subreq, req)) {
3164                 return tevent_req_post(req, ev);
3165         }
3166         tevent_req_set_callback(subreq, dcerpc_wbint_QueryUserList_done, req);
3167         return req;
3168 }
3169
3170 static void dcerpc_wbint_QueryUserList_done(struct tevent_req *subreq)
3171 {
3172         struct tevent_req *req = tevent_req_callback_data(
3173                 subreq, struct tevent_req);
3174         struct dcerpc_wbint_QueryUserList_state *state = tevent_req_data(
3175                 req, struct dcerpc_wbint_QueryUserList_state);
3176         NTSTATUS status;
3177         TALLOC_CTX *mem_ctx;
3178
3179         if (state->out_mem_ctx) {
3180                 mem_ctx = state->out_mem_ctx;
3181         } else {
3182                 mem_ctx = state;
3183         }
3184
3185         status = dcerpc_wbint_QueryUserList_r_recv(subreq, mem_ctx);
3186         TALLOC_FREE(subreq);
3187         if (tevent_req_nterror(req, status)) {
3188                 return;
3189         }
3190
3191         /* Copy out parameters */
3192         *state->orig.out.users = *state->tmp.out.users;
3193
3194         /* Copy result */
3195         state->orig.out.result = state->tmp.out.result;
3196
3197         /* Reset temporary structure */
3198         ZERO_STRUCT(state->tmp);
3199
3200         tevent_req_done(req);
3201 }
3202
3203 NTSTATUS dcerpc_wbint_QueryUserList_recv(struct tevent_req *req,
3204                                          TALLOC_CTX *mem_ctx,
3205                                          NTSTATUS *result)
3206 {
3207         struct dcerpc_wbint_QueryUserList_state *state = tevent_req_data(
3208                 req, struct dcerpc_wbint_QueryUserList_state);
3209         NTSTATUS status;
3210
3211         if (tevent_req_is_nterror(req, &status)) {
3212                 tevent_req_received(req);
3213                 return status;
3214         }
3215
3216         /* Steal possible out parameters to the callers context */
3217         talloc_steal(mem_ctx, state->out_mem_ctx);
3218
3219         /* Return result */
3220         *result = state->orig.out.result;
3221
3222         tevent_req_received(req);
3223         return NT_STATUS_OK;
3224 }
3225
3226 NTSTATUS dcerpc_wbint_QueryUserList(struct dcerpc_binding_handle *h,
3227                                     TALLOC_CTX *mem_ctx,
3228                                     struct wbint_userinfos *_users /* [out] [ref] */,
3229                                     NTSTATUS *result)
3230 {
3231         struct wbint_QueryUserList r;
3232         NTSTATUS status;
3233
3234         /* In parameters */
3235
3236         status = dcerpc_wbint_QueryUserList_r(h, mem_ctx, &r);
3237         if (!NT_STATUS_IS_OK(status)) {
3238                 return status;
3239         }
3240
3241         /* Return variables */
3242         *_users = *r.out.users;
3243
3244         /* Return result */
3245         *result = r.out.result;
3246
3247         return NT_STATUS_OK;
3248 }
3249
3250 struct dcerpc_wbint_QueryGroupList_r_state {
3251         TALLOC_CTX *out_mem_ctx;
3252 };
3253
3254 static void dcerpc_wbint_QueryGroupList_r_done(struct tevent_req *subreq);
3255
3256 struct tevent_req *dcerpc_wbint_QueryGroupList_r_send(TALLOC_CTX *mem_ctx,
3257         struct tevent_context *ev,
3258         struct dcerpc_binding_handle *h,
3259         struct wbint_QueryGroupList *r)
3260 {
3261         struct tevent_req *req;
3262         struct dcerpc_wbint_QueryGroupList_r_state *state;
3263         struct tevent_req *subreq;
3264
3265         req = tevent_req_create(mem_ctx, &state,
3266                                 struct dcerpc_wbint_QueryGroupList_r_state);
3267         if (req == NULL) {
3268                 return NULL;
3269         }
3270
3271         state->out_mem_ctx = talloc_new(state);
3272         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3273                 return tevent_req_post(req, ev);
3274         }
3275
3276         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3277                         NULL, &ndr_table_wbint,
3278                         NDR_WBINT_QUERYGROUPLIST, state->out_mem_ctx, r);
3279         if (tevent_req_nomem(subreq, req)) {
3280                 return tevent_req_post(req, ev);
3281         }
3282         tevent_req_set_callback(subreq, dcerpc_wbint_QueryGroupList_r_done, req);
3283
3284         return req;
3285 }
3286
3287 static void dcerpc_wbint_QueryGroupList_r_done(struct tevent_req *subreq)
3288 {
3289         struct tevent_req *req =
3290                 tevent_req_callback_data(subreq,
3291                 struct tevent_req);
3292         NTSTATUS status;
3293
3294         status = dcerpc_binding_handle_call_recv(subreq);
3295         TALLOC_FREE(subreq);
3296         if (tevent_req_nterror(req, status)) {
3297                 return;
3298         }
3299
3300         tevent_req_done(req);
3301 }
3302
3303 NTSTATUS dcerpc_wbint_QueryGroupList_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3304 {
3305         struct dcerpc_wbint_QueryGroupList_r_state *state =
3306                 tevent_req_data(req,
3307                 struct dcerpc_wbint_QueryGroupList_r_state);
3308         NTSTATUS status;
3309
3310         if (tevent_req_is_nterror(req, &status)) {
3311                 tevent_req_received(req);
3312                 return status;
3313         }
3314
3315         talloc_steal(mem_ctx, state->out_mem_ctx);
3316
3317         tevent_req_received(req);
3318         return NT_STATUS_OK;
3319 }
3320
3321 NTSTATUS dcerpc_wbint_QueryGroupList_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_QueryGroupList *r)
3322 {
3323         NTSTATUS status;
3324
3325         status = dcerpc_binding_handle_call(h,
3326                         NULL, &ndr_table_wbint,
3327                         NDR_WBINT_QUERYGROUPLIST, mem_ctx, r);
3328
3329         return status;
3330 }
3331
3332 struct dcerpc_wbint_QueryGroupList_state {
3333         struct wbint_QueryGroupList orig;
3334         struct wbint_QueryGroupList tmp;
3335         TALLOC_CTX *out_mem_ctx;
3336 };
3337
3338 static void dcerpc_wbint_QueryGroupList_done(struct tevent_req *subreq);
3339
3340 struct tevent_req *dcerpc_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
3341                                                     struct tevent_context *ev,
3342                                                     struct dcerpc_binding_handle *h,
3343                                                     struct wbint_Principals *_groups /* [out] [ref] */)
3344 {
3345         struct tevent_req *req;
3346         struct dcerpc_wbint_QueryGroupList_state *state;
3347         struct tevent_req *subreq;
3348
3349         req = tevent_req_create(mem_ctx, &state,
3350                                 struct dcerpc_wbint_QueryGroupList_state);
3351         if (req == NULL) {
3352                 return NULL;
3353         }
3354         state->out_mem_ctx = NULL;
3355
3356         /* In parameters */
3357
3358         /* Out parameters */
3359         state->orig.out.groups = _groups;
3360
3361         /* Result */
3362         ZERO_STRUCT(state->orig.out.result);
3363
3364         state->out_mem_ctx = talloc_named_const(state, 0,
3365                              "dcerpc_wbint_QueryGroupList_out_memory");
3366         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3367                 return tevent_req_post(req, ev);
3368         }
3369
3370         /* make a temporary copy, that we pass to the dispatch function */
3371         state->tmp = state->orig;
3372
3373         subreq = dcerpc_wbint_QueryGroupList_r_send(state, ev, h, &state->tmp);
3374         if (tevent_req_nomem(subreq, req)) {
3375                 return tevent_req_post(req, ev);
3376         }
3377         tevent_req_set_callback(subreq, dcerpc_wbint_QueryGroupList_done, req);
3378         return req;
3379 }
3380
3381 static void dcerpc_wbint_QueryGroupList_done(struct tevent_req *subreq)
3382 {
3383         struct tevent_req *req = tevent_req_callback_data(
3384                 subreq, struct tevent_req);
3385         struct dcerpc_wbint_QueryGroupList_state *state = tevent_req_data(
3386                 req, struct dcerpc_wbint_QueryGroupList_state);
3387         NTSTATUS status;
3388         TALLOC_CTX *mem_ctx;
3389
3390         if (state->out_mem_ctx) {
3391                 mem_ctx = state->out_mem_ctx;
3392         } else {
3393                 mem_ctx = state;
3394         }
3395
3396         status = dcerpc_wbint_QueryGroupList_r_recv(subreq, mem_ctx);
3397         TALLOC_FREE(subreq);
3398         if (tevent_req_nterror(req, status)) {
3399                 return;
3400         }
3401
3402         /* Copy out parameters */
3403         *state->orig.out.groups = *state->tmp.out.groups;
3404
3405         /* Copy result */
3406         state->orig.out.result = state->tmp.out.result;
3407
3408         /* Reset temporary structure */
3409         ZERO_STRUCT(state->tmp);
3410
3411         tevent_req_done(req);
3412 }
3413
3414 NTSTATUS dcerpc_wbint_QueryGroupList_recv(struct tevent_req *req,
3415                                           TALLOC_CTX *mem_ctx,
3416                                           NTSTATUS *result)
3417 {
3418         struct dcerpc_wbint_QueryGroupList_state *state = tevent_req_data(
3419                 req, struct dcerpc_wbint_QueryGroupList_state);
3420         NTSTATUS status;
3421
3422         if (tevent_req_is_nterror(req, &status)) {
3423                 tevent_req_received(req);
3424                 return status;
3425         }
3426
3427         /* Steal possible out parameters to the callers context */
3428         talloc_steal(mem_ctx, state->out_mem_ctx);
3429
3430         /* Return result */
3431         *result = state->orig.out.result;
3432
3433         tevent_req_received(req);
3434         return NT_STATUS_OK;
3435 }
3436
3437 NTSTATUS dcerpc_wbint_QueryGroupList(struct dcerpc_binding_handle *h,
3438                                      TALLOC_CTX *mem_ctx,
3439                                      struct wbint_Principals *_groups /* [out] [ref] */,
3440                                      NTSTATUS *result)
3441 {
3442         struct wbint_QueryGroupList r;
3443         NTSTATUS status;
3444
3445         /* In parameters */
3446
3447         status = dcerpc_wbint_QueryGroupList_r(h, mem_ctx, &r);
3448         if (!NT_STATUS_IS_OK(status)) {
3449                 return status;
3450         }
3451
3452         /* Return variables */
3453         *_groups = *r.out.groups;
3454
3455         /* Return result */
3456         *result = r.out.result;
3457
3458         return NT_STATUS_OK;
3459 }
3460
3461 struct dcerpc_wbint_DsGetDcName_r_state {
3462         TALLOC_CTX *out_mem_ctx;
3463 };
3464
3465 static void dcerpc_wbint_DsGetDcName_r_done(struct tevent_req *subreq);
3466
3467 struct tevent_req *dcerpc_wbint_DsGetDcName_r_send(TALLOC_CTX *mem_ctx,
3468         struct tevent_context *ev,
3469         struct dcerpc_binding_handle *h,
3470         struct wbint_DsGetDcName *r)
3471 {
3472         struct tevent_req *req;
3473         struct dcerpc_wbint_DsGetDcName_r_state *state;
3474         struct tevent_req *subreq;
3475
3476         req = tevent_req_create(mem_ctx, &state,
3477                                 struct dcerpc_wbint_DsGetDcName_r_state);
3478         if (req == NULL) {
3479                 return NULL;
3480         }
3481
3482         state->out_mem_ctx = talloc_new(state);
3483         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3484                 return tevent_req_post(req, ev);
3485         }
3486
3487         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3488                         NULL, &ndr_table_wbint,
3489                         NDR_WBINT_DSGETDCNAME, state->out_mem_ctx, r);
3490         if (tevent_req_nomem(subreq, req)) {
3491                 return tevent_req_post(req, ev);
3492         }
3493         tevent_req_set_callback(subreq, dcerpc_wbint_DsGetDcName_r_done, req);
3494
3495         return req;
3496 }
3497
3498 static void dcerpc_wbint_DsGetDcName_r_done(struct tevent_req *subreq)
3499 {
3500         struct tevent_req *req =
3501                 tevent_req_callback_data(subreq,
3502                 struct tevent_req);
3503         NTSTATUS status;
3504
3505         status = dcerpc_binding_handle_call_recv(subreq);
3506         TALLOC_FREE(subreq);
3507         if (tevent_req_nterror(req, status)) {
3508                 return;
3509         }
3510
3511         tevent_req_done(req);
3512 }
3513
3514 NTSTATUS dcerpc_wbint_DsGetDcName_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3515 {
3516         struct dcerpc_wbint_DsGetDcName_r_state *state =
3517                 tevent_req_data(req,
3518                 struct dcerpc_wbint_DsGetDcName_r_state);
3519         NTSTATUS status;
3520
3521         if (tevent_req_is_nterror(req, &status)) {
3522                 tevent_req_received(req);
3523                 return status;
3524         }
3525
3526         talloc_steal(mem_ctx, state->out_mem_ctx);
3527
3528         tevent_req_received(req);
3529         return NT_STATUS_OK;
3530 }
3531
3532 NTSTATUS dcerpc_wbint_DsGetDcName_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_DsGetDcName *r)
3533 {
3534         NTSTATUS status;
3535
3536         status = dcerpc_binding_handle_call(h,
3537                         NULL, &ndr_table_wbint,
3538                         NDR_WBINT_DSGETDCNAME, mem_ctx, r);
3539
3540         return status;
3541 }
3542
3543 struct dcerpc_wbint_DsGetDcName_state {
3544         struct wbint_DsGetDcName orig;
3545         struct wbint_DsGetDcName tmp;
3546         TALLOC_CTX *out_mem_ctx;
3547 };
3548
3549 static void dcerpc_wbint_DsGetDcName_done(struct tevent_req *subreq);
3550
3551 struct tevent_req *dcerpc_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
3552                                                  struct tevent_context *ev,
3553                                                  struct dcerpc_binding_handle *h,
3554                                                  const char *_domain_name /* [in] [ref,charset(UTF8)] */,
3555                                                  struct GUID *_domain_guid /* [in] [unique] */,
3556                                                  const char *_site_name /* [in] [unique,charset(UTF8)] */,
3557                                                  uint32_t _flags /* [in]  */,
3558                                                  struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
3559 {
3560         struct tevent_req *req;
3561         struct dcerpc_wbint_DsGetDcName_state *state;
3562         struct tevent_req *subreq;
3563
3564         req = tevent_req_create(mem_ctx, &state,
3565                                 struct dcerpc_wbint_DsGetDcName_state);
3566         if (req == NULL) {
3567                 return NULL;
3568         }
3569         state->out_mem_ctx = NULL;
3570
3571         /* In parameters */
3572         state->orig.in.domain_name = _domain_name;
3573         state->orig.in.domain_guid = _domain_guid;
3574         state->orig.in.site_name = _site_name;
3575         state->orig.in.flags = _flags;
3576
3577         /* Out parameters */
3578         state->orig.out.dc_info = _dc_info;
3579
3580         /* Result */
3581         ZERO_STRUCT(state->orig.out.result);
3582
3583         state->out_mem_ctx = talloc_named_const(state, 0,
3584                              "dcerpc_wbint_DsGetDcName_out_memory");
3585         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3586                 return tevent_req_post(req, ev);
3587         }
3588
3589         /* make a temporary copy, that we pass to the dispatch function */
3590         state->tmp = state->orig;
3591
3592         subreq = dcerpc_wbint_DsGetDcName_r_send(state, ev, h, &state->tmp);
3593         if (tevent_req_nomem(subreq, req)) {
3594                 return tevent_req_post(req, ev);
3595         }
3596         tevent_req_set_callback(subreq, dcerpc_wbint_DsGetDcName_done, req);
3597         return req;
3598 }
3599
3600 static void dcerpc_wbint_DsGetDcName_done(struct tevent_req *subreq)
3601 {
3602         struct tevent_req *req = tevent_req_callback_data(
3603                 subreq, struct tevent_req);
3604         struct dcerpc_wbint_DsGetDcName_state *state = tevent_req_data(
3605                 req, struct dcerpc_wbint_DsGetDcName_state);
3606         NTSTATUS status;
3607         TALLOC_CTX *mem_ctx;
3608
3609         if (state->out_mem_ctx) {
3610                 mem_ctx = state->out_mem_ctx;
3611         } else {
3612                 mem_ctx = state;
3613         }
3614
3615         status = dcerpc_wbint_DsGetDcName_r_recv(subreq, mem_ctx);
3616         TALLOC_FREE(subreq);
3617         if (tevent_req_nterror(req, status)) {
3618                 return;
3619         }
3620
3621         /* Copy out parameters */
3622         *state->orig.out.dc_info = *state->tmp.out.dc_info;
3623
3624         /* Copy result */
3625         state->orig.out.result = state->tmp.out.result;
3626
3627         /* Reset temporary structure */
3628         ZERO_STRUCT(state->tmp);
3629
3630         tevent_req_done(req);
3631 }
3632
3633 NTSTATUS dcerpc_wbint_DsGetDcName_recv(struct tevent_req *req,
3634                                        TALLOC_CTX *mem_ctx,
3635                                        NTSTATUS *result)
3636 {
3637         struct dcerpc_wbint_DsGetDcName_state *state = tevent_req_data(
3638                 req, struct dcerpc_wbint_DsGetDcName_state);
3639         NTSTATUS status;
3640
3641         if (tevent_req_is_nterror(req, &status)) {
3642                 tevent_req_received(req);
3643                 return status;
3644         }
3645
3646         /* Steal possible out parameters to the callers context */
3647         talloc_steal(mem_ctx, state->out_mem_ctx);
3648
3649         /* Return result */
3650         *result = state->orig.out.result;
3651
3652         tevent_req_received(req);
3653         return NT_STATUS_OK;
3654 }
3655
3656 NTSTATUS dcerpc_wbint_DsGetDcName(struct dcerpc_binding_handle *h,
3657                                   TALLOC_CTX *mem_ctx,
3658                                   const char *_domain_name /* [in] [ref,charset(UTF8)] */,
3659                                   struct GUID *_domain_guid /* [in] [unique] */,
3660                                   const char *_site_name /* [in] [unique,charset(UTF8)] */,
3661                                   uint32_t _flags /* [in]  */,
3662                                   struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */,
3663                                   NTSTATUS *result)
3664 {
3665         struct wbint_DsGetDcName r;
3666         NTSTATUS status;
3667
3668         /* In parameters */
3669         r.in.domain_name = _domain_name;
3670         r.in.domain_guid = _domain_guid;
3671         r.in.site_name = _site_name;
3672         r.in.flags = _flags;
3673
3674         status = dcerpc_wbint_DsGetDcName_r(h, mem_ctx, &r);
3675         if (!NT_STATUS_IS_OK(status)) {
3676                 return status;
3677         }
3678
3679         /* Return variables */
3680         *_dc_info = *r.out.dc_info;
3681
3682         /* Return result */
3683         *result = r.out.result;
3684
3685         return NT_STATUS_OK;
3686 }
3687
3688 struct dcerpc_wbint_LookupRids_r_state {
3689         TALLOC_CTX *out_mem_ctx;
3690 };
3691
3692 static void dcerpc_wbint_LookupRids_r_done(struct tevent_req *subreq);
3693
3694 struct tevent_req *dcerpc_wbint_LookupRids_r_send(TALLOC_CTX *mem_ctx,
3695         struct tevent_context *ev,
3696         struct dcerpc_binding_handle *h,
3697         struct wbint_LookupRids *r)
3698 {
3699         struct tevent_req *req;
3700         struct dcerpc_wbint_LookupRids_r_state *state;
3701         struct tevent_req *subreq;
3702
3703         req = tevent_req_create(mem_ctx, &state,
3704                                 struct dcerpc_wbint_LookupRids_r_state);
3705         if (req == NULL) {
3706                 return NULL;
3707         }
3708
3709         state->out_mem_ctx = talloc_new(state);
3710         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3711                 return tevent_req_post(req, ev);
3712         }
3713
3714         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3715                         NULL, &ndr_table_wbint,
3716                         NDR_WBINT_LOOKUPRIDS, state->out_mem_ctx, r);
3717         if (tevent_req_nomem(subreq, req)) {
3718                 return tevent_req_post(req, ev);
3719         }
3720         tevent_req_set_callback(subreq, dcerpc_wbint_LookupRids_r_done, req);
3721
3722         return req;
3723 }
3724
3725 static void dcerpc_wbint_LookupRids_r_done(struct tevent_req *subreq)
3726 {
3727         struct tevent_req *req =
3728                 tevent_req_callback_data(subreq,
3729                 struct tevent_req);
3730         NTSTATUS status;
3731
3732         status = dcerpc_binding_handle_call_recv(subreq);
3733         TALLOC_FREE(subreq);
3734         if (tevent_req_nterror(req, status)) {
3735                 return;
3736         }
3737
3738         tevent_req_done(req);
3739 }
3740
3741 NTSTATUS dcerpc_wbint_LookupRids_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3742 {
3743         struct dcerpc_wbint_LookupRids_r_state *state =
3744                 tevent_req_data(req,
3745                 struct dcerpc_wbint_LookupRids_r_state);
3746         NTSTATUS status;
3747
3748         if (tevent_req_is_nterror(req, &status)) {
3749                 tevent_req_received(req);
3750                 return status;
3751         }
3752
3753         talloc_steal(mem_ctx, state->out_mem_ctx);
3754
3755         tevent_req_received(req);
3756         return NT_STATUS_OK;
3757 }
3758
3759 NTSTATUS dcerpc_wbint_LookupRids_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_LookupRids *r)
3760 {
3761         NTSTATUS status;
3762
3763         status = dcerpc_binding_handle_call(h,
3764                         NULL, &ndr_table_wbint,
3765                         NDR_WBINT_LOOKUPRIDS, mem_ctx, r);
3766
3767         return status;
3768 }
3769
3770 struct dcerpc_wbint_LookupRids_state {
3771         struct wbint_LookupRids orig;
3772         struct wbint_LookupRids tmp;
3773         TALLOC_CTX *out_mem_ctx;
3774 };
3775
3776 static void dcerpc_wbint_LookupRids_done(struct tevent_req *subreq);
3777
3778 struct tevent_req *dcerpc_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
3779                                                 struct tevent_context *ev,
3780                                                 struct dcerpc_binding_handle *h,
3781                                                 struct dom_sid *_domain_sid /* [in] [ref] */,
3782                                                 struct wbint_RidArray *_rids /* [in] [ref] */,
3783                                                 const char **_domain_name /* [out] [ref,charset(UTF8)] */,
3784                                                 struct wbint_Principals *_names /* [out] [ref] */)
3785 {
3786         struct tevent_req *req;
3787         struct dcerpc_wbint_LookupRids_state *state;
3788         struct tevent_req *subreq;
3789
3790         req = tevent_req_create(mem_ctx, &state,
3791                                 struct dcerpc_wbint_LookupRids_state);
3792         if (req == NULL) {
3793                 return NULL;
3794         }
3795         state->out_mem_ctx = NULL;
3796
3797         /* In parameters */
3798         state->orig.in.domain_sid = _domain_sid;
3799         state->orig.in.rids = _rids;
3800
3801         /* Out parameters */
3802         state->orig.out.domain_name = _domain_name;
3803         state->orig.out.names = _names;
3804
3805         /* Result */
3806         ZERO_STRUCT(state->orig.out.result);
3807
3808         state->out_mem_ctx = talloc_named_const(state, 0,
3809                              "dcerpc_wbint_LookupRids_out_memory");
3810         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3811                 return tevent_req_post(req, ev);
3812         }
3813
3814         /* make a temporary copy, that we pass to the dispatch function */
3815         state->tmp = state->orig;
3816
3817         subreq = dcerpc_wbint_LookupRids_r_send(state, ev, h, &state->tmp);
3818         if (tevent_req_nomem(subreq, req)) {
3819                 return tevent_req_post(req, ev);
3820         }
3821         tevent_req_set_callback(subreq, dcerpc_wbint_LookupRids_done, req);
3822         return req;
3823 }
3824
3825 static void dcerpc_wbint_LookupRids_done(struct tevent_req *subreq)
3826 {
3827         struct tevent_req *req = tevent_req_callback_data(
3828                 subreq, struct tevent_req);
3829         struct dcerpc_wbint_LookupRids_state *state = tevent_req_data(
3830                 req, struct dcerpc_wbint_LookupRids_state);
3831         NTSTATUS status;
3832         TALLOC_CTX *mem_ctx;
3833
3834         if (state->out_mem_ctx) {
3835                 mem_ctx = state->out_mem_ctx;
3836         } else {
3837                 mem_ctx = state;
3838         }
3839
3840         status = dcerpc_wbint_LookupRids_r_recv(subreq, mem_ctx);
3841         TALLOC_FREE(subreq);
3842         if (tevent_req_nterror(req, status)) {
3843                 return;
3844         }
3845
3846         /* Copy out parameters */
3847         *state->orig.out.domain_name = *state->tmp.out.domain_name;
3848         *state->orig.out.names = *state->tmp.out.names;
3849
3850         /* Copy result */
3851         state->orig.out.result = state->tmp.out.result;
3852
3853         /* Reset temporary structure */
3854         ZERO_STRUCT(state->tmp);
3855
3856         tevent_req_done(req);
3857 }
3858
3859 NTSTATUS dcerpc_wbint_LookupRids_recv(struct tevent_req *req,
3860                                       TALLOC_CTX *mem_ctx,
3861                                       NTSTATUS *result)
3862 {
3863         struct dcerpc_wbint_LookupRids_state *state = tevent_req_data(
3864                 req, struct dcerpc_wbint_LookupRids_state);
3865         NTSTATUS status;
3866
3867         if (tevent_req_is_nterror(req, &status)) {
3868                 tevent_req_received(req);
3869                 return status;
3870         }
3871
3872         /* Steal possible out parameters to the callers context */
3873         talloc_steal(mem_ctx, state->out_mem_ctx);
3874
3875         /* Return result */
3876         *result = state->orig.out.result;
3877
3878         tevent_req_received(req);
3879         return NT_STATUS_OK;
3880 }
3881
3882 NTSTATUS dcerpc_wbint_LookupRids(struct dcerpc_binding_handle *h,
3883                                  TALLOC_CTX *mem_ctx,
3884                                  struct dom_sid *_domain_sid /* [in] [ref] */,
3885                                  struct wbint_RidArray *_rids /* [in] [ref] */,
3886                                  const char **_domain_name /* [out] [ref,charset(UTF8)] */,
3887                                  struct wbint_Principals *_names /* [out] [ref] */,
3888                                  NTSTATUS *result)
3889 {
3890         struct wbint_LookupRids r;
3891         NTSTATUS status;
3892
3893         /* In parameters */
3894         r.in.domain_sid = _domain_sid;
3895         r.in.rids = _rids;
3896
3897         status = dcerpc_wbint_LookupRids_r(h, mem_ctx, &r);
3898         if (!NT_STATUS_IS_OK(status)) {
3899                 return status;
3900         }
3901
3902         /* Return variables */
3903         *_domain_name = *r.out.domain_name;
3904         *_names = *r.out.names;
3905
3906         /* Return result */
3907         *result = r.out.result;
3908
3909         return NT_STATUS_OK;
3910 }
3911
3912 struct dcerpc_wbint_CheckMachineAccount_r_state {
3913         TALLOC_CTX *out_mem_ctx;
3914 };
3915
3916 static void dcerpc_wbint_CheckMachineAccount_r_done(struct tevent_req *subreq);
3917
3918 struct tevent_req *dcerpc_wbint_CheckMachineAccount_r_send(TALLOC_CTX *mem_ctx,
3919         struct tevent_context *ev,
3920         struct dcerpc_binding_handle *h,
3921         struct wbint_CheckMachineAccount *r)
3922 {
3923         struct tevent_req *req;
3924         struct dcerpc_wbint_CheckMachineAccount_r_state *state;
3925         struct tevent_req *subreq;
3926
3927         req = tevent_req_create(mem_ctx, &state,
3928                                 struct dcerpc_wbint_CheckMachineAccount_r_state);
3929         if (req == NULL) {
3930                 return NULL;
3931         }
3932
3933         state->out_mem_ctx = NULL;
3934
3935         subreq = dcerpc_binding_handle_call_send(state, ev, h,
3936                         NULL, &ndr_table_wbint,
3937                         NDR_WBINT_CHECKMACHINEACCOUNT, state, r);
3938         if (tevent_req_nomem(subreq, req)) {
3939                 return tevent_req_post(req, ev);
3940         }
3941         tevent_req_set_callback(subreq, dcerpc_wbint_CheckMachineAccount_r_done, req);
3942
3943         return req;
3944 }
3945
3946 static void dcerpc_wbint_CheckMachineAccount_r_done(struct tevent_req *subreq)
3947 {
3948         struct tevent_req *req =
3949                 tevent_req_callback_data(subreq,
3950                 struct tevent_req);
3951         NTSTATUS status;
3952
3953         status = dcerpc_binding_handle_call_recv(subreq);
3954         TALLOC_FREE(subreq);
3955         if (tevent_req_nterror(req, status)) {
3956                 return;
3957         }
3958
3959         tevent_req_done(req);
3960 }
3961
3962 NTSTATUS dcerpc_wbint_CheckMachineAccount_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
3963 {
3964         struct dcerpc_wbint_CheckMachineAccount_r_state *state =
3965                 tevent_req_data(req,
3966                 struct dcerpc_wbint_CheckMachineAccount_r_state);
3967         NTSTATUS status;
3968
3969         if (tevent_req_is_nterror(req, &status)) {
3970                 tevent_req_received(req);
3971                 return status;
3972         }
3973
3974         talloc_steal(mem_ctx, state->out_mem_ctx);
3975
3976         tevent_req_received(req);
3977         return NT_STATUS_OK;
3978 }
3979
3980 NTSTATUS dcerpc_wbint_CheckMachineAccount_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_CheckMachineAccount *r)
3981 {
3982         NTSTATUS status;
3983
3984         status = dcerpc_binding_handle_call(h,
3985                         NULL, &ndr_table_wbint,
3986                         NDR_WBINT_CHECKMACHINEACCOUNT, mem_ctx, r);
3987
3988         return status;
3989 }
3990
3991 struct dcerpc_wbint_CheckMachineAccount_state {
3992         struct wbint_CheckMachineAccount orig;
3993         struct wbint_CheckMachineAccount tmp;
3994         TALLOC_CTX *out_mem_ctx;
3995 };
3996
3997 static void dcerpc_wbint_CheckMachineAccount_done(struct tevent_req *subreq);
3998
3999 struct tevent_req *dcerpc_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx,
4000                                                          struct tevent_context *ev,
4001                                                          struct dcerpc_binding_handle *h)
4002 {
4003         struct tevent_req *req;
4004         struct dcerpc_wbint_CheckMachineAccount_state *state;
4005         struct tevent_req *subreq;
4006
4007         req = tevent_req_create(mem_ctx, &state,
4008                                 struct dcerpc_wbint_CheckMachineAccount_state);
4009         if (req == NULL) {
4010                 return NULL;
4011         }
4012         state->out_mem_ctx = NULL;
4013
4014         /* In parameters */
4015
4016         /* Out parameters */
4017
4018         /* Result */
4019         ZERO_STRUCT(state->orig.out.result);
4020
4021         /* make a temporary copy, that we pass to the dispatch function */
4022         state->tmp = state->orig;
4023
4024         subreq = dcerpc_wbint_CheckMachineAccount_r_send(state, ev, h, &state->tmp);
4025         if (tevent_req_nomem(subreq, req)) {
4026                 return tevent_req_post(req, ev);
4027         }
4028         tevent_req_set_callback(subreq, dcerpc_wbint_CheckMachineAccount_done, req);
4029         return req;
4030 }
4031
4032 static void dcerpc_wbint_CheckMachineAccount_done(struct tevent_req *subreq)
4033 {
4034         struct tevent_req *req = tevent_req_callback_data(
4035                 subreq, struct tevent_req);
4036         struct dcerpc_wbint_CheckMachineAccount_state *state = tevent_req_data(
4037                 req, struct dcerpc_wbint_CheckMachineAccount_state);
4038         NTSTATUS status;
4039         TALLOC_CTX *mem_ctx;
4040
4041         if (state->out_mem_ctx) {
4042                 mem_ctx = state->out_mem_ctx;
4043         } else {
4044                 mem_ctx = state;
4045         }
4046
4047         status = dcerpc_wbint_CheckMachineAccount_r_recv(subreq, mem_ctx);
4048         TALLOC_FREE(subreq);
4049         if (tevent_req_nterror(req, status)) {
4050                 return;
4051         }
4052
4053         /* Copy out parameters */
4054
4055         /* Copy result */
4056         state->orig.out.result = state->tmp.out.result;
4057
4058         /* Reset temporary structure */
4059         ZERO_STRUCT(state->tmp);
4060
4061         tevent_req_done(req);
4062 }
4063
4064 NTSTATUS dcerpc_wbint_CheckMachineAccount_recv(struct tevent_req *req,
4065                                                TALLOC_CTX *mem_ctx,
4066                                                NTSTATUS *result)
4067 {
4068         struct dcerpc_wbint_CheckMachineAccount_state *state = tevent_req_data(
4069                 req, struct dcerpc_wbint_CheckMachineAccount_state);
4070         NTSTATUS status;
4071
4072         if (tevent_req_is_nterror(req, &status)) {
4073                 tevent_req_received(req);
4074                 return status;
4075         }
4076
4077         /* Steal possible out parameters to the callers context */
4078         talloc_steal(mem_ctx, state->out_mem_ctx);
4079
4080         /* Return result */
4081         *result = state->orig.out.result;
4082
4083         tevent_req_received(req);
4084         return NT_STATUS_OK;
4085 }
4086
4087 NTSTATUS dcerpc_wbint_CheckMachineAccount(struct dcerpc_binding_handle *h,
4088                                           TALLOC_CTX *mem_ctx,
4089                                           NTSTATUS *result)
4090 {
4091         struct wbint_CheckMachineAccount r;
4092         NTSTATUS status;
4093
4094         /* In parameters */
4095
4096         status = dcerpc_wbint_CheckMachineAccount_r(h, mem_ctx, &r);
4097         if (!NT_STATUS_IS_OK(status)) {
4098                 return status;
4099         }
4100
4101         /* Return variables */
4102
4103         /* Return result */
4104         *result = r.out.result;
4105
4106         return NT_STATUS_OK;
4107 }
4108
4109 struct dcerpc_wbint_ChangeMachineAccount_r_state {
4110         TALLOC_CTX *out_mem_ctx;
4111 };
4112
4113 static void dcerpc_wbint_ChangeMachineAccount_r_done(struct tevent_req *subreq);
4114
4115 struct tevent_req *dcerpc_wbint_ChangeMachineAccount_r_send(TALLOC_CTX *mem_ctx,
4116         struct tevent_context *ev,
4117         struct dcerpc_binding_handle *h,
4118         struct wbint_ChangeMachineAccount *r)
4119 {
4120         struct tevent_req *req;
4121         struct dcerpc_wbint_ChangeMachineAccount_r_state *state;
4122         struct tevent_req *subreq;
4123
4124         req = tevent_req_create(mem_ctx, &state,
4125                                 struct dcerpc_wbint_ChangeMachineAccount_r_state);
4126         if (req == NULL) {
4127                 return NULL;
4128         }
4129
4130         state->out_mem_ctx = NULL;
4131
4132         subreq = dcerpc_binding_handle_call_send(state, ev, h,
4133                         NULL, &ndr_table_wbint,
4134                         NDR_WBINT_CHANGEMACHINEACCOUNT, state, r);
4135         if (tevent_req_nomem(subreq, req)) {
4136                 return tevent_req_post(req, ev);
4137         }
4138         tevent_req_set_callback(subreq, dcerpc_wbint_ChangeMachineAccount_r_done, req);
4139
4140         return req;
4141 }
4142
4143 static void dcerpc_wbint_ChangeMachineAccount_r_done(struct tevent_req *subreq)
4144 {
4145         struct tevent_req *req =
4146                 tevent_req_callback_data(subreq,
4147                 struct tevent_req);
4148         NTSTATUS status;
4149
4150         status = dcerpc_binding_handle_call_recv(subreq);
4151         TALLOC_FREE(subreq);
4152         if (tevent_req_nterror(req, status)) {
4153                 return;
4154         }
4155
4156         tevent_req_done(req);
4157 }
4158
4159 NTSTATUS dcerpc_wbint_ChangeMachineAccount_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4160 {
4161         struct dcerpc_wbint_ChangeMachineAccount_r_state *state =
4162                 tevent_req_data(req,
4163                 struct dcerpc_wbint_ChangeMachineAccount_r_state);
4164         NTSTATUS status;
4165
4166         if (tevent_req_is_nterror(req, &status)) {
4167                 tevent_req_received(req);
4168                 return status;
4169         }
4170
4171         talloc_steal(mem_ctx, state->out_mem_ctx);
4172
4173         tevent_req_received(req);
4174         return NT_STATUS_OK;
4175 }
4176
4177 NTSTATUS dcerpc_wbint_ChangeMachineAccount_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_ChangeMachineAccount *r)
4178 {
4179         NTSTATUS status;
4180
4181         status = dcerpc_binding_handle_call(h,
4182                         NULL, &ndr_table_wbint,
4183                         NDR_WBINT_CHANGEMACHINEACCOUNT, mem_ctx, r);
4184
4185         return status;
4186 }
4187
4188 struct dcerpc_wbint_ChangeMachineAccount_state {
4189         struct wbint_ChangeMachineAccount orig;
4190         struct wbint_ChangeMachineAccount tmp;
4191         TALLOC_CTX *out_mem_ctx;
4192 };
4193
4194 static void dcerpc_wbint_ChangeMachineAccount_done(struct tevent_req *subreq);
4195
4196 struct tevent_req *dcerpc_wbint_ChangeMachineAccount_send(TALLOC_CTX *mem_ctx,
4197                                                           struct tevent_context *ev,
4198                                                           struct dcerpc_binding_handle *h)
4199 {
4200         struct tevent_req *req;
4201         struct dcerpc_wbint_ChangeMachineAccount_state *state;
4202         struct tevent_req *subreq;
4203
4204         req = tevent_req_create(mem_ctx, &state,
4205                                 struct dcerpc_wbint_ChangeMachineAccount_state);
4206         if (req == NULL) {
4207                 return NULL;
4208         }
4209         state->out_mem_ctx = NULL;
4210
4211         /* In parameters */
4212
4213         /* Out parameters */
4214
4215         /* Result */
4216         ZERO_STRUCT(state->orig.out.result);
4217
4218         /* make a temporary copy, that we pass to the dispatch function */
4219         state->tmp = state->orig;
4220
4221         subreq = dcerpc_wbint_ChangeMachineAccount_r_send(state, ev, h, &state->tmp);
4222         if (tevent_req_nomem(subreq, req)) {
4223                 return tevent_req_post(req, ev);
4224         }
4225         tevent_req_set_callback(subreq, dcerpc_wbint_ChangeMachineAccount_done, req);
4226         return req;
4227 }
4228
4229 static void dcerpc_wbint_ChangeMachineAccount_done(struct tevent_req *subreq)
4230 {
4231         struct tevent_req *req = tevent_req_callback_data(
4232                 subreq, struct tevent_req);
4233         struct dcerpc_wbint_ChangeMachineAccount_state *state = tevent_req_data(
4234                 req, struct dcerpc_wbint_ChangeMachineAccount_state);
4235         NTSTATUS status;
4236         TALLOC_CTX *mem_ctx;
4237
4238         if (state->out_mem_ctx) {
4239                 mem_ctx = state->out_mem_ctx;
4240         } else {
4241                 mem_ctx = state;
4242         }
4243
4244         status = dcerpc_wbint_ChangeMachineAccount_r_recv(subreq, mem_ctx);
4245         TALLOC_FREE(subreq);
4246         if (tevent_req_nterror(req, status)) {
4247                 return;
4248         }
4249
4250         /* Copy out parameters */
4251
4252         /* Copy result */
4253         state->orig.out.result = state->tmp.out.result;
4254
4255         /* Reset temporary structure */
4256         ZERO_STRUCT(state->tmp);
4257
4258         tevent_req_done(req);
4259 }
4260
4261 NTSTATUS dcerpc_wbint_ChangeMachineAccount_recv(struct tevent_req *req,
4262                                                 TALLOC_CTX *mem_ctx,
4263                                                 NTSTATUS *result)
4264 {
4265         struct dcerpc_wbint_ChangeMachineAccount_state *state = tevent_req_data(
4266                 req, struct dcerpc_wbint_ChangeMachineAccount_state);
4267         NTSTATUS status;
4268
4269         if (tevent_req_is_nterror(req, &status)) {
4270                 tevent_req_received(req);
4271                 return status;
4272         }
4273
4274         /* Steal possible out parameters to the callers context */
4275         talloc_steal(mem_ctx, state->out_mem_ctx);
4276
4277         /* Return result */
4278         *result = state->orig.out.result;
4279
4280         tevent_req_received(req);
4281         return NT_STATUS_OK;
4282 }
4283
4284 NTSTATUS dcerpc_wbint_ChangeMachineAccount(struct dcerpc_binding_handle *h,
4285                                            TALLOC_CTX *mem_ctx,
4286                                            NTSTATUS *result)
4287 {
4288         struct wbint_ChangeMachineAccount r;
4289         NTSTATUS status;
4290
4291         /* In parameters */
4292
4293         status = dcerpc_wbint_ChangeMachineAccount_r(h, mem_ctx, &r);
4294         if (!NT_STATUS_IS_OK(status)) {
4295                 return status;
4296         }
4297
4298         /* Return variables */
4299
4300         /* Return result */
4301         *result = r.out.result;
4302
4303         return NT_STATUS_OK;
4304 }
4305
4306 struct dcerpc_wbint_PingDc_r_state {
4307         TALLOC_CTX *out_mem_ctx;
4308 };
4309
4310 static void dcerpc_wbint_PingDc_r_done(struct tevent_req *subreq);
4311
4312 struct tevent_req *dcerpc_wbint_PingDc_r_send(TALLOC_CTX *mem_ctx,
4313         struct tevent_context *ev,
4314         struct dcerpc_binding_handle *h,
4315         struct wbint_PingDc *r)
4316 {
4317         struct tevent_req *req;
4318         struct dcerpc_wbint_PingDc_r_state *state;
4319         struct tevent_req *subreq;
4320
4321         req = tevent_req_create(mem_ctx, &state,
4322                                 struct dcerpc_wbint_PingDc_r_state);
4323         if (req == NULL) {
4324                 return NULL;
4325         }
4326
4327         state->out_mem_ctx = talloc_new(state);
4328         if (tevent_req_nomem(state->out_mem_ctx, req)) {
4329                 return tevent_req_post(req, ev);
4330         }
4331
4332         subreq = dcerpc_binding_handle_call_send(state, ev, h,
4333                         NULL, &ndr_table_wbint,
4334                         NDR_WBINT_PINGDC, state->out_mem_ctx, r);
4335         if (tevent_req_nomem(subreq, req)) {
4336                 return tevent_req_post(req, ev);
4337         }
4338         tevent_req_set_callback(subreq, dcerpc_wbint_PingDc_r_done, req);
4339
4340         return req;
4341 }
4342
4343 static void dcerpc_wbint_PingDc_r_done(struct tevent_req *subreq)
4344 {
4345         struct tevent_req *req =
4346                 tevent_req_callback_data(subreq,
4347                 struct tevent_req);
4348         NTSTATUS status;
4349
4350         status = dcerpc_binding_handle_call_recv(subreq);
4351         TALLOC_FREE(subreq);
4352         if (tevent_req_nterror(req, status)) {
4353                 return;
4354         }
4355
4356         tevent_req_done(req);
4357 }
4358
4359 NTSTATUS dcerpc_wbint_PingDc_r_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx)
4360 {
4361         struct dcerpc_wbint_PingDc_r_state *state =
4362                 tevent_req_data(req,
4363                 struct dcerpc_wbint_PingDc_r_state);
4364         NTSTATUS status;
4365
4366         if (tevent_req_is_nterror(req, &status)) {
4367                 tevent_req_received(req);
4368                 return status;
4369         }
4370
4371         talloc_steal(mem_ctx, state->out_mem_ctx);
4372
4373         tevent_req_received(req);
4374         return NT_STATUS_OK;
4375 }
4376
4377 NTSTATUS dcerpc_wbint_PingDc_r(struct dcerpc_binding_handle *h, TALLOC_CTX *mem_ctx, struct wbint_PingDc *r)
4378 {
4379         NTSTATUS status;
4380
4381         status = dcerpc_binding_handle_call(h,
4382                         NULL, &ndr_table_wbint,
4383                         NDR_WBINT_PINGDC, mem_ctx, r);
4384
4385         return status;
4386 }
4387
4388 struct dcerpc_wbint_PingDc_state {
4389         struct wbint_PingDc orig;
4390         struct wbint_PingDc tmp;
4391         TALLOC_CTX *out_mem_ctx;
4392 };
4393
4394 static void dcerpc_wbint_PingDc_done(struct tevent_req *subreq);
4395
4396 struct tevent_req *dcerpc_wbint_PingDc_send(TALLOC_CTX *mem_ctx,
4397                                             struct tevent_context *ev,
4398                                             struct dcerpc_binding_handle *h,
4399                                             const char **_dcname /* [out] [ref,charset(UTF8)] */)
4400 {
4401         struct tevent_req *req;
4402         struct dcerpc_wbint_PingDc_state *state;
4403         struct tevent_req *subreq;
4404
4405         req = tevent_req_create(mem_ctx, &state,
4406                                 struct dcerpc_wbint_PingDc_state);
4407         if (req == NULL) {
4408                 return NULL;
4409         }
4410         state->out_mem_ctx = NULL;
4411
4412         /* In parameters */
4413
4414         /* Out parameters */
4415         state->orig.out.dcname = _dcname;
4416
4417         /* Result */
4418         ZERO_STRUCT(state->orig.out.result);
4419
4420         state->out_mem_ctx = talloc_named_const(state, 0,
4421                              "dcerpc_wbint_PingDc_out_memory");
4422         if (tevent_req_nomem(state->out_mem_ctx, req)) {
4423                 return tevent_req_post(req, ev);
4424         }
4425
4426         /* make a temporary copy, that we pass to the dispatch function */
4427         state->tmp = state->orig;
4428
4429         subreq = dcerpc_wbint_PingDc_r_send(state, ev, h, &state->tmp);
4430         if (tevent_req_nomem(subreq, req)) {
4431                 return tevent_req_post(req, ev);
4432         }
4433         tevent_req_set_callback(subreq, dcerpc_wbint_PingDc_done, req);
4434         return req;
4435 }
4436
4437 static void dcerpc_wbint_PingDc_done(struct tevent_req *subreq)
4438 {
4439         struct tevent_req *req = tevent_req_callback_data(
4440                 subreq, struct tevent_req);
4441         struct dcerpc_wbint_PingDc_state *state = tevent_req_data(
4442                 req, struct dcerpc_wbint_PingDc_state);
4443         NTSTATUS status;
4444         TALLOC_CTX *mem_ctx;
4445
4446         if (state->out_mem_ctx) {
4447                 mem_ctx = state->out_mem_ctx;
4448         } else {
4449                 mem_ctx = state;
4450         }
4451
4452         status = dcerpc_wbint_PingDc_r_recv(subreq, mem_ctx);
4453         TALLOC_FREE(subreq);
4454         if (tevent_req_nterror(req, status)) {
4455                 return;
4456         }
4457
4458         /* Copy out parameters */
4459         *state->orig.out.dcname = *state->tmp.out.dcname;
4460
4461         /* Copy result */
4462         state->orig.out.result = state->tmp.out.result;
4463
4464         /* Reset temporary structure */
4465         ZERO_STRUCT(state->tmp);
4466
4467         tevent_req_done(req);
4468 }
4469
4470 NTSTATUS dcerpc_wbint_PingDc_recv(struct tevent_req *req,
4471                                   TALLOC_CTX *mem_ctx,
4472                                   NTSTATUS *result)
4473 {
4474         struct dcerpc_wbint_PingDc_state *state = tevent_req_data(
4475                 req, struct dcerpc_wbint_PingDc_state);
4476         NTSTATUS status;
4477
4478         if (tevent_req_is_nterror(req, &status)) {
4479                 tevent_req_received(req);
4480                 return status;
4481         }
4482
4483         /* Steal possible out parameters to the callers context */
4484         talloc_steal(mem_ctx, state->out_mem_ctx);
4485
4486         /* Return result */
4487         *result = state->orig.out.result;
4488
4489         tevent_req_received(req);
4490         return NT_STATUS_OK;
4491 }
4492
4493 NTSTATUS dcerpc_wbint_PingDc(struct dcerpc_binding_handle *h,
4494                              TALLOC_CTX *mem_ctx,
4495                              const char **_dcname /* [out] [ref,charset(UTF8)] */,
4496                              NTSTATUS *result)
4497 {
4498         struct wbint_PingDc r;
4499         NTSTATUS status;
4500
4501         /* In parameters */
4502
4503         status = dcerpc_wbint_PingDc_r(h, mem_ctx, &r);
4504         if (!NT_STATUS_IS_OK(status)) {
4505                 return status;
4506         }
4507
4508         /* Return variables */
4509         *_dcname = *r.out.dcname;
4510
4511         /* Return result */
4512         *result = r.out.result;
4513
4514         return NT_STATUS_OK;
4515 }
4516