Revert "s3: Do not reference ndr_table_<pipe> in the cli_ routines directly"
[kai/samba-autobuild/.git] / source3 / librpc / gen_ndr / cli_wbint.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * client auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/cli_wbint.h"
8
9 struct rpccli_wbint_Ping_state {
10         struct wbint_Ping orig;
11         struct wbint_Ping tmp;
12         TALLOC_CTX *out_mem_ctx;
13         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
14 };
15
16 static void rpccli_wbint_Ping_done(struct tevent_req *subreq);
17
18 struct tevent_req *rpccli_wbint_Ping_send(TALLOC_CTX *mem_ctx,
19                                           struct tevent_context *ev,
20                                           struct rpc_pipe_client *cli,
21                                           uint32_t _in_data /* [in]  */,
22                                           uint32_t *_out_data /* [out] [ref] */)
23 {
24         struct tevent_req *req;
25         struct rpccli_wbint_Ping_state *state;
26         struct tevent_req *subreq;
27
28         req = tevent_req_create(mem_ctx, &state,
29                                 struct rpccli_wbint_Ping_state);
30         if (req == NULL) {
31                 return NULL;
32         }
33         state->out_mem_ctx = NULL;
34         state->dispatch_recv = cli->dispatch_recv;
35
36         /* In parameters */
37         state->orig.in.in_data = _in_data;
38
39         /* Out parameters */
40         state->orig.out.out_data = _out_data;
41
42         state->out_mem_ctx = talloc_named_const(state, 0,
43                              "rpccli_wbint_Ping_out_memory");
44         if (tevent_req_nomem(state->out_mem_ctx, req)) {
45                 return tevent_req_post(req, ev);
46         }
47
48         /* make a temporary copy, that we pass to the dispatch function */
49         state->tmp = state->orig;
50
51         subreq = cli->dispatch_send(state, ev, cli,
52                                     &ndr_table_wbint,
53                                     NDR_WBINT_PING,
54                                     &state->tmp);
55         if (tevent_req_nomem(subreq, req)) {
56                 return tevent_req_post(req, ev);
57         }
58         tevent_req_set_callback(subreq, rpccli_wbint_Ping_done, req);
59         return req;
60 }
61
62 static void rpccli_wbint_Ping_done(struct tevent_req *subreq)
63 {
64         struct tevent_req *req = tevent_req_callback_data(
65                 subreq, struct tevent_req);
66         struct rpccli_wbint_Ping_state *state = tevent_req_data(
67                 req, struct rpccli_wbint_Ping_state);
68         NTSTATUS status;
69         TALLOC_CTX *mem_ctx;
70
71         if (state->out_mem_ctx) {
72                 mem_ctx = state->out_mem_ctx;
73         } else {
74                 mem_ctx = state;
75         }
76
77         status = state->dispatch_recv(subreq, mem_ctx);
78         TALLOC_FREE(subreq);
79         if (!NT_STATUS_IS_OK(status)) {
80                 tevent_req_nterror(req, status);
81                 return;
82         }
83
84         /* Copy out parameters */
85         *state->orig.out.out_data = *state->tmp.out.out_data;
86
87         /* Reset temporary structure */
88         ZERO_STRUCT(state->tmp);
89
90         tevent_req_done(req);
91 }
92
93 NTSTATUS rpccli_wbint_Ping_recv(struct tevent_req *req,
94                                 TALLOC_CTX *mem_ctx)
95 {
96         struct rpccli_wbint_Ping_state *state = tevent_req_data(
97                 req, struct rpccli_wbint_Ping_state);
98         NTSTATUS status;
99
100         if (tevent_req_is_nterror(req, &status)) {
101                 tevent_req_received(req);
102                 return status;
103         }
104
105         /* Steal possbile out parameters to the callers context */
106         talloc_steal(mem_ctx, state->out_mem_ctx);
107
108         tevent_req_received(req);
109         return NT_STATUS_OK;
110 }
111
112 NTSTATUS rpccli_wbint_Ping(struct rpc_pipe_client *cli,
113                            TALLOC_CTX *mem_ctx,
114                            uint32_t in_data /* [in]  */,
115                            uint32_t *out_data /* [out] [ref] */)
116 {
117         struct wbint_Ping r;
118         NTSTATUS status;
119
120         /* In parameters */
121         r.in.in_data = in_data;
122
123         status = cli->dispatch(cli,
124                                 mem_ctx,
125                                 &ndr_table_wbint,
126                                 NDR_WBINT_PING,
127                                 &r);
128
129         if (!NT_STATUS_IS_OK(status)) {
130                 return status;
131         }
132
133         if (NT_STATUS_IS_ERR(status)) {
134                 return status;
135         }
136
137         /* Return variables */
138         *out_data = *r.out.out_data;
139
140         /* Return result */
141         return NT_STATUS_OK;
142 }
143
144 struct rpccli_wbint_LookupSid_state {
145         struct wbint_LookupSid orig;
146         struct wbint_LookupSid tmp;
147         TALLOC_CTX *out_mem_ctx;
148         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
149 };
150
151 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq);
152
153 struct tevent_req *rpccli_wbint_LookupSid_send(TALLOC_CTX *mem_ctx,
154                                                struct tevent_context *ev,
155                                                struct rpc_pipe_client *cli,
156                                                struct dom_sid *_sid /* [in] [ref] */,
157                                                enum lsa_SidType *_type /* [out] [ref] */,
158                                                const char **_domain /* [out] [ref,charset(UTF8)] */,
159                                                const char **_name /* [out] [ref,charset(UTF8)] */)
160 {
161         struct tevent_req *req;
162         struct rpccli_wbint_LookupSid_state *state;
163         struct tevent_req *subreq;
164
165         req = tevent_req_create(mem_ctx, &state,
166                                 struct rpccli_wbint_LookupSid_state);
167         if (req == NULL) {
168                 return NULL;
169         }
170         state->out_mem_ctx = NULL;
171         state->dispatch_recv = cli->dispatch_recv;
172
173         /* In parameters */
174         state->orig.in.sid = _sid;
175
176         /* Out parameters */
177         state->orig.out.type = _type;
178         state->orig.out.domain = _domain;
179         state->orig.out.name = _name;
180
181         /* Result */
182         ZERO_STRUCT(state->orig.out.result);
183
184         state->out_mem_ctx = talloc_named_const(state, 0,
185                              "rpccli_wbint_LookupSid_out_memory");
186         if (tevent_req_nomem(state->out_mem_ctx, req)) {
187                 return tevent_req_post(req, ev);
188         }
189
190         /* make a temporary copy, that we pass to the dispatch function */
191         state->tmp = state->orig;
192
193         subreq = cli->dispatch_send(state, ev, cli,
194                                     &ndr_table_wbint,
195                                     NDR_WBINT_LOOKUPSID,
196                                     &state->tmp);
197         if (tevent_req_nomem(subreq, req)) {
198                 return tevent_req_post(req, ev);
199         }
200         tevent_req_set_callback(subreq, rpccli_wbint_LookupSid_done, req);
201         return req;
202 }
203
204 static void rpccli_wbint_LookupSid_done(struct tevent_req *subreq)
205 {
206         struct tevent_req *req = tevent_req_callback_data(
207                 subreq, struct tevent_req);
208         struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
209                 req, struct rpccli_wbint_LookupSid_state);
210         NTSTATUS status;
211         TALLOC_CTX *mem_ctx;
212
213         if (state->out_mem_ctx) {
214                 mem_ctx = state->out_mem_ctx;
215         } else {
216                 mem_ctx = state;
217         }
218
219         status = state->dispatch_recv(subreq, mem_ctx);
220         TALLOC_FREE(subreq);
221         if (!NT_STATUS_IS_OK(status)) {
222                 tevent_req_nterror(req, status);
223                 return;
224         }
225
226         /* Copy out parameters */
227         *state->orig.out.type = *state->tmp.out.type;
228         *state->orig.out.domain = *state->tmp.out.domain;
229         *state->orig.out.name = *state->tmp.out.name;
230
231         /* Copy result */
232         state->orig.out.result = state->tmp.out.result;
233
234         /* Reset temporary structure */
235         ZERO_STRUCT(state->tmp);
236
237         tevent_req_done(req);
238 }
239
240 NTSTATUS rpccli_wbint_LookupSid_recv(struct tevent_req *req,
241                                      TALLOC_CTX *mem_ctx,
242                                      NTSTATUS *result)
243 {
244         struct rpccli_wbint_LookupSid_state *state = tevent_req_data(
245                 req, struct rpccli_wbint_LookupSid_state);
246         NTSTATUS status;
247
248         if (tevent_req_is_nterror(req, &status)) {
249                 tevent_req_received(req);
250                 return status;
251         }
252
253         /* Steal possbile out parameters to the callers context */
254         talloc_steal(mem_ctx, state->out_mem_ctx);
255
256         /* Return result */
257         *result = state->orig.out.result;
258
259         tevent_req_received(req);
260         return NT_STATUS_OK;
261 }
262
263 NTSTATUS rpccli_wbint_LookupSid(struct rpc_pipe_client *cli,
264                                 TALLOC_CTX *mem_ctx,
265                                 struct dom_sid *sid /* [in] [ref] */,
266                                 enum lsa_SidType *type /* [out] [ref] */,
267                                 const char **domain /* [out] [ref,charset(UTF8)] */,
268                                 const char **name /* [out] [ref,charset(UTF8)] */)
269 {
270         struct wbint_LookupSid r;
271         NTSTATUS status;
272
273         /* In parameters */
274         r.in.sid = sid;
275
276         status = cli->dispatch(cli,
277                                 mem_ctx,
278                                 &ndr_table_wbint,
279                                 NDR_WBINT_LOOKUPSID,
280                                 &r);
281
282         if (!NT_STATUS_IS_OK(status)) {
283                 return status;
284         }
285
286         if (NT_STATUS_IS_ERR(status)) {
287                 return status;
288         }
289
290         /* Return variables */
291         *type = *r.out.type;
292         *domain = *r.out.domain;
293         *name = *r.out.name;
294
295         /* Return result */
296         return r.out.result;
297 }
298
299 struct rpccli_wbint_LookupName_state {
300         struct wbint_LookupName orig;
301         struct wbint_LookupName tmp;
302         TALLOC_CTX *out_mem_ctx;
303         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
304 };
305
306 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq);
307
308 struct tevent_req *rpccli_wbint_LookupName_send(TALLOC_CTX *mem_ctx,
309                                                 struct tevent_context *ev,
310                                                 struct rpc_pipe_client *cli,
311                                                 const char *_domain /* [in] [ref,charset(UTF8)] */,
312                                                 const char *_name /* [in] [ref,charset(UTF8)] */,
313                                                 uint32_t _flags /* [in]  */,
314                                                 enum lsa_SidType *_type /* [out] [ref] */,
315                                                 struct dom_sid *_sid /* [out] [ref] */)
316 {
317         struct tevent_req *req;
318         struct rpccli_wbint_LookupName_state *state;
319         struct tevent_req *subreq;
320
321         req = tevent_req_create(mem_ctx, &state,
322                                 struct rpccli_wbint_LookupName_state);
323         if (req == NULL) {
324                 return NULL;
325         }
326         state->out_mem_ctx = NULL;
327         state->dispatch_recv = cli->dispatch_recv;
328
329         /* In parameters */
330         state->orig.in.domain = _domain;
331         state->orig.in.name = _name;
332         state->orig.in.flags = _flags;
333
334         /* Out parameters */
335         state->orig.out.type = _type;
336         state->orig.out.sid = _sid;
337
338         /* Result */
339         ZERO_STRUCT(state->orig.out.result);
340
341         state->out_mem_ctx = talloc_named_const(state, 0,
342                              "rpccli_wbint_LookupName_out_memory");
343         if (tevent_req_nomem(state->out_mem_ctx, req)) {
344                 return tevent_req_post(req, ev);
345         }
346
347         /* make a temporary copy, that we pass to the dispatch function */
348         state->tmp = state->orig;
349
350         subreq = cli->dispatch_send(state, ev, cli,
351                                     &ndr_table_wbint,
352                                     NDR_WBINT_LOOKUPNAME,
353                                     &state->tmp);
354         if (tevent_req_nomem(subreq, req)) {
355                 return tevent_req_post(req, ev);
356         }
357         tevent_req_set_callback(subreq, rpccli_wbint_LookupName_done, req);
358         return req;
359 }
360
361 static void rpccli_wbint_LookupName_done(struct tevent_req *subreq)
362 {
363         struct tevent_req *req = tevent_req_callback_data(
364                 subreq, struct tevent_req);
365         struct rpccli_wbint_LookupName_state *state = tevent_req_data(
366                 req, struct rpccli_wbint_LookupName_state);
367         NTSTATUS status;
368         TALLOC_CTX *mem_ctx;
369
370         if (state->out_mem_ctx) {
371                 mem_ctx = state->out_mem_ctx;
372         } else {
373                 mem_ctx = state;
374         }
375
376         status = state->dispatch_recv(subreq, mem_ctx);
377         TALLOC_FREE(subreq);
378         if (!NT_STATUS_IS_OK(status)) {
379                 tevent_req_nterror(req, status);
380                 return;
381         }
382
383         /* Copy out parameters */
384         *state->orig.out.type = *state->tmp.out.type;
385         *state->orig.out.sid = *state->tmp.out.sid;
386
387         /* Copy result */
388         state->orig.out.result = state->tmp.out.result;
389
390         /* Reset temporary structure */
391         ZERO_STRUCT(state->tmp);
392
393         tevent_req_done(req);
394 }
395
396 NTSTATUS rpccli_wbint_LookupName_recv(struct tevent_req *req,
397                                       TALLOC_CTX *mem_ctx,
398                                       NTSTATUS *result)
399 {
400         struct rpccli_wbint_LookupName_state *state = tevent_req_data(
401                 req, struct rpccli_wbint_LookupName_state);
402         NTSTATUS status;
403
404         if (tevent_req_is_nterror(req, &status)) {
405                 tevent_req_received(req);
406                 return status;
407         }
408
409         /* Steal possbile out parameters to the callers context */
410         talloc_steal(mem_ctx, state->out_mem_ctx);
411
412         /* Return result */
413         *result = state->orig.out.result;
414
415         tevent_req_received(req);
416         return NT_STATUS_OK;
417 }
418
419 NTSTATUS rpccli_wbint_LookupName(struct rpc_pipe_client *cli,
420                                  TALLOC_CTX *mem_ctx,
421                                  const char *domain /* [in] [ref,charset(UTF8)] */,
422                                  const char *name /* [in] [ref,charset(UTF8)] */,
423                                  uint32_t flags /* [in]  */,
424                                  enum lsa_SidType *type /* [out] [ref] */,
425                                  struct dom_sid *sid /* [out] [ref] */)
426 {
427         struct wbint_LookupName r;
428         NTSTATUS status;
429
430         /* In parameters */
431         r.in.domain = domain;
432         r.in.name = name;
433         r.in.flags = flags;
434
435         status = cli->dispatch(cli,
436                                 mem_ctx,
437                                 &ndr_table_wbint,
438                                 NDR_WBINT_LOOKUPNAME,
439                                 &r);
440
441         if (!NT_STATUS_IS_OK(status)) {
442                 return status;
443         }
444
445         if (NT_STATUS_IS_ERR(status)) {
446                 return status;
447         }
448
449         /* Return variables */
450         *type = *r.out.type;
451         *sid = *r.out.sid;
452
453         /* Return result */
454         return r.out.result;
455 }
456
457 struct rpccli_wbint_Sid2Uid_state {
458         struct wbint_Sid2Uid orig;
459         struct wbint_Sid2Uid tmp;
460         TALLOC_CTX *out_mem_ctx;
461         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
462 };
463
464 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq);
465
466 struct tevent_req *rpccli_wbint_Sid2Uid_send(TALLOC_CTX *mem_ctx,
467                                              struct tevent_context *ev,
468                                              struct rpc_pipe_client *cli,
469                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
470                                              struct dom_sid *_sid /* [in] [ref] */,
471                                              uint64_t *_uid /* [out] [ref] */)
472 {
473         struct tevent_req *req;
474         struct rpccli_wbint_Sid2Uid_state *state;
475         struct tevent_req *subreq;
476
477         req = tevent_req_create(mem_ctx, &state,
478                                 struct rpccli_wbint_Sid2Uid_state);
479         if (req == NULL) {
480                 return NULL;
481         }
482         state->out_mem_ctx = NULL;
483         state->dispatch_recv = cli->dispatch_recv;
484
485         /* In parameters */
486         state->orig.in.dom_name = _dom_name;
487         state->orig.in.sid = _sid;
488
489         /* Out parameters */
490         state->orig.out.uid = _uid;
491
492         /* Result */
493         ZERO_STRUCT(state->orig.out.result);
494
495         state->out_mem_ctx = talloc_named_const(state, 0,
496                              "rpccli_wbint_Sid2Uid_out_memory");
497         if (tevent_req_nomem(state->out_mem_ctx, req)) {
498                 return tevent_req_post(req, ev);
499         }
500
501         /* make a temporary copy, that we pass to the dispatch function */
502         state->tmp = state->orig;
503
504         subreq = cli->dispatch_send(state, ev, cli,
505                                     &ndr_table_wbint,
506                                     NDR_WBINT_SID2UID,
507                                     &state->tmp);
508         if (tevent_req_nomem(subreq, req)) {
509                 return tevent_req_post(req, ev);
510         }
511         tevent_req_set_callback(subreq, rpccli_wbint_Sid2Uid_done, req);
512         return req;
513 }
514
515 static void rpccli_wbint_Sid2Uid_done(struct tevent_req *subreq)
516 {
517         struct tevent_req *req = tevent_req_callback_data(
518                 subreq, struct tevent_req);
519         struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data(
520                 req, struct rpccli_wbint_Sid2Uid_state);
521         NTSTATUS status;
522         TALLOC_CTX *mem_ctx;
523
524         if (state->out_mem_ctx) {
525                 mem_ctx = state->out_mem_ctx;
526         } else {
527                 mem_ctx = state;
528         }
529
530         status = state->dispatch_recv(subreq, mem_ctx);
531         TALLOC_FREE(subreq);
532         if (!NT_STATUS_IS_OK(status)) {
533                 tevent_req_nterror(req, status);
534                 return;
535         }
536
537         /* Copy out parameters */
538         *state->orig.out.uid = *state->tmp.out.uid;
539
540         /* Copy result */
541         state->orig.out.result = state->tmp.out.result;
542
543         /* Reset temporary structure */
544         ZERO_STRUCT(state->tmp);
545
546         tevent_req_done(req);
547 }
548
549 NTSTATUS rpccli_wbint_Sid2Uid_recv(struct tevent_req *req,
550                                    TALLOC_CTX *mem_ctx,
551                                    NTSTATUS *result)
552 {
553         struct rpccli_wbint_Sid2Uid_state *state = tevent_req_data(
554                 req, struct rpccli_wbint_Sid2Uid_state);
555         NTSTATUS status;
556
557         if (tevent_req_is_nterror(req, &status)) {
558                 tevent_req_received(req);
559                 return status;
560         }
561
562         /* Steal possbile out parameters to the callers context */
563         talloc_steal(mem_ctx, state->out_mem_ctx);
564
565         /* Return result */
566         *result = state->orig.out.result;
567
568         tevent_req_received(req);
569         return NT_STATUS_OK;
570 }
571
572 NTSTATUS rpccli_wbint_Sid2Uid(struct rpc_pipe_client *cli,
573                               TALLOC_CTX *mem_ctx,
574                               const char *dom_name /* [in] [unique,charset(UTF8)] */,
575                               struct dom_sid *sid /* [in] [ref] */,
576                               uint64_t *uid /* [out] [ref] */)
577 {
578         struct wbint_Sid2Uid r;
579         NTSTATUS status;
580
581         /* In parameters */
582         r.in.dom_name = dom_name;
583         r.in.sid = sid;
584
585         status = cli->dispatch(cli,
586                                 mem_ctx,
587                                 &ndr_table_wbint,
588                                 NDR_WBINT_SID2UID,
589                                 &r);
590
591         if (!NT_STATUS_IS_OK(status)) {
592                 return status;
593         }
594
595         if (NT_STATUS_IS_ERR(status)) {
596                 return status;
597         }
598
599         /* Return variables */
600         *uid = *r.out.uid;
601
602         /* Return result */
603         return r.out.result;
604 }
605
606 struct rpccli_wbint_Sid2Gid_state {
607         struct wbint_Sid2Gid orig;
608         struct wbint_Sid2Gid tmp;
609         TALLOC_CTX *out_mem_ctx;
610         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
611 };
612
613 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq);
614
615 struct tevent_req *rpccli_wbint_Sid2Gid_send(TALLOC_CTX *mem_ctx,
616                                              struct tevent_context *ev,
617                                              struct rpc_pipe_client *cli,
618                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
619                                              struct dom_sid *_sid /* [in] [ref] */,
620                                              uint64_t *_gid /* [out] [ref] */)
621 {
622         struct tevent_req *req;
623         struct rpccli_wbint_Sid2Gid_state *state;
624         struct tevent_req *subreq;
625
626         req = tevent_req_create(mem_ctx, &state,
627                                 struct rpccli_wbint_Sid2Gid_state);
628         if (req == NULL) {
629                 return NULL;
630         }
631         state->out_mem_ctx = NULL;
632         state->dispatch_recv = cli->dispatch_recv;
633
634         /* In parameters */
635         state->orig.in.dom_name = _dom_name;
636         state->orig.in.sid = _sid;
637
638         /* Out parameters */
639         state->orig.out.gid = _gid;
640
641         /* Result */
642         ZERO_STRUCT(state->orig.out.result);
643
644         state->out_mem_ctx = talloc_named_const(state, 0,
645                              "rpccli_wbint_Sid2Gid_out_memory");
646         if (tevent_req_nomem(state->out_mem_ctx, req)) {
647                 return tevent_req_post(req, ev);
648         }
649
650         /* make a temporary copy, that we pass to the dispatch function */
651         state->tmp = state->orig;
652
653         subreq = cli->dispatch_send(state, ev, cli,
654                                     &ndr_table_wbint,
655                                     NDR_WBINT_SID2GID,
656                                     &state->tmp);
657         if (tevent_req_nomem(subreq, req)) {
658                 return tevent_req_post(req, ev);
659         }
660         tevent_req_set_callback(subreq, rpccli_wbint_Sid2Gid_done, req);
661         return req;
662 }
663
664 static void rpccli_wbint_Sid2Gid_done(struct tevent_req *subreq)
665 {
666         struct tevent_req *req = tevent_req_callback_data(
667                 subreq, struct tevent_req);
668         struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data(
669                 req, struct rpccli_wbint_Sid2Gid_state);
670         NTSTATUS status;
671         TALLOC_CTX *mem_ctx;
672
673         if (state->out_mem_ctx) {
674                 mem_ctx = state->out_mem_ctx;
675         } else {
676                 mem_ctx = state;
677         }
678
679         status = state->dispatch_recv(subreq, mem_ctx);
680         TALLOC_FREE(subreq);
681         if (!NT_STATUS_IS_OK(status)) {
682                 tevent_req_nterror(req, status);
683                 return;
684         }
685
686         /* Copy out parameters */
687         *state->orig.out.gid = *state->tmp.out.gid;
688
689         /* Copy result */
690         state->orig.out.result = state->tmp.out.result;
691
692         /* Reset temporary structure */
693         ZERO_STRUCT(state->tmp);
694
695         tevent_req_done(req);
696 }
697
698 NTSTATUS rpccli_wbint_Sid2Gid_recv(struct tevent_req *req,
699                                    TALLOC_CTX *mem_ctx,
700                                    NTSTATUS *result)
701 {
702         struct rpccli_wbint_Sid2Gid_state *state = tevent_req_data(
703                 req, struct rpccli_wbint_Sid2Gid_state);
704         NTSTATUS status;
705
706         if (tevent_req_is_nterror(req, &status)) {
707                 tevent_req_received(req);
708                 return status;
709         }
710
711         /* Steal possbile out parameters to the callers context */
712         talloc_steal(mem_ctx, state->out_mem_ctx);
713
714         /* Return result */
715         *result = state->orig.out.result;
716
717         tevent_req_received(req);
718         return NT_STATUS_OK;
719 }
720
721 NTSTATUS rpccli_wbint_Sid2Gid(struct rpc_pipe_client *cli,
722                               TALLOC_CTX *mem_ctx,
723                               const char *dom_name /* [in] [unique,charset(UTF8)] */,
724                               struct dom_sid *sid /* [in] [ref] */,
725                               uint64_t *gid /* [out] [ref] */)
726 {
727         struct wbint_Sid2Gid r;
728         NTSTATUS status;
729
730         /* In parameters */
731         r.in.dom_name = dom_name;
732         r.in.sid = sid;
733
734         status = cli->dispatch(cli,
735                                 mem_ctx,
736                                 &ndr_table_wbint,
737                                 NDR_WBINT_SID2GID,
738                                 &r);
739
740         if (!NT_STATUS_IS_OK(status)) {
741                 return status;
742         }
743
744         if (NT_STATUS_IS_ERR(status)) {
745                 return status;
746         }
747
748         /* Return variables */
749         *gid = *r.out.gid;
750
751         /* Return result */
752         return r.out.result;
753 }
754
755 struct rpccli_wbint_Uid2Sid_state {
756         struct wbint_Uid2Sid orig;
757         struct wbint_Uid2Sid tmp;
758         TALLOC_CTX *out_mem_ctx;
759         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
760 };
761
762 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq);
763
764 struct tevent_req *rpccli_wbint_Uid2Sid_send(TALLOC_CTX *mem_ctx,
765                                              struct tevent_context *ev,
766                                              struct rpc_pipe_client *cli,
767                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
768                                              uint64_t _uid /* [in]  */,
769                                              struct dom_sid *_sid /* [out] [ref] */)
770 {
771         struct tevent_req *req;
772         struct rpccli_wbint_Uid2Sid_state *state;
773         struct tevent_req *subreq;
774
775         req = tevent_req_create(mem_ctx, &state,
776                                 struct rpccli_wbint_Uid2Sid_state);
777         if (req == NULL) {
778                 return NULL;
779         }
780         state->out_mem_ctx = NULL;
781         state->dispatch_recv = cli->dispatch_recv;
782
783         /* In parameters */
784         state->orig.in.dom_name = _dom_name;
785         state->orig.in.uid = _uid;
786
787         /* Out parameters */
788         state->orig.out.sid = _sid;
789
790         /* Result */
791         ZERO_STRUCT(state->orig.out.result);
792
793         state->out_mem_ctx = talloc_named_const(state, 0,
794                              "rpccli_wbint_Uid2Sid_out_memory");
795         if (tevent_req_nomem(state->out_mem_ctx, req)) {
796                 return tevent_req_post(req, ev);
797         }
798
799         /* make a temporary copy, that we pass to the dispatch function */
800         state->tmp = state->orig;
801
802         subreq = cli->dispatch_send(state, ev, cli,
803                                     &ndr_table_wbint,
804                                     NDR_WBINT_UID2SID,
805                                     &state->tmp);
806         if (tevent_req_nomem(subreq, req)) {
807                 return tevent_req_post(req, ev);
808         }
809         tevent_req_set_callback(subreq, rpccli_wbint_Uid2Sid_done, req);
810         return req;
811 }
812
813 static void rpccli_wbint_Uid2Sid_done(struct tevent_req *subreq)
814 {
815         struct tevent_req *req = tevent_req_callback_data(
816                 subreq, struct tevent_req);
817         struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data(
818                 req, struct rpccli_wbint_Uid2Sid_state);
819         NTSTATUS status;
820         TALLOC_CTX *mem_ctx;
821
822         if (state->out_mem_ctx) {
823                 mem_ctx = state->out_mem_ctx;
824         } else {
825                 mem_ctx = state;
826         }
827
828         status = state->dispatch_recv(subreq, mem_ctx);
829         TALLOC_FREE(subreq);
830         if (!NT_STATUS_IS_OK(status)) {
831                 tevent_req_nterror(req, status);
832                 return;
833         }
834
835         /* Copy out parameters */
836         *state->orig.out.sid = *state->tmp.out.sid;
837
838         /* Copy result */
839         state->orig.out.result = state->tmp.out.result;
840
841         /* Reset temporary structure */
842         ZERO_STRUCT(state->tmp);
843
844         tevent_req_done(req);
845 }
846
847 NTSTATUS rpccli_wbint_Uid2Sid_recv(struct tevent_req *req,
848                                    TALLOC_CTX *mem_ctx,
849                                    NTSTATUS *result)
850 {
851         struct rpccli_wbint_Uid2Sid_state *state = tevent_req_data(
852                 req, struct rpccli_wbint_Uid2Sid_state);
853         NTSTATUS status;
854
855         if (tevent_req_is_nterror(req, &status)) {
856                 tevent_req_received(req);
857                 return status;
858         }
859
860         /* Steal possbile out parameters to the callers context */
861         talloc_steal(mem_ctx, state->out_mem_ctx);
862
863         /* Return result */
864         *result = state->orig.out.result;
865
866         tevent_req_received(req);
867         return NT_STATUS_OK;
868 }
869
870 NTSTATUS rpccli_wbint_Uid2Sid(struct rpc_pipe_client *cli,
871                               TALLOC_CTX *mem_ctx,
872                               const char *dom_name /* [in] [unique,charset(UTF8)] */,
873                               uint64_t uid /* [in]  */,
874                               struct dom_sid *sid /* [out] [ref] */)
875 {
876         struct wbint_Uid2Sid r;
877         NTSTATUS status;
878
879         /* In parameters */
880         r.in.dom_name = dom_name;
881         r.in.uid = uid;
882
883         status = cli->dispatch(cli,
884                                 mem_ctx,
885                                 &ndr_table_wbint,
886                                 NDR_WBINT_UID2SID,
887                                 &r);
888
889         if (!NT_STATUS_IS_OK(status)) {
890                 return status;
891         }
892
893         if (NT_STATUS_IS_ERR(status)) {
894                 return status;
895         }
896
897         /* Return variables */
898         *sid = *r.out.sid;
899
900         /* Return result */
901         return r.out.result;
902 }
903
904 struct rpccli_wbint_Gid2Sid_state {
905         struct wbint_Gid2Sid orig;
906         struct wbint_Gid2Sid tmp;
907         TALLOC_CTX *out_mem_ctx;
908         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
909 };
910
911 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq);
912
913 struct tevent_req *rpccli_wbint_Gid2Sid_send(TALLOC_CTX *mem_ctx,
914                                              struct tevent_context *ev,
915                                              struct rpc_pipe_client *cli,
916                                              const char *_dom_name /* [in] [unique,charset(UTF8)] */,
917                                              uint64_t _gid /* [in]  */,
918                                              struct dom_sid *_sid /* [out] [ref] */)
919 {
920         struct tevent_req *req;
921         struct rpccli_wbint_Gid2Sid_state *state;
922         struct tevent_req *subreq;
923
924         req = tevent_req_create(mem_ctx, &state,
925                                 struct rpccli_wbint_Gid2Sid_state);
926         if (req == NULL) {
927                 return NULL;
928         }
929         state->out_mem_ctx = NULL;
930         state->dispatch_recv = cli->dispatch_recv;
931
932         /* In parameters */
933         state->orig.in.dom_name = _dom_name;
934         state->orig.in.gid = _gid;
935
936         /* Out parameters */
937         state->orig.out.sid = _sid;
938
939         /* Result */
940         ZERO_STRUCT(state->orig.out.result);
941
942         state->out_mem_ctx = talloc_named_const(state, 0,
943                              "rpccli_wbint_Gid2Sid_out_memory");
944         if (tevent_req_nomem(state->out_mem_ctx, req)) {
945                 return tevent_req_post(req, ev);
946         }
947
948         /* make a temporary copy, that we pass to the dispatch function */
949         state->tmp = state->orig;
950
951         subreq = cli->dispatch_send(state, ev, cli,
952                                     &ndr_table_wbint,
953                                     NDR_WBINT_GID2SID,
954                                     &state->tmp);
955         if (tevent_req_nomem(subreq, req)) {
956                 return tevent_req_post(req, ev);
957         }
958         tevent_req_set_callback(subreq, rpccli_wbint_Gid2Sid_done, req);
959         return req;
960 }
961
962 static void rpccli_wbint_Gid2Sid_done(struct tevent_req *subreq)
963 {
964         struct tevent_req *req = tevent_req_callback_data(
965                 subreq, struct tevent_req);
966         struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data(
967                 req, struct rpccli_wbint_Gid2Sid_state);
968         NTSTATUS status;
969         TALLOC_CTX *mem_ctx;
970
971         if (state->out_mem_ctx) {
972                 mem_ctx = state->out_mem_ctx;
973         } else {
974                 mem_ctx = state;
975         }
976
977         status = state->dispatch_recv(subreq, mem_ctx);
978         TALLOC_FREE(subreq);
979         if (!NT_STATUS_IS_OK(status)) {
980                 tevent_req_nterror(req, status);
981                 return;
982         }
983
984         /* Copy out parameters */
985         *state->orig.out.sid = *state->tmp.out.sid;
986
987         /* Copy result */
988         state->orig.out.result = state->tmp.out.result;
989
990         /* Reset temporary structure */
991         ZERO_STRUCT(state->tmp);
992
993         tevent_req_done(req);
994 }
995
996 NTSTATUS rpccli_wbint_Gid2Sid_recv(struct tevent_req *req,
997                                    TALLOC_CTX *mem_ctx,
998                                    NTSTATUS *result)
999 {
1000         struct rpccli_wbint_Gid2Sid_state *state = tevent_req_data(
1001                 req, struct rpccli_wbint_Gid2Sid_state);
1002         NTSTATUS status;
1003
1004         if (tevent_req_is_nterror(req, &status)) {
1005                 tevent_req_received(req);
1006                 return status;
1007         }
1008
1009         /* Steal possbile out parameters to the callers context */
1010         talloc_steal(mem_ctx, state->out_mem_ctx);
1011
1012         /* Return result */
1013         *result = state->orig.out.result;
1014
1015         tevent_req_received(req);
1016         return NT_STATUS_OK;
1017 }
1018
1019 NTSTATUS rpccli_wbint_Gid2Sid(struct rpc_pipe_client *cli,
1020                               TALLOC_CTX *mem_ctx,
1021                               const char *dom_name /* [in] [unique,charset(UTF8)] */,
1022                               uint64_t gid /* [in]  */,
1023                               struct dom_sid *sid /* [out] [ref] */)
1024 {
1025         struct wbint_Gid2Sid r;
1026         NTSTATUS status;
1027
1028         /* In parameters */
1029         r.in.dom_name = dom_name;
1030         r.in.gid = gid;
1031
1032         status = cli->dispatch(cli,
1033                                 mem_ctx,
1034                                 &ndr_table_wbint,
1035                                 NDR_WBINT_GID2SID,
1036                                 &r);
1037
1038         if (!NT_STATUS_IS_OK(status)) {
1039                 return status;
1040         }
1041
1042         if (NT_STATUS_IS_ERR(status)) {
1043                 return status;
1044         }
1045
1046         /* Return variables */
1047         *sid = *r.out.sid;
1048
1049         /* Return result */
1050         return r.out.result;
1051 }
1052
1053 struct rpccli_wbint_AllocateUid_state {
1054         struct wbint_AllocateUid orig;
1055         struct wbint_AllocateUid tmp;
1056         TALLOC_CTX *out_mem_ctx;
1057         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1058 };
1059
1060 static void rpccli_wbint_AllocateUid_done(struct tevent_req *subreq);
1061
1062 struct tevent_req *rpccli_wbint_AllocateUid_send(TALLOC_CTX *mem_ctx,
1063                                                  struct tevent_context *ev,
1064                                                  struct rpc_pipe_client *cli,
1065                                                  uint64_t *_uid /* [out] [ref] */)
1066 {
1067         struct tevent_req *req;
1068         struct rpccli_wbint_AllocateUid_state *state;
1069         struct tevent_req *subreq;
1070
1071         req = tevent_req_create(mem_ctx, &state,
1072                                 struct rpccli_wbint_AllocateUid_state);
1073         if (req == NULL) {
1074                 return NULL;
1075         }
1076         state->out_mem_ctx = NULL;
1077         state->dispatch_recv = cli->dispatch_recv;
1078
1079         /* In parameters */
1080
1081         /* Out parameters */
1082         state->orig.out.uid = _uid;
1083
1084         /* Result */
1085         ZERO_STRUCT(state->orig.out.result);
1086
1087         state->out_mem_ctx = talloc_named_const(state, 0,
1088                              "rpccli_wbint_AllocateUid_out_memory");
1089         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1090                 return tevent_req_post(req, ev);
1091         }
1092
1093         /* make a temporary copy, that we pass to the dispatch function */
1094         state->tmp = state->orig;
1095
1096         subreq = cli->dispatch_send(state, ev, cli,
1097                                     &ndr_table_wbint,
1098                                     NDR_WBINT_ALLOCATEUID,
1099                                     &state->tmp);
1100         if (tevent_req_nomem(subreq, req)) {
1101                 return tevent_req_post(req, ev);
1102         }
1103         tevent_req_set_callback(subreq, rpccli_wbint_AllocateUid_done, req);
1104         return req;
1105 }
1106
1107 static void rpccli_wbint_AllocateUid_done(struct tevent_req *subreq)
1108 {
1109         struct tevent_req *req = tevent_req_callback_data(
1110                 subreq, struct tevent_req);
1111         struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
1112                 req, struct rpccli_wbint_AllocateUid_state);
1113         NTSTATUS status;
1114         TALLOC_CTX *mem_ctx;
1115
1116         if (state->out_mem_ctx) {
1117                 mem_ctx = state->out_mem_ctx;
1118         } else {
1119                 mem_ctx = state;
1120         }
1121
1122         status = state->dispatch_recv(subreq, mem_ctx);
1123         TALLOC_FREE(subreq);
1124         if (!NT_STATUS_IS_OK(status)) {
1125                 tevent_req_nterror(req, status);
1126                 return;
1127         }
1128
1129         /* Copy out parameters */
1130         *state->orig.out.uid = *state->tmp.out.uid;
1131
1132         /* Copy result */
1133         state->orig.out.result = state->tmp.out.result;
1134
1135         /* Reset temporary structure */
1136         ZERO_STRUCT(state->tmp);
1137
1138         tevent_req_done(req);
1139 }
1140
1141 NTSTATUS rpccli_wbint_AllocateUid_recv(struct tevent_req *req,
1142                                        TALLOC_CTX *mem_ctx,
1143                                        NTSTATUS *result)
1144 {
1145         struct rpccli_wbint_AllocateUid_state *state = tevent_req_data(
1146                 req, struct rpccli_wbint_AllocateUid_state);
1147         NTSTATUS status;
1148
1149         if (tevent_req_is_nterror(req, &status)) {
1150                 tevent_req_received(req);
1151                 return status;
1152         }
1153
1154         /* Steal possbile out parameters to the callers context */
1155         talloc_steal(mem_ctx, state->out_mem_ctx);
1156
1157         /* Return result */
1158         *result = state->orig.out.result;
1159
1160         tevent_req_received(req);
1161         return NT_STATUS_OK;
1162 }
1163
1164 NTSTATUS rpccli_wbint_AllocateUid(struct rpc_pipe_client *cli,
1165                                   TALLOC_CTX *mem_ctx,
1166                                   uint64_t *uid /* [out] [ref] */)
1167 {
1168         struct wbint_AllocateUid r;
1169         NTSTATUS status;
1170
1171         /* In parameters */
1172
1173         status = cli->dispatch(cli,
1174                                 mem_ctx,
1175                                 &ndr_table_wbint,
1176                                 NDR_WBINT_ALLOCATEUID,
1177                                 &r);
1178
1179         if (!NT_STATUS_IS_OK(status)) {
1180                 return status;
1181         }
1182
1183         if (NT_STATUS_IS_ERR(status)) {
1184                 return status;
1185         }
1186
1187         /* Return variables */
1188         *uid = *r.out.uid;
1189
1190         /* Return result */
1191         return r.out.result;
1192 }
1193
1194 struct rpccli_wbint_AllocateGid_state {
1195         struct wbint_AllocateGid orig;
1196         struct wbint_AllocateGid tmp;
1197         TALLOC_CTX *out_mem_ctx;
1198         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1199 };
1200
1201 static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq);
1202
1203 struct tevent_req *rpccli_wbint_AllocateGid_send(TALLOC_CTX *mem_ctx,
1204                                                  struct tevent_context *ev,
1205                                                  struct rpc_pipe_client *cli,
1206                                                  uint64_t *_gid /* [out] [ref] */)
1207 {
1208         struct tevent_req *req;
1209         struct rpccli_wbint_AllocateGid_state *state;
1210         struct tevent_req *subreq;
1211
1212         req = tevent_req_create(mem_ctx, &state,
1213                                 struct rpccli_wbint_AllocateGid_state);
1214         if (req == NULL) {
1215                 return NULL;
1216         }
1217         state->out_mem_ctx = NULL;
1218         state->dispatch_recv = cli->dispatch_recv;
1219
1220         /* In parameters */
1221
1222         /* Out parameters */
1223         state->orig.out.gid = _gid;
1224
1225         /* Result */
1226         ZERO_STRUCT(state->orig.out.result);
1227
1228         state->out_mem_ctx = talloc_named_const(state, 0,
1229                              "rpccli_wbint_AllocateGid_out_memory");
1230         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1231                 return tevent_req_post(req, ev);
1232         }
1233
1234         /* make a temporary copy, that we pass to the dispatch function */
1235         state->tmp = state->orig;
1236
1237         subreq = cli->dispatch_send(state, ev, cli,
1238                                     &ndr_table_wbint,
1239                                     NDR_WBINT_ALLOCATEGID,
1240                                     &state->tmp);
1241         if (tevent_req_nomem(subreq, req)) {
1242                 return tevent_req_post(req, ev);
1243         }
1244         tevent_req_set_callback(subreq, rpccli_wbint_AllocateGid_done, req);
1245         return req;
1246 }
1247
1248 static void rpccli_wbint_AllocateGid_done(struct tevent_req *subreq)
1249 {
1250         struct tevent_req *req = tevent_req_callback_data(
1251                 subreq, struct tevent_req);
1252         struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
1253                 req, struct rpccli_wbint_AllocateGid_state);
1254         NTSTATUS status;
1255         TALLOC_CTX *mem_ctx;
1256
1257         if (state->out_mem_ctx) {
1258                 mem_ctx = state->out_mem_ctx;
1259         } else {
1260                 mem_ctx = state;
1261         }
1262
1263         status = state->dispatch_recv(subreq, mem_ctx);
1264         TALLOC_FREE(subreq);
1265         if (!NT_STATUS_IS_OK(status)) {
1266                 tevent_req_nterror(req, status);
1267                 return;
1268         }
1269
1270         /* Copy out parameters */
1271         *state->orig.out.gid = *state->tmp.out.gid;
1272
1273         /* Copy result */
1274         state->orig.out.result = state->tmp.out.result;
1275
1276         /* Reset temporary structure */
1277         ZERO_STRUCT(state->tmp);
1278
1279         tevent_req_done(req);
1280 }
1281
1282 NTSTATUS rpccli_wbint_AllocateGid_recv(struct tevent_req *req,
1283                                        TALLOC_CTX *mem_ctx,
1284                                        NTSTATUS *result)
1285 {
1286         struct rpccli_wbint_AllocateGid_state *state = tevent_req_data(
1287                 req, struct rpccli_wbint_AllocateGid_state);
1288         NTSTATUS status;
1289
1290         if (tevent_req_is_nterror(req, &status)) {
1291                 tevent_req_received(req);
1292                 return status;
1293         }
1294
1295         /* Steal possbile out parameters to the callers context */
1296         talloc_steal(mem_ctx, state->out_mem_ctx);
1297
1298         /* Return result */
1299         *result = state->orig.out.result;
1300
1301         tevent_req_received(req);
1302         return NT_STATUS_OK;
1303 }
1304
1305 NTSTATUS rpccli_wbint_AllocateGid(struct rpc_pipe_client *cli,
1306                                   TALLOC_CTX *mem_ctx,
1307                                   uint64_t *gid /* [out] [ref] */)
1308 {
1309         struct wbint_AllocateGid r;
1310         NTSTATUS status;
1311
1312         /* In parameters */
1313
1314         status = cli->dispatch(cli,
1315                                 mem_ctx,
1316                                 &ndr_table_wbint,
1317                                 NDR_WBINT_ALLOCATEGID,
1318                                 &r);
1319
1320         if (!NT_STATUS_IS_OK(status)) {
1321                 return status;
1322         }
1323
1324         if (NT_STATUS_IS_ERR(status)) {
1325                 return status;
1326         }
1327
1328         /* Return variables */
1329         *gid = *r.out.gid;
1330
1331         /* Return result */
1332         return r.out.result;
1333 }
1334
1335 struct rpccli_wbint_QueryUser_state {
1336         struct wbint_QueryUser orig;
1337         struct wbint_QueryUser tmp;
1338         TALLOC_CTX *out_mem_ctx;
1339         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1340 };
1341
1342 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq);
1343
1344 struct tevent_req *rpccli_wbint_QueryUser_send(TALLOC_CTX *mem_ctx,
1345                                                struct tevent_context *ev,
1346                                                struct rpc_pipe_client *cli,
1347                                                struct dom_sid *_sid /* [in] [ref] */,
1348                                                struct wbint_userinfo *_info /* [out] [ref] */)
1349 {
1350         struct tevent_req *req;
1351         struct rpccli_wbint_QueryUser_state *state;
1352         struct tevent_req *subreq;
1353
1354         req = tevent_req_create(mem_ctx, &state,
1355                                 struct rpccli_wbint_QueryUser_state);
1356         if (req == NULL) {
1357                 return NULL;
1358         }
1359         state->out_mem_ctx = NULL;
1360         state->dispatch_recv = cli->dispatch_recv;
1361
1362         /* In parameters */
1363         state->orig.in.sid = _sid;
1364
1365         /* Out parameters */
1366         state->orig.out.info = _info;
1367
1368         /* Result */
1369         ZERO_STRUCT(state->orig.out.result);
1370
1371         state->out_mem_ctx = talloc_named_const(state, 0,
1372                              "rpccli_wbint_QueryUser_out_memory");
1373         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1374                 return tevent_req_post(req, ev);
1375         }
1376
1377         /* make a temporary copy, that we pass to the dispatch function */
1378         state->tmp = state->orig;
1379
1380         subreq = cli->dispatch_send(state, ev, cli,
1381                                     &ndr_table_wbint,
1382                                     NDR_WBINT_QUERYUSER,
1383                                     &state->tmp);
1384         if (tevent_req_nomem(subreq, req)) {
1385                 return tevent_req_post(req, ev);
1386         }
1387         tevent_req_set_callback(subreq, rpccli_wbint_QueryUser_done, req);
1388         return req;
1389 }
1390
1391 static void rpccli_wbint_QueryUser_done(struct tevent_req *subreq)
1392 {
1393         struct tevent_req *req = tevent_req_callback_data(
1394                 subreq, struct tevent_req);
1395         struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1396                 req, struct rpccli_wbint_QueryUser_state);
1397         NTSTATUS status;
1398         TALLOC_CTX *mem_ctx;
1399
1400         if (state->out_mem_ctx) {
1401                 mem_ctx = state->out_mem_ctx;
1402         } else {
1403                 mem_ctx = state;
1404         }
1405
1406         status = state->dispatch_recv(subreq, mem_ctx);
1407         TALLOC_FREE(subreq);
1408         if (!NT_STATUS_IS_OK(status)) {
1409                 tevent_req_nterror(req, status);
1410                 return;
1411         }
1412
1413         /* Copy out parameters */
1414         *state->orig.out.info = *state->tmp.out.info;
1415
1416         /* Copy result */
1417         state->orig.out.result = state->tmp.out.result;
1418
1419         /* Reset temporary structure */
1420         ZERO_STRUCT(state->tmp);
1421
1422         tevent_req_done(req);
1423 }
1424
1425 NTSTATUS rpccli_wbint_QueryUser_recv(struct tevent_req *req,
1426                                      TALLOC_CTX *mem_ctx,
1427                                      NTSTATUS *result)
1428 {
1429         struct rpccli_wbint_QueryUser_state *state = tevent_req_data(
1430                 req, struct rpccli_wbint_QueryUser_state);
1431         NTSTATUS status;
1432
1433         if (tevent_req_is_nterror(req, &status)) {
1434                 tevent_req_received(req);
1435                 return status;
1436         }
1437
1438         /* Steal possbile out parameters to the callers context */
1439         talloc_steal(mem_ctx, state->out_mem_ctx);
1440
1441         /* Return result */
1442         *result = state->orig.out.result;
1443
1444         tevent_req_received(req);
1445         return NT_STATUS_OK;
1446 }
1447
1448 NTSTATUS rpccli_wbint_QueryUser(struct rpc_pipe_client *cli,
1449                                 TALLOC_CTX *mem_ctx,
1450                                 struct dom_sid *sid /* [in] [ref] */,
1451                                 struct wbint_userinfo *info /* [out] [ref] */)
1452 {
1453         struct wbint_QueryUser r;
1454         NTSTATUS status;
1455
1456         /* In parameters */
1457         r.in.sid = sid;
1458
1459         status = cli->dispatch(cli,
1460                                 mem_ctx,
1461                                 &ndr_table_wbint,
1462                                 NDR_WBINT_QUERYUSER,
1463                                 &r);
1464
1465         if (!NT_STATUS_IS_OK(status)) {
1466                 return status;
1467         }
1468
1469         if (NT_STATUS_IS_ERR(status)) {
1470                 return status;
1471         }
1472
1473         /* Return variables */
1474         *info = *r.out.info;
1475
1476         /* Return result */
1477         return r.out.result;
1478 }
1479
1480 struct rpccli_wbint_LookupUserAliases_state {
1481         struct wbint_LookupUserAliases orig;
1482         struct wbint_LookupUserAliases tmp;
1483         TALLOC_CTX *out_mem_ctx;
1484         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1485 };
1486
1487 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq);
1488
1489 struct tevent_req *rpccli_wbint_LookupUserAliases_send(TALLOC_CTX *mem_ctx,
1490                                                        struct tevent_context *ev,
1491                                                        struct rpc_pipe_client *cli,
1492                                                        struct wbint_SidArray *_sids /* [in] [ref] */,
1493                                                        struct wbint_RidArray *_rids /* [out] [ref] */)
1494 {
1495         struct tevent_req *req;
1496         struct rpccli_wbint_LookupUserAliases_state *state;
1497         struct tevent_req *subreq;
1498
1499         req = tevent_req_create(mem_ctx, &state,
1500                                 struct rpccli_wbint_LookupUserAliases_state);
1501         if (req == NULL) {
1502                 return NULL;
1503         }
1504         state->out_mem_ctx = NULL;
1505         state->dispatch_recv = cli->dispatch_recv;
1506
1507         /* In parameters */
1508         state->orig.in.sids = _sids;
1509
1510         /* Out parameters */
1511         state->orig.out.rids = _rids;
1512
1513         /* Result */
1514         ZERO_STRUCT(state->orig.out.result);
1515
1516         state->out_mem_ctx = talloc_named_const(state, 0,
1517                              "rpccli_wbint_LookupUserAliases_out_memory");
1518         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1519                 return tevent_req_post(req, ev);
1520         }
1521
1522         /* make a temporary copy, that we pass to the dispatch function */
1523         state->tmp = state->orig;
1524
1525         subreq = cli->dispatch_send(state, ev, cli,
1526                                     &ndr_table_wbint,
1527                                     NDR_WBINT_LOOKUPUSERALIASES,
1528                                     &state->tmp);
1529         if (tevent_req_nomem(subreq, req)) {
1530                 return tevent_req_post(req, ev);
1531         }
1532         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserAliases_done, req);
1533         return req;
1534 }
1535
1536 static void rpccli_wbint_LookupUserAliases_done(struct tevent_req *subreq)
1537 {
1538         struct tevent_req *req = tevent_req_callback_data(
1539                 subreq, struct tevent_req);
1540         struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1541                 req, struct rpccli_wbint_LookupUserAliases_state);
1542         NTSTATUS status;
1543         TALLOC_CTX *mem_ctx;
1544
1545         if (state->out_mem_ctx) {
1546                 mem_ctx = state->out_mem_ctx;
1547         } else {
1548                 mem_ctx = state;
1549         }
1550
1551         status = state->dispatch_recv(subreq, mem_ctx);
1552         TALLOC_FREE(subreq);
1553         if (!NT_STATUS_IS_OK(status)) {
1554                 tevent_req_nterror(req, status);
1555                 return;
1556         }
1557
1558         /* Copy out parameters */
1559         *state->orig.out.rids = *state->tmp.out.rids;
1560
1561         /* Copy result */
1562         state->orig.out.result = state->tmp.out.result;
1563
1564         /* Reset temporary structure */
1565         ZERO_STRUCT(state->tmp);
1566
1567         tevent_req_done(req);
1568 }
1569
1570 NTSTATUS rpccli_wbint_LookupUserAliases_recv(struct tevent_req *req,
1571                                              TALLOC_CTX *mem_ctx,
1572                                              NTSTATUS *result)
1573 {
1574         struct rpccli_wbint_LookupUserAliases_state *state = tevent_req_data(
1575                 req, struct rpccli_wbint_LookupUserAliases_state);
1576         NTSTATUS status;
1577
1578         if (tevent_req_is_nterror(req, &status)) {
1579                 tevent_req_received(req);
1580                 return status;
1581         }
1582
1583         /* Steal possbile out parameters to the callers context */
1584         talloc_steal(mem_ctx, state->out_mem_ctx);
1585
1586         /* Return result */
1587         *result = state->orig.out.result;
1588
1589         tevent_req_received(req);
1590         return NT_STATUS_OK;
1591 }
1592
1593 NTSTATUS rpccli_wbint_LookupUserAliases(struct rpc_pipe_client *cli,
1594                                         TALLOC_CTX *mem_ctx,
1595                                         struct wbint_SidArray *sids /* [in] [ref] */,
1596                                         struct wbint_RidArray *rids /* [out] [ref] */)
1597 {
1598         struct wbint_LookupUserAliases r;
1599         NTSTATUS status;
1600
1601         /* In parameters */
1602         r.in.sids = sids;
1603
1604         status = cli->dispatch(cli,
1605                                 mem_ctx,
1606                                 &ndr_table_wbint,
1607                                 NDR_WBINT_LOOKUPUSERALIASES,
1608                                 &r);
1609
1610         if (!NT_STATUS_IS_OK(status)) {
1611                 return status;
1612         }
1613
1614         if (NT_STATUS_IS_ERR(status)) {
1615                 return status;
1616         }
1617
1618         /* Return variables */
1619         *rids = *r.out.rids;
1620
1621         /* Return result */
1622         return r.out.result;
1623 }
1624
1625 struct rpccli_wbint_LookupUserGroups_state {
1626         struct wbint_LookupUserGroups orig;
1627         struct wbint_LookupUserGroups tmp;
1628         TALLOC_CTX *out_mem_ctx;
1629         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1630 };
1631
1632 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq);
1633
1634 struct tevent_req *rpccli_wbint_LookupUserGroups_send(TALLOC_CTX *mem_ctx,
1635                                                       struct tevent_context *ev,
1636                                                       struct rpc_pipe_client *cli,
1637                                                       struct dom_sid *_sid /* [in] [ref] */,
1638                                                       struct wbint_SidArray *_sids /* [out] [ref] */)
1639 {
1640         struct tevent_req *req;
1641         struct rpccli_wbint_LookupUserGroups_state *state;
1642         struct tevent_req *subreq;
1643
1644         req = tevent_req_create(mem_ctx, &state,
1645                                 struct rpccli_wbint_LookupUserGroups_state);
1646         if (req == NULL) {
1647                 return NULL;
1648         }
1649         state->out_mem_ctx = NULL;
1650         state->dispatch_recv = cli->dispatch_recv;
1651
1652         /* In parameters */
1653         state->orig.in.sid = _sid;
1654
1655         /* Out parameters */
1656         state->orig.out.sids = _sids;
1657
1658         /* Result */
1659         ZERO_STRUCT(state->orig.out.result);
1660
1661         state->out_mem_ctx = talloc_named_const(state, 0,
1662                              "rpccli_wbint_LookupUserGroups_out_memory");
1663         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1664                 return tevent_req_post(req, ev);
1665         }
1666
1667         /* make a temporary copy, that we pass to the dispatch function */
1668         state->tmp = state->orig;
1669
1670         subreq = cli->dispatch_send(state, ev, cli,
1671                                     &ndr_table_wbint,
1672                                     NDR_WBINT_LOOKUPUSERGROUPS,
1673                                     &state->tmp);
1674         if (tevent_req_nomem(subreq, req)) {
1675                 return tevent_req_post(req, ev);
1676         }
1677         tevent_req_set_callback(subreq, rpccli_wbint_LookupUserGroups_done, req);
1678         return req;
1679 }
1680
1681 static void rpccli_wbint_LookupUserGroups_done(struct tevent_req *subreq)
1682 {
1683         struct tevent_req *req = tevent_req_callback_data(
1684                 subreq, struct tevent_req);
1685         struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1686                 req, struct rpccli_wbint_LookupUserGroups_state);
1687         NTSTATUS status;
1688         TALLOC_CTX *mem_ctx;
1689
1690         if (state->out_mem_ctx) {
1691                 mem_ctx = state->out_mem_ctx;
1692         } else {
1693                 mem_ctx = state;
1694         }
1695
1696         status = state->dispatch_recv(subreq, mem_ctx);
1697         TALLOC_FREE(subreq);
1698         if (!NT_STATUS_IS_OK(status)) {
1699                 tevent_req_nterror(req, status);
1700                 return;
1701         }
1702
1703         /* Copy out parameters */
1704         *state->orig.out.sids = *state->tmp.out.sids;
1705
1706         /* Copy result */
1707         state->orig.out.result = state->tmp.out.result;
1708
1709         /* Reset temporary structure */
1710         ZERO_STRUCT(state->tmp);
1711
1712         tevent_req_done(req);
1713 }
1714
1715 NTSTATUS rpccli_wbint_LookupUserGroups_recv(struct tevent_req *req,
1716                                             TALLOC_CTX *mem_ctx,
1717                                             NTSTATUS *result)
1718 {
1719         struct rpccli_wbint_LookupUserGroups_state *state = tevent_req_data(
1720                 req, struct rpccli_wbint_LookupUserGroups_state);
1721         NTSTATUS status;
1722
1723         if (tevent_req_is_nterror(req, &status)) {
1724                 tevent_req_received(req);
1725                 return status;
1726         }
1727
1728         /* Steal possbile out parameters to the callers context */
1729         talloc_steal(mem_ctx, state->out_mem_ctx);
1730
1731         /* Return result */
1732         *result = state->orig.out.result;
1733
1734         tevent_req_received(req);
1735         return NT_STATUS_OK;
1736 }
1737
1738 NTSTATUS rpccli_wbint_LookupUserGroups(struct rpc_pipe_client *cli,
1739                                        TALLOC_CTX *mem_ctx,
1740                                        struct dom_sid *sid /* [in] [ref] */,
1741                                        struct wbint_SidArray *sids /* [out] [ref] */)
1742 {
1743         struct wbint_LookupUserGroups r;
1744         NTSTATUS status;
1745
1746         /* In parameters */
1747         r.in.sid = sid;
1748
1749         status = cli->dispatch(cli,
1750                                 mem_ctx,
1751                                 &ndr_table_wbint,
1752                                 NDR_WBINT_LOOKUPUSERGROUPS,
1753                                 &r);
1754
1755         if (!NT_STATUS_IS_OK(status)) {
1756                 return status;
1757         }
1758
1759         if (NT_STATUS_IS_ERR(status)) {
1760                 return status;
1761         }
1762
1763         /* Return variables */
1764         *sids = *r.out.sids;
1765
1766         /* Return result */
1767         return r.out.result;
1768 }
1769
1770 struct rpccli_wbint_QuerySequenceNumber_state {
1771         struct wbint_QuerySequenceNumber orig;
1772         struct wbint_QuerySequenceNumber tmp;
1773         TALLOC_CTX *out_mem_ctx;
1774         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1775 };
1776
1777 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq);
1778
1779 struct tevent_req *rpccli_wbint_QuerySequenceNumber_send(TALLOC_CTX *mem_ctx,
1780                                                          struct tevent_context *ev,
1781                                                          struct rpc_pipe_client *cli,
1782                                                          uint32_t *_sequence /* [out] [ref] */)
1783 {
1784         struct tevent_req *req;
1785         struct rpccli_wbint_QuerySequenceNumber_state *state;
1786         struct tevent_req *subreq;
1787
1788         req = tevent_req_create(mem_ctx, &state,
1789                                 struct rpccli_wbint_QuerySequenceNumber_state);
1790         if (req == NULL) {
1791                 return NULL;
1792         }
1793         state->out_mem_ctx = NULL;
1794         state->dispatch_recv = cli->dispatch_recv;
1795
1796         /* In parameters */
1797
1798         /* Out parameters */
1799         state->orig.out.sequence = _sequence;
1800
1801         /* Result */
1802         ZERO_STRUCT(state->orig.out.result);
1803
1804         state->out_mem_ctx = talloc_named_const(state, 0,
1805                              "rpccli_wbint_QuerySequenceNumber_out_memory");
1806         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1807                 return tevent_req_post(req, ev);
1808         }
1809
1810         /* make a temporary copy, that we pass to the dispatch function */
1811         state->tmp = state->orig;
1812
1813         subreq = cli->dispatch_send(state, ev, cli,
1814                                     &ndr_table_wbint,
1815                                     NDR_WBINT_QUERYSEQUENCENUMBER,
1816                                     &state->tmp);
1817         if (tevent_req_nomem(subreq, req)) {
1818                 return tevent_req_post(req, ev);
1819         }
1820         tevent_req_set_callback(subreq, rpccli_wbint_QuerySequenceNumber_done, req);
1821         return req;
1822 }
1823
1824 static void rpccli_wbint_QuerySequenceNumber_done(struct tevent_req *subreq)
1825 {
1826         struct tevent_req *req = tevent_req_callback_data(
1827                 subreq, struct tevent_req);
1828         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
1829                 req, struct rpccli_wbint_QuerySequenceNumber_state);
1830         NTSTATUS status;
1831         TALLOC_CTX *mem_ctx;
1832
1833         if (state->out_mem_ctx) {
1834                 mem_ctx = state->out_mem_ctx;
1835         } else {
1836                 mem_ctx = state;
1837         }
1838
1839         status = state->dispatch_recv(subreq, mem_ctx);
1840         TALLOC_FREE(subreq);
1841         if (!NT_STATUS_IS_OK(status)) {
1842                 tevent_req_nterror(req, status);
1843                 return;
1844         }
1845
1846         /* Copy out parameters */
1847         *state->orig.out.sequence = *state->tmp.out.sequence;
1848
1849         /* Copy result */
1850         state->orig.out.result = state->tmp.out.result;
1851
1852         /* Reset temporary structure */
1853         ZERO_STRUCT(state->tmp);
1854
1855         tevent_req_done(req);
1856 }
1857
1858 NTSTATUS rpccli_wbint_QuerySequenceNumber_recv(struct tevent_req *req,
1859                                                TALLOC_CTX *mem_ctx,
1860                                                NTSTATUS *result)
1861 {
1862         struct rpccli_wbint_QuerySequenceNumber_state *state = tevent_req_data(
1863                 req, struct rpccli_wbint_QuerySequenceNumber_state);
1864         NTSTATUS status;
1865
1866         if (tevent_req_is_nterror(req, &status)) {
1867                 tevent_req_received(req);
1868                 return status;
1869         }
1870
1871         /* Steal possbile out parameters to the callers context */
1872         talloc_steal(mem_ctx, state->out_mem_ctx);
1873
1874         /* Return result */
1875         *result = state->orig.out.result;
1876
1877         tevent_req_received(req);
1878         return NT_STATUS_OK;
1879 }
1880
1881 NTSTATUS rpccli_wbint_QuerySequenceNumber(struct rpc_pipe_client *cli,
1882                                           TALLOC_CTX *mem_ctx,
1883                                           uint32_t *sequence /* [out] [ref] */)
1884 {
1885         struct wbint_QuerySequenceNumber r;
1886         NTSTATUS status;
1887
1888         /* In parameters */
1889
1890         status = cli->dispatch(cli,
1891                                 mem_ctx,
1892                                 &ndr_table_wbint,
1893                                 NDR_WBINT_QUERYSEQUENCENUMBER,
1894                                 &r);
1895
1896         if (!NT_STATUS_IS_OK(status)) {
1897                 return status;
1898         }
1899
1900         if (NT_STATUS_IS_ERR(status)) {
1901                 return status;
1902         }
1903
1904         /* Return variables */
1905         *sequence = *r.out.sequence;
1906
1907         /* Return result */
1908         return r.out.result;
1909 }
1910
1911 struct rpccli_wbint_LookupGroupMembers_state {
1912         struct wbint_LookupGroupMembers orig;
1913         struct wbint_LookupGroupMembers tmp;
1914         TALLOC_CTX *out_mem_ctx;
1915         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1916 };
1917
1918 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq);
1919
1920 struct tevent_req *rpccli_wbint_LookupGroupMembers_send(TALLOC_CTX *mem_ctx,
1921                                                         struct tevent_context *ev,
1922                                                         struct rpc_pipe_client *cli,
1923                                                         struct dom_sid *_sid /* [in] [ref] */,
1924                                                         enum lsa_SidType _type /* [in]  */,
1925                                                         struct wbint_Principals *_members /* [out] [ref] */)
1926 {
1927         struct tevent_req *req;
1928         struct rpccli_wbint_LookupGroupMembers_state *state;
1929         struct tevent_req *subreq;
1930
1931         req = tevent_req_create(mem_ctx, &state,
1932                                 struct rpccli_wbint_LookupGroupMembers_state);
1933         if (req == NULL) {
1934                 return NULL;
1935         }
1936         state->out_mem_ctx = NULL;
1937         state->dispatch_recv = cli->dispatch_recv;
1938
1939         /* In parameters */
1940         state->orig.in.sid = _sid;
1941         state->orig.in.type = _type;
1942
1943         /* Out parameters */
1944         state->orig.out.members = _members;
1945
1946         /* Result */
1947         ZERO_STRUCT(state->orig.out.result);
1948
1949         state->out_mem_ctx = talloc_named_const(state, 0,
1950                              "rpccli_wbint_LookupGroupMembers_out_memory");
1951         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1952                 return tevent_req_post(req, ev);
1953         }
1954
1955         /* make a temporary copy, that we pass to the dispatch function */
1956         state->tmp = state->orig;
1957
1958         subreq = cli->dispatch_send(state, ev, cli,
1959                                     &ndr_table_wbint,
1960                                     NDR_WBINT_LOOKUPGROUPMEMBERS,
1961                                     &state->tmp);
1962         if (tevent_req_nomem(subreq, req)) {
1963                 return tevent_req_post(req, ev);
1964         }
1965         tevent_req_set_callback(subreq, rpccli_wbint_LookupGroupMembers_done, req);
1966         return req;
1967 }
1968
1969 static void rpccli_wbint_LookupGroupMembers_done(struct tevent_req *subreq)
1970 {
1971         struct tevent_req *req = tevent_req_callback_data(
1972                 subreq, struct tevent_req);
1973         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
1974                 req, struct rpccli_wbint_LookupGroupMembers_state);
1975         NTSTATUS status;
1976         TALLOC_CTX *mem_ctx;
1977
1978         if (state->out_mem_ctx) {
1979                 mem_ctx = state->out_mem_ctx;
1980         } else {
1981                 mem_ctx = state;
1982         }
1983
1984         status = state->dispatch_recv(subreq, mem_ctx);
1985         TALLOC_FREE(subreq);
1986         if (!NT_STATUS_IS_OK(status)) {
1987                 tevent_req_nterror(req, status);
1988                 return;
1989         }
1990
1991         /* Copy out parameters */
1992         *state->orig.out.members = *state->tmp.out.members;
1993
1994         /* Copy result */
1995         state->orig.out.result = state->tmp.out.result;
1996
1997         /* Reset temporary structure */
1998         ZERO_STRUCT(state->tmp);
1999
2000         tevent_req_done(req);
2001 }
2002
2003 NTSTATUS rpccli_wbint_LookupGroupMembers_recv(struct tevent_req *req,
2004                                               TALLOC_CTX *mem_ctx,
2005                                               NTSTATUS *result)
2006 {
2007         struct rpccli_wbint_LookupGroupMembers_state *state = tevent_req_data(
2008                 req, struct rpccli_wbint_LookupGroupMembers_state);
2009         NTSTATUS status;
2010
2011         if (tevent_req_is_nterror(req, &status)) {
2012                 tevent_req_received(req);
2013                 return status;
2014         }
2015
2016         /* Steal possbile out parameters to the callers context */
2017         talloc_steal(mem_ctx, state->out_mem_ctx);
2018
2019         /* Return result */
2020         *result = state->orig.out.result;
2021
2022         tevent_req_received(req);
2023         return NT_STATUS_OK;
2024 }
2025
2026 NTSTATUS rpccli_wbint_LookupGroupMembers(struct rpc_pipe_client *cli,
2027                                          TALLOC_CTX *mem_ctx,
2028                                          struct dom_sid *sid /* [in] [ref] */,
2029                                          enum lsa_SidType type /* [in]  */,
2030                                          struct wbint_Principals *members /* [out] [ref] */)
2031 {
2032         struct wbint_LookupGroupMembers r;
2033         NTSTATUS status;
2034
2035         /* In parameters */
2036         r.in.sid = sid;
2037         r.in.type = type;
2038
2039         status = cli->dispatch(cli,
2040                                 mem_ctx,
2041                                 &ndr_table_wbint,
2042                                 NDR_WBINT_LOOKUPGROUPMEMBERS,
2043                                 &r);
2044
2045         if (!NT_STATUS_IS_OK(status)) {
2046                 return status;
2047         }
2048
2049         if (NT_STATUS_IS_ERR(status)) {
2050                 return status;
2051         }
2052
2053         /* Return variables */
2054         *members = *r.out.members;
2055
2056         /* Return result */
2057         return r.out.result;
2058 }
2059
2060 struct rpccli_wbint_QueryUserList_state {
2061         struct wbint_QueryUserList orig;
2062         struct wbint_QueryUserList tmp;
2063         TALLOC_CTX *out_mem_ctx;
2064         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2065 };
2066
2067 static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq);
2068
2069 struct tevent_req *rpccli_wbint_QueryUserList_send(TALLOC_CTX *mem_ctx,
2070                                                    struct tevent_context *ev,
2071                                                    struct rpc_pipe_client *cli,
2072                                                    struct wbint_userinfos *_users /* [out] [ref] */)
2073 {
2074         struct tevent_req *req;
2075         struct rpccli_wbint_QueryUserList_state *state;
2076         struct tevent_req *subreq;
2077
2078         req = tevent_req_create(mem_ctx, &state,
2079                                 struct rpccli_wbint_QueryUserList_state);
2080         if (req == NULL) {
2081                 return NULL;
2082         }
2083         state->out_mem_ctx = NULL;
2084         state->dispatch_recv = cli->dispatch_recv;
2085
2086         /* In parameters */
2087
2088         /* Out parameters */
2089         state->orig.out.users = _users;
2090
2091         /* Result */
2092         ZERO_STRUCT(state->orig.out.result);
2093
2094         state->out_mem_ctx = talloc_named_const(state, 0,
2095                              "rpccli_wbint_QueryUserList_out_memory");
2096         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2097                 return tevent_req_post(req, ev);
2098         }
2099
2100         /* make a temporary copy, that we pass to the dispatch function */
2101         state->tmp = state->orig;
2102
2103         subreq = cli->dispatch_send(state, ev, cli,
2104                                     &ndr_table_wbint,
2105                                     NDR_WBINT_QUERYUSERLIST,
2106                                     &state->tmp);
2107         if (tevent_req_nomem(subreq, req)) {
2108                 return tevent_req_post(req, ev);
2109         }
2110         tevent_req_set_callback(subreq, rpccli_wbint_QueryUserList_done, req);
2111         return req;
2112 }
2113
2114 static void rpccli_wbint_QueryUserList_done(struct tevent_req *subreq)
2115 {
2116         struct tevent_req *req = tevent_req_callback_data(
2117                 subreq, struct tevent_req);
2118         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2119                 req, struct rpccli_wbint_QueryUserList_state);
2120         NTSTATUS status;
2121         TALLOC_CTX *mem_ctx;
2122
2123         if (state->out_mem_ctx) {
2124                 mem_ctx = state->out_mem_ctx;
2125         } else {
2126                 mem_ctx = state;
2127         }
2128
2129         status = state->dispatch_recv(subreq, mem_ctx);
2130         TALLOC_FREE(subreq);
2131         if (!NT_STATUS_IS_OK(status)) {
2132                 tevent_req_nterror(req, status);
2133                 return;
2134         }
2135
2136         /* Copy out parameters */
2137         *state->orig.out.users = *state->tmp.out.users;
2138
2139         /* Copy result */
2140         state->orig.out.result = state->tmp.out.result;
2141
2142         /* Reset temporary structure */
2143         ZERO_STRUCT(state->tmp);
2144
2145         tevent_req_done(req);
2146 }
2147
2148 NTSTATUS rpccli_wbint_QueryUserList_recv(struct tevent_req *req,
2149                                          TALLOC_CTX *mem_ctx,
2150                                          NTSTATUS *result)
2151 {
2152         struct rpccli_wbint_QueryUserList_state *state = tevent_req_data(
2153                 req, struct rpccli_wbint_QueryUserList_state);
2154         NTSTATUS status;
2155
2156         if (tevent_req_is_nterror(req, &status)) {
2157                 tevent_req_received(req);
2158                 return status;
2159         }
2160
2161         /* Steal possbile out parameters to the callers context */
2162         talloc_steal(mem_ctx, state->out_mem_ctx);
2163
2164         /* Return result */
2165         *result = state->orig.out.result;
2166
2167         tevent_req_received(req);
2168         return NT_STATUS_OK;
2169 }
2170
2171 NTSTATUS rpccli_wbint_QueryUserList(struct rpc_pipe_client *cli,
2172                                     TALLOC_CTX *mem_ctx,
2173                                     struct wbint_userinfos *users /* [out] [ref] */)
2174 {
2175         struct wbint_QueryUserList r;
2176         NTSTATUS status;
2177
2178         /* In parameters */
2179
2180         status = cli->dispatch(cli,
2181                                 mem_ctx,
2182                                 &ndr_table_wbint,
2183                                 NDR_WBINT_QUERYUSERLIST,
2184                                 &r);
2185
2186         if (!NT_STATUS_IS_OK(status)) {
2187                 return status;
2188         }
2189
2190         if (NT_STATUS_IS_ERR(status)) {
2191                 return status;
2192         }
2193
2194         /* Return variables */
2195         *users = *r.out.users;
2196
2197         /* Return result */
2198         return r.out.result;
2199 }
2200
2201 struct rpccli_wbint_QueryGroupList_state {
2202         struct wbint_QueryGroupList orig;
2203         struct wbint_QueryGroupList tmp;
2204         TALLOC_CTX *out_mem_ctx;
2205         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2206 };
2207
2208 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq);
2209
2210 struct tevent_req *rpccli_wbint_QueryGroupList_send(TALLOC_CTX *mem_ctx,
2211                                                     struct tevent_context *ev,
2212                                                     struct rpc_pipe_client *cli,
2213                                                     struct wbint_Principals *_groups /* [out] [ref] */)
2214 {
2215         struct tevent_req *req;
2216         struct rpccli_wbint_QueryGroupList_state *state;
2217         struct tevent_req *subreq;
2218
2219         req = tevent_req_create(mem_ctx, &state,
2220                                 struct rpccli_wbint_QueryGroupList_state);
2221         if (req == NULL) {
2222                 return NULL;
2223         }
2224         state->out_mem_ctx = NULL;
2225         state->dispatch_recv = cli->dispatch_recv;
2226
2227         /* In parameters */
2228
2229         /* Out parameters */
2230         state->orig.out.groups = _groups;
2231
2232         /* Result */
2233         ZERO_STRUCT(state->orig.out.result);
2234
2235         state->out_mem_ctx = talloc_named_const(state, 0,
2236                              "rpccli_wbint_QueryGroupList_out_memory");
2237         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2238                 return tevent_req_post(req, ev);
2239         }
2240
2241         /* make a temporary copy, that we pass to the dispatch function */
2242         state->tmp = state->orig;
2243
2244         subreq = cli->dispatch_send(state, ev, cli,
2245                                     &ndr_table_wbint,
2246                                     NDR_WBINT_QUERYGROUPLIST,
2247                                     &state->tmp);
2248         if (tevent_req_nomem(subreq, req)) {
2249                 return tevent_req_post(req, ev);
2250         }
2251         tevent_req_set_callback(subreq, rpccli_wbint_QueryGroupList_done, req);
2252         return req;
2253 }
2254
2255 static void rpccli_wbint_QueryGroupList_done(struct tevent_req *subreq)
2256 {
2257         struct tevent_req *req = tevent_req_callback_data(
2258                 subreq, struct tevent_req);
2259         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2260                 req, struct rpccli_wbint_QueryGroupList_state);
2261         NTSTATUS status;
2262         TALLOC_CTX *mem_ctx;
2263
2264         if (state->out_mem_ctx) {
2265                 mem_ctx = state->out_mem_ctx;
2266         } else {
2267                 mem_ctx = state;
2268         }
2269
2270         status = state->dispatch_recv(subreq, mem_ctx);
2271         TALLOC_FREE(subreq);
2272         if (!NT_STATUS_IS_OK(status)) {
2273                 tevent_req_nterror(req, status);
2274                 return;
2275         }
2276
2277         /* Copy out parameters */
2278         *state->orig.out.groups = *state->tmp.out.groups;
2279
2280         /* Copy result */
2281         state->orig.out.result = state->tmp.out.result;
2282
2283         /* Reset temporary structure */
2284         ZERO_STRUCT(state->tmp);
2285
2286         tevent_req_done(req);
2287 }
2288
2289 NTSTATUS rpccli_wbint_QueryGroupList_recv(struct tevent_req *req,
2290                                           TALLOC_CTX *mem_ctx,
2291                                           NTSTATUS *result)
2292 {
2293         struct rpccli_wbint_QueryGroupList_state *state = tevent_req_data(
2294                 req, struct rpccli_wbint_QueryGroupList_state);
2295         NTSTATUS status;
2296
2297         if (tevent_req_is_nterror(req, &status)) {
2298                 tevent_req_received(req);
2299                 return status;
2300         }
2301
2302         /* Steal possbile out parameters to the callers context */
2303         talloc_steal(mem_ctx, state->out_mem_ctx);
2304
2305         /* Return result */
2306         *result = state->orig.out.result;
2307
2308         tevent_req_received(req);
2309         return NT_STATUS_OK;
2310 }
2311
2312 NTSTATUS rpccli_wbint_QueryGroupList(struct rpc_pipe_client *cli,
2313                                      TALLOC_CTX *mem_ctx,
2314                                      struct wbint_Principals *groups /* [out] [ref] */)
2315 {
2316         struct wbint_QueryGroupList r;
2317         NTSTATUS status;
2318
2319         /* In parameters */
2320
2321         status = cli->dispatch(cli,
2322                                 mem_ctx,
2323                                 &ndr_table_wbint,
2324                                 NDR_WBINT_QUERYGROUPLIST,
2325                                 &r);
2326
2327         if (!NT_STATUS_IS_OK(status)) {
2328                 return status;
2329         }
2330
2331         if (NT_STATUS_IS_ERR(status)) {
2332                 return status;
2333         }
2334
2335         /* Return variables */
2336         *groups = *r.out.groups;
2337
2338         /* Return result */
2339         return r.out.result;
2340 }
2341
2342 struct rpccli_wbint_DsGetDcName_state {
2343         struct wbint_DsGetDcName orig;
2344         struct wbint_DsGetDcName tmp;
2345         TALLOC_CTX *out_mem_ctx;
2346         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2347 };
2348
2349 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq);
2350
2351 struct tevent_req *rpccli_wbint_DsGetDcName_send(TALLOC_CTX *mem_ctx,
2352                                                  struct tevent_context *ev,
2353                                                  struct rpc_pipe_client *cli,
2354                                                  const char *_domain_name /* [in] [ref,charset(UTF8)] */,
2355                                                  struct GUID *_domain_guid /* [in] [unique] */,
2356                                                  const char *_site_name /* [in] [unique,charset(UTF8)] */,
2357                                                  uint32_t _flags /* [in]  */,
2358                                                  struct netr_DsRGetDCNameInfo **_dc_info /* [out] [ref] */)
2359 {
2360         struct tevent_req *req;
2361         struct rpccli_wbint_DsGetDcName_state *state;
2362         struct tevent_req *subreq;
2363
2364         req = tevent_req_create(mem_ctx, &state,
2365                                 struct rpccli_wbint_DsGetDcName_state);
2366         if (req == NULL) {
2367                 return NULL;
2368         }
2369         state->out_mem_ctx = NULL;
2370         state->dispatch_recv = cli->dispatch_recv;
2371
2372         /* In parameters */
2373         state->orig.in.domain_name = _domain_name;
2374         state->orig.in.domain_guid = _domain_guid;
2375         state->orig.in.site_name = _site_name;
2376         state->orig.in.flags = _flags;
2377
2378         /* Out parameters */
2379         state->orig.out.dc_info = _dc_info;
2380
2381         /* Result */
2382         ZERO_STRUCT(state->orig.out.result);
2383
2384         state->out_mem_ctx = talloc_named_const(state, 0,
2385                              "rpccli_wbint_DsGetDcName_out_memory");
2386         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2387                 return tevent_req_post(req, ev);
2388         }
2389
2390         /* make a temporary copy, that we pass to the dispatch function */
2391         state->tmp = state->orig;
2392
2393         subreq = cli->dispatch_send(state, ev, cli,
2394                                     &ndr_table_wbint,
2395                                     NDR_WBINT_DSGETDCNAME,
2396                                     &state->tmp);
2397         if (tevent_req_nomem(subreq, req)) {
2398                 return tevent_req_post(req, ev);
2399         }
2400         tevent_req_set_callback(subreq, rpccli_wbint_DsGetDcName_done, req);
2401         return req;
2402 }
2403
2404 static void rpccli_wbint_DsGetDcName_done(struct tevent_req *subreq)
2405 {
2406         struct tevent_req *req = tevent_req_callback_data(
2407                 subreq, struct tevent_req);
2408         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2409                 req, struct rpccli_wbint_DsGetDcName_state);
2410         NTSTATUS status;
2411         TALLOC_CTX *mem_ctx;
2412
2413         if (state->out_mem_ctx) {
2414                 mem_ctx = state->out_mem_ctx;
2415         } else {
2416                 mem_ctx = state;
2417         }
2418
2419         status = state->dispatch_recv(subreq, mem_ctx);
2420         TALLOC_FREE(subreq);
2421         if (!NT_STATUS_IS_OK(status)) {
2422                 tevent_req_nterror(req, status);
2423                 return;
2424         }
2425
2426         /* Copy out parameters */
2427         *state->orig.out.dc_info = *state->tmp.out.dc_info;
2428
2429         /* Copy result */
2430         state->orig.out.result = state->tmp.out.result;
2431
2432         /* Reset temporary structure */
2433         ZERO_STRUCT(state->tmp);
2434
2435         tevent_req_done(req);
2436 }
2437
2438 NTSTATUS rpccli_wbint_DsGetDcName_recv(struct tevent_req *req,
2439                                        TALLOC_CTX *mem_ctx,
2440                                        NTSTATUS *result)
2441 {
2442         struct rpccli_wbint_DsGetDcName_state *state = tevent_req_data(
2443                 req, struct rpccli_wbint_DsGetDcName_state);
2444         NTSTATUS status;
2445
2446         if (tevent_req_is_nterror(req, &status)) {
2447                 tevent_req_received(req);
2448                 return status;
2449         }
2450
2451         /* Steal possbile out parameters to the callers context */
2452         talloc_steal(mem_ctx, state->out_mem_ctx);
2453
2454         /* Return result */
2455         *result = state->orig.out.result;
2456
2457         tevent_req_received(req);
2458         return NT_STATUS_OK;
2459 }
2460
2461 NTSTATUS rpccli_wbint_DsGetDcName(struct rpc_pipe_client *cli,
2462                                   TALLOC_CTX *mem_ctx,
2463                                   const char *domain_name /* [in] [ref,charset(UTF8)] */,
2464                                   struct GUID *domain_guid /* [in] [unique] */,
2465                                   const char *site_name /* [in] [unique,charset(UTF8)] */,
2466                                   uint32_t flags /* [in]  */,
2467                                   struct netr_DsRGetDCNameInfo **dc_info /* [out] [ref] */)
2468 {
2469         struct wbint_DsGetDcName r;
2470         NTSTATUS status;
2471
2472         /* In parameters */
2473         r.in.domain_name = domain_name;
2474         r.in.domain_guid = domain_guid;
2475         r.in.site_name = site_name;
2476         r.in.flags = flags;
2477
2478         status = cli->dispatch(cli,
2479                                 mem_ctx,
2480                                 &ndr_table_wbint,
2481                                 NDR_WBINT_DSGETDCNAME,
2482                                 &r);
2483
2484         if (!NT_STATUS_IS_OK(status)) {
2485                 return status;
2486         }
2487
2488         if (NT_STATUS_IS_ERR(status)) {
2489                 return status;
2490         }
2491
2492         /* Return variables */
2493         *dc_info = *r.out.dc_info;
2494
2495         /* Return result */
2496         return r.out.result;
2497 }
2498
2499 struct rpccli_wbint_LookupRids_state {
2500         struct wbint_LookupRids orig;
2501         struct wbint_LookupRids tmp;
2502         TALLOC_CTX *out_mem_ctx;
2503         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2504 };
2505
2506 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq);
2507
2508 struct tevent_req *rpccli_wbint_LookupRids_send(TALLOC_CTX *mem_ctx,
2509                                                 struct tevent_context *ev,
2510                                                 struct rpc_pipe_client *cli,
2511                                                 struct wbint_RidArray *_rids /* [in] [ref] */,
2512                                                 struct wbint_Principals *_names /* [out] [ref] */)
2513 {
2514         struct tevent_req *req;
2515         struct rpccli_wbint_LookupRids_state *state;
2516         struct tevent_req *subreq;
2517
2518         req = tevent_req_create(mem_ctx, &state,
2519                                 struct rpccli_wbint_LookupRids_state);
2520         if (req == NULL) {
2521                 return NULL;
2522         }
2523         state->out_mem_ctx = NULL;
2524         state->dispatch_recv = cli->dispatch_recv;
2525
2526         /* In parameters */
2527         state->orig.in.rids = _rids;
2528
2529         /* Out parameters */
2530         state->orig.out.names = _names;
2531
2532         /* Result */
2533         ZERO_STRUCT(state->orig.out.result);
2534
2535         state->out_mem_ctx = talloc_named_const(state, 0,
2536                              "rpccli_wbint_LookupRids_out_memory");
2537         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2538                 return tevent_req_post(req, ev);
2539         }
2540
2541         /* make a temporary copy, that we pass to the dispatch function */
2542         state->tmp = state->orig;
2543
2544         subreq = cli->dispatch_send(state, ev, cli,
2545                                     &ndr_table_wbint,
2546                                     NDR_WBINT_LOOKUPRIDS,
2547                                     &state->tmp);
2548         if (tevent_req_nomem(subreq, req)) {
2549                 return tevent_req_post(req, ev);
2550         }
2551         tevent_req_set_callback(subreq, rpccli_wbint_LookupRids_done, req);
2552         return req;
2553 }
2554
2555 static void rpccli_wbint_LookupRids_done(struct tevent_req *subreq)
2556 {
2557         struct tevent_req *req = tevent_req_callback_data(
2558                 subreq, struct tevent_req);
2559         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2560                 req, struct rpccli_wbint_LookupRids_state);
2561         NTSTATUS status;
2562         TALLOC_CTX *mem_ctx;
2563
2564         if (state->out_mem_ctx) {
2565                 mem_ctx = state->out_mem_ctx;
2566         } else {
2567                 mem_ctx = state;
2568         }
2569
2570         status = state->dispatch_recv(subreq, mem_ctx);
2571         TALLOC_FREE(subreq);
2572         if (!NT_STATUS_IS_OK(status)) {
2573                 tevent_req_nterror(req, status);
2574                 return;
2575         }
2576
2577         /* Copy out parameters */
2578         *state->orig.out.names = *state->tmp.out.names;
2579
2580         /* Copy result */
2581         state->orig.out.result = state->tmp.out.result;
2582
2583         /* Reset temporary structure */
2584         ZERO_STRUCT(state->tmp);
2585
2586         tevent_req_done(req);
2587 }
2588
2589 NTSTATUS rpccli_wbint_LookupRids_recv(struct tevent_req *req,
2590                                       TALLOC_CTX *mem_ctx,
2591                                       NTSTATUS *result)
2592 {
2593         struct rpccli_wbint_LookupRids_state *state = tevent_req_data(
2594                 req, struct rpccli_wbint_LookupRids_state);
2595         NTSTATUS status;
2596
2597         if (tevent_req_is_nterror(req, &status)) {
2598                 tevent_req_received(req);
2599                 return status;
2600         }
2601
2602         /* Steal possbile out parameters to the callers context */
2603         talloc_steal(mem_ctx, state->out_mem_ctx);
2604
2605         /* Return result */
2606         *result = state->orig.out.result;
2607
2608         tevent_req_received(req);
2609         return NT_STATUS_OK;
2610 }
2611
2612 NTSTATUS rpccli_wbint_LookupRids(struct rpc_pipe_client *cli,
2613                                  TALLOC_CTX *mem_ctx,
2614                                  struct wbint_RidArray *rids /* [in] [ref] */,
2615                                  struct wbint_Principals *names /* [out] [ref] */)
2616 {
2617         struct wbint_LookupRids r;
2618         NTSTATUS status;
2619
2620         /* In parameters */
2621         r.in.rids = rids;
2622
2623         status = cli->dispatch(cli,
2624                                 mem_ctx,
2625                                 &ndr_table_wbint,
2626                                 NDR_WBINT_LOOKUPRIDS,
2627                                 &r);
2628
2629         if (!NT_STATUS_IS_OK(status)) {
2630                 return status;
2631         }
2632
2633         if (NT_STATUS_IS_ERR(status)) {
2634                 return status;
2635         }
2636
2637         /* Return variables */
2638         *names = *r.out.names;
2639
2640         /* Return result */
2641         return r.out.result;
2642 }
2643
2644 struct rpccli_wbint_CheckMachineAccount_state {
2645         struct wbint_CheckMachineAccount orig;
2646         struct wbint_CheckMachineAccount tmp;
2647         TALLOC_CTX *out_mem_ctx;
2648         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2649 };
2650
2651 static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq);
2652
2653 struct tevent_req *rpccli_wbint_CheckMachineAccount_send(TALLOC_CTX *mem_ctx,
2654                                                          struct tevent_context *ev,
2655                                                          struct rpc_pipe_client *cli)
2656 {
2657         struct tevent_req *req;
2658         struct rpccli_wbint_CheckMachineAccount_state *state;
2659         struct tevent_req *subreq;
2660
2661         req = tevent_req_create(mem_ctx, &state,
2662                                 struct rpccli_wbint_CheckMachineAccount_state);
2663         if (req == NULL) {
2664                 return NULL;
2665         }
2666         state->out_mem_ctx = NULL;
2667         state->dispatch_recv = cli->dispatch_recv;
2668
2669         /* In parameters */
2670
2671         /* Out parameters */
2672
2673         /* Result */
2674         ZERO_STRUCT(state->orig.out.result);
2675
2676         /* make a temporary copy, that we pass to the dispatch function */
2677         state->tmp = state->orig;
2678
2679         subreq = cli->dispatch_send(state, ev, cli,
2680                                     &ndr_table_wbint,
2681                                     NDR_WBINT_CHECKMACHINEACCOUNT,
2682                                     &state->tmp);
2683         if (tevent_req_nomem(subreq, req)) {
2684                 return tevent_req_post(req, ev);
2685         }
2686         tevent_req_set_callback(subreq, rpccli_wbint_CheckMachineAccount_done, req);
2687         return req;
2688 }
2689
2690 static void rpccli_wbint_CheckMachineAccount_done(struct tevent_req *subreq)
2691 {
2692         struct tevent_req *req = tevent_req_callback_data(
2693                 subreq, struct tevent_req);
2694         struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
2695                 req, struct rpccli_wbint_CheckMachineAccount_state);
2696         NTSTATUS status;
2697         TALLOC_CTX *mem_ctx;
2698
2699         if (state->out_mem_ctx) {
2700                 mem_ctx = state->out_mem_ctx;
2701         } else {
2702                 mem_ctx = state;
2703         }
2704
2705         status = state->dispatch_recv(subreq, mem_ctx);
2706         TALLOC_FREE(subreq);
2707         if (!NT_STATUS_IS_OK(status)) {
2708                 tevent_req_nterror(req, status);
2709                 return;
2710         }
2711
2712         /* Copy out parameters */
2713
2714         /* Copy result */
2715         state->orig.out.result = state->tmp.out.result;
2716
2717         /* Reset temporary structure */
2718         ZERO_STRUCT(state->tmp);
2719
2720         tevent_req_done(req);
2721 }
2722
2723 NTSTATUS rpccli_wbint_CheckMachineAccount_recv(struct tevent_req *req,
2724                                                TALLOC_CTX *mem_ctx,
2725                                                NTSTATUS *result)
2726 {
2727         struct rpccli_wbint_CheckMachineAccount_state *state = tevent_req_data(
2728                 req, struct rpccli_wbint_CheckMachineAccount_state);
2729         NTSTATUS status;
2730
2731         if (tevent_req_is_nterror(req, &status)) {
2732                 tevent_req_received(req);
2733                 return status;
2734         }
2735
2736         /* Steal possbile out parameters to the callers context */
2737         talloc_steal(mem_ctx, state->out_mem_ctx);
2738
2739         /* Return result */
2740         *result = state->orig.out.result;
2741
2742         tevent_req_received(req);
2743         return NT_STATUS_OK;
2744 }
2745
2746 NTSTATUS rpccli_wbint_CheckMachineAccount(struct rpc_pipe_client *cli,
2747                                           TALLOC_CTX *mem_ctx)
2748 {
2749         struct wbint_CheckMachineAccount r;
2750         NTSTATUS status;
2751
2752         /* In parameters */
2753
2754         status = cli->dispatch(cli,
2755                                 mem_ctx,
2756                                 &ndr_table_wbint,
2757                                 NDR_WBINT_CHECKMACHINEACCOUNT,
2758                                 &r);
2759
2760         if (!NT_STATUS_IS_OK(status)) {
2761                 return status;
2762         }
2763
2764         if (NT_STATUS_IS_ERR(status)) {
2765                 return status;
2766         }
2767
2768         /* Return variables */
2769
2770         /* Return result */
2771         return r.out.result;
2772 }
2773
2774 struct rpccli_wbint_ChangeMachineAccount_state {
2775         struct wbint_ChangeMachineAccount orig;
2776         struct wbint_ChangeMachineAccount tmp;
2777         TALLOC_CTX *out_mem_ctx;
2778         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2779 };
2780
2781 static void rpccli_wbint_ChangeMachineAccount_done(struct tevent_req *subreq);
2782
2783 struct tevent_req *rpccli_wbint_ChangeMachineAccount_send(TALLOC_CTX *mem_ctx,
2784                                                           struct tevent_context *ev,
2785                                                           struct rpc_pipe_client *cli)
2786 {
2787         struct tevent_req *req;
2788         struct rpccli_wbint_ChangeMachineAccount_state *state;
2789         struct tevent_req *subreq;
2790
2791         req = tevent_req_create(mem_ctx, &state,
2792                                 struct rpccli_wbint_ChangeMachineAccount_state);
2793         if (req == NULL) {
2794                 return NULL;
2795         }
2796         state->out_mem_ctx = NULL;
2797         state->dispatch_recv = cli->dispatch_recv;
2798
2799         /* In parameters */
2800
2801         /* Out parameters */
2802
2803         /* Result */
2804         ZERO_STRUCT(state->orig.out.result);
2805
2806         /* make a temporary copy, that we pass to the dispatch function */
2807         state->tmp = state->orig;
2808
2809         subreq = cli->dispatch_send(state, ev, cli,
2810                                     &ndr_table_wbint,
2811                                     NDR_WBINT_CHANGEMACHINEACCOUNT,
2812                                     &state->tmp);
2813         if (tevent_req_nomem(subreq, req)) {
2814                 return tevent_req_post(req, ev);
2815         }
2816         tevent_req_set_callback(subreq, rpccli_wbint_ChangeMachineAccount_done, req);
2817         return req;
2818 }
2819
2820 static void rpccli_wbint_ChangeMachineAccount_done(struct tevent_req *subreq)
2821 {
2822         struct tevent_req *req = tevent_req_callback_data(
2823                 subreq, struct tevent_req);
2824         struct rpccli_wbint_ChangeMachineAccount_state *state = tevent_req_data(
2825                 req, struct rpccli_wbint_ChangeMachineAccount_state);
2826         NTSTATUS status;
2827         TALLOC_CTX *mem_ctx;
2828
2829         if (state->out_mem_ctx) {
2830                 mem_ctx = state->out_mem_ctx;
2831         } else {
2832                 mem_ctx = state;
2833         }
2834
2835         status = state->dispatch_recv(subreq, mem_ctx);
2836         TALLOC_FREE(subreq);
2837         if (!NT_STATUS_IS_OK(status)) {
2838                 tevent_req_nterror(req, status);
2839                 return;
2840         }
2841
2842         /* Copy out parameters */
2843
2844         /* Copy result */
2845         state->orig.out.result = state->tmp.out.result;
2846
2847         /* Reset temporary structure */
2848         ZERO_STRUCT(state->tmp);
2849
2850         tevent_req_done(req);
2851 }
2852
2853 NTSTATUS rpccli_wbint_ChangeMachineAccount_recv(struct tevent_req *req,
2854                                                 TALLOC_CTX *mem_ctx,
2855                                                 NTSTATUS *result)
2856 {
2857         struct rpccli_wbint_ChangeMachineAccount_state *state = tevent_req_data(
2858                 req, struct rpccli_wbint_ChangeMachineAccount_state);
2859         NTSTATUS status;
2860
2861         if (tevent_req_is_nterror(req, &status)) {
2862                 tevent_req_received(req);
2863                 return status;
2864         }
2865
2866         /* Steal possbile out parameters to the callers context */
2867         talloc_steal(mem_ctx, state->out_mem_ctx);
2868
2869         /* Return result */
2870         *result = state->orig.out.result;
2871
2872         tevent_req_received(req);
2873         return NT_STATUS_OK;
2874 }
2875
2876 NTSTATUS rpccli_wbint_ChangeMachineAccount(struct rpc_pipe_client *cli,
2877                                            TALLOC_CTX *mem_ctx)
2878 {
2879         struct wbint_ChangeMachineAccount r;
2880         NTSTATUS status;
2881
2882         /* In parameters */
2883
2884         status = cli->dispatch(cli,
2885                                 mem_ctx,
2886                                 &ndr_table_wbint,
2887                                 NDR_WBINT_CHANGEMACHINEACCOUNT,
2888                                 &r);
2889
2890         if (!NT_STATUS_IS_OK(status)) {
2891                 return status;
2892         }
2893
2894         if (NT_STATUS_IS_ERR(status)) {
2895                 return status;
2896         }
2897
2898         /* Return variables */
2899
2900         /* Return result */
2901         return r.out.result;
2902 }
2903
2904 struct rpccli_wbint_SetMapping_state {
2905         struct wbint_SetMapping orig;
2906         struct wbint_SetMapping tmp;
2907         TALLOC_CTX *out_mem_ctx;
2908         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2909 };
2910
2911 static void rpccli_wbint_SetMapping_done(struct tevent_req *subreq);
2912
2913 struct tevent_req *rpccli_wbint_SetMapping_send(TALLOC_CTX *mem_ctx,
2914                                                 struct tevent_context *ev,
2915                                                 struct rpc_pipe_client *cli,
2916                                                 struct dom_sid *_sid /* [in] [ref] */,
2917                                                 enum wbint_IdType _type /* [in]  */,
2918                                                 uint64_t _id /* [in]  */)
2919 {
2920         struct tevent_req *req;
2921         struct rpccli_wbint_SetMapping_state *state;
2922         struct tevent_req *subreq;
2923
2924         req = tevent_req_create(mem_ctx, &state,
2925                                 struct rpccli_wbint_SetMapping_state);
2926         if (req == NULL) {
2927                 return NULL;
2928         }
2929         state->out_mem_ctx = NULL;
2930         state->dispatch_recv = cli->dispatch_recv;
2931
2932         /* In parameters */
2933         state->orig.in.sid = _sid;
2934         state->orig.in.type = _type;
2935         state->orig.in.id = _id;
2936
2937         /* Out parameters */
2938
2939         /* Result */
2940         ZERO_STRUCT(state->orig.out.result);
2941
2942         /* make a temporary copy, that we pass to the dispatch function */
2943         state->tmp = state->orig;
2944
2945         subreq = cli->dispatch_send(state, ev, cli,
2946                                     &ndr_table_wbint,
2947                                     NDR_WBINT_SETMAPPING,
2948                                     &state->tmp);
2949         if (tevent_req_nomem(subreq, req)) {
2950                 return tevent_req_post(req, ev);
2951         }
2952         tevent_req_set_callback(subreq, rpccli_wbint_SetMapping_done, req);
2953         return req;
2954 }
2955
2956 static void rpccli_wbint_SetMapping_done(struct tevent_req *subreq)
2957 {
2958         struct tevent_req *req = tevent_req_callback_data(
2959                 subreq, struct tevent_req);
2960         struct rpccli_wbint_SetMapping_state *state = tevent_req_data(
2961                 req, struct rpccli_wbint_SetMapping_state);
2962         NTSTATUS status;
2963         TALLOC_CTX *mem_ctx;
2964
2965         if (state->out_mem_ctx) {
2966                 mem_ctx = state->out_mem_ctx;
2967         } else {
2968                 mem_ctx = state;
2969         }
2970
2971         status = state->dispatch_recv(subreq, mem_ctx);
2972         TALLOC_FREE(subreq);
2973         if (!NT_STATUS_IS_OK(status)) {
2974                 tevent_req_nterror(req, status);
2975                 return;
2976         }
2977
2978         /* Copy out parameters */
2979
2980         /* Copy result */
2981         state->orig.out.result = state->tmp.out.result;
2982
2983         /* Reset temporary structure */
2984         ZERO_STRUCT(state->tmp);
2985
2986         tevent_req_done(req);
2987 }
2988
2989 NTSTATUS rpccli_wbint_SetMapping_recv(struct tevent_req *req,
2990                                       TALLOC_CTX *mem_ctx,
2991                                       NTSTATUS *result)
2992 {
2993         struct rpccli_wbint_SetMapping_state *state = tevent_req_data(
2994                 req, struct rpccli_wbint_SetMapping_state);
2995         NTSTATUS status;
2996
2997         if (tevent_req_is_nterror(req, &status)) {
2998                 tevent_req_received(req);
2999                 return status;
3000         }
3001
3002         /* Steal possbile out parameters to the callers context */
3003         talloc_steal(mem_ctx, state->out_mem_ctx);
3004
3005         /* Return result */
3006         *result = state->orig.out.result;
3007
3008         tevent_req_received(req);
3009         return NT_STATUS_OK;
3010 }
3011
3012 NTSTATUS rpccli_wbint_SetMapping(struct rpc_pipe_client *cli,
3013                                  TALLOC_CTX *mem_ctx,
3014                                  struct dom_sid *sid /* [in] [ref] */,
3015                                  enum wbint_IdType type /* [in]  */,
3016                                  uint64_t id /* [in]  */)
3017 {
3018         struct wbint_SetMapping r;
3019         NTSTATUS status;
3020
3021         /* In parameters */
3022         r.in.sid = sid;
3023         r.in.type = type;
3024         r.in.id = id;
3025
3026         status = cli->dispatch(cli,
3027                                 mem_ctx,
3028                                 &ndr_table_wbint,
3029                                 NDR_WBINT_SETMAPPING,
3030                                 &r);
3031
3032         if (!NT_STATUS_IS_OK(status)) {
3033                 return status;
3034         }
3035
3036         if (NT_STATUS_IS_ERR(status)) {
3037                 return status;
3038         }
3039
3040         /* Return variables */
3041
3042         /* Return result */
3043         return r.out.result;
3044 }
3045
3046 struct rpccli_wbint_RemoveMapping_state {
3047         struct wbint_RemoveMapping orig;
3048         struct wbint_RemoveMapping tmp;
3049         TALLOC_CTX *out_mem_ctx;
3050         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3051 };
3052
3053 static void rpccli_wbint_RemoveMapping_done(struct tevent_req *subreq);
3054
3055 struct tevent_req *rpccli_wbint_RemoveMapping_send(TALLOC_CTX *mem_ctx,
3056                                                    struct tevent_context *ev,
3057                                                    struct rpc_pipe_client *cli,
3058                                                    struct dom_sid *_sid /* [in] [ref] */,
3059                                                    enum wbint_IdType _type /* [in]  */,
3060                                                    uint64_t _id /* [in]  */)
3061 {
3062         struct tevent_req *req;
3063         struct rpccli_wbint_RemoveMapping_state *state;
3064         struct tevent_req *subreq;
3065
3066         req = tevent_req_create(mem_ctx, &state,
3067                                 struct rpccli_wbint_RemoveMapping_state);
3068         if (req == NULL) {
3069                 return NULL;
3070         }
3071         state->out_mem_ctx = NULL;
3072         state->dispatch_recv = cli->dispatch_recv;
3073
3074         /* In parameters */
3075         state->orig.in.sid = _sid;
3076         state->orig.in.type = _type;
3077         state->orig.in.id = _id;
3078
3079         /* Out parameters */
3080
3081         /* Result */
3082         ZERO_STRUCT(state->orig.out.result);
3083
3084         /* make a temporary copy, that we pass to the dispatch function */
3085         state->tmp = state->orig;
3086
3087         subreq = cli->dispatch_send(state, ev, cli,
3088                                     &ndr_table_wbint,
3089                                     NDR_WBINT_REMOVEMAPPING,
3090                                     &state->tmp);
3091         if (tevent_req_nomem(subreq, req)) {
3092                 return tevent_req_post(req, ev);
3093         }
3094         tevent_req_set_callback(subreq, rpccli_wbint_RemoveMapping_done, req);
3095         return req;
3096 }
3097
3098 static void rpccli_wbint_RemoveMapping_done(struct tevent_req *subreq)
3099 {
3100         struct tevent_req *req = tevent_req_callback_data(
3101                 subreq, struct tevent_req);
3102         struct rpccli_wbint_RemoveMapping_state *state = tevent_req_data(
3103                 req, struct rpccli_wbint_RemoveMapping_state);
3104         NTSTATUS status;
3105         TALLOC_CTX *mem_ctx;
3106
3107         if (state->out_mem_ctx) {
3108                 mem_ctx = state->out_mem_ctx;
3109         } else {
3110                 mem_ctx = state;
3111         }
3112
3113         status = state->dispatch_recv(subreq, mem_ctx);
3114         TALLOC_FREE(subreq);
3115         if (!NT_STATUS_IS_OK(status)) {
3116                 tevent_req_nterror(req, status);
3117                 return;
3118         }
3119
3120         /* Copy out parameters */
3121
3122         /* Copy result */
3123         state->orig.out.result = state->tmp.out.result;
3124
3125         /* Reset temporary structure */
3126         ZERO_STRUCT(state->tmp);
3127
3128         tevent_req_done(req);
3129 }
3130
3131 NTSTATUS rpccli_wbint_RemoveMapping_recv(struct tevent_req *req,
3132                                          TALLOC_CTX *mem_ctx,
3133                                          NTSTATUS *result)
3134 {
3135         struct rpccli_wbint_RemoveMapping_state *state = tevent_req_data(
3136                 req, struct rpccli_wbint_RemoveMapping_state);
3137         NTSTATUS status;
3138
3139         if (tevent_req_is_nterror(req, &status)) {
3140                 tevent_req_received(req);
3141                 return status;
3142         }
3143
3144         /* Steal possbile out parameters to the callers context */
3145         talloc_steal(mem_ctx, state->out_mem_ctx);
3146
3147         /* Return result */
3148         *result = state->orig.out.result;
3149
3150         tevent_req_received(req);
3151         return NT_STATUS_OK;
3152 }
3153
3154 NTSTATUS rpccli_wbint_RemoveMapping(struct rpc_pipe_client *cli,
3155                                     TALLOC_CTX *mem_ctx,
3156                                     struct dom_sid *sid /* [in] [ref] */,
3157                                     enum wbint_IdType type /* [in]  */,
3158                                     uint64_t id /* [in]  */)
3159 {
3160         struct wbint_RemoveMapping r;
3161         NTSTATUS status;
3162
3163         /* In parameters */
3164         r.in.sid = sid;
3165         r.in.type = type;
3166         r.in.id = id;
3167
3168         status = cli->dispatch(cli,
3169                                 mem_ctx,
3170                                 &ndr_table_wbint,
3171                                 NDR_WBINT_REMOVEMAPPING,
3172                                 &r);
3173
3174         if (!NT_STATUS_IS_OK(status)) {
3175                 return status;
3176         }
3177
3178         if (NT_STATUS_IS_ERR(status)) {
3179                 return status;
3180         }
3181
3182         /* Return variables */
3183
3184         /* Return result */
3185         return r.out.result;
3186 }
3187
3188 struct rpccli_wbint_SetHWM_state {
3189         struct wbint_SetHWM orig;
3190         struct wbint_SetHWM tmp;
3191         TALLOC_CTX *out_mem_ctx;
3192         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3193 };
3194
3195 static void rpccli_wbint_SetHWM_done(struct tevent_req *subreq);
3196
3197 struct tevent_req *rpccli_wbint_SetHWM_send(TALLOC_CTX *mem_ctx,
3198                                             struct tevent_context *ev,
3199                                             struct rpc_pipe_client *cli,
3200                                             enum wbint_IdType _type /* [in]  */,
3201                                             uint64_t _id /* [in]  */)
3202 {
3203         struct tevent_req *req;
3204         struct rpccli_wbint_SetHWM_state *state;
3205         struct tevent_req *subreq;
3206
3207         req = tevent_req_create(mem_ctx, &state,
3208                                 struct rpccli_wbint_SetHWM_state);
3209         if (req == NULL) {
3210                 return NULL;
3211         }
3212         state->out_mem_ctx = NULL;
3213         state->dispatch_recv = cli->dispatch_recv;
3214
3215         /* In parameters */
3216         state->orig.in.type = _type;
3217         state->orig.in.id = _id;
3218
3219         /* Out parameters */
3220
3221         /* Result */
3222         ZERO_STRUCT(state->orig.out.result);
3223
3224         /* make a temporary copy, that we pass to the dispatch function */
3225         state->tmp = state->orig;
3226
3227         subreq = cli->dispatch_send(state, ev, cli,
3228                                     &ndr_table_wbint,
3229                                     NDR_WBINT_SETHWM,
3230                                     &state->tmp);
3231         if (tevent_req_nomem(subreq, req)) {
3232                 return tevent_req_post(req, ev);
3233         }
3234         tevent_req_set_callback(subreq, rpccli_wbint_SetHWM_done, req);
3235         return req;
3236 }
3237
3238 static void rpccli_wbint_SetHWM_done(struct tevent_req *subreq)
3239 {
3240         struct tevent_req *req = tevent_req_callback_data(
3241                 subreq, struct tevent_req);
3242         struct rpccli_wbint_SetHWM_state *state = tevent_req_data(
3243                 req, struct rpccli_wbint_SetHWM_state);
3244         NTSTATUS status;
3245         TALLOC_CTX *mem_ctx;
3246
3247         if (state->out_mem_ctx) {
3248                 mem_ctx = state->out_mem_ctx;
3249         } else {
3250                 mem_ctx = state;
3251         }
3252
3253         status = state->dispatch_recv(subreq, mem_ctx);
3254         TALLOC_FREE(subreq);
3255         if (!NT_STATUS_IS_OK(status)) {
3256                 tevent_req_nterror(req, status);
3257                 return;
3258         }
3259
3260         /* Copy out parameters */
3261
3262         /* Copy result */
3263         state->orig.out.result = state->tmp.out.result;
3264
3265         /* Reset temporary structure */
3266         ZERO_STRUCT(state->tmp);
3267
3268         tevent_req_done(req);
3269 }
3270
3271 NTSTATUS rpccli_wbint_SetHWM_recv(struct tevent_req *req,
3272                                   TALLOC_CTX *mem_ctx,
3273                                   NTSTATUS *result)
3274 {
3275         struct rpccli_wbint_SetHWM_state *state = tevent_req_data(
3276                 req, struct rpccli_wbint_SetHWM_state);
3277         NTSTATUS status;
3278
3279         if (tevent_req_is_nterror(req, &status)) {
3280                 tevent_req_received(req);
3281                 return status;
3282         }
3283
3284         /* Steal possbile out parameters to the callers context */
3285         talloc_steal(mem_ctx, state->out_mem_ctx);
3286
3287         /* Return result */
3288         *result = state->orig.out.result;
3289
3290         tevent_req_received(req);
3291         return NT_STATUS_OK;
3292 }
3293
3294 NTSTATUS rpccli_wbint_SetHWM(struct rpc_pipe_client *cli,
3295                              TALLOC_CTX *mem_ctx,
3296                              enum wbint_IdType type /* [in]  */,
3297                              uint64_t id /* [in]  */)
3298 {
3299         struct wbint_SetHWM r;
3300         NTSTATUS status;
3301
3302         /* In parameters */
3303         r.in.type = type;
3304         r.in.id = id;
3305
3306         status = cli->dispatch(cli,
3307                                 mem_ctx,
3308                                 &ndr_table_wbint,
3309                                 NDR_WBINT_SETHWM,
3310                                 &r);
3311
3312         if (!NT_STATUS_IS_OK(status)) {
3313                 return status;
3314         }
3315
3316         if (NT_STATUS_IS_ERR(status)) {
3317                 return status;
3318         }
3319
3320         /* Return variables */
3321
3322         /* Return result */
3323         return r.out.result;
3324 }
3325