librpc: rerun "make idl"
[amitay/samba.git] / librpc / gen_ndr / cli_wkssvc.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_wkssvc.h"
8
9 struct rpccli_wkssvc_NetWkstaGetInfo_state {
10         struct wkssvc_NetWkstaGetInfo orig;
11         struct wkssvc_NetWkstaGetInfo 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_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq);
17
18 struct tevent_req *rpccli_wkssvc_NetWkstaGetInfo_send(TALLOC_CTX *mem_ctx,
19                                                       struct tevent_context *ev,
20                                                       struct rpc_pipe_client *cli,
21                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
22                                                       uint32_t _level /* [in]  */,
23                                                       union wkssvc_NetWkstaInfo *_info /* [out] [ref,switch_is(level)] */)
24 {
25         struct tevent_req *req;
26         struct rpccli_wkssvc_NetWkstaGetInfo_state *state;
27         struct tevent_req *subreq;
28
29         req = tevent_req_create(mem_ctx, &state,
30                                 struct rpccli_wkssvc_NetWkstaGetInfo_state);
31         if (req == NULL) {
32                 return NULL;
33         }
34         state->out_mem_ctx = NULL;
35         state->dispatch_recv = cli->dispatch_recv;
36
37         /* In parameters */
38         state->orig.in.server_name = _server_name;
39         state->orig.in.level = _level;
40
41         /* Out parameters */
42         state->orig.out.info = _info;
43
44         /* Result */
45         ZERO_STRUCT(state->orig.out.result);
46
47         if (DEBUGLEVEL >= 10) {
48                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
49         }
50
51         state->out_mem_ctx = talloc_named_const(state, 0,
52                              "rpccli_wkssvc_NetWkstaGetInfo_out_memory");
53         if (tevent_req_nomem(state->out_mem_ctx, req)) {
54                 return tevent_req_post(req, ev);
55         }
56
57         /* make a temporary copy, that we pass to the dispatch function */
58         state->tmp = state->orig;
59
60         subreq = cli->dispatch_send(state, ev, cli,
61                                     &ndr_table_wkssvc,
62                                     NDR_WKSSVC_NETWKSTAGETINFO,
63                                     &state->tmp);
64         if (tevent_req_nomem(subreq, req)) {
65                 return tevent_req_post(req, ev);
66         }
67         tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaGetInfo_done, req);
68         return req;
69 }
70
71 static void rpccli_wkssvc_NetWkstaGetInfo_done(struct tevent_req *subreq)
72 {
73         struct tevent_req *req = tevent_req_callback_data(
74                 subreq, struct tevent_req);
75         struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
76                 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
77         NTSTATUS status;
78         TALLOC_CTX *mem_ctx;
79
80         if (state->out_mem_ctx) {
81                 mem_ctx = state->out_mem_ctx;
82         } else {
83                 mem_ctx = state;
84         }
85
86         status = state->dispatch_recv(subreq, mem_ctx);
87         TALLOC_FREE(subreq);
88         if (!NT_STATUS_IS_OK(status)) {
89                 tevent_req_nterror(req, status);
90                 return;
91         }
92
93         /* Copy out parameters */
94         *state->orig.out.info = *state->tmp.out.info;
95
96         /* Copy result */
97         state->orig.out.result = state->tmp.out.result;
98
99         /* Reset temporary structure */
100         ZERO_STRUCT(state->tmp);
101
102         if (DEBUGLEVEL >= 10) {
103                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &state->orig);
104         }
105
106         tevent_req_done(req);
107 }
108
109 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo_recv(struct tevent_req *req,
110                                             TALLOC_CTX *mem_ctx,
111                                             WERROR *result)
112 {
113         struct rpccli_wkssvc_NetWkstaGetInfo_state *state = tevent_req_data(
114                 req, struct rpccli_wkssvc_NetWkstaGetInfo_state);
115         NTSTATUS status;
116
117         if (tevent_req_is_nterror(req, &status)) {
118                 tevent_req_received(req);
119                 return status;
120         }
121
122         /* Steal possbile out parameters to the callers context */
123         talloc_steal(mem_ctx, state->out_mem_ctx);
124
125         /* Return result */
126         *result = state->orig.out.result;
127
128         tevent_req_received(req);
129         return NT_STATUS_OK;
130 }
131
132 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
133                                        TALLOC_CTX *mem_ctx,
134                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
135                                        uint32_t level /* [in]  */,
136                                        union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */,
137                                        WERROR *werror)
138 {
139         struct wkssvc_NetWkstaGetInfo r;
140         NTSTATUS status;
141
142         /* In parameters */
143         r.in.server_name = server_name;
144         r.in.level = level;
145
146         if (DEBUGLEVEL >= 10) {
147                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &r);
148         }
149
150         status = cli->dispatch(cli,
151                                 mem_ctx,
152                                 &ndr_table_wkssvc,
153                                 NDR_WKSSVC_NETWKSTAGETINFO,
154                                 &r);
155
156         if (!NT_STATUS_IS_OK(status)) {
157                 return status;
158         }
159
160         if (DEBUGLEVEL >= 10) {
161                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r);
162         }
163
164         if (NT_STATUS_IS_ERR(status)) {
165                 return status;
166         }
167
168         /* Return variables */
169         *info = *r.out.info;
170
171         /* Return result */
172         if (werror) {
173                 *werror = r.out.result;
174         }
175
176         return werror_to_ntstatus(r.out.result);
177 }
178
179 struct rpccli_wkssvc_NetWkstaSetInfo_state {
180         struct wkssvc_NetWkstaSetInfo orig;
181         struct wkssvc_NetWkstaSetInfo tmp;
182         TALLOC_CTX *out_mem_ctx;
183         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
184 };
185
186 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq);
187
188 struct tevent_req *rpccli_wkssvc_NetWkstaSetInfo_send(TALLOC_CTX *mem_ctx,
189                                                       struct tevent_context *ev,
190                                                       struct rpc_pipe_client *cli,
191                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
192                                                       uint32_t _level /* [in]  */,
193                                                       union wkssvc_NetWkstaInfo *_info /* [in] [ref,switch_is(level)] */,
194                                                       uint32_t *_parm_error /* [in,out] [ref] */)
195 {
196         struct tevent_req *req;
197         struct rpccli_wkssvc_NetWkstaSetInfo_state *state;
198         struct tevent_req *subreq;
199
200         req = tevent_req_create(mem_ctx, &state,
201                                 struct rpccli_wkssvc_NetWkstaSetInfo_state);
202         if (req == NULL) {
203                 return NULL;
204         }
205         state->out_mem_ctx = NULL;
206         state->dispatch_recv = cli->dispatch_recv;
207
208         /* In parameters */
209         state->orig.in.server_name = _server_name;
210         state->orig.in.level = _level;
211         state->orig.in.info = _info;
212         state->orig.in.parm_error = _parm_error;
213
214         /* Out parameters */
215         state->orig.out.parm_error = _parm_error;
216
217         /* Result */
218         ZERO_STRUCT(state->orig.out.result);
219
220         if (DEBUGLEVEL >= 10) {
221                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
222         }
223
224         state->out_mem_ctx = talloc_named_const(state, 0,
225                              "rpccli_wkssvc_NetWkstaSetInfo_out_memory");
226         if (tevent_req_nomem(state->out_mem_ctx, req)) {
227                 return tevent_req_post(req, ev);
228         }
229
230         /* make a temporary copy, that we pass to the dispatch function */
231         state->tmp = state->orig;
232
233         subreq = cli->dispatch_send(state, ev, cli,
234                                     &ndr_table_wkssvc,
235                                     NDR_WKSSVC_NETWKSTASETINFO,
236                                     &state->tmp);
237         if (tevent_req_nomem(subreq, req)) {
238                 return tevent_req_post(req, ev);
239         }
240         tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaSetInfo_done, req);
241         return req;
242 }
243
244 static void rpccli_wkssvc_NetWkstaSetInfo_done(struct tevent_req *subreq)
245 {
246         struct tevent_req *req = tevent_req_callback_data(
247                 subreq, struct tevent_req);
248         struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
249                 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
250         NTSTATUS status;
251         TALLOC_CTX *mem_ctx;
252
253         if (state->out_mem_ctx) {
254                 mem_ctx = state->out_mem_ctx;
255         } else {
256                 mem_ctx = state;
257         }
258
259         status = state->dispatch_recv(subreq, mem_ctx);
260         TALLOC_FREE(subreq);
261         if (!NT_STATUS_IS_OK(status)) {
262                 tevent_req_nterror(req, status);
263                 return;
264         }
265
266         /* Copy out parameters */
267         *state->orig.out.parm_error = *state->tmp.out.parm_error;
268
269         /* Copy result */
270         state->orig.out.result = state->tmp.out.result;
271
272         /* Reset temporary structure */
273         ZERO_STRUCT(state->tmp);
274
275         if (DEBUGLEVEL >= 10) {
276                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &state->orig);
277         }
278
279         tevent_req_done(req);
280 }
281
282 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo_recv(struct tevent_req *req,
283                                             TALLOC_CTX *mem_ctx,
284                                             WERROR *result)
285 {
286         struct rpccli_wkssvc_NetWkstaSetInfo_state *state = tevent_req_data(
287                 req, struct rpccli_wkssvc_NetWkstaSetInfo_state);
288         NTSTATUS status;
289
290         if (tevent_req_is_nterror(req, &status)) {
291                 tevent_req_received(req);
292                 return status;
293         }
294
295         /* Steal possbile out parameters to the callers context */
296         talloc_steal(mem_ctx, state->out_mem_ctx);
297
298         /* Return result */
299         *result = state->orig.out.result;
300
301         tevent_req_received(req);
302         return NT_STATUS_OK;
303 }
304
305 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
306                                        TALLOC_CTX *mem_ctx,
307                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
308                                        uint32_t level /* [in]  */,
309                                        union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */,
310                                        uint32_t *parm_error /* [in,out] [ref] */,
311                                        WERROR *werror)
312 {
313         struct wkssvc_NetWkstaSetInfo r;
314         NTSTATUS status;
315
316         /* In parameters */
317         r.in.server_name = server_name;
318         r.in.level = level;
319         r.in.info = info;
320         r.in.parm_error = parm_error;
321
322         if (DEBUGLEVEL >= 10) {
323                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &r);
324         }
325
326         status = cli->dispatch(cli,
327                                 mem_ctx,
328                                 &ndr_table_wkssvc,
329                                 NDR_WKSSVC_NETWKSTASETINFO,
330                                 &r);
331
332         if (!NT_STATUS_IS_OK(status)) {
333                 return status;
334         }
335
336         if (DEBUGLEVEL >= 10) {
337                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r);
338         }
339
340         if (NT_STATUS_IS_ERR(status)) {
341                 return status;
342         }
343
344         /* Return variables */
345         *parm_error = *r.out.parm_error;
346
347         /* Return result */
348         if (werror) {
349                 *werror = r.out.result;
350         }
351
352         return werror_to_ntstatus(r.out.result);
353 }
354
355 struct rpccli_wkssvc_NetWkstaEnumUsers_state {
356         struct wkssvc_NetWkstaEnumUsers orig;
357         struct wkssvc_NetWkstaEnumUsers tmp;
358         TALLOC_CTX *out_mem_ctx;
359         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
360 };
361
362 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq);
363
364 struct tevent_req *rpccli_wkssvc_NetWkstaEnumUsers_send(TALLOC_CTX *mem_ctx,
365                                                         struct tevent_context *ev,
366                                                         struct rpc_pipe_client *cli,
367                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
368                                                         struct wkssvc_NetWkstaEnumUsersInfo *_info /* [in,out] [ref] */,
369                                                         uint32_t _prefmaxlen /* [in]  */,
370                                                         uint32_t *_entries_read /* [out] [ref] */,
371                                                         uint32_t *_resume_handle /* [in,out] [unique] */)
372 {
373         struct tevent_req *req;
374         struct rpccli_wkssvc_NetWkstaEnumUsers_state *state;
375         struct tevent_req *subreq;
376
377         req = tevent_req_create(mem_ctx, &state,
378                                 struct rpccli_wkssvc_NetWkstaEnumUsers_state);
379         if (req == NULL) {
380                 return NULL;
381         }
382         state->out_mem_ctx = NULL;
383         state->dispatch_recv = cli->dispatch_recv;
384
385         /* In parameters */
386         state->orig.in.server_name = _server_name;
387         state->orig.in.info = _info;
388         state->orig.in.prefmaxlen = _prefmaxlen;
389         state->orig.in.resume_handle = _resume_handle;
390
391         /* Out parameters */
392         state->orig.out.info = _info;
393         state->orig.out.entries_read = _entries_read;
394         state->orig.out.resume_handle = _resume_handle;
395
396         /* Result */
397         ZERO_STRUCT(state->orig.out.result);
398
399         if (DEBUGLEVEL >= 10) {
400                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
401         }
402
403         state->out_mem_ctx = talloc_named_const(state, 0,
404                              "rpccli_wkssvc_NetWkstaEnumUsers_out_memory");
405         if (tevent_req_nomem(state->out_mem_ctx, req)) {
406                 return tevent_req_post(req, ev);
407         }
408
409         /* make a temporary copy, that we pass to the dispatch function */
410         state->tmp = state->orig;
411
412         subreq = cli->dispatch_send(state, ev, cli,
413                                     &ndr_table_wkssvc,
414                                     NDR_WKSSVC_NETWKSTAENUMUSERS,
415                                     &state->tmp);
416         if (tevent_req_nomem(subreq, req)) {
417                 return tevent_req_post(req, ev);
418         }
419         tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaEnumUsers_done, req);
420         return req;
421 }
422
423 static void rpccli_wkssvc_NetWkstaEnumUsers_done(struct tevent_req *subreq)
424 {
425         struct tevent_req *req = tevent_req_callback_data(
426                 subreq, struct tevent_req);
427         struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
428                 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
429         NTSTATUS status;
430         TALLOC_CTX *mem_ctx;
431
432         if (state->out_mem_ctx) {
433                 mem_ctx = state->out_mem_ctx;
434         } else {
435                 mem_ctx = state;
436         }
437
438         status = state->dispatch_recv(subreq, mem_ctx);
439         TALLOC_FREE(subreq);
440         if (!NT_STATUS_IS_OK(status)) {
441                 tevent_req_nterror(req, status);
442                 return;
443         }
444
445         /* Copy out parameters */
446         *state->orig.out.info = *state->tmp.out.info;
447         *state->orig.out.entries_read = *state->tmp.out.entries_read;
448         if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
449                 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
450         }
451
452         /* Copy result */
453         state->orig.out.result = state->tmp.out.result;
454
455         /* Reset temporary structure */
456         ZERO_STRUCT(state->tmp);
457
458         if (DEBUGLEVEL >= 10) {
459                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &state->orig);
460         }
461
462         tevent_req_done(req);
463 }
464
465 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers_recv(struct tevent_req *req,
466                                               TALLOC_CTX *mem_ctx,
467                                               WERROR *result)
468 {
469         struct rpccli_wkssvc_NetWkstaEnumUsers_state *state = tevent_req_data(
470                 req, struct rpccli_wkssvc_NetWkstaEnumUsers_state);
471         NTSTATUS status;
472
473         if (tevent_req_is_nterror(req, &status)) {
474                 tevent_req_received(req);
475                 return status;
476         }
477
478         /* Steal possbile out parameters to the callers context */
479         talloc_steal(mem_ctx, state->out_mem_ctx);
480
481         /* Return result */
482         *result = state->orig.out.result;
483
484         tevent_req_received(req);
485         return NT_STATUS_OK;
486 }
487
488 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
489                                          TALLOC_CTX *mem_ctx,
490                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
491                                          struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */,
492                                          uint32_t prefmaxlen /* [in]  */,
493                                          uint32_t *entries_read /* [out] [ref] */,
494                                          uint32_t *resume_handle /* [in,out] [unique] */,
495                                          WERROR *werror)
496 {
497         struct wkssvc_NetWkstaEnumUsers r;
498         NTSTATUS status;
499
500         /* In parameters */
501         r.in.server_name = server_name;
502         r.in.info = info;
503         r.in.prefmaxlen = prefmaxlen;
504         r.in.resume_handle = resume_handle;
505
506         if (DEBUGLEVEL >= 10) {
507                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
508         }
509
510         status = cli->dispatch(cli,
511                                 mem_ctx,
512                                 &ndr_table_wkssvc,
513                                 NDR_WKSSVC_NETWKSTAENUMUSERS,
514                                 &r);
515
516         if (!NT_STATUS_IS_OK(status)) {
517                 return status;
518         }
519
520         if (DEBUGLEVEL >= 10) {
521                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
522         }
523
524         if (NT_STATUS_IS_ERR(status)) {
525                 return status;
526         }
527
528         /* Return variables */
529         *info = *r.out.info;
530         *entries_read = *r.out.entries_read;
531         if (resume_handle && r.out.resume_handle) {
532                 *resume_handle = *r.out.resume_handle;
533         }
534
535         /* Return result */
536         if (werror) {
537                 *werror = r.out.result;
538         }
539
540         return werror_to_ntstatus(r.out.result);
541 }
542
543 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state {
544         struct wkssvc_NetrWkstaUserGetInfo orig;
545         struct wkssvc_NetrWkstaUserGetInfo tmp;
546         TALLOC_CTX *out_mem_ctx;
547         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
548 };
549
550 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq);
551
552 struct tevent_req *rpccli_wkssvc_NetrWkstaUserGetInfo_send(TALLOC_CTX *mem_ctx,
553                                                            struct tevent_context *ev,
554                                                            struct rpc_pipe_client *cli,
555                                                            const char *_unknown /* [in] [unique,charset(UTF16)] */,
556                                                            uint32_t _level /* [in]  */,
557                                                            union wkssvc_NetrWkstaUserInfo *_info /* [out] [ref,switch_is(level)] */)
558 {
559         struct tevent_req *req;
560         struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state;
561         struct tevent_req *subreq;
562
563         req = tevent_req_create(mem_ctx, &state,
564                                 struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
565         if (req == NULL) {
566                 return NULL;
567         }
568         state->out_mem_ctx = NULL;
569         state->dispatch_recv = cli->dispatch_recv;
570
571         /* In parameters */
572         state->orig.in.unknown = _unknown;
573         state->orig.in.level = _level;
574
575         /* Out parameters */
576         state->orig.out.info = _info;
577
578         /* Result */
579         ZERO_STRUCT(state->orig.out.result);
580
581         if (DEBUGLEVEL >= 10) {
582                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
583         }
584
585         state->out_mem_ctx = talloc_named_const(state, 0,
586                              "rpccli_wkssvc_NetrWkstaUserGetInfo_out_memory");
587         if (tevent_req_nomem(state->out_mem_ctx, req)) {
588                 return tevent_req_post(req, ev);
589         }
590
591         /* make a temporary copy, that we pass to the dispatch function */
592         state->tmp = state->orig;
593
594         subreq = cli->dispatch_send(state, ev, cli,
595                                     &ndr_table_wkssvc,
596                                     NDR_WKSSVC_NETRWKSTAUSERGETINFO,
597                                     &state->tmp);
598         if (tevent_req_nomem(subreq, req)) {
599                 return tevent_req_post(req, ev);
600         }
601         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserGetInfo_done, req);
602         return req;
603 }
604
605 static void rpccli_wkssvc_NetrWkstaUserGetInfo_done(struct tevent_req *subreq)
606 {
607         struct tevent_req *req = tevent_req_callback_data(
608                 subreq, struct tevent_req);
609         struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
610                 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
611         NTSTATUS status;
612         TALLOC_CTX *mem_ctx;
613
614         if (state->out_mem_ctx) {
615                 mem_ctx = state->out_mem_ctx;
616         } else {
617                 mem_ctx = state;
618         }
619
620         status = state->dispatch_recv(subreq, mem_ctx);
621         TALLOC_FREE(subreq);
622         if (!NT_STATUS_IS_OK(status)) {
623                 tevent_req_nterror(req, status);
624                 return;
625         }
626
627         /* Copy out parameters */
628         *state->orig.out.info = *state->tmp.out.info;
629
630         /* Copy result */
631         state->orig.out.result = state->tmp.out.result;
632
633         /* Reset temporary structure */
634         ZERO_STRUCT(state->tmp);
635
636         if (DEBUGLEVEL >= 10) {
637                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &state->orig);
638         }
639
640         tevent_req_done(req);
641 }
642
643 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo_recv(struct tevent_req *req,
644                                                  TALLOC_CTX *mem_ctx,
645                                                  WERROR *result)
646 {
647         struct rpccli_wkssvc_NetrWkstaUserGetInfo_state *state = tevent_req_data(
648                 req, struct rpccli_wkssvc_NetrWkstaUserGetInfo_state);
649         NTSTATUS status;
650
651         if (tevent_req_is_nterror(req, &status)) {
652                 tevent_req_received(req);
653                 return status;
654         }
655
656         /* Steal possbile out parameters to the callers context */
657         talloc_steal(mem_ctx, state->out_mem_ctx);
658
659         /* Return result */
660         *result = state->orig.out.result;
661
662         tevent_req_received(req);
663         return NT_STATUS_OK;
664 }
665
666 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
667                                             TALLOC_CTX *mem_ctx,
668                                             const char *unknown /* [in] [unique,charset(UTF16)] */,
669                                             uint32_t level /* [in]  */,
670                                             union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */,
671                                             WERROR *werror)
672 {
673         struct wkssvc_NetrWkstaUserGetInfo r;
674         NTSTATUS status;
675
676         /* In parameters */
677         r.in.unknown = unknown;
678         r.in.level = level;
679
680         if (DEBUGLEVEL >= 10) {
681                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
682         }
683
684         status = cli->dispatch(cli,
685                                 mem_ctx,
686                                 &ndr_table_wkssvc,
687                                 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
688                                 &r);
689
690         if (!NT_STATUS_IS_OK(status)) {
691                 return status;
692         }
693
694         if (DEBUGLEVEL >= 10) {
695                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
696         }
697
698         if (NT_STATUS_IS_ERR(status)) {
699                 return status;
700         }
701
702         /* Return variables */
703         *info = *r.out.info;
704
705         /* Return result */
706         if (werror) {
707                 *werror = r.out.result;
708         }
709
710         return werror_to_ntstatus(r.out.result);
711 }
712
713 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state {
714         struct wkssvc_NetrWkstaUserSetInfo orig;
715         struct wkssvc_NetrWkstaUserSetInfo tmp;
716         TALLOC_CTX *out_mem_ctx;
717         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
718 };
719
720 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq);
721
722 struct tevent_req *rpccli_wkssvc_NetrWkstaUserSetInfo_send(TALLOC_CTX *mem_ctx,
723                                                            struct tevent_context *ev,
724                                                            struct rpc_pipe_client *cli,
725                                                            const char *_unknown /* [in] [unique,charset(UTF16)] */,
726                                                            uint32_t _level /* [in]  */,
727                                                            union wkssvc_NetrWkstaUserInfo *_info /* [in] [ref,switch_is(level)] */,
728                                                            uint32_t *_parm_err /* [in,out] [unique] */)
729 {
730         struct tevent_req *req;
731         struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state;
732         struct tevent_req *subreq;
733
734         req = tevent_req_create(mem_ctx, &state,
735                                 struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
736         if (req == NULL) {
737                 return NULL;
738         }
739         state->out_mem_ctx = NULL;
740         state->dispatch_recv = cli->dispatch_recv;
741
742         /* In parameters */
743         state->orig.in.unknown = _unknown;
744         state->orig.in.level = _level;
745         state->orig.in.info = _info;
746         state->orig.in.parm_err = _parm_err;
747
748         /* Out parameters */
749         state->orig.out.parm_err = _parm_err;
750
751         /* Result */
752         ZERO_STRUCT(state->orig.out.result);
753
754         if (DEBUGLEVEL >= 10) {
755                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
756         }
757
758         state->out_mem_ctx = talloc_named_const(state, 0,
759                              "rpccli_wkssvc_NetrWkstaUserSetInfo_out_memory");
760         if (tevent_req_nomem(state->out_mem_ctx, req)) {
761                 return tevent_req_post(req, ev);
762         }
763
764         /* make a temporary copy, that we pass to the dispatch function */
765         state->tmp = state->orig;
766
767         subreq = cli->dispatch_send(state, ev, cli,
768                                     &ndr_table_wkssvc,
769                                     NDR_WKSSVC_NETRWKSTAUSERSETINFO,
770                                     &state->tmp);
771         if (tevent_req_nomem(subreq, req)) {
772                 return tevent_req_post(req, ev);
773         }
774         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaUserSetInfo_done, req);
775         return req;
776 }
777
778 static void rpccli_wkssvc_NetrWkstaUserSetInfo_done(struct tevent_req *subreq)
779 {
780         struct tevent_req *req = tevent_req_callback_data(
781                 subreq, struct tevent_req);
782         struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
783                 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
784         NTSTATUS status;
785         TALLOC_CTX *mem_ctx;
786
787         if (state->out_mem_ctx) {
788                 mem_ctx = state->out_mem_ctx;
789         } else {
790                 mem_ctx = state;
791         }
792
793         status = state->dispatch_recv(subreq, mem_ctx);
794         TALLOC_FREE(subreq);
795         if (!NT_STATUS_IS_OK(status)) {
796                 tevent_req_nterror(req, status);
797                 return;
798         }
799
800         /* Copy out parameters */
801         if (state->orig.out.parm_err && state->tmp.out.parm_err) {
802                 *state->orig.out.parm_err = *state->tmp.out.parm_err;
803         }
804
805         /* Copy result */
806         state->orig.out.result = state->tmp.out.result;
807
808         /* Reset temporary structure */
809         ZERO_STRUCT(state->tmp);
810
811         if (DEBUGLEVEL >= 10) {
812                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &state->orig);
813         }
814
815         tevent_req_done(req);
816 }
817
818 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo_recv(struct tevent_req *req,
819                                                  TALLOC_CTX *mem_ctx,
820                                                  WERROR *result)
821 {
822         struct rpccli_wkssvc_NetrWkstaUserSetInfo_state *state = tevent_req_data(
823                 req, struct rpccli_wkssvc_NetrWkstaUserSetInfo_state);
824         NTSTATUS status;
825
826         if (tevent_req_is_nterror(req, &status)) {
827                 tevent_req_received(req);
828                 return status;
829         }
830
831         /* Steal possbile out parameters to the callers context */
832         talloc_steal(mem_ctx, state->out_mem_ctx);
833
834         /* Return result */
835         *result = state->orig.out.result;
836
837         tevent_req_received(req);
838         return NT_STATUS_OK;
839 }
840
841 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
842                                             TALLOC_CTX *mem_ctx,
843                                             const char *unknown /* [in] [unique,charset(UTF16)] */,
844                                             uint32_t level /* [in]  */,
845                                             union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */,
846                                             uint32_t *parm_err /* [in,out] [unique] */,
847                                             WERROR *werror)
848 {
849         struct wkssvc_NetrWkstaUserSetInfo r;
850         NTSTATUS status;
851
852         /* In parameters */
853         r.in.unknown = unknown;
854         r.in.level = level;
855         r.in.info = info;
856         r.in.parm_err = parm_err;
857
858         if (DEBUGLEVEL >= 10) {
859                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
860         }
861
862         status = cli->dispatch(cli,
863                                 mem_ctx,
864                                 &ndr_table_wkssvc,
865                                 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
866                                 &r);
867
868         if (!NT_STATUS_IS_OK(status)) {
869                 return status;
870         }
871
872         if (DEBUGLEVEL >= 10) {
873                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
874         }
875
876         if (NT_STATUS_IS_ERR(status)) {
877                 return status;
878         }
879
880         /* Return variables */
881         if (parm_err && r.out.parm_err) {
882                 *parm_err = *r.out.parm_err;
883         }
884
885         /* Return result */
886         if (werror) {
887                 *werror = r.out.result;
888         }
889
890         return werror_to_ntstatus(r.out.result);
891 }
892
893 struct rpccli_wkssvc_NetWkstaTransportEnum_state {
894         struct wkssvc_NetWkstaTransportEnum orig;
895         struct wkssvc_NetWkstaTransportEnum tmp;
896         TALLOC_CTX *out_mem_ctx;
897         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
898 };
899
900 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq);
901
902 struct tevent_req *rpccli_wkssvc_NetWkstaTransportEnum_send(TALLOC_CTX *mem_ctx,
903                                                             struct tevent_context *ev,
904                                                             struct rpc_pipe_client *cli,
905                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
906                                                             struct wkssvc_NetWkstaTransportInfo *_info /* [in,out] [ref] */,
907                                                             uint32_t _max_buffer /* [in]  */,
908                                                             uint32_t *_total_entries /* [out] [ref] */,
909                                                             uint32_t *_resume_handle /* [in,out] [unique] */)
910 {
911         struct tevent_req *req;
912         struct rpccli_wkssvc_NetWkstaTransportEnum_state *state;
913         struct tevent_req *subreq;
914
915         req = tevent_req_create(mem_ctx, &state,
916                                 struct rpccli_wkssvc_NetWkstaTransportEnum_state);
917         if (req == NULL) {
918                 return NULL;
919         }
920         state->out_mem_ctx = NULL;
921         state->dispatch_recv = cli->dispatch_recv;
922
923         /* In parameters */
924         state->orig.in.server_name = _server_name;
925         state->orig.in.info = _info;
926         state->orig.in.max_buffer = _max_buffer;
927         state->orig.in.resume_handle = _resume_handle;
928
929         /* Out parameters */
930         state->orig.out.info = _info;
931         state->orig.out.total_entries = _total_entries;
932         state->orig.out.resume_handle = _resume_handle;
933
934         /* Result */
935         ZERO_STRUCT(state->orig.out.result);
936
937         if (DEBUGLEVEL >= 10) {
938                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
939         }
940
941         state->out_mem_ctx = talloc_named_const(state, 0,
942                              "rpccli_wkssvc_NetWkstaTransportEnum_out_memory");
943         if (tevent_req_nomem(state->out_mem_ctx, req)) {
944                 return tevent_req_post(req, ev);
945         }
946
947         /* make a temporary copy, that we pass to the dispatch function */
948         state->tmp = state->orig;
949
950         subreq = cli->dispatch_send(state, ev, cli,
951                                     &ndr_table_wkssvc,
952                                     NDR_WKSSVC_NETWKSTATRANSPORTENUM,
953                                     &state->tmp);
954         if (tevent_req_nomem(subreq, req)) {
955                 return tevent_req_post(req, ev);
956         }
957         tevent_req_set_callback(subreq, rpccli_wkssvc_NetWkstaTransportEnum_done, req);
958         return req;
959 }
960
961 static void rpccli_wkssvc_NetWkstaTransportEnum_done(struct tevent_req *subreq)
962 {
963         struct tevent_req *req = tevent_req_callback_data(
964                 subreq, struct tevent_req);
965         struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
966                 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
967         NTSTATUS status;
968         TALLOC_CTX *mem_ctx;
969
970         if (state->out_mem_ctx) {
971                 mem_ctx = state->out_mem_ctx;
972         } else {
973                 mem_ctx = state;
974         }
975
976         status = state->dispatch_recv(subreq, mem_ctx);
977         TALLOC_FREE(subreq);
978         if (!NT_STATUS_IS_OK(status)) {
979                 tevent_req_nterror(req, status);
980                 return;
981         }
982
983         /* Copy out parameters */
984         *state->orig.out.info = *state->tmp.out.info;
985         *state->orig.out.total_entries = *state->tmp.out.total_entries;
986         if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
987                 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
988         }
989
990         /* Copy result */
991         state->orig.out.result = state->tmp.out.result;
992
993         /* Reset temporary structure */
994         ZERO_STRUCT(state->tmp);
995
996         if (DEBUGLEVEL >= 10) {
997                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &state->orig);
998         }
999
1000         tevent_req_done(req);
1001 }
1002
1003 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum_recv(struct tevent_req *req,
1004                                                   TALLOC_CTX *mem_ctx,
1005                                                   WERROR *result)
1006 {
1007         struct rpccli_wkssvc_NetWkstaTransportEnum_state *state = tevent_req_data(
1008                 req, struct rpccli_wkssvc_NetWkstaTransportEnum_state);
1009         NTSTATUS status;
1010
1011         if (tevent_req_is_nterror(req, &status)) {
1012                 tevent_req_received(req);
1013                 return status;
1014         }
1015
1016         /* Steal possbile out parameters to the callers context */
1017         talloc_steal(mem_ctx, state->out_mem_ctx);
1018
1019         /* Return result */
1020         *result = state->orig.out.result;
1021
1022         tevent_req_received(req);
1023         return NT_STATUS_OK;
1024 }
1025
1026 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
1027                                              TALLOC_CTX *mem_ctx,
1028                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
1029                                              struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
1030                                              uint32_t max_buffer /* [in]  */,
1031                                              uint32_t *total_entries /* [out] [ref] */,
1032                                              uint32_t *resume_handle /* [in,out] [unique] */,
1033                                              WERROR *werror)
1034 {
1035         struct wkssvc_NetWkstaTransportEnum r;
1036         NTSTATUS status;
1037
1038         /* In parameters */
1039         r.in.server_name = server_name;
1040         r.in.info = info;
1041         r.in.max_buffer = max_buffer;
1042         r.in.resume_handle = resume_handle;
1043
1044         if (DEBUGLEVEL >= 10) {
1045                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
1046         }
1047
1048         status = cli->dispatch(cli,
1049                                 mem_ctx,
1050                                 &ndr_table_wkssvc,
1051                                 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
1052                                 &r);
1053
1054         if (!NT_STATUS_IS_OK(status)) {
1055                 return status;
1056         }
1057
1058         if (DEBUGLEVEL >= 10) {
1059                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
1060         }
1061
1062         if (NT_STATUS_IS_ERR(status)) {
1063                 return status;
1064         }
1065
1066         /* Return variables */
1067         *info = *r.out.info;
1068         *total_entries = *r.out.total_entries;
1069         if (resume_handle && r.out.resume_handle) {
1070                 *resume_handle = *r.out.resume_handle;
1071         }
1072
1073         /* Return result */
1074         if (werror) {
1075                 *werror = r.out.result;
1076         }
1077
1078         return werror_to_ntstatus(r.out.result);
1079 }
1080
1081 struct rpccli_wkssvc_NetrWkstaTransportAdd_state {
1082         struct wkssvc_NetrWkstaTransportAdd orig;
1083         struct wkssvc_NetrWkstaTransportAdd tmp;
1084         TALLOC_CTX *out_mem_ctx;
1085         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1086 };
1087
1088 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq);
1089
1090 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportAdd_send(TALLOC_CTX *mem_ctx,
1091                                                             struct tevent_context *ev,
1092                                                             struct rpc_pipe_client *cli,
1093                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
1094                                                             uint32_t _level /* [in]  */,
1095                                                             struct wkssvc_NetWkstaTransportInfo0 *_info0 /* [in] [ref] */,
1096                                                             uint32_t *_parm_err /* [in,out] [unique] */)
1097 {
1098         struct tevent_req *req;
1099         struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state;
1100         struct tevent_req *subreq;
1101
1102         req = tevent_req_create(mem_ctx, &state,
1103                                 struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1104         if (req == NULL) {
1105                 return NULL;
1106         }
1107         state->out_mem_ctx = NULL;
1108         state->dispatch_recv = cli->dispatch_recv;
1109
1110         /* In parameters */
1111         state->orig.in.server_name = _server_name;
1112         state->orig.in.level = _level;
1113         state->orig.in.info0 = _info0;
1114         state->orig.in.parm_err = _parm_err;
1115
1116         /* Out parameters */
1117         state->orig.out.parm_err = _parm_err;
1118
1119         /* Result */
1120         ZERO_STRUCT(state->orig.out.result);
1121
1122         if (DEBUGLEVEL >= 10) {
1123                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
1124         }
1125
1126         state->out_mem_ctx = talloc_named_const(state, 0,
1127                              "rpccli_wkssvc_NetrWkstaTransportAdd_out_memory");
1128         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1129                 return tevent_req_post(req, ev);
1130         }
1131
1132         /* make a temporary copy, that we pass to the dispatch function */
1133         state->tmp = state->orig;
1134
1135         subreq = cli->dispatch_send(state, ev, cli,
1136                                     &ndr_table_wkssvc,
1137                                     NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1138                                     &state->tmp);
1139         if (tevent_req_nomem(subreq, req)) {
1140                 return tevent_req_post(req, ev);
1141         }
1142         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportAdd_done, req);
1143         return req;
1144 }
1145
1146 static void rpccli_wkssvc_NetrWkstaTransportAdd_done(struct tevent_req *subreq)
1147 {
1148         struct tevent_req *req = tevent_req_callback_data(
1149                 subreq, struct tevent_req);
1150         struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1151                 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1152         NTSTATUS status;
1153         TALLOC_CTX *mem_ctx;
1154
1155         if (state->out_mem_ctx) {
1156                 mem_ctx = state->out_mem_ctx;
1157         } else {
1158                 mem_ctx = state;
1159         }
1160
1161         status = state->dispatch_recv(subreq, mem_ctx);
1162         TALLOC_FREE(subreq);
1163         if (!NT_STATUS_IS_OK(status)) {
1164                 tevent_req_nterror(req, status);
1165                 return;
1166         }
1167
1168         /* Copy out parameters */
1169         if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1170                 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1171         }
1172
1173         /* Copy result */
1174         state->orig.out.result = state->tmp.out.result;
1175
1176         /* Reset temporary structure */
1177         ZERO_STRUCT(state->tmp);
1178
1179         if (DEBUGLEVEL >= 10) {
1180                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &state->orig);
1181         }
1182
1183         tevent_req_done(req);
1184 }
1185
1186 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd_recv(struct tevent_req *req,
1187                                                   TALLOC_CTX *mem_ctx,
1188                                                   WERROR *result)
1189 {
1190         struct rpccli_wkssvc_NetrWkstaTransportAdd_state *state = tevent_req_data(
1191                 req, struct rpccli_wkssvc_NetrWkstaTransportAdd_state);
1192         NTSTATUS status;
1193
1194         if (tevent_req_is_nterror(req, &status)) {
1195                 tevent_req_received(req);
1196                 return status;
1197         }
1198
1199         /* Steal possbile out parameters to the callers context */
1200         talloc_steal(mem_ctx, state->out_mem_ctx);
1201
1202         /* Return result */
1203         *result = state->orig.out.result;
1204
1205         tevent_req_received(req);
1206         return NT_STATUS_OK;
1207 }
1208
1209 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
1210                                              TALLOC_CTX *mem_ctx,
1211                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
1212                                              uint32_t level /* [in]  */,
1213                                              struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */,
1214                                              uint32_t *parm_err /* [in,out] [unique] */,
1215                                              WERROR *werror)
1216 {
1217         struct wkssvc_NetrWkstaTransportAdd r;
1218         NTSTATUS status;
1219
1220         /* In parameters */
1221         r.in.server_name = server_name;
1222         r.in.level = level;
1223         r.in.info0 = info0;
1224         r.in.parm_err = parm_err;
1225
1226         if (DEBUGLEVEL >= 10) {
1227                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
1228         }
1229
1230         status = cli->dispatch(cli,
1231                                 mem_ctx,
1232                                 &ndr_table_wkssvc,
1233                                 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
1234                                 &r);
1235
1236         if (!NT_STATUS_IS_OK(status)) {
1237                 return status;
1238         }
1239
1240         if (DEBUGLEVEL >= 10) {
1241                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
1242         }
1243
1244         if (NT_STATUS_IS_ERR(status)) {
1245                 return status;
1246         }
1247
1248         /* Return variables */
1249         if (parm_err && r.out.parm_err) {
1250                 *parm_err = *r.out.parm_err;
1251         }
1252
1253         /* Return result */
1254         if (werror) {
1255                 *werror = r.out.result;
1256         }
1257
1258         return werror_to_ntstatus(r.out.result);
1259 }
1260
1261 struct rpccli_wkssvc_NetrWkstaTransportDel_state {
1262         struct wkssvc_NetrWkstaTransportDel orig;
1263         struct wkssvc_NetrWkstaTransportDel tmp;
1264         TALLOC_CTX *out_mem_ctx;
1265         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1266 };
1267
1268 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq);
1269
1270 struct tevent_req *rpccli_wkssvc_NetrWkstaTransportDel_send(TALLOC_CTX *mem_ctx,
1271                                                             struct tevent_context *ev,
1272                                                             struct rpc_pipe_client *cli,
1273                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
1274                                                             const char *_transport_name /* [in] [unique,charset(UTF16)] */,
1275                                                             uint32_t _unknown3 /* [in]  */)
1276 {
1277         struct tevent_req *req;
1278         struct rpccli_wkssvc_NetrWkstaTransportDel_state *state;
1279         struct tevent_req *subreq;
1280
1281         req = tevent_req_create(mem_ctx, &state,
1282                                 struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1283         if (req == NULL) {
1284                 return NULL;
1285         }
1286         state->out_mem_ctx = NULL;
1287         state->dispatch_recv = cli->dispatch_recv;
1288
1289         /* In parameters */
1290         state->orig.in.server_name = _server_name;
1291         state->orig.in.transport_name = _transport_name;
1292         state->orig.in.unknown3 = _unknown3;
1293
1294         /* Out parameters */
1295
1296         /* Result */
1297         ZERO_STRUCT(state->orig.out.result);
1298
1299         if (DEBUGLEVEL >= 10) {
1300                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
1301         }
1302
1303         /* make a temporary copy, that we pass to the dispatch function */
1304         state->tmp = state->orig;
1305
1306         subreq = cli->dispatch_send(state, ev, cli,
1307                                     &ndr_table_wkssvc,
1308                                     NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1309                                     &state->tmp);
1310         if (tevent_req_nomem(subreq, req)) {
1311                 return tevent_req_post(req, ev);
1312         }
1313         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWkstaTransportDel_done, req);
1314         return req;
1315 }
1316
1317 static void rpccli_wkssvc_NetrWkstaTransportDel_done(struct tevent_req *subreq)
1318 {
1319         struct tevent_req *req = tevent_req_callback_data(
1320                 subreq, struct tevent_req);
1321         struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1322                 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1323         NTSTATUS status;
1324         TALLOC_CTX *mem_ctx;
1325
1326         if (state->out_mem_ctx) {
1327                 mem_ctx = state->out_mem_ctx;
1328         } else {
1329                 mem_ctx = state;
1330         }
1331
1332         status = state->dispatch_recv(subreq, mem_ctx);
1333         TALLOC_FREE(subreq);
1334         if (!NT_STATUS_IS_OK(status)) {
1335                 tevent_req_nterror(req, status);
1336                 return;
1337         }
1338
1339         /* Copy out parameters */
1340
1341         /* Copy result */
1342         state->orig.out.result = state->tmp.out.result;
1343
1344         /* Reset temporary structure */
1345         ZERO_STRUCT(state->tmp);
1346
1347         if (DEBUGLEVEL >= 10) {
1348                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &state->orig);
1349         }
1350
1351         tevent_req_done(req);
1352 }
1353
1354 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel_recv(struct tevent_req *req,
1355                                                   TALLOC_CTX *mem_ctx,
1356                                                   WERROR *result)
1357 {
1358         struct rpccli_wkssvc_NetrWkstaTransportDel_state *state = tevent_req_data(
1359                 req, struct rpccli_wkssvc_NetrWkstaTransportDel_state);
1360         NTSTATUS status;
1361
1362         if (tevent_req_is_nterror(req, &status)) {
1363                 tevent_req_received(req);
1364                 return status;
1365         }
1366
1367         /* Steal possbile out parameters to the callers context */
1368         talloc_steal(mem_ctx, state->out_mem_ctx);
1369
1370         /* Return result */
1371         *result = state->orig.out.result;
1372
1373         tevent_req_received(req);
1374         return NT_STATUS_OK;
1375 }
1376
1377 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
1378                                              TALLOC_CTX *mem_ctx,
1379                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
1380                                              const char *transport_name /* [in] [unique,charset(UTF16)] */,
1381                                              uint32_t unknown3 /* [in]  */,
1382                                              WERROR *werror)
1383 {
1384         struct wkssvc_NetrWkstaTransportDel r;
1385         NTSTATUS status;
1386
1387         /* In parameters */
1388         r.in.server_name = server_name;
1389         r.in.transport_name = transport_name;
1390         r.in.unknown3 = unknown3;
1391
1392         if (DEBUGLEVEL >= 10) {
1393                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
1394         }
1395
1396         status = cli->dispatch(cli,
1397                                 mem_ctx,
1398                                 &ndr_table_wkssvc,
1399                                 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
1400                                 &r);
1401
1402         if (!NT_STATUS_IS_OK(status)) {
1403                 return status;
1404         }
1405
1406         if (DEBUGLEVEL >= 10) {
1407                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
1408         }
1409
1410         if (NT_STATUS_IS_ERR(status)) {
1411                 return status;
1412         }
1413
1414         /* Return variables */
1415
1416         /* Return result */
1417         if (werror) {
1418                 *werror = r.out.result;
1419         }
1420
1421         return werror_to_ntstatus(r.out.result);
1422 }
1423
1424 struct rpccli_wkssvc_NetrUseAdd_state {
1425         struct wkssvc_NetrUseAdd orig;
1426         struct wkssvc_NetrUseAdd tmp;
1427         TALLOC_CTX *out_mem_ctx;
1428         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1429 };
1430
1431 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq);
1432
1433 struct tevent_req *rpccli_wkssvc_NetrUseAdd_send(TALLOC_CTX *mem_ctx,
1434                                                  struct tevent_context *ev,
1435                                                  struct rpc_pipe_client *cli,
1436                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
1437                                                  uint32_t _level /* [in]  */,
1438                                                  union wkssvc_NetrUseGetInfoCtr *_ctr /* [in] [ref,switch_is(level)] */,
1439                                                  uint32_t *_parm_err /* [in,out] [unique] */)
1440 {
1441         struct tevent_req *req;
1442         struct rpccli_wkssvc_NetrUseAdd_state *state;
1443         struct tevent_req *subreq;
1444
1445         req = tevent_req_create(mem_ctx, &state,
1446                                 struct rpccli_wkssvc_NetrUseAdd_state);
1447         if (req == NULL) {
1448                 return NULL;
1449         }
1450         state->out_mem_ctx = NULL;
1451         state->dispatch_recv = cli->dispatch_recv;
1452
1453         /* In parameters */
1454         state->orig.in.server_name = _server_name;
1455         state->orig.in.level = _level;
1456         state->orig.in.ctr = _ctr;
1457         state->orig.in.parm_err = _parm_err;
1458
1459         /* Out parameters */
1460         state->orig.out.parm_err = _parm_err;
1461
1462         /* Result */
1463         ZERO_STRUCT(state->orig.out.result);
1464
1465         if (DEBUGLEVEL >= 10) {
1466                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &state->orig);
1467         }
1468
1469         state->out_mem_ctx = talloc_named_const(state, 0,
1470                              "rpccli_wkssvc_NetrUseAdd_out_memory");
1471         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1472                 return tevent_req_post(req, ev);
1473         }
1474
1475         /* make a temporary copy, that we pass to the dispatch function */
1476         state->tmp = state->orig;
1477
1478         subreq = cli->dispatch_send(state, ev, cli,
1479                                     &ndr_table_wkssvc,
1480                                     NDR_WKSSVC_NETRUSEADD,
1481                                     &state->tmp);
1482         if (tevent_req_nomem(subreq, req)) {
1483                 return tevent_req_post(req, ev);
1484         }
1485         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseAdd_done, req);
1486         return req;
1487 }
1488
1489 static void rpccli_wkssvc_NetrUseAdd_done(struct tevent_req *subreq)
1490 {
1491         struct tevent_req *req = tevent_req_callback_data(
1492                 subreq, struct tevent_req);
1493         struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1494                 req, struct rpccli_wkssvc_NetrUseAdd_state);
1495         NTSTATUS status;
1496         TALLOC_CTX *mem_ctx;
1497
1498         if (state->out_mem_ctx) {
1499                 mem_ctx = state->out_mem_ctx;
1500         } else {
1501                 mem_ctx = state;
1502         }
1503
1504         status = state->dispatch_recv(subreq, mem_ctx);
1505         TALLOC_FREE(subreq);
1506         if (!NT_STATUS_IS_OK(status)) {
1507                 tevent_req_nterror(req, status);
1508                 return;
1509         }
1510
1511         /* Copy out parameters */
1512         if (state->orig.out.parm_err && state->tmp.out.parm_err) {
1513                 *state->orig.out.parm_err = *state->tmp.out.parm_err;
1514         }
1515
1516         /* Copy result */
1517         state->orig.out.result = state->tmp.out.result;
1518
1519         /* Reset temporary structure */
1520         ZERO_STRUCT(state->tmp);
1521
1522         if (DEBUGLEVEL >= 10) {
1523                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &state->orig);
1524         }
1525
1526         tevent_req_done(req);
1527 }
1528
1529 NTSTATUS rpccli_wkssvc_NetrUseAdd_recv(struct tevent_req *req,
1530                                        TALLOC_CTX *mem_ctx,
1531                                        WERROR *result)
1532 {
1533         struct rpccli_wkssvc_NetrUseAdd_state *state = tevent_req_data(
1534                 req, struct rpccli_wkssvc_NetrUseAdd_state);
1535         NTSTATUS status;
1536
1537         if (tevent_req_is_nterror(req, &status)) {
1538                 tevent_req_received(req);
1539                 return status;
1540         }
1541
1542         /* Steal possbile out parameters to the callers context */
1543         talloc_steal(mem_ctx, state->out_mem_ctx);
1544
1545         /* Return result */
1546         *result = state->orig.out.result;
1547
1548         tevent_req_received(req);
1549         return NT_STATUS_OK;
1550 }
1551
1552 NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
1553                                   TALLOC_CTX *mem_ctx,
1554                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
1555                                   uint32_t level /* [in]  */,
1556                                   union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */,
1557                                   uint32_t *parm_err /* [in,out] [unique] */,
1558                                   WERROR *werror)
1559 {
1560         struct wkssvc_NetrUseAdd r;
1561         NTSTATUS status;
1562
1563         /* In parameters */
1564         r.in.server_name = server_name;
1565         r.in.level = level;
1566         r.in.ctr = ctr;
1567         r.in.parm_err = parm_err;
1568
1569         if (DEBUGLEVEL >= 10) {
1570                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &r);
1571         }
1572
1573         status = cli->dispatch(cli,
1574                                 mem_ctx,
1575                                 &ndr_table_wkssvc,
1576                                 NDR_WKSSVC_NETRUSEADD,
1577                                 &r);
1578
1579         if (!NT_STATUS_IS_OK(status)) {
1580                 return status;
1581         }
1582
1583         if (DEBUGLEVEL >= 10) {
1584                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &r);
1585         }
1586
1587         if (NT_STATUS_IS_ERR(status)) {
1588                 return status;
1589         }
1590
1591         /* Return variables */
1592         if (parm_err && r.out.parm_err) {
1593                 *parm_err = *r.out.parm_err;
1594         }
1595
1596         /* Return result */
1597         if (werror) {
1598                 *werror = r.out.result;
1599         }
1600
1601         return werror_to_ntstatus(r.out.result);
1602 }
1603
1604 struct rpccli_wkssvc_NetrUseGetInfo_state {
1605         struct wkssvc_NetrUseGetInfo orig;
1606         struct wkssvc_NetrUseGetInfo tmp;
1607         TALLOC_CTX *out_mem_ctx;
1608         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1609 };
1610
1611 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq);
1612
1613 struct tevent_req *rpccli_wkssvc_NetrUseGetInfo_send(TALLOC_CTX *mem_ctx,
1614                                                      struct tevent_context *ev,
1615                                                      struct rpc_pipe_client *cli,
1616                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
1617                                                      const char *_use_name /* [in] [ref,charset(UTF16)] */,
1618                                                      uint32_t _level /* [in]  */,
1619                                                      union wkssvc_NetrUseGetInfoCtr *_ctr /* [out] [ref,switch_is(level)] */)
1620 {
1621         struct tevent_req *req;
1622         struct rpccli_wkssvc_NetrUseGetInfo_state *state;
1623         struct tevent_req *subreq;
1624
1625         req = tevent_req_create(mem_ctx, &state,
1626                                 struct rpccli_wkssvc_NetrUseGetInfo_state);
1627         if (req == NULL) {
1628                 return NULL;
1629         }
1630         state->out_mem_ctx = NULL;
1631         state->dispatch_recv = cli->dispatch_recv;
1632
1633         /* In parameters */
1634         state->orig.in.server_name = _server_name;
1635         state->orig.in.use_name = _use_name;
1636         state->orig.in.level = _level;
1637
1638         /* Out parameters */
1639         state->orig.out.ctr = _ctr;
1640
1641         /* Result */
1642         ZERO_STRUCT(state->orig.out.result);
1643
1644         if (DEBUGLEVEL >= 10) {
1645                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
1646         }
1647
1648         state->out_mem_ctx = talloc_named_const(state, 0,
1649                              "rpccli_wkssvc_NetrUseGetInfo_out_memory");
1650         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1651                 return tevent_req_post(req, ev);
1652         }
1653
1654         /* make a temporary copy, that we pass to the dispatch function */
1655         state->tmp = state->orig;
1656
1657         subreq = cli->dispatch_send(state, ev, cli,
1658                                     &ndr_table_wkssvc,
1659                                     NDR_WKSSVC_NETRUSEGETINFO,
1660                                     &state->tmp);
1661         if (tevent_req_nomem(subreq, req)) {
1662                 return tevent_req_post(req, ev);
1663         }
1664         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseGetInfo_done, req);
1665         return req;
1666 }
1667
1668 static void rpccli_wkssvc_NetrUseGetInfo_done(struct tevent_req *subreq)
1669 {
1670         struct tevent_req *req = tevent_req_callback_data(
1671                 subreq, struct tevent_req);
1672         struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1673                 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1674         NTSTATUS status;
1675         TALLOC_CTX *mem_ctx;
1676
1677         if (state->out_mem_ctx) {
1678                 mem_ctx = state->out_mem_ctx;
1679         } else {
1680                 mem_ctx = state;
1681         }
1682
1683         status = state->dispatch_recv(subreq, mem_ctx);
1684         TALLOC_FREE(subreq);
1685         if (!NT_STATUS_IS_OK(status)) {
1686                 tevent_req_nterror(req, status);
1687                 return;
1688         }
1689
1690         /* Copy out parameters */
1691         *state->orig.out.ctr = *state->tmp.out.ctr;
1692
1693         /* Copy result */
1694         state->orig.out.result = state->tmp.out.result;
1695
1696         /* Reset temporary structure */
1697         ZERO_STRUCT(state->tmp);
1698
1699         if (DEBUGLEVEL >= 10) {
1700                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &state->orig);
1701         }
1702
1703         tevent_req_done(req);
1704 }
1705
1706 NTSTATUS rpccli_wkssvc_NetrUseGetInfo_recv(struct tevent_req *req,
1707                                            TALLOC_CTX *mem_ctx,
1708                                            WERROR *result)
1709 {
1710         struct rpccli_wkssvc_NetrUseGetInfo_state *state = tevent_req_data(
1711                 req, struct rpccli_wkssvc_NetrUseGetInfo_state);
1712         NTSTATUS status;
1713
1714         if (tevent_req_is_nterror(req, &status)) {
1715                 tevent_req_received(req);
1716                 return status;
1717         }
1718
1719         /* Steal possbile out parameters to the callers context */
1720         talloc_steal(mem_ctx, state->out_mem_ctx);
1721
1722         /* Return result */
1723         *result = state->orig.out.result;
1724
1725         tevent_req_received(req);
1726         return NT_STATUS_OK;
1727 }
1728
1729 NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
1730                                       TALLOC_CTX *mem_ctx,
1731                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
1732                                       const char *use_name /* [in] [ref,charset(UTF16)] */,
1733                                       uint32_t level /* [in]  */,
1734                                       union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */,
1735                                       WERROR *werror)
1736 {
1737         struct wkssvc_NetrUseGetInfo r;
1738         NTSTATUS status;
1739
1740         /* In parameters */
1741         r.in.server_name = server_name;
1742         r.in.use_name = use_name;
1743         r.in.level = level;
1744
1745         if (DEBUGLEVEL >= 10) {
1746                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &r);
1747         }
1748
1749         status = cli->dispatch(cli,
1750                                 mem_ctx,
1751                                 &ndr_table_wkssvc,
1752                                 NDR_WKSSVC_NETRUSEGETINFO,
1753                                 &r);
1754
1755         if (!NT_STATUS_IS_OK(status)) {
1756                 return status;
1757         }
1758
1759         if (DEBUGLEVEL >= 10) {
1760                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &r);
1761         }
1762
1763         if (NT_STATUS_IS_ERR(status)) {
1764                 return status;
1765         }
1766
1767         /* Return variables */
1768         *ctr = *r.out.ctr;
1769
1770         /* Return result */
1771         if (werror) {
1772                 *werror = r.out.result;
1773         }
1774
1775         return werror_to_ntstatus(r.out.result);
1776 }
1777
1778 struct rpccli_wkssvc_NetrUseDel_state {
1779         struct wkssvc_NetrUseDel orig;
1780         struct wkssvc_NetrUseDel tmp;
1781         TALLOC_CTX *out_mem_ctx;
1782         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1783 };
1784
1785 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq);
1786
1787 struct tevent_req *rpccli_wkssvc_NetrUseDel_send(TALLOC_CTX *mem_ctx,
1788                                                  struct tevent_context *ev,
1789                                                  struct rpc_pipe_client *cli,
1790                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
1791                                                  const char *_use_name /* [in] [ref,charset(UTF16)] */,
1792                                                  uint32_t _force_cond /* [in]  */)
1793 {
1794         struct tevent_req *req;
1795         struct rpccli_wkssvc_NetrUseDel_state *state;
1796         struct tevent_req *subreq;
1797
1798         req = tevent_req_create(mem_ctx, &state,
1799                                 struct rpccli_wkssvc_NetrUseDel_state);
1800         if (req == NULL) {
1801                 return NULL;
1802         }
1803         state->out_mem_ctx = NULL;
1804         state->dispatch_recv = cli->dispatch_recv;
1805
1806         /* In parameters */
1807         state->orig.in.server_name = _server_name;
1808         state->orig.in.use_name = _use_name;
1809         state->orig.in.force_cond = _force_cond;
1810
1811         /* Out parameters */
1812
1813         /* Result */
1814         ZERO_STRUCT(state->orig.out.result);
1815
1816         if (DEBUGLEVEL >= 10) {
1817                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &state->orig);
1818         }
1819
1820         /* make a temporary copy, that we pass to the dispatch function */
1821         state->tmp = state->orig;
1822
1823         subreq = cli->dispatch_send(state, ev, cli,
1824                                     &ndr_table_wkssvc,
1825                                     NDR_WKSSVC_NETRUSEDEL,
1826                                     &state->tmp);
1827         if (tevent_req_nomem(subreq, req)) {
1828                 return tevent_req_post(req, ev);
1829         }
1830         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseDel_done, req);
1831         return req;
1832 }
1833
1834 static void rpccli_wkssvc_NetrUseDel_done(struct tevent_req *subreq)
1835 {
1836         struct tevent_req *req = tevent_req_callback_data(
1837                 subreq, struct tevent_req);
1838         struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1839                 req, struct rpccli_wkssvc_NetrUseDel_state);
1840         NTSTATUS status;
1841         TALLOC_CTX *mem_ctx;
1842
1843         if (state->out_mem_ctx) {
1844                 mem_ctx = state->out_mem_ctx;
1845         } else {
1846                 mem_ctx = state;
1847         }
1848
1849         status = state->dispatch_recv(subreq, mem_ctx);
1850         TALLOC_FREE(subreq);
1851         if (!NT_STATUS_IS_OK(status)) {
1852                 tevent_req_nterror(req, status);
1853                 return;
1854         }
1855
1856         /* Copy out parameters */
1857
1858         /* Copy result */
1859         state->orig.out.result = state->tmp.out.result;
1860
1861         /* Reset temporary structure */
1862         ZERO_STRUCT(state->tmp);
1863
1864         if (DEBUGLEVEL >= 10) {
1865                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &state->orig);
1866         }
1867
1868         tevent_req_done(req);
1869 }
1870
1871 NTSTATUS rpccli_wkssvc_NetrUseDel_recv(struct tevent_req *req,
1872                                        TALLOC_CTX *mem_ctx,
1873                                        WERROR *result)
1874 {
1875         struct rpccli_wkssvc_NetrUseDel_state *state = tevent_req_data(
1876                 req, struct rpccli_wkssvc_NetrUseDel_state);
1877         NTSTATUS status;
1878
1879         if (tevent_req_is_nterror(req, &status)) {
1880                 tevent_req_received(req);
1881                 return status;
1882         }
1883
1884         /* Steal possbile out parameters to the callers context */
1885         talloc_steal(mem_ctx, state->out_mem_ctx);
1886
1887         /* Return result */
1888         *result = state->orig.out.result;
1889
1890         tevent_req_received(req);
1891         return NT_STATUS_OK;
1892 }
1893
1894 NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
1895                                   TALLOC_CTX *mem_ctx,
1896                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
1897                                   const char *use_name /* [in] [ref,charset(UTF16)] */,
1898                                   uint32_t force_cond /* [in]  */,
1899                                   WERROR *werror)
1900 {
1901         struct wkssvc_NetrUseDel r;
1902         NTSTATUS status;
1903
1904         /* In parameters */
1905         r.in.server_name = server_name;
1906         r.in.use_name = use_name;
1907         r.in.force_cond = force_cond;
1908
1909         if (DEBUGLEVEL >= 10) {
1910                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &r);
1911         }
1912
1913         status = cli->dispatch(cli,
1914                                 mem_ctx,
1915                                 &ndr_table_wkssvc,
1916                                 NDR_WKSSVC_NETRUSEDEL,
1917                                 &r);
1918
1919         if (!NT_STATUS_IS_OK(status)) {
1920                 return status;
1921         }
1922
1923         if (DEBUGLEVEL >= 10) {
1924                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &r);
1925         }
1926
1927         if (NT_STATUS_IS_ERR(status)) {
1928                 return status;
1929         }
1930
1931         /* Return variables */
1932
1933         /* Return result */
1934         if (werror) {
1935                 *werror = r.out.result;
1936         }
1937
1938         return werror_to_ntstatus(r.out.result);
1939 }
1940
1941 struct rpccli_wkssvc_NetrUseEnum_state {
1942         struct wkssvc_NetrUseEnum orig;
1943         struct wkssvc_NetrUseEnum tmp;
1944         TALLOC_CTX *out_mem_ctx;
1945         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
1946 };
1947
1948 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq);
1949
1950 struct tevent_req *rpccli_wkssvc_NetrUseEnum_send(TALLOC_CTX *mem_ctx,
1951                                                   struct tevent_context *ev,
1952                                                   struct rpc_pipe_client *cli,
1953                                                   const char *_server_name /* [in] [unique,charset(UTF16)] */,
1954                                                   struct wkssvc_NetrUseEnumInfo *_info /* [in,out] [ref] */,
1955                                                   uint32_t _prefmaxlen /* [in]  */,
1956                                                   uint32_t *_entries_read /* [out] [ref] */,
1957                                                   uint32_t *_resume_handle /* [in,out] [unique] */)
1958 {
1959         struct tevent_req *req;
1960         struct rpccli_wkssvc_NetrUseEnum_state *state;
1961         struct tevent_req *subreq;
1962
1963         req = tevent_req_create(mem_ctx, &state,
1964                                 struct rpccli_wkssvc_NetrUseEnum_state);
1965         if (req == NULL) {
1966                 return NULL;
1967         }
1968         state->out_mem_ctx = NULL;
1969         state->dispatch_recv = cli->dispatch_recv;
1970
1971         /* In parameters */
1972         state->orig.in.server_name = _server_name;
1973         state->orig.in.info = _info;
1974         state->orig.in.prefmaxlen = _prefmaxlen;
1975         state->orig.in.resume_handle = _resume_handle;
1976
1977         /* Out parameters */
1978         state->orig.out.info = _info;
1979         state->orig.out.entries_read = _entries_read;
1980         state->orig.out.resume_handle = _resume_handle;
1981
1982         /* Result */
1983         ZERO_STRUCT(state->orig.out.result);
1984
1985         if (DEBUGLEVEL >= 10) {
1986                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &state->orig);
1987         }
1988
1989         state->out_mem_ctx = talloc_named_const(state, 0,
1990                              "rpccli_wkssvc_NetrUseEnum_out_memory");
1991         if (tevent_req_nomem(state->out_mem_ctx, req)) {
1992                 return tevent_req_post(req, ev);
1993         }
1994
1995         /* make a temporary copy, that we pass to the dispatch function */
1996         state->tmp = state->orig;
1997
1998         subreq = cli->dispatch_send(state, ev, cli,
1999                                     &ndr_table_wkssvc,
2000                                     NDR_WKSSVC_NETRUSEENUM,
2001                                     &state->tmp);
2002         if (tevent_req_nomem(subreq, req)) {
2003                 return tevent_req_post(req, ev);
2004         }
2005         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUseEnum_done, req);
2006         return req;
2007 }
2008
2009 static void rpccli_wkssvc_NetrUseEnum_done(struct tevent_req *subreq)
2010 {
2011         struct tevent_req *req = tevent_req_callback_data(
2012                 subreq, struct tevent_req);
2013         struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
2014                 req, struct rpccli_wkssvc_NetrUseEnum_state);
2015         NTSTATUS status;
2016         TALLOC_CTX *mem_ctx;
2017
2018         if (state->out_mem_ctx) {
2019                 mem_ctx = state->out_mem_ctx;
2020         } else {
2021                 mem_ctx = state;
2022         }
2023
2024         status = state->dispatch_recv(subreq, mem_ctx);
2025         TALLOC_FREE(subreq);
2026         if (!NT_STATUS_IS_OK(status)) {
2027                 tevent_req_nterror(req, status);
2028                 return;
2029         }
2030
2031         /* Copy out parameters */
2032         *state->orig.out.info = *state->tmp.out.info;
2033         *state->orig.out.entries_read = *state->tmp.out.entries_read;
2034         if (state->orig.out.resume_handle && state->tmp.out.resume_handle) {
2035                 *state->orig.out.resume_handle = *state->tmp.out.resume_handle;
2036         }
2037
2038         /* Copy result */
2039         state->orig.out.result = state->tmp.out.result;
2040
2041         /* Reset temporary structure */
2042         ZERO_STRUCT(state->tmp);
2043
2044         if (DEBUGLEVEL >= 10) {
2045                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &state->orig);
2046         }
2047
2048         tevent_req_done(req);
2049 }
2050
2051 NTSTATUS rpccli_wkssvc_NetrUseEnum_recv(struct tevent_req *req,
2052                                         TALLOC_CTX *mem_ctx,
2053                                         WERROR *result)
2054 {
2055         struct rpccli_wkssvc_NetrUseEnum_state *state = tevent_req_data(
2056                 req, struct rpccli_wkssvc_NetrUseEnum_state);
2057         NTSTATUS status;
2058
2059         if (tevent_req_is_nterror(req, &status)) {
2060                 tevent_req_received(req);
2061                 return status;
2062         }
2063
2064         /* Steal possbile out parameters to the callers context */
2065         talloc_steal(mem_ctx, state->out_mem_ctx);
2066
2067         /* Return result */
2068         *result = state->orig.out.result;
2069
2070         tevent_req_received(req);
2071         return NT_STATUS_OK;
2072 }
2073
2074 NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
2075                                    TALLOC_CTX *mem_ctx,
2076                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
2077                                    struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */,
2078                                    uint32_t prefmaxlen /* [in]  */,
2079                                    uint32_t *entries_read /* [out] [ref] */,
2080                                    uint32_t *resume_handle /* [in,out] [unique] */,
2081                                    WERROR *werror)
2082 {
2083         struct wkssvc_NetrUseEnum r;
2084         NTSTATUS status;
2085
2086         /* In parameters */
2087         r.in.server_name = server_name;
2088         r.in.info = info;
2089         r.in.prefmaxlen = prefmaxlen;
2090         r.in.resume_handle = resume_handle;
2091
2092         if (DEBUGLEVEL >= 10) {
2093                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &r);
2094         }
2095
2096         status = cli->dispatch(cli,
2097                                 mem_ctx,
2098                                 &ndr_table_wkssvc,
2099                                 NDR_WKSSVC_NETRUSEENUM,
2100                                 &r);
2101
2102         if (!NT_STATUS_IS_OK(status)) {
2103                 return status;
2104         }
2105
2106         if (DEBUGLEVEL >= 10) {
2107                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &r);
2108         }
2109
2110         if (NT_STATUS_IS_ERR(status)) {
2111                 return status;
2112         }
2113
2114         /* Return variables */
2115         *info = *r.out.info;
2116         *entries_read = *r.out.entries_read;
2117         if (resume_handle && r.out.resume_handle) {
2118                 *resume_handle = *r.out.resume_handle;
2119         }
2120
2121         /* Return result */
2122         if (werror) {
2123                 *werror = r.out.result;
2124         }
2125
2126         return werror_to_ntstatus(r.out.result);
2127 }
2128
2129 struct rpccli_wkssvc_NetrMessageBufferSend_state {
2130         struct wkssvc_NetrMessageBufferSend orig;
2131         struct wkssvc_NetrMessageBufferSend tmp;
2132         TALLOC_CTX *out_mem_ctx;
2133         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2134 };
2135
2136 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq);
2137
2138 struct tevent_req *rpccli_wkssvc_NetrMessageBufferSend_send(TALLOC_CTX *mem_ctx,
2139                                                             struct tevent_context *ev,
2140                                                             struct rpc_pipe_client *cli,
2141                                                             const char *_server_name /* [in] [unique,charset(UTF16)] */,
2142                                                             const char *_message_name /* [in] [ref,charset(UTF16)] */,
2143                                                             const char *_message_sender_name /* [in] [unique,charset(UTF16)] */,
2144                                                             uint8_t *_message_buffer /* [in] [ref,size_is(message_size)] */,
2145                                                             uint32_t _message_size /* [in]  */)
2146 {
2147         struct tevent_req *req;
2148         struct rpccli_wkssvc_NetrMessageBufferSend_state *state;
2149         struct tevent_req *subreq;
2150
2151         req = tevent_req_create(mem_ctx, &state,
2152                                 struct rpccli_wkssvc_NetrMessageBufferSend_state);
2153         if (req == NULL) {
2154                 return NULL;
2155         }
2156         state->out_mem_ctx = NULL;
2157         state->dispatch_recv = cli->dispatch_recv;
2158
2159         /* In parameters */
2160         state->orig.in.server_name = _server_name;
2161         state->orig.in.message_name = _message_name;
2162         state->orig.in.message_sender_name = _message_sender_name;
2163         state->orig.in.message_buffer = _message_buffer;
2164         state->orig.in.message_size = _message_size;
2165
2166         /* Out parameters */
2167
2168         /* Result */
2169         ZERO_STRUCT(state->orig.out.result);
2170
2171         if (DEBUGLEVEL >= 10) {
2172                 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
2173         }
2174
2175         /* make a temporary copy, that we pass to the dispatch function */
2176         state->tmp = state->orig;
2177
2178         subreq = cli->dispatch_send(state, ev, cli,
2179                                     &ndr_table_wkssvc,
2180                                     NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
2181                                     &state->tmp);
2182         if (tevent_req_nomem(subreq, req)) {
2183                 return tevent_req_post(req, ev);
2184         }
2185         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrMessageBufferSend_done, req);
2186         return req;
2187 }
2188
2189 static void rpccli_wkssvc_NetrMessageBufferSend_done(struct tevent_req *subreq)
2190 {
2191         struct tevent_req *req = tevent_req_callback_data(
2192                 subreq, struct tevent_req);
2193         struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
2194                 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
2195         NTSTATUS status;
2196         TALLOC_CTX *mem_ctx;
2197
2198         if (state->out_mem_ctx) {
2199                 mem_ctx = state->out_mem_ctx;
2200         } else {
2201                 mem_ctx = state;
2202         }
2203
2204         status = state->dispatch_recv(subreq, mem_ctx);
2205         TALLOC_FREE(subreq);
2206         if (!NT_STATUS_IS_OK(status)) {
2207                 tevent_req_nterror(req, status);
2208                 return;
2209         }
2210
2211         /* Copy out parameters */
2212
2213         /* Copy result */
2214         state->orig.out.result = state->tmp.out.result;
2215
2216         /* Reset temporary structure */
2217         ZERO_STRUCT(state->tmp);
2218
2219         if (DEBUGLEVEL >= 10) {
2220                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &state->orig);
2221         }
2222
2223         tevent_req_done(req);
2224 }
2225
2226 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend_recv(struct tevent_req *req,
2227                                                   TALLOC_CTX *mem_ctx,
2228                                                   WERROR *result)
2229 {
2230         struct rpccli_wkssvc_NetrMessageBufferSend_state *state = tevent_req_data(
2231                 req, struct rpccli_wkssvc_NetrMessageBufferSend_state);
2232         NTSTATUS status;
2233
2234         if (tevent_req_is_nterror(req, &status)) {
2235                 tevent_req_received(req);
2236                 return status;
2237         }
2238
2239         /* Steal possbile out parameters to the callers context */
2240         talloc_steal(mem_ctx, state->out_mem_ctx);
2241
2242         /* Return result */
2243         *result = state->orig.out.result;
2244
2245         tevent_req_received(req);
2246         return NT_STATUS_OK;
2247 }
2248
2249 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
2250                                              TALLOC_CTX *mem_ctx,
2251                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
2252                                              const char *message_name /* [in] [ref,charset(UTF16)] */,
2253                                              const char *message_sender_name /* [in] [unique,charset(UTF16)] */,
2254                                              uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */,
2255                                              uint32_t message_size /* [in]  */,
2256                                              WERROR *werror)
2257 {
2258         struct wkssvc_NetrMessageBufferSend r;
2259         NTSTATUS status;
2260
2261         /* In parameters */
2262         r.in.server_name = server_name;
2263         r.in.message_name = message_name;
2264         r.in.message_sender_name = message_sender_name;
2265         r.in.message_buffer = message_buffer;
2266         r.in.message_size = message_size;
2267
2268         if (DEBUGLEVEL >= 10) {
2269                 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &r);
2270         }
2271
2272         status = cli->dispatch(cli,
2273                                 mem_ctx,
2274                                 &ndr_table_wkssvc,
2275                                 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
2276                                 &r);
2277
2278         if (!NT_STATUS_IS_OK(status)) {
2279                 return status;
2280         }
2281
2282         if (DEBUGLEVEL >= 10) {
2283                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &r);
2284         }
2285
2286         if (NT_STATUS_IS_ERR(status)) {
2287                 return status;
2288         }
2289
2290         /* Return variables */
2291
2292         /* Return result */
2293         if (werror) {
2294                 *werror = r.out.result;
2295         }
2296
2297         return werror_to_ntstatus(r.out.result);
2298 }
2299
2300 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state {
2301         struct wkssvc_NetrWorkstationStatisticsGet orig;
2302         struct wkssvc_NetrWorkstationStatisticsGet tmp;
2303         TALLOC_CTX *out_mem_ctx;
2304         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2305 };
2306
2307 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq);
2308
2309 struct tevent_req *rpccli_wkssvc_NetrWorkstationStatisticsGet_send(TALLOC_CTX *mem_ctx,
2310                                                                    struct tevent_context *ev,
2311                                                                    struct rpc_pipe_client *cli,
2312                                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
2313                                                                    const char *_unknown2 /* [in] [unique,charset(UTF16)] */,
2314                                                                    uint32_t _unknown3 /* [in]  */,
2315                                                                    uint32_t _unknown4 /* [in]  */,
2316                                                                    struct wkssvc_NetrWorkstationStatistics **_info /* [out] [ref] */)
2317 {
2318         struct tevent_req *req;
2319         struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state;
2320         struct tevent_req *subreq;
2321
2322         req = tevent_req_create(mem_ctx, &state,
2323                                 struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2324         if (req == NULL) {
2325                 return NULL;
2326         }
2327         state->out_mem_ctx = NULL;
2328         state->dispatch_recv = cli->dispatch_recv;
2329
2330         /* In parameters */
2331         state->orig.in.server_name = _server_name;
2332         state->orig.in.unknown2 = _unknown2;
2333         state->orig.in.unknown3 = _unknown3;
2334         state->orig.in.unknown4 = _unknown4;
2335
2336         /* Out parameters */
2337         state->orig.out.info = _info;
2338
2339         /* Result */
2340         ZERO_STRUCT(state->orig.out.result);
2341
2342         if (DEBUGLEVEL >= 10) {
2343                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
2344         }
2345
2346         state->out_mem_ctx = talloc_named_const(state, 0,
2347                              "rpccli_wkssvc_NetrWorkstationStatisticsGet_out_memory");
2348         if (tevent_req_nomem(state->out_mem_ctx, req)) {
2349                 return tevent_req_post(req, ev);
2350         }
2351
2352         /* make a temporary copy, that we pass to the dispatch function */
2353         state->tmp = state->orig;
2354
2355         subreq = cli->dispatch_send(state, ev, cli,
2356                                     &ndr_table_wkssvc,
2357                                     NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2358                                     &state->tmp);
2359         if (tevent_req_nomem(subreq, req)) {
2360                 return tevent_req_post(req, ev);
2361         }
2362         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrWorkstationStatisticsGet_done, req);
2363         return req;
2364 }
2365
2366 static void rpccli_wkssvc_NetrWorkstationStatisticsGet_done(struct tevent_req *subreq)
2367 {
2368         struct tevent_req *req = tevent_req_callback_data(
2369                 subreq, struct tevent_req);
2370         struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2371                 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2372         NTSTATUS status;
2373         TALLOC_CTX *mem_ctx;
2374
2375         if (state->out_mem_ctx) {
2376                 mem_ctx = state->out_mem_ctx;
2377         } else {
2378                 mem_ctx = state;
2379         }
2380
2381         status = state->dispatch_recv(subreq, mem_ctx);
2382         TALLOC_FREE(subreq);
2383         if (!NT_STATUS_IS_OK(status)) {
2384                 tevent_req_nterror(req, status);
2385                 return;
2386         }
2387
2388         /* Copy out parameters */
2389         *state->orig.out.info = *state->tmp.out.info;
2390
2391         /* Copy result */
2392         state->orig.out.result = state->tmp.out.result;
2393
2394         /* Reset temporary structure */
2395         ZERO_STRUCT(state->tmp);
2396
2397         if (DEBUGLEVEL >= 10) {
2398                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &state->orig);
2399         }
2400
2401         tevent_req_done(req);
2402 }
2403
2404 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet_recv(struct tevent_req *req,
2405                                                          TALLOC_CTX *mem_ctx,
2406                                                          WERROR *result)
2407 {
2408         struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state *state = tevent_req_data(
2409                 req, struct rpccli_wkssvc_NetrWorkstationStatisticsGet_state);
2410         NTSTATUS status;
2411
2412         if (tevent_req_is_nterror(req, &status)) {
2413                 tevent_req_received(req);
2414                 return status;
2415         }
2416
2417         /* Steal possbile out parameters to the callers context */
2418         talloc_steal(mem_ctx, state->out_mem_ctx);
2419
2420         /* Return result */
2421         *result = state->orig.out.result;
2422
2423         tevent_req_received(req);
2424         return NT_STATUS_OK;
2425 }
2426
2427 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
2428                                                     TALLOC_CTX *mem_ctx,
2429                                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
2430                                                     const char *unknown2 /* [in] [unique,charset(UTF16)] */,
2431                                                     uint32_t unknown3 /* [in]  */,
2432                                                     uint32_t unknown4 /* [in]  */,
2433                                                     struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */,
2434                                                     WERROR *werror)
2435 {
2436         struct wkssvc_NetrWorkstationStatisticsGet r;
2437         NTSTATUS status;
2438
2439         /* In parameters */
2440         r.in.server_name = server_name;
2441         r.in.unknown2 = unknown2;
2442         r.in.unknown3 = unknown3;
2443         r.in.unknown4 = unknown4;
2444
2445         if (DEBUGLEVEL >= 10) {
2446                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
2447         }
2448
2449         status = cli->dispatch(cli,
2450                                 mem_ctx,
2451                                 &ndr_table_wkssvc,
2452                                 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
2453                                 &r);
2454
2455         if (!NT_STATUS_IS_OK(status)) {
2456                 return status;
2457         }
2458
2459         if (DEBUGLEVEL >= 10) {
2460                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
2461         }
2462
2463         if (NT_STATUS_IS_ERR(status)) {
2464                 return status;
2465         }
2466
2467         /* Return variables */
2468         *info = *r.out.info;
2469
2470         /* Return result */
2471         if (werror) {
2472                 *werror = r.out.result;
2473         }
2474
2475         return werror_to_ntstatus(r.out.result);
2476 }
2477
2478 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state {
2479         struct wkssvc_NetrLogonDomainNameAdd orig;
2480         struct wkssvc_NetrLogonDomainNameAdd tmp;
2481         TALLOC_CTX *out_mem_ctx;
2482         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2483 };
2484
2485 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq);
2486
2487 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameAdd_send(TALLOC_CTX *mem_ctx,
2488                                                              struct tevent_context *ev,
2489                                                              struct rpc_pipe_client *cli,
2490                                                              const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2491 {
2492         struct tevent_req *req;
2493         struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state;
2494         struct tevent_req *subreq;
2495
2496         req = tevent_req_create(mem_ctx, &state,
2497                                 struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2498         if (req == NULL) {
2499                 return NULL;
2500         }
2501         state->out_mem_ctx = NULL;
2502         state->dispatch_recv = cli->dispatch_recv;
2503
2504         /* In parameters */
2505         state->orig.in.domain_name = _domain_name;
2506
2507         /* Out parameters */
2508
2509         /* Result */
2510         ZERO_STRUCT(state->orig.out.result);
2511
2512         if (DEBUGLEVEL >= 10) {
2513                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
2514         }
2515
2516         /* make a temporary copy, that we pass to the dispatch function */
2517         state->tmp = state->orig;
2518
2519         subreq = cli->dispatch_send(state, ev, cli,
2520                                     &ndr_table_wkssvc,
2521                                     NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2522                                     &state->tmp);
2523         if (tevent_req_nomem(subreq, req)) {
2524                 return tevent_req_post(req, ev);
2525         }
2526         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameAdd_done, req);
2527         return req;
2528 }
2529
2530 static void rpccli_wkssvc_NetrLogonDomainNameAdd_done(struct tevent_req *subreq)
2531 {
2532         struct tevent_req *req = tevent_req_callback_data(
2533                 subreq, struct tevent_req);
2534         struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2535                 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2536         NTSTATUS status;
2537         TALLOC_CTX *mem_ctx;
2538
2539         if (state->out_mem_ctx) {
2540                 mem_ctx = state->out_mem_ctx;
2541         } else {
2542                 mem_ctx = state;
2543         }
2544
2545         status = state->dispatch_recv(subreq, mem_ctx);
2546         TALLOC_FREE(subreq);
2547         if (!NT_STATUS_IS_OK(status)) {
2548                 tevent_req_nterror(req, status);
2549                 return;
2550         }
2551
2552         /* Copy out parameters */
2553
2554         /* Copy result */
2555         state->orig.out.result = state->tmp.out.result;
2556
2557         /* Reset temporary structure */
2558         ZERO_STRUCT(state->tmp);
2559
2560         if (DEBUGLEVEL >= 10) {
2561                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &state->orig);
2562         }
2563
2564         tevent_req_done(req);
2565 }
2566
2567 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd_recv(struct tevent_req *req,
2568                                                    TALLOC_CTX *mem_ctx,
2569                                                    WERROR *result)
2570 {
2571         struct rpccli_wkssvc_NetrLogonDomainNameAdd_state *state = tevent_req_data(
2572                 req, struct rpccli_wkssvc_NetrLogonDomainNameAdd_state);
2573         NTSTATUS status;
2574
2575         if (tevent_req_is_nterror(req, &status)) {
2576                 tevent_req_received(req);
2577                 return status;
2578         }
2579
2580         /* Steal possbile out parameters to the callers context */
2581         talloc_steal(mem_ctx, state->out_mem_ctx);
2582
2583         /* Return result */
2584         *result = state->orig.out.result;
2585
2586         tevent_req_received(req);
2587         return NT_STATUS_OK;
2588 }
2589
2590 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
2591                                               TALLOC_CTX *mem_ctx,
2592                                               const char *domain_name /* [in] [ref,charset(UTF16)] */,
2593                                               WERROR *werror)
2594 {
2595         struct wkssvc_NetrLogonDomainNameAdd r;
2596         NTSTATUS status;
2597
2598         /* In parameters */
2599         r.in.domain_name = domain_name;
2600
2601         if (DEBUGLEVEL >= 10) {
2602                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
2603         }
2604
2605         status = cli->dispatch(cli,
2606                                 mem_ctx,
2607                                 &ndr_table_wkssvc,
2608                                 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
2609                                 &r);
2610
2611         if (!NT_STATUS_IS_OK(status)) {
2612                 return status;
2613         }
2614
2615         if (DEBUGLEVEL >= 10) {
2616                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
2617         }
2618
2619         if (NT_STATUS_IS_ERR(status)) {
2620                 return status;
2621         }
2622
2623         /* Return variables */
2624
2625         /* Return result */
2626         if (werror) {
2627                 *werror = r.out.result;
2628         }
2629
2630         return werror_to_ntstatus(r.out.result);
2631 }
2632
2633 struct rpccli_wkssvc_NetrLogonDomainNameDel_state {
2634         struct wkssvc_NetrLogonDomainNameDel orig;
2635         struct wkssvc_NetrLogonDomainNameDel tmp;
2636         TALLOC_CTX *out_mem_ctx;
2637         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2638 };
2639
2640 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq);
2641
2642 struct tevent_req *rpccli_wkssvc_NetrLogonDomainNameDel_send(TALLOC_CTX *mem_ctx,
2643                                                              struct tevent_context *ev,
2644                                                              struct rpc_pipe_client *cli,
2645                                                              const char *_domain_name /* [in] [ref,charset(UTF16)] */)
2646 {
2647         struct tevent_req *req;
2648         struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state;
2649         struct tevent_req *subreq;
2650
2651         req = tevent_req_create(mem_ctx, &state,
2652                                 struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2653         if (req == NULL) {
2654                 return NULL;
2655         }
2656         state->out_mem_ctx = NULL;
2657         state->dispatch_recv = cli->dispatch_recv;
2658
2659         /* In parameters */
2660         state->orig.in.domain_name = _domain_name;
2661
2662         /* Out parameters */
2663
2664         /* Result */
2665         ZERO_STRUCT(state->orig.out.result);
2666
2667         if (DEBUGLEVEL >= 10) {
2668                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
2669         }
2670
2671         /* make a temporary copy, that we pass to the dispatch function */
2672         state->tmp = state->orig;
2673
2674         subreq = cli->dispatch_send(state, ev, cli,
2675                                     &ndr_table_wkssvc,
2676                                     NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2677                                     &state->tmp);
2678         if (tevent_req_nomem(subreq, req)) {
2679                 return tevent_req_post(req, ev);
2680         }
2681         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrLogonDomainNameDel_done, req);
2682         return req;
2683 }
2684
2685 static void rpccli_wkssvc_NetrLogonDomainNameDel_done(struct tevent_req *subreq)
2686 {
2687         struct tevent_req *req = tevent_req_callback_data(
2688                 subreq, struct tevent_req);
2689         struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2690                 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2691         NTSTATUS status;
2692         TALLOC_CTX *mem_ctx;
2693
2694         if (state->out_mem_ctx) {
2695                 mem_ctx = state->out_mem_ctx;
2696         } else {
2697                 mem_ctx = state;
2698         }
2699
2700         status = state->dispatch_recv(subreq, mem_ctx);
2701         TALLOC_FREE(subreq);
2702         if (!NT_STATUS_IS_OK(status)) {
2703                 tevent_req_nterror(req, status);
2704                 return;
2705         }
2706
2707         /* Copy out parameters */
2708
2709         /* Copy result */
2710         state->orig.out.result = state->tmp.out.result;
2711
2712         /* Reset temporary structure */
2713         ZERO_STRUCT(state->tmp);
2714
2715         if (DEBUGLEVEL >= 10) {
2716                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &state->orig);
2717         }
2718
2719         tevent_req_done(req);
2720 }
2721
2722 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel_recv(struct tevent_req *req,
2723                                                    TALLOC_CTX *mem_ctx,
2724                                                    WERROR *result)
2725 {
2726         struct rpccli_wkssvc_NetrLogonDomainNameDel_state *state = tevent_req_data(
2727                 req, struct rpccli_wkssvc_NetrLogonDomainNameDel_state);
2728         NTSTATUS status;
2729
2730         if (tevent_req_is_nterror(req, &status)) {
2731                 tevent_req_received(req);
2732                 return status;
2733         }
2734
2735         /* Steal possbile out parameters to the callers context */
2736         talloc_steal(mem_ctx, state->out_mem_ctx);
2737
2738         /* Return result */
2739         *result = state->orig.out.result;
2740
2741         tevent_req_received(req);
2742         return NT_STATUS_OK;
2743 }
2744
2745 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
2746                                               TALLOC_CTX *mem_ctx,
2747                                               const char *domain_name /* [in] [ref,charset(UTF16)] */,
2748                                               WERROR *werror)
2749 {
2750         struct wkssvc_NetrLogonDomainNameDel r;
2751         NTSTATUS status;
2752
2753         /* In parameters */
2754         r.in.domain_name = domain_name;
2755
2756         if (DEBUGLEVEL >= 10) {
2757                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
2758         }
2759
2760         status = cli->dispatch(cli,
2761                                 mem_ctx,
2762                                 &ndr_table_wkssvc,
2763                                 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
2764                                 &r);
2765
2766         if (!NT_STATUS_IS_OK(status)) {
2767                 return status;
2768         }
2769
2770         if (DEBUGLEVEL >= 10) {
2771                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
2772         }
2773
2774         if (NT_STATUS_IS_ERR(status)) {
2775                 return status;
2776         }
2777
2778         /* Return variables */
2779
2780         /* Return result */
2781         if (werror) {
2782                 *werror = r.out.result;
2783         }
2784
2785         return werror_to_ntstatus(r.out.result);
2786 }
2787
2788 struct rpccli_wkssvc_NetrJoinDomain_state {
2789         struct wkssvc_NetrJoinDomain orig;
2790         struct wkssvc_NetrJoinDomain tmp;
2791         TALLOC_CTX *out_mem_ctx;
2792         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2793 };
2794
2795 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq);
2796
2797 struct tevent_req *rpccli_wkssvc_NetrJoinDomain_send(TALLOC_CTX *mem_ctx,
2798                                                      struct tevent_context *ev,
2799                                                      struct rpc_pipe_client *cli,
2800                                                      const char *_server_name /* [in] [unique,charset(UTF16)] */,
2801                                                      const char *_domain_name /* [in] [ref,charset(UTF16)] */,
2802                                                      const char *_account_ou /* [in] [unique,charset(UTF16)] */,
2803                                                      const char *_Account /* [in] [unique,charset(UTF16)] */,
2804                                                      const char *_password /* [in] [unique,charset(UTF16)] */,
2805                                                      uint32_t _join_flags /* [in]  */)
2806 {
2807         struct tevent_req *req;
2808         struct rpccli_wkssvc_NetrJoinDomain_state *state;
2809         struct tevent_req *subreq;
2810
2811         req = tevent_req_create(mem_ctx, &state,
2812                                 struct rpccli_wkssvc_NetrJoinDomain_state);
2813         if (req == NULL) {
2814                 return NULL;
2815         }
2816         state->out_mem_ctx = NULL;
2817         state->dispatch_recv = cli->dispatch_recv;
2818
2819         /* In parameters */
2820         state->orig.in.server_name = _server_name;
2821         state->orig.in.domain_name = _domain_name;
2822         state->orig.in.account_ou = _account_ou;
2823         state->orig.in.Account = _Account;
2824         state->orig.in.password = _password;
2825         state->orig.in.join_flags = _join_flags;
2826
2827         /* Out parameters */
2828
2829         /* Result */
2830         ZERO_STRUCT(state->orig.out.result);
2831
2832         if (DEBUGLEVEL >= 10) {
2833                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
2834         }
2835
2836         /* make a temporary copy, that we pass to the dispatch function */
2837         state->tmp = state->orig;
2838
2839         subreq = cli->dispatch_send(state, ev, cli,
2840                                     &ndr_table_wkssvc,
2841                                     NDR_WKSSVC_NETRJOINDOMAIN,
2842                                     &state->tmp);
2843         if (tevent_req_nomem(subreq, req)) {
2844                 return tevent_req_post(req, ev);
2845         }
2846         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain_done, req);
2847         return req;
2848 }
2849
2850 static void rpccli_wkssvc_NetrJoinDomain_done(struct tevent_req *subreq)
2851 {
2852         struct tevent_req *req = tevent_req_callback_data(
2853                 subreq, struct tevent_req);
2854         struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2855                 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2856         NTSTATUS status;
2857         TALLOC_CTX *mem_ctx;
2858
2859         if (state->out_mem_ctx) {
2860                 mem_ctx = state->out_mem_ctx;
2861         } else {
2862                 mem_ctx = state;
2863         }
2864
2865         status = state->dispatch_recv(subreq, mem_ctx);
2866         TALLOC_FREE(subreq);
2867         if (!NT_STATUS_IS_OK(status)) {
2868                 tevent_req_nterror(req, status);
2869                 return;
2870         }
2871
2872         /* Copy out parameters */
2873
2874         /* Copy result */
2875         state->orig.out.result = state->tmp.out.result;
2876
2877         /* Reset temporary structure */
2878         ZERO_STRUCT(state->tmp);
2879
2880         if (DEBUGLEVEL >= 10) {
2881                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &state->orig);
2882         }
2883
2884         tevent_req_done(req);
2885 }
2886
2887 NTSTATUS rpccli_wkssvc_NetrJoinDomain_recv(struct tevent_req *req,
2888                                            TALLOC_CTX *mem_ctx,
2889                                            WERROR *result)
2890 {
2891         struct rpccli_wkssvc_NetrJoinDomain_state *state = tevent_req_data(
2892                 req, struct rpccli_wkssvc_NetrJoinDomain_state);
2893         NTSTATUS status;
2894
2895         if (tevent_req_is_nterror(req, &status)) {
2896                 tevent_req_received(req);
2897                 return status;
2898         }
2899
2900         /* Steal possbile out parameters to the callers context */
2901         talloc_steal(mem_ctx, state->out_mem_ctx);
2902
2903         /* Return result */
2904         *result = state->orig.out.result;
2905
2906         tevent_req_received(req);
2907         return NT_STATUS_OK;
2908 }
2909
2910 NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
2911                                       TALLOC_CTX *mem_ctx,
2912                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
2913                                       const char *domain_name /* [in] [ref,charset(UTF16)] */,
2914                                       const char *account_ou /* [in] [unique,charset(UTF16)] */,
2915                                       const char *Account /* [in] [unique,charset(UTF16)] */,
2916                                       const char *password /* [in] [unique,charset(UTF16)] */,
2917                                       uint32_t join_flags /* [in]  */,
2918                                       WERROR *werror)
2919 {
2920         struct wkssvc_NetrJoinDomain r;
2921         NTSTATUS status;
2922
2923         /* In parameters */
2924         r.in.server_name = server_name;
2925         r.in.domain_name = domain_name;
2926         r.in.account_ou = account_ou;
2927         r.in.Account = Account;
2928         r.in.password = password;
2929         r.in.join_flags = join_flags;
2930
2931         if (DEBUGLEVEL >= 10) {
2932                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &r);
2933         }
2934
2935         status = cli->dispatch(cli,
2936                                 mem_ctx,
2937                                 &ndr_table_wkssvc,
2938                                 NDR_WKSSVC_NETRJOINDOMAIN,
2939                                 &r);
2940
2941         if (!NT_STATUS_IS_OK(status)) {
2942                 return status;
2943         }
2944
2945         if (DEBUGLEVEL >= 10) {
2946                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &r);
2947         }
2948
2949         if (NT_STATUS_IS_ERR(status)) {
2950                 return status;
2951         }
2952
2953         /* Return variables */
2954
2955         /* Return result */
2956         if (werror) {
2957                 *werror = r.out.result;
2958         }
2959
2960         return werror_to_ntstatus(r.out.result);
2961 }
2962
2963 struct rpccli_wkssvc_NetrUnjoinDomain_state {
2964         struct wkssvc_NetrUnjoinDomain orig;
2965         struct wkssvc_NetrUnjoinDomain tmp;
2966         TALLOC_CTX *out_mem_ctx;
2967         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
2968 };
2969
2970 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq);
2971
2972 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain_send(TALLOC_CTX *mem_ctx,
2973                                                        struct tevent_context *ev,
2974                                                        struct rpc_pipe_client *cli,
2975                                                        const char *_server_name /* [in] [unique,charset(UTF16)] */,
2976                                                        const char *_Account /* [in] [unique,charset(UTF16)] */,
2977                                                        const char *_password /* [in] [unique,charset(UTF16)] */,
2978                                                        uint32_t _unjoin_flags /* [in]  */)
2979 {
2980         struct tevent_req *req;
2981         struct rpccli_wkssvc_NetrUnjoinDomain_state *state;
2982         struct tevent_req *subreq;
2983
2984         req = tevent_req_create(mem_ctx, &state,
2985                                 struct rpccli_wkssvc_NetrUnjoinDomain_state);
2986         if (req == NULL) {
2987                 return NULL;
2988         }
2989         state->out_mem_ctx = NULL;
2990         state->dispatch_recv = cli->dispatch_recv;
2991
2992         /* In parameters */
2993         state->orig.in.server_name = _server_name;
2994         state->orig.in.Account = _Account;
2995         state->orig.in.password = _password;
2996         state->orig.in.unjoin_flags = _unjoin_flags;
2997
2998         /* Out parameters */
2999
3000         /* Result */
3001         ZERO_STRUCT(state->orig.out.result);
3002
3003         if (DEBUGLEVEL >= 10) {
3004                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
3005         }
3006
3007         /* make a temporary copy, that we pass to the dispatch function */
3008         state->tmp = state->orig;
3009
3010         subreq = cli->dispatch_send(state, ev, cli,
3011                                     &ndr_table_wkssvc,
3012                                     NDR_WKSSVC_NETRUNJOINDOMAIN,
3013                                     &state->tmp);
3014         if (tevent_req_nomem(subreq, req)) {
3015                 return tevent_req_post(req, ev);
3016         }
3017         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain_done, req);
3018         return req;
3019 }
3020
3021 static void rpccli_wkssvc_NetrUnjoinDomain_done(struct tevent_req *subreq)
3022 {
3023         struct tevent_req *req = tevent_req_callback_data(
3024                 subreq, struct tevent_req);
3025         struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
3026                 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
3027         NTSTATUS status;
3028         TALLOC_CTX *mem_ctx;
3029
3030         if (state->out_mem_ctx) {
3031                 mem_ctx = state->out_mem_ctx;
3032         } else {
3033                 mem_ctx = state;
3034         }
3035
3036         status = state->dispatch_recv(subreq, mem_ctx);
3037         TALLOC_FREE(subreq);
3038         if (!NT_STATUS_IS_OK(status)) {
3039                 tevent_req_nterror(req, status);
3040                 return;
3041         }
3042
3043         /* Copy out parameters */
3044
3045         /* Copy result */
3046         state->orig.out.result = state->tmp.out.result;
3047
3048         /* Reset temporary structure */
3049         ZERO_STRUCT(state->tmp);
3050
3051         if (DEBUGLEVEL >= 10) {
3052                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &state->orig);
3053         }
3054
3055         tevent_req_done(req);
3056 }
3057
3058 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain_recv(struct tevent_req *req,
3059                                              TALLOC_CTX *mem_ctx,
3060                                              WERROR *result)
3061 {
3062         struct rpccli_wkssvc_NetrUnjoinDomain_state *state = tevent_req_data(
3063                 req, struct rpccli_wkssvc_NetrUnjoinDomain_state);
3064         NTSTATUS status;
3065
3066         if (tevent_req_is_nterror(req, &status)) {
3067                 tevent_req_received(req);
3068                 return status;
3069         }
3070
3071         /* Steal possbile out parameters to the callers context */
3072         talloc_steal(mem_ctx, state->out_mem_ctx);
3073
3074         /* Return result */
3075         *result = state->orig.out.result;
3076
3077         tevent_req_received(req);
3078         return NT_STATUS_OK;
3079 }
3080
3081 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
3082                                         TALLOC_CTX *mem_ctx,
3083                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
3084                                         const char *Account /* [in] [unique,charset(UTF16)] */,
3085                                         const char *password /* [in] [unique,charset(UTF16)] */,
3086                                         uint32_t unjoin_flags /* [in]  */,
3087                                         WERROR *werror)
3088 {
3089         struct wkssvc_NetrUnjoinDomain r;
3090         NTSTATUS status;
3091
3092         /* In parameters */
3093         r.in.server_name = server_name;
3094         r.in.Account = Account;
3095         r.in.password = password;
3096         r.in.unjoin_flags = unjoin_flags;
3097
3098         if (DEBUGLEVEL >= 10) {
3099                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &r);
3100         }
3101
3102         status = cli->dispatch(cli,
3103                                 mem_ctx,
3104                                 &ndr_table_wkssvc,
3105                                 NDR_WKSSVC_NETRUNJOINDOMAIN,
3106                                 &r);
3107
3108         if (!NT_STATUS_IS_OK(status)) {
3109                 return status;
3110         }
3111
3112         if (DEBUGLEVEL >= 10) {
3113                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &r);
3114         }
3115
3116         if (NT_STATUS_IS_ERR(status)) {
3117                 return status;
3118         }
3119
3120         /* Return variables */
3121
3122         /* Return result */
3123         if (werror) {
3124                 *werror = r.out.result;
3125         }
3126
3127         return werror_to_ntstatus(r.out.result);
3128 }
3129
3130 struct rpccli_wkssvc_NetrRenameMachineInDomain_state {
3131         struct wkssvc_NetrRenameMachineInDomain orig;
3132         struct wkssvc_NetrRenameMachineInDomain tmp;
3133         TALLOC_CTX *out_mem_ctx;
3134         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3135 };
3136
3137 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq);
3138
3139 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain_send(TALLOC_CTX *mem_ctx,
3140                                                                 struct tevent_context *ev,
3141                                                                 struct rpc_pipe_client *cli,
3142                                                                 const char *_server_name /* [in] [unique,charset(UTF16)] */,
3143                                                                 const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
3144                                                                 const char *_Account /* [in] [unique,charset(UTF16)] */,
3145                                                                 const char *_password /* [in] [unique,charset(UTF16)] */,
3146                                                                 uint32_t _RenameOptions /* [in]  */)
3147 {
3148         struct tevent_req *req;
3149         struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state;
3150         struct tevent_req *subreq;
3151
3152         req = tevent_req_create(mem_ctx, &state,
3153                                 struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3154         if (req == NULL) {
3155                 return NULL;
3156         }
3157         state->out_mem_ctx = NULL;
3158         state->dispatch_recv = cli->dispatch_recv;
3159
3160         /* In parameters */
3161         state->orig.in.server_name = _server_name;
3162         state->orig.in.NewMachineName = _NewMachineName;
3163         state->orig.in.Account = _Account;
3164         state->orig.in.password = _password;
3165         state->orig.in.RenameOptions = _RenameOptions;
3166
3167         /* Out parameters */
3168
3169         /* Result */
3170         ZERO_STRUCT(state->orig.out.result);
3171
3172         if (DEBUGLEVEL >= 10) {
3173                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
3174         }
3175
3176         /* make a temporary copy, that we pass to the dispatch function */
3177         state->tmp = state->orig;
3178
3179         subreq = cli->dispatch_send(state, ev, cli,
3180                                     &ndr_table_wkssvc,
3181                                     NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
3182                                     &state->tmp);
3183         if (tevent_req_nomem(subreq, req)) {
3184                 return tevent_req_post(req, ev);
3185         }
3186         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain_done, req);
3187         return req;
3188 }
3189
3190 static void rpccli_wkssvc_NetrRenameMachineInDomain_done(struct tevent_req *subreq)
3191 {
3192         struct tevent_req *req = tevent_req_callback_data(
3193                 subreq, struct tevent_req);
3194         struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
3195                 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3196         NTSTATUS status;
3197         TALLOC_CTX *mem_ctx;
3198
3199         if (state->out_mem_ctx) {
3200                 mem_ctx = state->out_mem_ctx;
3201         } else {
3202                 mem_ctx = state;
3203         }
3204
3205         status = state->dispatch_recv(subreq, mem_ctx);
3206         TALLOC_FREE(subreq);
3207         if (!NT_STATUS_IS_OK(status)) {
3208                 tevent_req_nterror(req, status);
3209                 return;
3210         }
3211
3212         /* Copy out parameters */
3213
3214         /* Copy result */
3215         state->orig.out.result = state->tmp.out.result;
3216
3217         /* Reset temporary structure */
3218         ZERO_STRUCT(state->tmp);
3219
3220         if (DEBUGLEVEL >= 10) {
3221                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &state->orig);
3222         }
3223
3224         tevent_req_done(req);
3225 }
3226
3227 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain_recv(struct tevent_req *req,
3228                                                       TALLOC_CTX *mem_ctx,
3229                                                       WERROR *result)
3230 {
3231         struct rpccli_wkssvc_NetrRenameMachineInDomain_state *state = tevent_req_data(
3232                 req, struct rpccli_wkssvc_NetrRenameMachineInDomain_state);
3233         NTSTATUS status;
3234
3235         if (tevent_req_is_nterror(req, &status)) {
3236                 tevent_req_received(req);
3237                 return status;
3238         }
3239
3240         /* Steal possbile out parameters to the callers context */
3241         talloc_steal(mem_ctx, state->out_mem_ctx);
3242
3243         /* Return result */
3244         *result = state->orig.out.result;
3245
3246         tevent_req_received(req);
3247         return NT_STATUS_OK;
3248 }
3249
3250 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
3251                                                  TALLOC_CTX *mem_ctx,
3252                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
3253                                                  const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
3254                                                  const char *Account /* [in] [unique,charset(UTF16)] */,
3255                                                  const char *password /* [in] [unique,charset(UTF16)] */,
3256                                                  uint32_t RenameOptions /* [in]  */,
3257                                                  WERROR *werror)
3258 {
3259         struct wkssvc_NetrRenameMachineInDomain r;
3260         NTSTATUS status;
3261
3262         /* In parameters */
3263         r.in.server_name = server_name;
3264         r.in.NewMachineName = NewMachineName;
3265         r.in.Account = Account;
3266         r.in.password = password;
3267         r.in.RenameOptions = RenameOptions;
3268
3269         if (DEBUGLEVEL >= 10) {
3270                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
3271         }
3272
3273         status = cli->dispatch(cli,
3274                                 mem_ctx,
3275                                 &ndr_table_wkssvc,
3276                                 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
3277                                 &r);
3278
3279         if (!NT_STATUS_IS_OK(status)) {
3280                 return status;
3281         }
3282
3283         if (DEBUGLEVEL >= 10) {
3284                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
3285         }
3286
3287         if (NT_STATUS_IS_ERR(status)) {
3288                 return status;
3289         }
3290
3291         /* Return variables */
3292
3293         /* Return result */
3294         if (werror) {
3295                 *werror = r.out.result;
3296         }
3297
3298         return werror_to_ntstatus(r.out.result);
3299 }
3300
3301 struct rpccli_wkssvc_NetrValidateName_state {
3302         struct wkssvc_NetrValidateName orig;
3303         struct wkssvc_NetrValidateName tmp;
3304         TALLOC_CTX *out_mem_ctx;
3305         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3306 };
3307
3308 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq);
3309
3310 struct tevent_req *rpccli_wkssvc_NetrValidateName_send(TALLOC_CTX *mem_ctx,
3311                                                        struct tevent_context *ev,
3312                                                        struct rpc_pipe_client *cli,
3313                                                        const char *_server_name /* [in] [unique,charset(UTF16)] */,
3314                                                        const char *_name /* [in] [ref,charset(UTF16)] */,
3315                                                        const char *_Account /* [in] [unique,charset(UTF16)] */,
3316                                                        const char *_Password /* [in] [unique,charset(UTF16)] */,
3317                                                        enum wkssvc_NetValidateNameType _name_type /* [in]  */)
3318 {
3319         struct tevent_req *req;
3320         struct rpccli_wkssvc_NetrValidateName_state *state;
3321         struct tevent_req *subreq;
3322
3323         req = tevent_req_create(mem_ctx, &state,
3324                                 struct rpccli_wkssvc_NetrValidateName_state);
3325         if (req == NULL) {
3326                 return NULL;
3327         }
3328         state->out_mem_ctx = NULL;
3329         state->dispatch_recv = cli->dispatch_recv;
3330
3331         /* In parameters */
3332         state->orig.in.server_name = _server_name;
3333         state->orig.in.name = _name;
3334         state->orig.in.Account = _Account;
3335         state->orig.in.Password = _Password;
3336         state->orig.in.name_type = _name_type;
3337
3338         /* Out parameters */
3339
3340         /* Result */
3341         ZERO_STRUCT(state->orig.out.result);
3342
3343         if (DEBUGLEVEL >= 10) {
3344                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &state->orig);
3345         }
3346
3347         /* make a temporary copy, that we pass to the dispatch function */
3348         state->tmp = state->orig;
3349
3350         subreq = cli->dispatch_send(state, ev, cli,
3351                                     &ndr_table_wkssvc,
3352                                     NDR_WKSSVC_NETRVALIDATENAME,
3353                                     &state->tmp);
3354         if (tevent_req_nomem(subreq, req)) {
3355                 return tevent_req_post(req, ev);
3356         }
3357         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName_done, req);
3358         return req;
3359 }
3360
3361 static void rpccli_wkssvc_NetrValidateName_done(struct tevent_req *subreq)
3362 {
3363         struct tevent_req *req = tevent_req_callback_data(
3364                 subreq, struct tevent_req);
3365         struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3366                 req, struct rpccli_wkssvc_NetrValidateName_state);
3367         NTSTATUS status;
3368         TALLOC_CTX *mem_ctx;
3369
3370         if (state->out_mem_ctx) {
3371                 mem_ctx = state->out_mem_ctx;
3372         } else {
3373                 mem_ctx = state;
3374         }
3375
3376         status = state->dispatch_recv(subreq, mem_ctx);
3377         TALLOC_FREE(subreq);
3378         if (!NT_STATUS_IS_OK(status)) {
3379                 tevent_req_nterror(req, status);
3380                 return;
3381         }
3382
3383         /* Copy out parameters */
3384
3385         /* Copy result */
3386         state->orig.out.result = state->tmp.out.result;
3387
3388         /* Reset temporary structure */
3389         ZERO_STRUCT(state->tmp);
3390
3391         if (DEBUGLEVEL >= 10) {
3392                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &state->orig);
3393         }
3394
3395         tevent_req_done(req);
3396 }
3397
3398 NTSTATUS rpccli_wkssvc_NetrValidateName_recv(struct tevent_req *req,
3399                                              TALLOC_CTX *mem_ctx,
3400                                              WERROR *result)
3401 {
3402         struct rpccli_wkssvc_NetrValidateName_state *state = tevent_req_data(
3403                 req, struct rpccli_wkssvc_NetrValidateName_state);
3404         NTSTATUS status;
3405
3406         if (tevent_req_is_nterror(req, &status)) {
3407                 tevent_req_received(req);
3408                 return status;
3409         }
3410
3411         /* Steal possbile out parameters to the callers context */
3412         talloc_steal(mem_ctx, state->out_mem_ctx);
3413
3414         /* Return result */
3415         *result = state->orig.out.result;
3416
3417         tevent_req_received(req);
3418         return NT_STATUS_OK;
3419 }
3420
3421 NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
3422                                         TALLOC_CTX *mem_ctx,
3423                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
3424                                         const char *name /* [in] [ref,charset(UTF16)] */,
3425                                         const char *Account /* [in] [unique,charset(UTF16)] */,
3426                                         const char *Password /* [in] [unique,charset(UTF16)] */,
3427                                         enum wkssvc_NetValidateNameType name_type /* [in]  */,
3428                                         WERROR *werror)
3429 {
3430         struct wkssvc_NetrValidateName r;
3431         NTSTATUS status;
3432
3433         /* In parameters */
3434         r.in.server_name = server_name;
3435         r.in.name = name;
3436         r.in.Account = Account;
3437         r.in.Password = Password;
3438         r.in.name_type = name_type;
3439
3440         if (DEBUGLEVEL >= 10) {
3441                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r);
3442         }
3443
3444         status = cli->dispatch(cli,
3445                                 mem_ctx,
3446                                 &ndr_table_wkssvc,
3447                                 NDR_WKSSVC_NETRVALIDATENAME,
3448                                 &r);
3449
3450         if (!NT_STATUS_IS_OK(status)) {
3451                 return status;
3452         }
3453
3454         if (DEBUGLEVEL >= 10) {
3455                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r);
3456         }
3457
3458         if (NT_STATUS_IS_ERR(status)) {
3459                 return status;
3460         }
3461
3462         /* Return variables */
3463
3464         /* Return result */
3465         if (werror) {
3466                 *werror = r.out.result;
3467         }
3468
3469         return werror_to_ntstatus(r.out.result);
3470 }
3471
3472 struct rpccli_wkssvc_NetrGetJoinInformation_state {
3473         struct wkssvc_NetrGetJoinInformation orig;
3474         struct wkssvc_NetrGetJoinInformation tmp;
3475         TALLOC_CTX *out_mem_ctx;
3476         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3477 };
3478
3479 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq);
3480
3481 struct tevent_req *rpccli_wkssvc_NetrGetJoinInformation_send(TALLOC_CTX *mem_ctx,
3482                                                              struct tevent_context *ev,
3483                                                              struct rpc_pipe_client *cli,
3484                                                              const char *_server_name /* [in] [unique,charset(UTF16)] */,
3485                                                              const char **_name_buffer /* [in,out] [ref,charset(UTF16)] */,
3486                                                              enum wkssvc_NetJoinStatus *_name_type /* [out] [ref] */)
3487 {
3488         struct tevent_req *req;
3489         struct rpccli_wkssvc_NetrGetJoinInformation_state *state;
3490         struct tevent_req *subreq;
3491
3492         req = tevent_req_create(mem_ctx, &state,
3493                                 struct rpccli_wkssvc_NetrGetJoinInformation_state);
3494         if (req == NULL) {
3495                 return NULL;
3496         }
3497         state->out_mem_ctx = NULL;
3498         state->dispatch_recv = cli->dispatch_recv;
3499
3500         /* In parameters */
3501         state->orig.in.server_name = _server_name;
3502         state->orig.in.name_buffer = _name_buffer;
3503
3504         /* Out parameters */
3505         state->orig.out.name_buffer = _name_buffer;
3506         state->orig.out.name_type = _name_type;
3507
3508         /* Result */
3509         ZERO_STRUCT(state->orig.out.result);
3510
3511         if (DEBUGLEVEL >= 10) {
3512                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
3513         }
3514
3515         state->out_mem_ctx = talloc_named_const(state, 0,
3516                              "rpccli_wkssvc_NetrGetJoinInformation_out_memory");
3517         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3518                 return tevent_req_post(req, ev);
3519         }
3520
3521         /* make a temporary copy, that we pass to the dispatch function */
3522         state->tmp = state->orig;
3523
3524         subreq = cli->dispatch_send(state, ev, cli,
3525                                     &ndr_table_wkssvc,
3526                                     NDR_WKSSVC_NETRGETJOININFORMATION,
3527                                     &state->tmp);
3528         if (tevent_req_nomem(subreq, req)) {
3529                 return tevent_req_post(req, ev);
3530         }
3531         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinInformation_done, req);
3532         return req;
3533 }
3534
3535 static void rpccli_wkssvc_NetrGetJoinInformation_done(struct tevent_req *subreq)
3536 {
3537         struct tevent_req *req = tevent_req_callback_data(
3538                 subreq, struct tevent_req);
3539         struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3540                 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3541         NTSTATUS status;
3542         TALLOC_CTX *mem_ctx;
3543
3544         if (state->out_mem_ctx) {
3545                 mem_ctx = state->out_mem_ctx;
3546         } else {
3547                 mem_ctx = state;
3548         }
3549
3550         status = state->dispatch_recv(subreq, mem_ctx);
3551         TALLOC_FREE(subreq);
3552         if (!NT_STATUS_IS_OK(status)) {
3553                 tevent_req_nterror(req, status);
3554                 return;
3555         }
3556
3557         /* Copy out parameters */
3558         *state->orig.out.name_buffer = *state->tmp.out.name_buffer;
3559         *state->orig.out.name_type = *state->tmp.out.name_type;
3560
3561         /* Copy result */
3562         state->orig.out.result = state->tmp.out.result;
3563
3564         /* Reset temporary structure */
3565         ZERO_STRUCT(state->tmp);
3566
3567         if (DEBUGLEVEL >= 10) {
3568                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &state->orig);
3569         }
3570
3571         tevent_req_done(req);
3572 }
3573
3574 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation_recv(struct tevent_req *req,
3575                                                    TALLOC_CTX *mem_ctx,
3576                                                    WERROR *result)
3577 {
3578         struct rpccli_wkssvc_NetrGetJoinInformation_state *state = tevent_req_data(
3579                 req, struct rpccli_wkssvc_NetrGetJoinInformation_state);
3580         NTSTATUS status;
3581
3582         if (tevent_req_is_nterror(req, &status)) {
3583                 tevent_req_received(req);
3584                 return status;
3585         }
3586
3587         /* Steal possbile out parameters to the callers context */
3588         talloc_steal(mem_ctx, state->out_mem_ctx);
3589
3590         /* Return result */
3591         *result = state->orig.out.result;
3592
3593         tevent_req_received(req);
3594         return NT_STATUS_OK;
3595 }
3596
3597 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
3598                                               TALLOC_CTX *mem_ctx,
3599                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
3600                                               const char **name_buffer /* [in,out] [ref,charset(UTF16)] */,
3601                                               enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */,
3602                                               WERROR *werror)
3603 {
3604         struct wkssvc_NetrGetJoinInformation r;
3605         NTSTATUS status;
3606
3607         /* In parameters */
3608         r.in.server_name = server_name;
3609         r.in.name_buffer = name_buffer;
3610
3611         if (DEBUGLEVEL >= 10) {
3612                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &r);
3613         }
3614
3615         status = cli->dispatch(cli,
3616                                 mem_ctx,
3617                                 &ndr_table_wkssvc,
3618                                 NDR_WKSSVC_NETRGETJOININFORMATION,
3619                                 &r);
3620
3621         if (!NT_STATUS_IS_OK(status)) {
3622                 return status;
3623         }
3624
3625         if (DEBUGLEVEL >= 10) {
3626                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &r);
3627         }
3628
3629         if (NT_STATUS_IS_ERR(status)) {
3630                 return status;
3631         }
3632
3633         /* Return variables */
3634         *name_buffer = *r.out.name_buffer;
3635         *name_type = *r.out.name_type;
3636
3637         /* Return result */
3638         if (werror) {
3639                 *werror = r.out.result;
3640         }
3641
3642         return werror_to_ntstatus(r.out.result);
3643 }
3644
3645 struct rpccli_wkssvc_NetrGetJoinableOus_state {
3646         struct wkssvc_NetrGetJoinableOus orig;
3647         struct wkssvc_NetrGetJoinableOus tmp;
3648         TALLOC_CTX *out_mem_ctx;
3649         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3650 };
3651
3652 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq);
3653
3654 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus_send(TALLOC_CTX *mem_ctx,
3655                                                          struct tevent_context *ev,
3656                                                          struct rpc_pipe_client *cli,
3657                                                          const char *_server_name /* [in] [unique,charset(UTF16)] */,
3658                                                          const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3659                                                          const char *_Account /* [in] [unique,charset(UTF16)] */,
3660                                                          const char *_unknown /* [in] [unique,charset(UTF16)] */,
3661                                                          uint32_t *_num_ous /* [in,out] [ref] */,
3662                                                          const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
3663 {
3664         struct tevent_req *req;
3665         struct rpccli_wkssvc_NetrGetJoinableOus_state *state;
3666         struct tevent_req *subreq;
3667
3668         req = tevent_req_create(mem_ctx, &state,
3669                                 struct rpccli_wkssvc_NetrGetJoinableOus_state);
3670         if (req == NULL) {
3671                 return NULL;
3672         }
3673         state->out_mem_ctx = NULL;
3674         state->dispatch_recv = cli->dispatch_recv;
3675
3676         /* In parameters */
3677         state->orig.in.server_name = _server_name;
3678         state->orig.in.domain_name = _domain_name;
3679         state->orig.in.Account = _Account;
3680         state->orig.in.unknown = _unknown;
3681         state->orig.in.num_ous = _num_ous;
3682
3683         /* Out parameters */
3684         state->orig.out.num_ous = _num_ous;
3685         state->orig.out.ous = _ous;
3686
3687         /* Result */
3688         ZERO_STRUCT(state->orig.out.result);
3689
3690         if (DEBUGLEVEL >= 10) {
3691                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
3692         }
3693
3694         state->out_mem_ctx = talloc_named_const(state, 0,
3695                              "rpccli_wkssvc_NetrGetJoinableOus_out_memory");
3696         if (tevent_req_nomem(state->out_mem_ctx, req)) {
3697                 return tevent_req_post(req, ev);
3698         }
3699
3700         /* make a temporary copy, that we pass to the dispatch function */
3701         state->tmp = state->orig;
3702
3703         subreq = cli->dispatch_send(state, ev, cli,
3704                                     &ndr_table_wkssvc,
3705                                     NDR_WKSSVC_NETRGETJOINABLEOUS,
3706                                     &state->tmp);
3707         if (tevent_req_nomem(subreq, req)) {
3708                 return tevent_req_post(req, ev);
3709         }
3710         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus_done, req);
3711         return req;
3712 }
3713
3714 static void rpccli_wkssvc_NetrGetJoinableOus_done(struct tevent_req *subreq)
3715 {
3716         struct tevent_req *req = tevent_req_callback_data(
3717                 subreq, struct tevent_req);
3718         struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3719                 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3720         NTSTATUS status;
3721         TALLOC_CTX *mem_ctx;
3722
3723         if (state->out_mem_ctx) {
3724                 mem_ctx = state->out_mem_ctx;
3725         } else {
3726                 mem_ctx = state;
3727         }
3728
3729         status = state->dispatch_recv(subreq, mem_ctx);
3730         TALLOC_FREE(subreq);
3731         if (!NT_STATUS_IS_OK(status)) {
3732                 tevent_req_nterror(req, status);
3733                 return;
3734         }
3735
3736         /* Copy out parameters */
3737         *state->orig.out.num_ous = *state->tmp.out.num_ous;
3738         *state->orig.out.ous = *state->tmp.out.ous;
3739
3740         /* Copy result */
3741         state->orig.out.result = state->tmp.out.result;
3742
3743         /* Reset temporary structure */
3744         ZERO_STRUCT(state->tmp);
3745
3746         if (DEBUGLEVEL >= 10) {
3747                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &state->orig);
3748         }
3749
3750         tevent_req_done(req);
3751 }
3752
3753 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus_recv(struct tevent_req *req,
3754                                                TALLOC_CTX *mem_ctx,
3755                                                WERROR *result)
3756 {
3757         struct rpccli_wkssvc_NetrGetJoinableOus_state *state = tevent_req_data(
3758                 req, struct rpccli_wkssvc_NetrGetJoinableOus_state);
3759         NTSTATUS status;
3760
3761         if (tevent_req_is_nterror(req, &status)) {
3762                 tevent_req_received(req);
3763                 return status;
3764         }
3765
3766         /* Steal possbile out parameters to the callers context */
3767         talloc_steal(mem_ctx, state->out_mem_ctx);
3768
3769         /* Return result */
3770         *result = state->orig.out.result;
3771
3772         tevent_req_received(req);
3773         return NT_STATUS_OK;
3774 }
3775
3776 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
3777                                           TALLOC_CTX *mem_ctx,
3778                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
3779                                           const char *domain_name /* [in] [ref,charset(UTF16)] */,
3780                                           const char *Account /* [in] [unique,charset(UTF16)] */,
3781                                           const char *unknown /* [in] [unique,charset(UTF16)] */,
3782                                           uint32_t *num_ous /* [in,out] [ref] */,
3783                                           const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
3784                                           WERROR *werror)
3785 {
3786         struct wkssvc_NetrGetJoinableOus r;
3787         NTSTATUS status;
3788
3789         /* In parameters */
3790         r.in.server_name = server_name;
3791         r.in.domain_name = domain_name;
3792         r.in.Account = Account;
3793         r.in.unknown = unknown;
3794         r.in.num_ous = num_ous;
3795
3796         if (DEBUGLEVEL >= 10) {
3797                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &r);
3798         }
3799
3800         status = cli->dispatch(cli,
3801                                 mem_ctx,
3802                                 &ndr_table_wkssvc,
3803                                 NDR_WKSSVC_NETRGETJOINABLEOUS,
3804                                 &r);
3805
3806         if (!NT_STATUS_IS_OK(status)) {
3807                 return status;
3808         }
3809
3810         if (DEBUGLEVEL >= 10) {
3811                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &r);
3812         }
3813
3814         if (NT_STATUS_IS_ERR(status)) {
3815                 return status;
3816         }
3817
3818         /* Return variables */
3819         *num_ous = *r.out.num_ous;
3820         *ous = *r.out.ous;
3821
3822         /* Return result */
3823         if (werror) {
3824                 *werror = r.out.result;
3825         }
3826
3827         return werror_to_ntstatus(r.out.result);
3828 }
3829
3830 struct rpccli_wkssvc_NetrJoinDomain2_state {
3831         struct wkssvc_NetrJoinDomain2 orig;
3832         struct wkssvc_NetrJoinDomain2 tmp;
3833         TALLOC_CTX *out_mem_ctx;
3834         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
3835 };
3836
3837 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq);
3838
3839 struct tevent_req *rpccli_wkssvc_NetrJoinDomain2_send(TALLOC_CTX *mem_ctx,
3840                                                       struct tevent_context *ev,
3841                                                       struct rpc_pipe_client *cli,
3842                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
3843                                                       const char *_domain_name /* [in] [ref,charset(UTF16)] */,
3844                                                       const char *_account_ou /* [in] [unique,charset(UTF16)] */,
3845                                                       const char *_admin_account /* [in] [unique,charset(UTF16)] */,
3846                                                       struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
3847                                                       uint32_t _join_flags /* [in]  */)
3848 {
3849         struct tevent_req *req;
3850         struct rpccli_wkssvc_NetrJoinDomain2_state *state;
3851         struct tevent_req *subreq;
3852
3853         req = tevent_req_create(mem_ctx, &state,
3854                                 struct rpccli_wkssvc_NetrJoinDomain2_state);
3855         if (req == NULL) {
3856                 return NULL;
3857         }
3858         state->out_mem_ctx = NULL;
3859         state->dispatch_recv = cli->dispatch_recv;
3860
3861         /* In parameters */
3862         state->orig.in.server_name = _server_name;
3863         state->orig.in.domain_name = _domain_name;
3864         state->orig.in.account_ou = _account_ou;
3865         state->orig.in.admin_account = _admin_account;
3866         state->orig.in.encrypted_password = _encrypted_password;
3867         state->orig.in.join_flags = _join_flags;
3868
3869         /* Out parameters */
3870
3871         /* Result */
3872         ZERO_STRUCT(state->orig.out.result);
3873
3874         if (DEBUGLEVEL >= 10) {
3875                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
3876         }
3877
3878         /* make a temporary copy, that we pass to the dispatch function */
3879         state->tmp = state->orig;
3880
3881         subreq = cli->dispatch_send(state, ev, cli,
3882                                     &ndr_table_wkssvc,
3883                                     NDR_WKSSVC_NETRJOINDOMAIN2,
3884                                     &state->tmp);
3885         if (tevent_req_nomem(subreq, req)) {
3886                 return tevent_req_post(req, ev);
3887         }
3888         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrJoinDomain2_done, req);
3889         return req;
3890 }
3891
3892 static void rpccli_wkssvc_NetrJoinDomain2_done(struct tevent_req *subreq)
3893 {
3894         struct tevent_req *req = tevent_req_callback_data(
3895                 subreq, struct tevent_req);
3896         struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3897                 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3898         NTSTATUS status;
3899         TALLOC_CTX *mem_ctx;
3900
3901         if (state->out_mem_ctx) {
3902                 mem_ctx = state->out_mem_ctx;
3903         } else {
3904                 mem_ctx = state;
3905         }
3906
3907         status = state->dispatch_recv(subreq, mem_ctx);
3908         TALLOC_FREE(subreq);
3909         if (!NT_STATUS_IS_OK(status)) {
3910                 tevent_req_nterror(req, status);
3911                 return;
3912         }
3913
3914         /* Copy out parameters */
3915
3916         /* Copy result */
3917         state->orig.out.result = state->tmp.out.result;
3918
3919         /* Reset temporary structure */
3920         ZERO_STRUCT(state->tmp);
3921
3922         if (DEBUGLEVEL >= 10) {
3923                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &state->orig);
3924         }
3925
3926         tevent_req_done(req);
3927 }
3928
3929 NTSTATUS rpccli_wkssvc_NetrJoinDomain2_recv(struct tevent_req *req,
3930                                             TALLOC_CTX *mem_ctx,
3931                                             WERROR *result)
3932 {
3933         struct rpccli_wkssvc_NetrJoinDomain2_state *state = tevent_req_data(
3934                 req, struct rpccli_wkssvc_NetrJoinDomain2_state);
3935         NTSTATUS status;
3936
3937         if (tevent_req_is_nterror(req, &status)) {
3938                 tevent_req_received(req);
3939                 return status;
3940         }
3941
3942         /* Steal possbile out parameters to the callers context */
3943         talloc_steal(mem_ctx, state->out_mem_ctx);
3944
3945         /* Return result */
3946         *result = state->orig.out.result;
3947
3948         tevent_req_received(req);
3949         return NT_STATUS_OK;
3950 }
3951
3952 NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
3953                                        TALLOC_CTX *mem_ctx,
3954                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
3955                                        const char *domain_name /* [in] [ref,charset(UTF16)] */,
3956                                        const char *account_ou /* [in] [unique,charset(UTF16)] */,
3957                                        const char *admin_account /* [in] [unique,charset(UTF16)] */,
3958                                        struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
3959                                        uint32_t join_flags /* [in]  */,
3960                                        WERROR *werror)
3961 {
3962         struct wkssvc_NetrJoinDomain2 r;
3963         NTSTATUS status;
3964
3965         /* In parameters */
3966         r.in.server_name = server_name;
3967         r.in.domain_name = domain_name;
3968         r.in.account_ou = account_ou;
3969         r.in.admin_account = admin_account;
3970         r.in.encrypted_password = encrypted_password;
3971         r.in.join_flags = join_flags;
3972
3973         if (DEBUGLEVEL >= 10) {
3974                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &r);
3975         }
3976
3977         status = cli->dispatch(cli,
3978                                 mem_ctx,
3979                                 &ndr_table_wkssvc,
3980                                 NDR_WKSSVC_NETRJOINDOMAIN2,
3981                                 &r);
3982
3983         if (!NT_STATUS_IS_OK(status)) {
3984                 return status;
3985         }
3986
3987         if (DEBUGLEVEL >= 10) {
3988                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r);
3989         }
3990
3991         if (NT_STATUS_IS_ERR(status)) {
3992                 return status;
3993         }
3994
3995         /* Return variables */
3996
3997         /* Return result */
3998         if (werror) {
3999                 *werror = r.out.result;
4000         }
4001
4002         return werror_to_ntstatus(r.out.result);
4003 }
4004
4005 struct rpccli_wkssvc_NetrUnjoinDomain2_state {
4006         struct wkssvc_NetrUnjoinDomain2 orig;
4007         struct wkssvc_NetrUnjoinDomain2 tmp;
4008         TALLOC_CTX *out_mem_ctx;
4009         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4010 };
4011
4012 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq);
4013
4014 struct tevent_req *rpccli_wkssvc_NetrUnjoinDomain2_send(TALLOC_CTX *mem_ctx,
4015                                                         struct tevent_context *ev,
4016                                                         struct rpc_pipe_client *cli,
4017                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
4018                                                         const char *_account /* [in] [unique,charset(UTF16)] */,
4019                                                         struct wkssvc_PasswordBuffer *_encrypted_password /* [in] [unique] */,
4020                                                         uint32_t _unjoin_flags /* [in]  */)
4021 {
4022         struct tevent_req *req;
4023         struct rpccli_wkssvc_NetrUnjoinDomain2_state *state;
4024         struct tevent_req *subreq;
4025
4026         req = tevent_req_create(mem_ctx, &state,
4027                                 struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4028         if (req == NULL) {
4029                 return NULL;
4030         }
4031         state->out_mem_ctx = NULL;
4032         state->dispatch_recv = cli->dispatch_recv;
4033
4034         /* In parameters */
4035         state->orig.in.server_name = _server_name;
4036         state->orig.in.account = _account;
4037         state->orig.in.encrypted_password = _encrypted_password;
4038         state->orig.in.unjoin_flags = _unjoin_flags;
4039
4040         /* Out parameters */
4041
4042         /* Result */
4043         ZERO_STRUCT(state->orig.out.result);
4044
4045         if (DEBUGLEVEL >= 10) {
4046                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
4047         }
4048
4049         /* make a temporary copy, that we pass to the dispatch function */
4050         state->tmp = state->orig;
4051
4052         subreq = cli->dispatch_send(state, ev, cli,
4053                                     &ndr_table_wkssvc,
4054                                     NDR_WKSSVC_NETRUNJOINDOMAIN2,
4055                                     &state->tmp);
4056         if (tevent_req_nomem(subreq, req)) {
4057                 return tevent_req_post(req, ev);
4058         }
4059         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrUnjoinDomain2_done, req);
4060         return req;
4061 }
4062
4063 static void rpccli_wkssvc_NetrUnjoinDomain2_done(struct tevent_req *subreq)
4064 {
4065         struct tevent_req *req = tevent_req_callback_data(
4066                 subreq, struct tevent_req);
4067         struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
4068                 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4069         NTSTATUS status;
4070         TALLOC_CTX *mem_ctx;
4071
4072         if (state->out_mem_ctx) {
4073                 mem_ctx = state->out_mem_ctx;
4074         } else {
4075                 mem_ctx = state;
4076         }
4077
4078         status = state->dispatch_recv(subreq, mem_ctx);
4079         TALLOC_FREE(subreq);
4080         if (!NT_STATUS_IS_OK(status)) {
4081                 tevent_req_nterror(req, status);
4082                 return;
4083         }
4084
4085         /* Copy out parameters */
4086
4087         /* Copy result */
4088         state->orig.out.result = state->tmp.out.result;
4089
4090         /* Reset temporary structure */
4091         ZERO_STRUCT(state->tmp);
4092
4093         if (DEBUGLEVEL >= 10) {
4094                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &state->orig);
4095         }
4096
4097         tevent_req_done(req);
4098 }
4099
4100 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2_recv(struct tevent_req *req,
4101                                               TALLOC_CTX *mem_ctx,
4102                                               WERROR *result)
4103 {
4104         struct rpccli_wkssvc_NetrUnjoinDomain2_state *state = tevent_req_data(
4105                 req, struct rpccli_wkssvc_NetrUnjoinDomain2_state);
4106         NTSTATUS status;
4107
4108         if (tevent_req_is_nterror(req, &status)) {
4109                 tevent_req_received(req);
4110                 return status;
4111         }
4112
4113         /* Steal possbile out parameters to the callers context */
4114         talloc_steal(mem_ctx, state->out_mem_ctx);
4115
4116         /* Return result */
4117         *result = state->orig.out.result;
4118
4119         tevent_req_received(req);
4120         return NT_STATUS_OK;
4121 }
4122
4123 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
4124                                          TALLOC_CTX *mem_ctx,
4125                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
4126                                          const char *account /* [in] [unique,charset(UTF16)] */,
4127                                          struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
4128                                          uint32_t unjoin_flags /* [in]  */,
4129                                          WERROR *werror)
4130 {
4131         struct wkssvc_NetrUnjoinDomain2 r;
4132         NTSTATUS status;
4133
4134         /* In parameters */
4135         r.in.server_name = server_name;
4136         r.in.account = account;
4137         r.in.encrypted_password = encrypted_password;
4138         r.in.unjoin_flags = unjoin_flags;
4139
4140         if (DEBUGLEVEL >= 10) {
4141                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
4142         }
4143
4144         status = cli->dispatch(cli,
4145                                 mem_ctx,
4146                                 &ndr_table_wkssvc,
4147                                 NDR_WKSSVC_NETRUNJOINDOMAIN2,
4148                                 &r);
4149
4150         if (!NT_STATUS_IS_OK(status)) {
4151                 return status;
4152         }
4153
4154         if (DEBUGLEVEL >= 10) {
4155                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
4156         }
4157
4158         if (NT_STATUS_IS_ERR(status)) {
4159                 return status;
4160         }
4161
4162         /* Return variables */
4163
4164         /* Return result */
4165         if (werror) {
4166                 *werror = r.out.result;
4167         }
4168
4169         return werror_to_ntstatus(r.out.result);
4170 }
4171
4172 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state {
4173         struct wkssvc_NetrRenameMachineInDomain2 orig;
4174         struct wkssvc_NetrRenameMachineInDomain2 tmp;
4175         TALLOC_CTX *out_mem_ctx;
4176         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4177 };
4178
4179 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq);
4180
4181 struct tevent_req *rpccli_wkssvc_NetrRenameMachineInDomain2_send(TALLOC_CTX *mem_ctx,
4182                                                                  struct tevent_context *ev,
4183                                                                  struct rpc_pipe_client *cli,
4184                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
4185                                                                  const char *_NewMachineName /* [in] [unique,charset(UTF16)] */,
4186                                                                  const char *_Account /* [in] [unique,charset(UTF16)] */,
4187                                                                  struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4188                                                                  uint32_t _RenameOptions /* [in]  */)
4189 {
4190         struct tevent_req *req;
4191         struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state;
4192         struct tevent_req *subreq;
4193
4194         req = tevent_req_create(mem_ctx, &state,
4195                                 struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4196         if (req == NULL) {
4197                 return NULL;
4198         }
4199         state->out_mem_ctx = NULL;
4200         state->dispatch_recv = cli->dispatch_recv;
4201
4202         /* In parameters */
4203         state->orig.in.server_name = _server_name;
4204         state->orig.in.NewMachineName = _NewMachineName;
4205         state->orig.in.Account = _Account;
4206         state->orig.in.EncryptedPassword = _EncryptedPassword;
4207         state->orig.in.RenameOptions = _RenameOptions;
4208
4209         /* Out parameters */
4210
4211         /* Result */
4212         ZERO_STRUCT(state->orig.out.result);
4213
4214         if (DEBUGLEVEL >= 10) {
4215                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
4216         }
4217
4218         /* make a temporary copy, that we pass to the dispatch function */
4219         state->tmp = state->orig;
4220
4221         subreq = cli->dispatch_send(state, ev, cli,
4222                                     &ndr_table_wkssvc,
4223                                     NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
4224                                     &state->tmp);
4225         if (tevent_req_nomem(subreq, req)) {
4226                 return tevent_req_post(req, ev);
4227         }
4228         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRenameMachineInDomain2_done, req);
4229         return req;
4230 }
4231
4232 static void rpccli_wkssvc_NetrRenameMachineInDomain2_done(struct tevent_req *subreq)
4233 {
4234         struct tevent_req *req = tevent_req_callback_data(
4235                 subreq, struct tevent_req);
4236         struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
4237                 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4238         NTSTATUS status;
4239         TALLOC_CTX *mem_ctx;
4240
4241         if (state->out_mem_ctx) {
4242                 mem_ctx = state->out_mem_ctx;
4243         } else {
4244                 mem_ctx = state;
4245         }
4246
4247         status = state->dispatch_recv(subreq, mem_ctx);
4248         TALLOC_FREE(subreq);
4249         if (!NT_STATUS_IS_OK(status)) {
4250                 tevent_req_nterror(req, status);
4251                 return;
4252         }
4253
4254         /* Copy out parameters */
4255
4256         /* Copy result */
4257         state->orig.out.result = state->tmp.out.result;
4258
4259         /* Reset temporary structure */
4260         ZERO_STRUCT(state->tmp);
4261
4262         if (DEBUGLEVEL >= 10) {
4263                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &state->orig);
4264         }
4265
4266         tevent_req_done(req);
4267 }
4268
4269 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2_recv(struct tevent_req *req,
4270                                                        TALLOC_CTX *mem_ctx,
4271                                                        WERROR *result)
4272 {
4273         struct rpccli_wkssvc_NetrRenameMachineInDomain2_state *state = tevent_req_data(
4274                 req, struct rpccli_wkssvc_NetrRenameMachineInDomain2_state);
4275         NTSTATUS status;
4276
4277         if (tevent_req_is_nterror(req, &status)) {
4278                 tevent_req_received(req);
4279                 return status;
4280         }
4281
4282         /* Steal possbile out parameters to the callers context */
4283         talloc_steal(mem_ctx, state->out_mem_ctx);
4284
4285         /* Return result */
4286         *result = state->orig.out.result;
4287
4288         tevent_req_received(req);
4289         return NT_STATUS_OK;
4290 }
4291
4292 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
4293                                                   TALLOC_CTX *mem_ctx,
4294                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
4295                                                   const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
4296                                                   const char *Account /* [in] [unique,charset(UTF16)] */,
4297                                                   struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4298                                                   uint32_t RenameOptions /* [in]  */,
4299                                                   WERROR *werror)
4300 {
4301         struct wkssvc_NetrRenameMachineInDomain2 r;
4302         NTSTATUS status;
4303
4304         /* In parameters */
4305         r.in.server_name = server_name;
4306         r.in.NewMachineName = NewMachineName;
4307         r.in.Account = Account;
4308         r.in.EncryptedPassword = EncryptedPassword;
4309         r.in.RenameOptions = RenameOptions;
4310
4311         if (DEBUGLEVEL >= 10) {
4312                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
4313         }
4314
4315         status = cli->dispatch(cli,
4316                                 mem_ctx,
4317                                 &ndr_table_wkssvc,
4318                                 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
4319                                 &r);
4320
4321         if (!NT_STATUS_IS_OK(status)) {
4322                 return status;
4323         }
4324
4325         if (DEBUGLEVEL >= 10) {
4326                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
4327         }
4328
4329         if (NT_STATUS_IS_ERR(status)) {
4330                 return status;
4331         }
4332
4333         /* Return variables */
4334
4335         /* Return result */
4336         if (werror) {
4337                 *werror = r.out.result;
4338         }
4339
4340         return werror_to_ntstatus(r.out.result);
4341 }
4342
4343 struct rpccli_wkssvc_NetrValidateName2_state {
4344         struct wkssvc_NetrValidateName2 orig;
4345         struct wkssvc_NetrValidateName2 tmp;
4346         TALLOC_CTX *out_mem_ctx;
4347         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4348 };
4349
4350 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq);
4351
4352 struct tevent_req *rpccli_wkssvc_NetrValidateName2_send(TALLOC_CTX *mem_ctx,
4353                                                         struct tevent_context *ev,
4354                                                         struct rpc_pipe_client *cli,
4355                                                         const char *_server_name /* [in] [unique,charset(UTF16)] */,
4356                                                         const char *_name /* [in] [ref,charset(UTF16)] */,
4357                                                         const char *_Account /* [in] [unique,charset(UTF16)] */,
4358                                                         struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4359                                                         enum wkssvc_NetValidateNameType _name_type /* [in]  */)
4360 {
4361         struct tevent_req *req;
4362         struct rpccli_wkssvc_NetrValidateName2_state *state;
4363         struct tevent_req *subreq;
4364
4365         req = tevent_req_create(mem_ctx, &state,
4366                                 struct rpccli_wkssvc_NetrValidateName2_state);
4367         if (req == NULL) {
4368                 return NULL;
4369         }
4370         state->out_mem_ctx = NULL;
4371         state->dispatch_recv = cli->dispatch_recv;
4372
4373         /* In parameters */
4374         state->orig.in.server_name = _server_name;
4375         state->orig.in.name = _name;
4376         state->orig.in.Account = _Account;
4377         state->orig.in.EncryptedPassword = _EncryptedPassword;
4378         state->orig.in.name_type = _name_type;
4379
4380         /* Out parameters */
4381
4382         /* Result */
4383         ZERO_STRUCT(state->orig.out.result);
4384
4385         if (DEBUGLEVEL >= 10) {
4386                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &state->orig);
4387         }
4388
4389         /* make a temporary copy, that we pass to the dispatch function */
4390         state->tmp = state->orig;
4391
4392         subreq = cli->dispatch_send(state, ev, cli,
4393                                     &ndr_table_wkssvc,
4394                                     NDR_WKSSVC_NETRVALIDATENAME2,
4395                                     &state->tmp);
4396         if (tevent_req_nomem(subreq, req)) {
4397                 return tevent_req_post(req, ev);
4398         }
4399         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrValidateName2_done, req);
4400         return req;
4401 }
4402
4403 static void rpccli_wkssvc_NetrValidateName2_done(struct tevent_req *subreq)
4404 {
4405         struct tevent_req *req = tevent_req_callback_data(
4406                 subreq, struct tevent_req);
4407         struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4408                 req, struct rpccli_wkssvc_NetrValidateName2_state);
4409         NTSTATUS status;
4410         TALLOC_CTX *mem_ctx;
4411
4412         if (state->out_mem_ctx) {
4413                 mem_ctx = state->out_mem_ctx;
4414         } else {
4415                 mem_ctx = state;
4416         }
4417
4418         status = state->dispatch_recv(subreq, mem_ctx);
4419         TALLOC_FREE(subreq);
4420         if (!NT_STATUS_IS_OK(status)) {
4421                 tevent_req_nterror(req, status);
4422                 return;
4423         }
4424
4425         /* Copy out parameters */
4426
4427         /* Copy result */
4428         state->orig.out.result = state->tmp.out.result;
4429
4430         /* Reset temporary structure */
4431         ZERO_STRUCT(state->tmp);
4432
4433         if (DEBUGLEVEL >= 10) {
4434                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &state->orig);
4435         }
4436
4437         tevent_req_done(req);
4438 }
4439
4440 NTSTATUS rpccli_wkssvc_NetrValidateName2_recv(struct tevent_req *req,
4441                                               TALLOC_CTX *mem_ctx,
4442                                               WERROR *result)
4443 {
4444         struct rpccli_wkssvc_NetrValidateName2_state *state = tevent_req_data(
4445                 req, struct rpccli_wkssvc_NetrValidateName2_state);
4446         NTSTATUS status;
4447
4448         if (tevent_req_is_nterror(req, &status)) {
4449                 tevent_req_received(req);
4450                 return status;
4451         }
4452
4453         /* Steal possbile out parameters to the callers context */
4454         talloc_steal(mem_ctx, state->out_mem_ctx);
4455
4456         /* Return result */
4457         *result = state->orig.out.result;
4458
4459         tevent_req_received(req);
4460         return NT_STATUS_OK;
4461 }
4462
4463 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
4464                                          TALLOC_CTX *mem_ctx,
4465                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
4466                                          const char *name /* [in] [ref,charset(UTF16)] */,
4467                                          const char *Account /* [in] [unique,charset(UTF16)] */,
4468                                          struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4469                                          enum wkssvc_NetValidateNameType name_type /* [in]  */,
4470                                          WERROR *werror)
4471 {
4472         struct wkssvc_NetrValidateName2 r;
4473         NTSTATUS status;
4474
4475         /* In parameters */
4476         r.in.server_name = server_name;
4477         r.in.name = name;
4478         r.in.Account = Account;
4479         r.in.EncryptedPassword = EncryptedPassword;
4480         r.in.name_type = name_type;
4481
4482         if (DEBUGLEVEL >= 10) {
4483                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &r);
4484         }
4485
4486         status = cli->dispatch(cli,
4487                                 mem_ctx,
4488                                 &ndr_table_wkssvc,
4489                                 NDR_WKSSVC_NETRVALIDATENAME2,
4490                                 &r);
4491
4492         if (!NT_STATUS_IS_OK(status)) {
4493                 return status;
4494         }
4495
4496         if (DEBUGLEVEL >= 10) {
4497                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &r);
4498         }
4499
4500         if (NT_STATUS_IS_ERR(status)) {
4501                 return status;
4502         }
4503
4504         /* Return variables */
4505
4506         /* Return result */
4507         if (werror) {
4508                 *werror = r.out.result;
4509         }
4510
4511         return werror_to_ntstatus(r.out.result);
4512 }
4513
4514 struct rpccli_wkssvc_NetrGetJoinableOus2_state {
4515         struct wkssvc_NetrGetJoinableOus2 orig;
4516         struct wkssvc_NetrGetJoinableOus2 tmp;
4517         TALLOC_CTX *out_mem_ctx;
4518         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4519 };
4520
4521 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq);
4522
4523 struct tevent_req *rpccli_wkssvc_NetrGetJoinableOus2_send(TALLOC_CTX *mem_ctx,
4524                                                           struct tevent_context *ev,
4525                                                           struct rpc_pipe_client *cli,
4526                                                           const char *_server_name /* [in] [unique,charset(UTF16)] */,
4527                                                           const char *_domain_name /* [in] [ref,charset(UTF16)] */,
4528                                                           const char *_Account /* [in] [unique,charset(UTF16)] */,
4529                                                           struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4530                                                           uint32_t *_num_ous /* [in,out] [ref] */,
4531                                                           const char ***_ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */)
4532 {
4533         struct tevent_req *req;
4534         struct rpccli_wkssvc_NetrGetJoinableOus2_state *state;
4535         struct tevent_req *subreq;
4536
4537         req = tevent_req_create(mem_ctx, &state,
4538                                 struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4539         if (req == NULL) {
4540                 return NULL;
4541         }
4542         state->out_mem_ctx = NULL;
4543         state->dispatch_recv = cli->dispatch_recv;
4544
4545         /* In parameters */
4546         state->orig.in.server_name = _server_name;
4547         state->orig.in.domain_name = _domain_name;
4548         state->orig.in.Account = _Account;
4549         state->orig.in.EncryptedPassword = _EncryptedPassword;
4550         state->orig.in.num_ous = _num_ous;
4551
4552         /* Out parameters */
4553         state->orig.out.num_ous = _num_ous;
4554         state->orig.out.ous = _ous;
4555
4556         /* Result */
4557         ZERO_STRUCT(state->orig.out.result);
4558
4559         if (DEBUGLEVEL >= 10) {
4560                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
4561         }
4562
4563         state->out_mem_ctx = talloc_named_const(state, 0,
4564                              "rpccli_wkssvc_NetrGetJoinableOus2_out_memory");
4565         if (tevent_req_nomem(state->out_mem_ctx, req)) {
4566                 return tevent_req_post(req, ev);
4567         }
4568
4569         /* make a temporary copy, that we pass to the dispatch function */
4570         state->tmp = state->orig;
4571
4572         subreq = cli->dispatch_send(state, ev, cli,
4573                                     &ndr_table_wkssvc,
4574                                     NDR_WKSSVC_NETRGETJOINABLEOUS2,
4575                                     &state->tmp);
4576         if (tevent_req_nomem(subreq, req)) {
4577                 return tevent_req_post(req, ev);
4578         }
4579         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrGetJoinableOus2_done, req);
4580         return req;
4581 }
4582
4583 static void rpccli_wkssvc_NetrGetJoinableOus2_done(struct tevent_req *subreq)
4584 {
4585         struct tevent_req *req = tevent_req_callback_data(
4586                 subreq, struct tevent_req);
4587         struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4588                 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4589         NTSTATUS status;
4590         TALLOC_CTX *mem_ctx;
4591
4592         if (state->out_mem_ctx) {
4593                 mem_ctx = state->out_mem_ctx;
4594         } else {
4595                 mem_ctx = state;
4596         }
4597
4598         status = state->dispatch_recv(subreq, mem_ctx);
4599         TALLOC_FREE(subreq);
4600         if (!NT_STATUS_IS_OK(status)) {
4601                 tevent_req_nterror(req, status);
4602                 return;
4603         }
4604
4605         /* Copy out parameters */
4606         *state->orig.out.num_ous = *state->tmp.out.num_ous;
4607         *state->orig.out.ous = *state->tmp.out.ous;
4608
4609         /* Copy result */
4610         state->orig.out.result = state->tmp.out.result;
4611
4612         /* Reset temporary structure */
4613         ZERO_STRUCT(state->tmp);
4614
4615         if (DEBUGLEVEL >= 10) {
4616                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &state->orig);
4617         }
4618
4619         tevent_req_done(req);
4620 }
4621
4622 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2_recv(struct tevent_req *req,
4623                                                 TALLOC_CTX *mem_ctx,
4624                                                 WERROR *result)
4625 {
4626         struct rpccli_wkssvc_NetrGetJoinableOus2_state *state = tevent_req_data(
4627                 req, struct rpccli_wkssvc_NetrGetJoinableOus2_state);
4628         NTSTATUS status;
4629
4630         if (tevent_req_is_nterror(req, &status)) {
4631                 tevent_req_received(req);
4632                 return status;
4633         }
4634
4635         /* Steal possbile out parameters to the callers context */
4636         talloc_steal(mem_ctx, state->out_mem_ctx);
4637
4638         /* Return result */
4639         *result = state->orig.out.result;
4640
4641         tevent_req_received(req);
4642         return NT_STATUS_OK;
4643 }
4644
4645 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
4646                                            TALLOC_CTX *mem_ctx,
4647                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
4648                                            const char *domain_name /* [in] [ref,charset(UTF16)] */,
4649                                            const char *Account /* [in] [unique,charset(UTF16)] */,
4650                                            struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4651                                            uint32_t *num_ous /* [in,out] [ref] */,
4652                                            const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
4653                                            WERROR *werror)
4654 {
4655         struct wkssvc_NetrGetJoinableOus2 r;
4656         NTSTATUS status;
4657
4658         /* In parameters */
4659         r.in.server_name = server_name;
4660         r.in.domain_name = domain_name;
4661         r.in.Account = Account;
4662         r.in.EncryptedPassword = EncryptedPassword;
4663         r.in.num_ous = num_ous;
4664
4665         if (DEBUGLEVEL >= 10) {
4666                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
4667         }
4668
4669         status = cli->dispatch(cli,
4670                                 mem_ctx,
4671                                 &ndr_table_wkssvc,
4672                                 NDR_WKSSVC_NETRGETJOINABLEOUS2,
4673                                 &r);
4674
4675         if (!NT_STATUS_IS_OK(status)) {
4676                 return status;
4677         }
4678
4679         if (DEBUGLEVEL >= 10) {
4680                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
4681         }
4682
4683         if (NT_STATUS_IS_ERR(status)) {
4684                 return status;
4685         }
4686
4687         /* Return variables */
4688         *num_ous = *r.out.num_ous;
4689         *ous = *r.out.ous;
4690
4691         /* Return result */
4692         if (werror) {
4693                 *werror = r.out.result;
4694         }
4695
4696         return werror_to_ntstatus(r.out.result);
4697 }
4698
4699 struct rpccli_wkssvc_NetrAddAlternateComputerName_state {
4700         struct wkssvc_NetrAddAlternateComputerName orig;
4701         struct wkssvc_NetrAddAlternateComputerName tmp;
4702         TALLOC_CTX *out_mem_ctx;
4703         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4704 };
4705
4706 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq);
4707
4708 struct tevent_req *rpccli_wkssvc_NetrAddAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4709                                                                    struct tevent_context *ev,
4710                                                                    struct rpc_pipe_client *cli,
4711                                                                    const char *_server_name /* [in] [unique,charset(UTF16)] */,
4712                                                                    const char *_NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4713                                                                    const char *_Account /* [in] [unique,charset(UTF16)] */,
4714                                                                    struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4715                                                                    uint32_t _Reserved /* [in]  */)
4716 {
4717         struct tevent_req *req;
4718         struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state;
4719         struct tevent_req *subreq;
4720
4721         req = tevent_req_create(mem_ctx, &state,
4722                                 struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4723         if (req == NULL) {
4724                 return NULL;
4725         }
4726         state->out_mem_ctx = NULL;
4727         state->dispatch_recv = cli->dispatch_recv;
4728
4729         /* In parameters */
4730         state->orig.in.server_name = _server_name;
4731         state->orig.in.NewAlternateMachineName = _NewAlternateMachineName;
4732         state->orig.in.Account = _Account;
4733         state->orig.in.EncryptedPassword = _EncryptedPassword;
4734         state->orig.in.Reserved = _Reserved;
4735
4736         /* Out parameters */
4737
4738         /* Result */
4739         ZERO_STRUCT(state->orig.out.result);
4740
4741         if (DEBUGLEVEL >= 10) {
4742                 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
4743         }
4744
4745         /* make a temporary copy, that we pass to the dispatch function */
4746         state->tmp = state->orig;
4747
4748         subreq = cli->dispatch_send(state, ev, cli,
4749                                     &ndr_table_wkssvc,
4750                                     NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4751                                     &state->tmp);
4752         if (tevent_req_nomem(subreq, req)) {
4753                 return tevent_req_post(req, ev);
4754         }
4755         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrAddAlternateComputerName_done, req);
4756         return req;
4757 }
4758
4759 static void rpccli_wkssvc_NetrAddAlternateComputerName_done(struct tevent_req *subreq)
4760 {
4761         struct tevent_req *req = tevent_req_callback_data(
4762                 subreq, struct tevent_req);
4763         struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4764                 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4765         NTSTATUS status;
4766         TALLOC_CTX *mem_ctx;
4767
4768         if (state->out_mem_ctx) {
4769                 mem_ctx = state->out_mem_ctx;
4770         } else {
4771                 mem_ctx = state;
4772         }
4773
4774         status = state->dispatch_recv(subreq, mem_ctx);
4775         TALLOC_FREE(subreq);
4776         if (!NT_STATUS_IS_OK(status)) {
4777                 tevent_req_nterror(req, status);
4778                 return;
4779         }
4780
4781         /* Copy out parameters */
4782
4783         /* Copy result */
4784         state->orig.out.result = state->tmp.out.result;
4785
4786         /* Reset temporary structure */
4787         ZERO_STRUCT(state->tmp);
4788
4789         if (DEBUGLEVEL >= 10) {
4790                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &state->orig);
4791         }
4792
4793         tevent_req_done(req);
4794 }
4795
4796 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName_recv(struct tevent_req *req,
4797                                                          TALLOC_CTX *mem_ctx,
4798                                                          WERROR *result)
4799 {
4800         struct rpccli_wkssvc_NetrAddAlternateComputerName_state *state = tevent_req_data(
4801                 req, struct rpccli_wkssvc_NetrAddAlternateComputerName_state);
4802         NTSTATUS status;
4803
4804         if (tevent_req_is_nterror(req, &status)) {
4805                 tevent_req_received(req);
4806                 return status;
4807         }
4808
4809         /* Steal possbile out parameters to the callers context */
4810         talloc_steal(mem_ctx, state->out_mem_ctx);
4811
4812         /* Return result */
4813         *result = state->orig.out.result;
4814
4815         tevent_req_received(req);
4816         return NT_STATUS_OK;
4817 }
4818
4819 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
4820                                                     TALLOC_CTX *mem_ctx,
4821                                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
4822                                                     const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
4823                                                     const char *Account /* [in] [unique,charset(UTF16)] */,
4824                                                     struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4825                                                     uint32_t Reserved /* [in]  */,
4826                                                     WERROR *werror)
4827 {
4828         struct wkssvc_NetrAddAlternateComputerName r;
4829         NTSTATUS status;
4830
4831         /* In parameters */
4832         r.in.server_name = server_name;
4833         r.in.NewAlternateMachineName = NewAlternateMachineName;
4834         r.in.Account = Account;
4835         r.in.EncryptedPassword = EncryptedPassword;
4836         r.in.Reserved = Reserved;
4837
4838         if (DEBUGLEVEL >= 10) {
4839                 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
4840         }
4841
4842         status = cli->dispatch(cli,
4843                                 mem_ctx,
4844                                 &ndr_table_wkssvc,
4845                                 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
4846                                 &r);
4847
4848         if (!NT_STATUS_IS_OK(status)) {
4849                 return status;
4850         }
4851
4852         if (DEBUGLEVEL >= 10) {
4853                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
4854         }
4855
4856         if (NT_STATUS_IS_ERR(status)) {
4857                 return status;
4858         }
4859
4860         /* Return variables */
4861
4862         /* Return result */
4863         if (werror) {
4864                 *werror = r.out.result;
4865         }
4866
4867         return werror_to_ntstatus(r.out.result);
4868 }
4869
4870 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state {
4871         struct wkssvc_NetrRemoveAlternateComputerName orig;
4872         struct wkssvc_NetrRemoveAlternateComputerName tmp;
4873         TALLOC_CTX *out_mem_ctx;
4874         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
4875 };
4876
4877 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq);
4878
4879 struct tevent_req *rpccli_wkssvc_NetrRemoveAlternateComputerName_send(TALLOC_CTX *mem_ctx,
4880                                                                       struct tevent_context *ev,
4881                                                                       struct rpc_pipe_client *cli,
4882                                                                       const char *_server_name /* [in] [unique,charset(UTF16)] */,
4883                                                                       const char *_AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4884                                                                       const char *_Account /* [in] [unique,charset(UTF16)] */,
4885                                                                       struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
4886                                                                       uint32_t _Reserved /* [in]  */)
4887 {
4888         struct tevent_req *req;
4889         struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state;
4890         struct tevent_req *subreq;
4891
4892         req = tevent_req_create(mem_ctx, &state,
4893                                 struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4894         if (req == NULL) {
4895                 return NULL;
4896         }
4897         state->out_mem_ctx = NULL;
4898         state->dispatch_recv = cli->dispatch_recv;
4899
4900         /* In parameters */
4901         state->orig.in.server_name = _server_name;
4902         state->orig.in.AlternateMachineNameToRemove = _AlternateMachineNameToRemove;
4903         state->orig.in.Account = _Account;
4904         state->orig.in.EncryptedPassword = _EncryptedPassword;
4905         state->orig.in.Reserved = _Reserved;
4906
4907         /* Out parameters */
4908
4909         /* Result */
4910         ZERO_STRUCT(state->orig.out.result);
4911
4912         if (DEBUGLEVEL >= 10) {
4913                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
4914         }
4915
4916         /* make a temporary copy, that we pass to the dispatch function */
4917         state->tmp = state->orig;
4918
4919         subreq = cli->dispatch_send(state, ev, cli,
4920                                     &ndr_table_wkssvc,
4921                                     NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
4922                                     &state->tmp);
4923         if (tevent_req_nomem(subreq, req)) {
4924                 return tevent_req_post(req, ev);
4925         }
4926         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrRemoveAlternateComputerName_done, req);
4927         return req;
4928 }
4929
4930 static void rpccli_wkssvc_NetrRemoveAlternateComputerName_done(struct tevent_req *subreq)
4931 {
4932         struct tevent_req *req = tevent_req_callback_data(
4933                 subreq, struct tevent_req);
4934         struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4935                 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4936         NTSTATUS status;
4937         TALLOC_CTX *mem_ctx;
4938
4939         if (state->out_mem_ctx) {
4940                 mem_ctx = state->out_mem_ctx;
4941         } else {
4942                 mem_ctx = state;
4943         }
4944
4945         status = state->dispatch_recv(subreq, mem_ctx);
4946         TALLOC_FREE(subreq);
4947         if (!NT_STATUS_IS_OK(status)) {
4948                 tevent_req_nterror(req, status);
4949                 return;
4950         }
4951
4952         /* Copy out parameters */
4953
4954         /* Copy result */
4955         state->orig.out.result = state->tmp.out.result;
4956
4957         /* Reset temporary structure */
4958         ZERO_STRUCT(state->tmp);
4959
4960         if (DEBUGLEVEL >= 10) {
4961                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &state->orig);
4962         }
4963
4964         tevent_req_done(req);
4965 }
4966
4967 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName_recv(struct tevent_req *req,
4968                                                             TALLOC_CTX *mem_ctx,
4969                                                             WERROR *result)
4970 {
4971         struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state *state = tevent_req_data(
4972                 req, struct rpccli_wkssvc_NetrRemoveAlternateComputerName_state);
4973         NTSTATUS status;
4974
4975         if (tevent_req_is_nterror(req, &status)) {
4976                 tevent_req_received(req);
4977                 return status;
4978         }
4979
4980         /* Steal possbile out parameters to the callers context */
4981         talloc_steal(mem_ctx, state->out_mem_ctx);
4982
4983         /* Return result */
4984         *result = state->orig.out.result;
4985
4986         tevent_req_received(req);
4987         return NT_STATUS_OK;
4988 }
4989
4990 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
4991                                                        TALLOC_CTX *mem_ctx,
4992                                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
4993                                                        const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
4994                                                        const char *Account /* [in] [unique,charset(UTF16)] */,
4995                                                        struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
4996                                                        uint32_t Reserved /* [in]  */,
4997                                                        WERROR *werror)
4998 {
4999         struct wkssvc_NetrRemoveAlternateComputerName r;
5000         NTSTATUS status;
5001
5002         /* In parameters */
5003         r.in.server_name = server_name;
5004         r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove;
5005         r.in.Account = Account;
5006         r.in.EncryptedPassword = EncryptedPassword;
5007         r.in.Reserved = Reserved;
5008
5009         if (DEBUGLEVEL >= 10) {
5010                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
5011         }
5012
5013         status = cli->dispatch(cli,
5014                                 mem_ctx,
5015                                 &ndr_table_wkssvc,
5016                                 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
5017                                 &r);
5018
5019         if (!NT_STATUS_IS_OK(status)) {
5020                 return status;
5021         }
5022
5023         if (DEBUGLEVEL >= 10) {
5024                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
5025         }
5026
5027         if (NT_STATUS_IS_ERR(status)) {
5028                 return status;
5029         }
5030
5031         /* Return variables */
5032
5033         /* Return result */
5034         if (werror) {
5035                 *werror = r.out.result;
5036         }
5037
5038         return werror_to_ntstatus(r.out.result);
5039 }
5040
5041 struct rpccli_wkssvc_NetrSetPrimaryComputername_state {
5042         struct wkssvc_NetrSetPrimaryComputername orig;
5043         struct wkssvc_NetrSetPrimaryComputername tmp;
5044         TALLOC_CTX *out_mem_ctx;
5045         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5046 };
5047
5048 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq);
5049
5050 struct tevent_req *rpccli_wkssvc_NetrSetPrimaryComputername_send(TALLOC_CTX *mem_ctx,
5051                                                                  struct tevent_context *ev,
5052                                                                  struct rpc_pipe_client *cli,
5053                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
5054                                                                  const char *_primary_name /* [in] [unique,charset(UTF16)] */,
5055                                                                  const char *_Account /* [in] [unique,charset(UTF16)] */,
5056                                                                  struct wkssvc_PasswordBuffer *_EncryptedPassword /* [in] [unique] */,
5057                                                                  uint32_t _Reserved /* [in]  */)
5058 {
5059         struct tevent_req *req;
5060         struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state;
5061         struct tevent_req *subreq;
5062
5063         req = tevent_req_create(mem_ctx, &state,
5064                                 struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5065         if (req == NULL) {
5066                 return NULL;
5067         }
5068         state->out_mem_ctx = NULL;
5069         state->dispatch_recv = cli->dispatch_recv;
5070
5071         /* In parameters */
5072         state->orig.in.server_name = _server_name;
5073         state->orig.in.primary_name = _primary_name;
5074         state->orig.in.Account = _Account;
5075         state->orig.in.EncryptedPassword = _EncryptedPassword;
5076         state->orig.in.Reserved = _Reserved;
5077
5078         /* Out parameters */
5079
5080         /* Result */
5081         ZERO_STRUCT(state->orig.out.result);
5082
5083         if (DEBUGLEVEL >= 10) {
5084                 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
5085         }
5086
5087         /* make a temporary copy, that we pass to the dispatch function */
5088         state->tmp = state->orig;
5089
5090         subreq = cli->dispatch_send(state, ev, cli,
5091                                     &ndr_table_wkssvc,
5092                                     NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
5093                                     &state->tmp);
5094         if (tevent_req_nomem(subreq, req)) {
5095                 return tevent_req_post(req, ev);
5096         }
5097         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrSetPrimaryComputername_done, req);
5098         return req;
5099 }
5100
5101 static void rpccli_wkssvc_NetrSetPrimaryComputername_done(struct tevent_req *subreq)
5102 {
5103         struct tevent_req *req = tevent_req_callback_data(
5104                 subreq, struct tevent_req);
5105         struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
5106                 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5107         NTSTATUS status;
5108         TALLOC_CTX *mem_ctx;
5109
5110         if (state->out_mem_ctx) {
5111                 mem_ctx = state->out_mem_ctx;
5112         } else {
5113                 mem_ctx = state;
5114         }
5115
5116         status = state->dispatch_recv(subreq, mem_ctx);
5117         TALLOC_FREE(subreq);
5118         if (!NT_STATUS_IS_OK(status)) {
5119                 tevent_req_nterror(req, status);
5120                 return;
5121         }
5122
5123         /* Copy out parameters */
5124
5125         /* Copy result */
5126         state->orig.out.result = state->tmp.out.result;
5127
5128         /* Reset temporary structure */
5129         ZERO_STRUCT(state->tmp);
5130
5131         if (DEBUGLEVEL >= 10) {
5132                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &state->orig);
5133         }
5134
5135         tevent_req_done(req);
5136 }
5137
5138 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername_recv(struct tevent_req *req,
5139                                                        TALLOC_CTX *mem_ctx,
5140                                                        WERROR *result)
5141 {
5142         struct rpccli_wkssvc_NetrSetPrimaryComputername_state *state = tevent_req_data(
5143                 req, struct rpccli_wkssvc_NetrSetPrimaryComputername_state);
5144         NTSTATUS status;
5145
5146         if (tevent_req_is_nterror(req, &status)) {
5147                 tevent_req_received(req);
5148                 return status;
5149         }
5150
5151         /* Steal possbile out parameters to the callers context */
5152         talloc_steal(mem_ctx, state->out_mem_ctx);
5153
5154         /* Return result */
5155         *result = state->orig.out.result;
5156
5157         tevent_req_received(req);
5158         return NT_STATUS_OK;
5159 }
5160
5161 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
5162                                                   TALLOC_CTX *mem_ctx,
5163                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
5164                                                   const char *primary_name /* [in] [unique,charset(UTF16)] */,
5165                                                   const char *Account /* [in] [unique,charset(UTF16)] */,
5166                                                   struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
5167                                                   uint32_t Reserved /* [in]  */,
5168                                                   WERROR *werror)
5169 {
5170         struct wkssvc_NetrSetPrimaryComputername r;
5171         NTSTATUS status;
5172
5173         /* In parameters */
5174         r.in.server_name = server_name;
5175         r.in.primary_name = primary_name;
5176         r.in.Account = Account;
5177         r.in.EncryptedPassword = EncryptedPassword;
5178         r.in.Reserved = Reserved;
5179
5180         if (DEBUGLEVEL >= 10) {
5181                 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
5182         }
5183
5184         status = cli->dispatch(cli,
5185                                 mem_ctx,
5186                                 &ndr_table_wkssvc,
5187                                 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
5188                                 &r);
5189
5190         if (!NT_STATUS_IS_OK(status)) {
5191                 return status;
5192         }
5193
5194         if (DEBUGLEVEL >= 10) {
5195                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
5196         }
5197
5198         if (NT_STATUS_IS_ERR(status)) {
5199                 return status;
5200         }
5201
5202         /* Return variables */
5203
5204         /* Return result */
5205         if (werror) {
5206                 *werror = r.out.result;
5207         }
5208
5209         return werror_to_ntstatus(r.out.result);
5210 }
5211
5212 struct rpccli_wkssvc_NetrEnumerateComputerNames_state {
5213         struct wkssvc_NetrEnumerateComputerNames orig;
5214         struct wkssvc_NetrEnumerateComputerNames tmp;
5215         TALLOC_CTX *out_mem_ctx;
5216         NTSTATUS (*dispatch_recv)(struct tevent_req *req, TALLOC_CTX *mem_ctx);
5217 };
5218
5219 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq);
5220
5221 struct tevent_req *rpccli_wkssvc_NetrEnumerateComputerNames_send(TALLOC_CTX *mem_ctx,
5222                                                                  struct tevent_context *ev,
5223                                                                  struct rpc_pipe_client *cli,
5224                                                                  const char *_server_name /* [in] [unique,charset(UTF16)] */,
5225                                                                  enum wkssvc_ComputerNameType _name_type /* [in]  */,
5226                                                                  uint32_t _Reserved /* [in]  */,
5227                                                                  struct wkssvc_ComputerNamesCtr **_ctr /* [out] [ref] */)
5228 {
5229         struct tevent_req *req;
5230         struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state;
5231         struct tevent_req *subreq;
5232
5233         req = tevent_req_create(mem_ctx, &state,
5234                                 struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5235         if (req == NULL) {
5236                 return NULL;
5237         }
5238         state->out_mem_ctx = NULL;
5239         state->dispatch_recv = cli->dispatch_recv;
5240
5241         /* In parameters */
5242         state->orig.in.server_name = _server_name;
5243         state->orig.in.name_type = _name_type;
5244         state->orig.in.Reserved = _Reserved;
5245
5246         /* Out parameters */
5247         state->orig.out.ctr = _ctr;
5248
5249         /* Result */
5250         ZERO_STRUCT(state->orig.out.result);
5251
5252         if (DEBUGLEVEL >= 10) {
5253                 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
5254         }
5255
5256         state->out_mem_ctx = talloc_named_const(state, 0,
5257                              "rpccli_wkssvc_NetrEnumerateComputerNames_out_memory");
5258         if (tevent_req_nomem(state->out_mem_ctx, req)) {
5259                 return tevent_req_post(req, ev);
5260         }
5261
5262         /* make a temporary copy, that we pass to the dispatch function */
5263         state->tmp = state->orig;
5264
5265         subreq = cli->dispatch_send(state, ev, cli,
5266                                     &ndr_table_wkssvc,
5267                                     NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
5268                                     &state->tmp);
5269         if (tevent_req_nomem(subreq, req)) {
5270                 return tevent_req_post(req, ev);
5271         }
5272         tevent_req_set_callback(subreq, rpccli_wkssvc_NetrEnumerateComputerNames_done, req);
5273         return req;
5274 }
5275
5276 static void rpccli_wkssvc_NetrEnumerateComputerNames_done(struct tevent_req *subreq)
5277 {
5278         struct tevent_req *req = tevent_req_callback_data(
5279                 subreq, struct tevent_req);
5280         struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
5281                 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5282         NTSTATUS status;
5283         TALLOC_CTX *mem_ctx;
5284
5285         if (state->out_mem_ctx) {
5286                 mem_ctx = state->out_mem_ctx;
5287         } else {
5288                 mem_ctx = state;
5289         }
5290
5291         status = state->dispatch_recv(subreq, mem_ctx);
5292         TALLOC_FREE(subreq);
5293         if (!NT_STATUS_IS_OK(status)) {
5294                 tevent_req_nterror(req, status);
5295                 return;
5296         }
5297
5298         /* Copy out parameters */
5299         *state->orig.out.ctr = *state->tmp.out.ctr;
5300
5301         /* Copy result */
5302         state->orig.out.result = state->tmp.out.result;
5303
5304         /* Reset temporary structure */
5305         ZERO_STRUCT(state->tmp);
5306
5307         if (DEBUGLEVEL >= 10) {
5308                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &state->orig);
5309         }
5310
5311         tevent_req_done(req);
5312 }
5313
5314 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames_recv(struct tevent_req *req,
5315                                                        TALLOC_CTX *mem_ctx,
5316                                                        WERROR *result)
5317 {
5318         struct rpccli_wkssvc_NetrEnumerateComputerNames_state *state = tevent_req_data(
5319                 req, struct rpccli_wkssvc_NetrEnumerateComputerNames_state);
5320         NTSTATUS status;
5321
5322         if (tevent_req_is_nterror(req, &status)) {
5323                 tevent_req_received(req);
5324                 return status;
5325         }
5326
5327         /* Steal possbile out parameters to the callers context */
5328         talloc_steal(mem_ctx, state->out_mem_ctx);
5329
5330         /* Return result */
5331         *result = state->orig.out.result;
5332
5333         tevent_req_received(req);
5334         return NT_STATUS_OK;
5335 }
5336
5337 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
5338                                                   TALLOC_CTX *mem_ctx,
5339                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
5340                                                   enum wkssvc_ComputerNameType name_type /* [in]  */,
5341                                                   uint32_t Reserved /* [in]  */,
5342                                                   struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */,
5343                                                   WERROR *werror)
5344 {
5345         struct wkssvc_NetrEnumerateComputerNames r;
5346         NTSTATUS status;
5347
5348         /* In parameters */
5349         r.in.server_name = server_name;
5350         r.in.name_type = name_type;
5351         r.in.Reserved = Reserved;
5352
5353         if (DEBUGLEVEL >= 10) {
5354                 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
5355         }
5356
5357         status = cli->dispatch(cli,
5358                                 mem_ctx,
5359                                 &ndr_table_wkssvc,
5360                                 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
5361                                 &r);
5362
5363         if (!NT_STATUS_IS_OK(status)) {
5364                 return status;
5365         }
5366
5367         if (DEBUGLEVEL >= 10) {
5368                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
5369         }
5370
5371         if (NT_STATUS_IS_ERR(status)) {
5372                 return status;
5373         }
5374
5375         /* Return variables */
5376         *ctr = *r.out.ctr;
5377
5378         /* Return result */
5379         if (werror) {
5380                 *werror = r.out.result;
5381         }
5382
5383         return werror_to_ntstatus(r.out.result);
5384 }
5385