Re-run make idl.
[ira/wip.git] / source3 / librpc / gen_ndr / srv_wkssvc.c
1 /*
2  * Unix SMB/CIFS implementation.
3  * server auto-generated by pidl. DO NOT MODIFY!
4  */
5
6 #include "includes.h"
7 #include "librpc/gen_ndr/srv_wkssvc.h"
8
9 static bool api_wkssvc_NetWkstaGetInfo(pipes_struct *p)
10 {
11         const struct ndr_interface_call *call;
12         struct ndr_pull *pull;
13         struct ndr_push *push;
14         enum ndr_err_code ndr_err;
15         DATA_BLOB blob;
16         struct wkssvc_NetWkstaGetInfo *r;
17
18         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAGETINFO];
19
20         r = talloc(talloc_tos(), struct wkssvc_NetWkstaGetInfo);
21         if (r == NULL) {
22                 return false;
23         }
24
25         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
26                 talloc_free(r);
27                 return false;
28         }
29
30         pull = ndr_pull_init_blob(&blob, r);
31         if (pull == NULL) {
32                 talloc_free(r);
33                 return false;
34         }
35
36         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
37         ndr_err = call->ndr_pull(pull, NDR_IN, r);
38         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
39                 talloc_free(r);
40                 return false;
41         }
42
43         if (DEBUGLEVEL >= 10) {
44                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, r);
45         }
46
47         ZERO_STRUCT(r->out);
48         r->out.info = talloc_zero(r, union wkssvc_NetWkstaInfo);
49         if (r->out.info == NULL) {
50                 talloc_free(r);
51                 return false;
52         }
53
54         r->out.result = _wkssvc_NetWkstaGetInfo(p, r);
55
56         if (p->rng_fault_state) {
57                 talloc_free(r);
58                 /* Return true here, srv_pipe_hnd.c will take care */
59                 return true;
60         }
61
62         if (DEBUGLEVEL >= 10) {
63                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, r);
64         }
65
66         push = ndr_push_init_ctx(r);
67         if (push == NULL) {
68                 talloc_free(r);
69                 return false;
70         }
71
72         ndr_err = call->ndr_push(push, NDR_OUT, r);
73         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
74                 talloc_free(r);
75                 return false;
76         }
77
78         blob = ndr_push_blob(push);
79         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
80                 talloc_free(r);
81                 return false;
82         }
83
84         talloc_free(r);
85
86         return true;
87 }
88
89 static bool api_wkssvc_NetWkstaSetInfo(pipes_struct *p)
90 {
91         const struct ndr_interface_call *call;
92         struct ndr_pull *pull;
93         struct ndr_push *push;
94         enum ndr_err_code ndr_err;
95         DATA_BLOB blob;
96         struct wkssvc_NetWkstaSetInfo *r;
97
98         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTASETINFO];
99
100         r = talloc(talloc_tos(), struct wkssvc_NetWkstaSetInfo);
101         if (r == NULL) {
102                 return false;
103         }
104
105         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
106                 talloc_free(r);
107                 return false;
108         }
109
110         pull = ndr_pull_init_blob(&blob, r);
111         if (pull == NULL) {
112                 talloc_free(r);
113                 return false;
114         }
115
116         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
117         ndr_err = call->ndr_pull(pull, NDR_IN, r);
118         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
119                 talloc_free(r);
120                 return false;
121         }
122
123         if (DEBUGLEVEL >= 10) {
124                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, r);
125         }
126
127         ZERO_STRUCT(r->out);
128         r->out.parm_error = r->in.parm_error;
129         r->out.result = _wkssvc_NetWkstaSetInfo(p, r);
130
131         if (p->rng_fault_state) {
132                 talloc_free(r);
133                 /* Return true here, srv_pipe_hnd.c will take care */
134                 return true;
135         }
136
137         if (DEBUGLEVEL >= 10) {
138                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, r);
139         }
140
141         push = ndr_push_init_ctx(r);
142         if (push == NULL) {
143                 talloc_free(r);
144                 return false;
145         }
146
147         ndr_err = call->ndr_push(push, NDR_OUT, r);
148         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
149                 talloc_free(r);
150                 return false;
151         }
152
153         blob = ndr_push_blob(push);
154         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
155                 talloc_free(r);
156                 return false;
157         }
158
159         talloc_free(r);
160
161         return true;
162 }
163
164 static bool api_wkssvc_NetWkstaEnumUsers(pipes_struct *p)
165 {
166         const struct ndr_interface_call *call;
167         struct ndr_pull *pull;
168         struct ndr_push *push;
169         enum ndr_err_code ndr_err;
170         DATA_BLOB blob;
171         struct wkssvc_NetWkstaEnumUsers *r;
172
173         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTAENUMUSERS];
174
175         r = talloc(talloc_tos(), struct wkssvc_NetWkstaEnumUsers);
176         if (r == NULL) {
177                 return false;
178         }
179
180         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
181                 talloc_free(r);
182                 return false;
183         }
184
185         pull = ndr_pull_init_blob(&blob, r);
186         if (pull == NULL) {
187                 talloc_free(r);
188                 return false;
189         }
190
191         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
192         ndr_err = call->ndr_pull(pull, NDR_IN, r);
193         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
194                 talloc_free(r);
195                 return false;
196         }
197
198         if (DEBUGLEVEL >= 10) {
199                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, r);
200         }
201
202         ZERO_STRUCT(r->out);
203         r->out.info = r->in.info;
204         r->out.entries_read = talloc_zero(r, uint32_t);
205         if (r->out.entries_read == NULL) {
206                 talloc_free(r);
207                 return false;
208         }
209
210         r->out.resume_handle = r->in.resume_handle;
211         r->out.result = _wkssvc_NetWkstaEnumUsers(p, r);
212
213         if (p->rng_fault_state) {
214                 talloc_free(r);
215                 /* Return true here, srv_pipe_hnd.c will take care */
216                 return true;
217         }
218
219         if (DEBUGLEVEL >= 10) {
220                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, r);
221         }
222
223         push = ndr_push_init_ctx(r);
224         if (push == NULL) {
225                 talloc_free(r);
226                 return false;
227         }
228
229         ndr_err = call->ndr_push(push, NDR_OUT, r);
230         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
231                 talloc_free(r);
232                 return false;
233         }
234
235         blob = ndr_push_blob(push);
236         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
237                 talloc_free(r);
238                 return false;
239         }
240
241         talloc_free(r);
242
243         return true;
244 }
245
246 static bool api_wkssvc_NetrWkstaUserGetInfo(pipes_struct *p)
247 {
248         const struct ndr_interface_call *call;
249         struct ndr_pull *pull;
250         struct ndr_push *push;
251         enum ndr_err_code ndr_err;
252         DATA_BLOB blob;
253         struct wkssvc_NetrWkstaUserGetInfo *r;
254
255         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERGETINFO];
256
257         r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserGetInfo);
258         if (r == NULL) {
259                 return false;
260         }
261
262         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
263                 talloc_free(r);
264                 return false;
265         }
266
267         pull = ndr_pull_init_blob(&blob, r);
268         if (pull == NULL) {
269                 talloc_free(r);
270                 return false;
271         }
272
273         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
274         ndr_err = call->ndr_pull(pull, NDR_IN, r);
275         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
276                 talloc_free(r);
277                 return false;
278         }
279
280         if (DEBUGLEVEL >= 10) {
281                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, r);
282         }
283
284         ZERO_STRUCT(r->out);
285         r->out.info = talloc_zero(r, union wkssvc_NetrWkstaUserInfo);
286         if (r->out.info == NULL) {
287                 talloc_free(r);
288                 return false;
289         }
290
291         r->out.result = _wkssvc_NetrWkstaUserGetInfo(p, r);
292
293         if (p->rng_fault_state) {
294                 talloc_free(r);
295                 /* Return true here, srv_pipe_hnd.c will take care */
296                 return true;
297         }
298
299         if (DEBUGLEVEL >= 10) {
300                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, r);
301         }
302
303         push = ndr_push_init_ctx(r);
304         if (push == NULL) {
305                 talloc_free(r);
306                 return false;
307         }
308
309         ndr_err = call->ndr_push(push, NDR_OUT, r);
310         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
311                 talloc_free(r);
312                 return false;
313         }
314
315         blob = ndr_push_blob(push);
316         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
317                 talloc_free(r);
318                 return false;
319         }
320
321         talloc_free(r);
322
323         return true;
324 }
325
326 static bool api_wkssvc_NetrWkstaUserSetInfo(pipes_struct *p)
327 {
328         const struct ndr_interface_call *call;
329         struct ndr_pull *pull;
330         struct ndr_push *push;
331         enum ndr_err_code ndr_err;
332         DATA_BLOB blob;
333         struct wkssvc_NetrWkstaUserSetInfo *r;
334
335         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTAUSERSETINFO];
336
337         r = talloc(talloc_tos(), struct wkssvc_NetrWkstaUserSetInfo);
338         if (r == NULL) {
339                 return false;
340         }
341
342         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
343                 talloc_free(r);
344                 return false;
345         }
346
347         pull = ndr_pull_init_blob(&blob, r);
348         if (pull == NULL) {
349                 talloc_free(r);
350                 return false;
351         }
352
353         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
354         ndr_err = call->ndr_pull(pull, NDR_IN, r);
355         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
356                 talloc_free(r);
357                 return false;
358         }
359
360         if (DEBUGLEVEL >= 10) {
361                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, r);
362         }
363
364         ZERO_STRUCT(r->out);
365         r->out.parm_err = r->in.parm_err;
366         r->out.result = _wkssvc_NetrWkstaUserSetInfo(p, r);
367
368         if (p->rng_fault_state) {
369                 talloc_free(r);
370                 /* Return true here, srv_pipe_hnd.c will take care */
371                 return true;
372         }
373
374         if (DEBUGLEVEL >= 10) {
375                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, r);
376         }
377
378         push = ndr_push_init_ctx(r);
379         if (push == NULL) {
380                 talloc_free(r);
381                 return false;
382         }
383
384         ndr_err = call->ndr_push(push, NDR_OUT, r);
385         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
386                 talloc_free(r);
387                 return false;
388         }
389
390         blob = ndr_push_blob(push);
391         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
392                 talloc_free(r);
393                 return false;
394         }
395
396         talloc_free(r);
397
398         return true;
399 }
400
401 static bool api_wkssvc_NetWkstaTransportEnum(pipes_struct *p)
402 {
403         const struct ndr_interface_call *call;
404         struct ndr_pull *pull;
405         struct ndr_push *push;
406         enum ndr_err_code ndr_err;
407         DATA_BLOB blob;
408         struct wkssvc_NetWkstaTransportEnum *r;
409
410         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETWKSTATRANSPORTENUM];
411
412         r = talloc(talloc_tos(), struct wkssvc_NetWkstaTransportEnum);
413         if (r == NULL) {
414                 return false;
415         }
416
417         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
418                 talloc_free(r);
419                 return false;
420         }
421
422         pull = ndr_pull_init_blob(&blob, r);
423         if (pull == NULL) {
424                 talloc_free(r);
425                 return false;
426         }
427
428         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
429         ndr_err = call->ndr_pull(pull, NDR_IN, r);
430         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
431                 talloc_free(r);
432                 return false;
433         }
434
435         if (DEBUGLEVEL >= 10) {
436                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, r);
437         }
438
439         ZERO_STRUCT(r->out);
440         r->out.info = r->in.info;
441         r->out.total_entries = talloc_zero(r, uint32_t);
442         if (r->out.total_entries == NULL) {
443                 talloc_free(r);
444                 return false;
445         }
446
447         r->out.resume_handle = r->in.resume_handle;
448         r->out.result = _wkssvc_NetWkstaTransportEnum(p, r);
449
450         if (p->rng_fault_state) {
451                 talloc_free(r);
452                 /* Return true here, srv_pipe_hnd.c will take care */
453                 return true;
454         }
455
456         if (DEBUGLEVEL >= 10) {
457                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, r);
458         }
459
460         push = ndr_push_init_ctx(r);
461         if (push == NULL) {
462                 talloc_free(r);
463                 return false;
464         }
465
466         ndr_err = call->ndr_push(push, NDR_OUT, r);
467         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
468                 talloc_free(r);
469                 return false;
470         }
471
472         blob = ndr_push_blob(push);
473         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
474                 talloc_free(r);
475                 return false;
476         }
477
478         talloc_free(r);
479
480         return true;
481 }
482
483 static bool api_wkssvc_NetrWkstaTransportAdd(pipes_struct *p)
484 {
485         const struct ndr_interface_call *call;
486         struct ndr_pull *pull;
487         struct ndr_push *push;
488         enum ndr_err_code ndr_err;
489         DATA_BLOB blob;
490         struct wkssvc_NetrWkstaTransportAdd *r;
491
492         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTADD];
493
494         r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportAdd);
495         if (r == NULL) {
496                 return false;
497         }
498
499         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
500                 talloc_free(r);
501                 return false;
502         }
503
504         pull = ndr_pull_init_blob(&blob, r);
505         if (pull == NULL) {
506                 talloc_free(r);
507                 return false;
508         }
509
510         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
511         ndr_err = call->ndr_pull(pull, NDR_IN, r);
512         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
513                 talloc_free(r);
514                 return false;
515         }
516
517         if (DEBUGLEVEL >= 10) {
518                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, r);
519         }
520
521         ZERO_STRUCT(r->out);
522         r->out.parm_err = r->in.parm_err;
523         r->out.result = _wkssvc_NetrWkstaTransportAdd(p, r);
524
525         if (p->rng_fault_state) {
526                 talloc_free(r);
527                 /* Return true here, srv_pipe_hnd.c will take care */
528                 return true;
529         }
530
531         if (DEBUGLEVEL >= 10) {
532                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, r);
533         }
534
535         push = ndr_push_init_ctx(r);
536         if (push == NULL) {
537                 talloc_free(r);
538                 return false;
539         }
540
541         ndr_err = call->ndr_push(push, NDR_OUT, r);
542         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
543                 talloc_free(r);
544                 return false;
545         }
546
547         blob = ndr_push_blob(push);
548         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
549                 talloc_free(r);
550                 return false;
551         }
552
553         talloc_free(r);
554
555         return true;
556 }
557
558 static bool api_wkssvc_NetrWkstaTransportDel(pipes_struct *p)
559 {
560         const struct ndr_interface_call *call;
561         struct ndr_pull *pull;
562         struct ndr_push *push;
563         enum ndr_err_code ndr_err;
564         DATA_BLOB blob;
565         struct wkssvc_NetrWkstaTransportDel *r;
566
567         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWKSTATRANSPORTDEL];
568
569         r = talloc(talloc_tos(), struct wkssvc_NetrWkstaTransportDel);
570         if (r == NULL) {
571                 return false;
572         }
573
574         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
575                 talloc_free(r);
576                 return false;
577         }
578
579         pull = ndr_pull_init_blob(&blob, r);
580         if (pull == NULL) {
581                 talloc_free(r);
582                 return false;
583         }
584
585         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
586         ndr_err = call->ndr_pull(pull, NDR_IN, r);
587         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
588                 talloc_free(r);
589                 return false;
590         }
591
592         if (DEBUGLEVEL >= 10) {
593                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, r);
594         }
595
596         r->out.result = _wkssvc_NetrWkstaTransportDel(p, r);
597
598         if (p->rng_fault_state) {
599                 talloc_free(r);
600                 /* Return true here, srv_pipe_hnd.c will take care */
601                 return true;
602         }
603
604         if (DEBUGLEVEL >= 10) {
605                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, r);
606         }
607
608         push = ndr_push_init_ctx(r);
609         if (push == NULL) {
610                 talloc_free(r);
611                 return false;
612         }
613
614         ndr_err = call->ndr_push(push, NDR_OUT, r);
615         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
616                 talloc_free(r);
617                 return false;
618         }
619
620         blob = ndr_push_blob(push);
621         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
622                 talloc_free(r);
623                 return false;
624         }
625
626         talloc_free(r);
627
628         return true;
629 }
630
631 static bool api_wkssvc_NetrUseAdd(pipes_struct *p)
632 {
633         const struct ndr_interface_call *call;
634         struct ndr_pull *pull;
635         struct ndr_push *push;
636         enum ndr_err_code ndr_err;
637         DATA_BLOB blob;
638         struct wkssvc_NetrUseAdd *r;
639
640         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEADD];
641
642         r = talloc(talloc_tos(), struct wkssvc_NetrUseAdd);
643         if (r == NULL) {
644                 return false;
645         }
646
647         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
648                 talloc_free(r);
649                 return false;
650         }
651
652         pull = ndr_pull_init_blob(&blob, r);
653         if (pull == NULL) {
654                 talloc_free(r);
655                 return false;
656         }
657
658         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
659         ndr_err = call->ndr_pull(pull, NDR_IN, r);
660         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
661                 talloc_free(r);
662                 return false;
663         }
664
665         if (DEBUGLEVEL >= 10) {
666                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, r);
667         }
668
669         ZERO_STRUCT(r->out);
670         r->out.parm_err = r->in.parm_err;
671         r->out.result = _wkssvc_NetrUseAdd(p, r);
672
673         if (p->rng_fault_state) {
674                 talloc_free(r);
675                 /* Return true here, srv_pipe_hnd.c will take care */
676                 return true;
677         }
678
679         if (DEBUGLEVEL >= 10) {
680                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, r);
681         }
682
683         push = ndr_push_init_ctx(r);
684         if (push == NULL) {
685                 talloc_free(r);
686                 return false;
687         }
688
689         ndr_err = call->ndr_push(push, NDR_OUT, r);
690         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
691                 talloc_free(r);
692                 return false;
693         }
694
695         blob = ndr_push_blob(push);
696         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
697                 talloc_free(r);
698                 return false;
699         }
700
701         talloc_free(r);
702
703         return true;
704 }
705
706 static bool api_wkssvc_NetrUseGetInfo(pipes_struct *p)
707 {
708         const struct ndr_interface_call *call;
709         struct ndr_pull *pull;
710         struct ndr_push *push;
711         enum ndr_err_code ndr_err;
712         DATA_BLOB blob;
713         struct wkssvc_NetrUseGetInfo *r;
714
715         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEGETINFO];
716
717         r = talloc(talloc_tos(), struct wkssvc_NetrUseGetInfo);
718         if (r == NULL) {
719                 return false;
720         }
721
722         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
723                 talloc_free(r);
724                 return false;
725         }
726
727         pull = ndr_pull_init_blob(&blob, r);
728         if (pull == NULL) {
729                 talloc_free(r);
730                 return false;
731         }
732
733         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
734         ndr_err = call->ndr_pull(pull, NDR_IN, r);
735         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
736                 talloc_free(r);
737                 return false;
738         }
739
740         if (DEBUGLEVEL >= 10) {
741                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, r);
742         }
743
744         ZERO_STRUCT(r->out);
745         r->out.ctr = talloc_zero(r, union wkssvc_NetrUseGetInfoCtr);
746         if (r->out.ctr == NULL) {
747                 talloc_free(r);
748                 return false;
749         }
750
751         r->out.result = _wkssvc_NetrUseGetInfo(p, r);
752
753         if (p->rng_fault_state) {
754                 talloc_free(r);
755                 /* Return true here, srv_pipe_hnd.c will take care */
756                 return true;
757         }
758
759         if (DEBUGLEVEL >= 10) {
760                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, r);
761         }
762
763         push = ndr_push_init_ctx(r);
764         if (push == NULL) {
765                 talloc_free(r);
766                 return false;
767         }
768
769         ndr_err = call->ndr_push(push, NDR_OUT, r);
770         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
771                 talloc_free(r);
772                 return false;
773         }
774
775         blob = ndr_push_blob(push);
776         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
777                 talloc_free(r);
778                 return false;
779         }
780
781         talloc_free(r);
782
783         return true;
784 }
785
786 static bool api_wkssvc_NetrUseDel(pipes_struct *p)
787 {
788         const struct ndr_interface_call *call;
789         struct ndr_pull *pull;
790         struct ndr_push *push;
791         enum ndr_err_code ndr_err;
792         DATA_BLOB blob;
793         struct wkssvc_NetrUseDel *r;
794
795         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEDEL];
796
797         r = talloc(talloc_tos(), struct wkssvc_NetrUseDel);
798         if (r == NULL) {
799                 return false;
800         }
801
802         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
803                 talloc_free(r);
804                 return false;
805         }
806
807         pull = ndr_pull_init_blob(&blob, r);
808         if (pull == NULL) {
809                 talloc_free(r);
810                 return false;
811         }
812
813         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
814         ndr_err = call->ndr_pull(pull, NDR_IN, r);
815         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
816                 talloc_free(r);
817                 return false;
818         }
819
820         if (DEBUGLEVEL >= 10) {
821                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, r);
822         }
823
824         r->out.result = _wkssvc_NetrUseDel(p, r);
825
826         if (p->rng_fault_state) {
827                 talloc_free(r);
828                 /* Return true here, srv_pipe_hnd.c will take care */
829                 return true;
830         }
831
832         if (DEBUGLEVEL >= 10) {
833                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, r);
834         }
835
836         push = ndr_push_init_ctx(r);
837         if (push == NULL) {
838                 talloc_free(r);
839                 return false;
840         }
841
842         ndr_err = call->ndr_push(push, NDR_OUT, r);
843         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
844                 talloc_free(r);
845                 return false;
846         }
847
848         blob = ndr_push_blob(push);
849         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
850                 talloc_free(r);
851                 return false;
852         }
853
854         talloc_free(r);
855
856         return true;
857 }
858
859 static bool api_wkssvc_NetrUseEnum(pipes_struct *p)
860 {
861         const struct ndr_interface_call *call;
862         struct ndr_pull *pull;
863         struct ndr_push *push;
864         enum ndr_err_code ndr_err;
865         DATA_BLOB blob;
866         struct wkssvc_NetrUseEnum *r;
867
868         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUSEENUM];
869
870         r = talloc(talloc_tos(), struct wkssvc_NetrUseEnum);
871         if (r == NULL) {
872                 return false;
873         }
874
875         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
876                 talloc_free(r);
877                 return false;
878         }
879
880         pull = ndr_pull_init_blob(&blob, r);
881         if (pull == NULL) {
882                 talloc_free(r);
883                 return false;
884         }
885
886         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
887         ndr_err = call->ndr_pull(pull, NDR_IN, r);
888         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
889                 talloc_free(r);
890                 return false;
891         }
892
893         if (DEBUGLEVEL >= 10) {
894                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, r);
895         }
896
897         ZERO_STRUCT(r->out);
898         r->out.info = r->in.info;
899         r->out.entries_read = talloc_zero(r, uint32_t);
900         if (r->out.entries_read == NULL) {
901                 talloc_free(r);
902                 return false;
903         }
904
905         r->out.resume_handle = r->in.resume_handle;
906         r->out.result = _wkssvc_NetrUseEnum(p, r);
907
908         if (p->rng_fault_state) {
909                 talloc_free(r);
910                 /* Return true here, srv_pipe_hnd.c will take care */
911                 return true;
912         }
913
914         if (DEBUGLEVEL >= 10) {
915                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, r);
916         }
917
918         push = ndr_push_init_ctx(r);
919         if (push == NULL) {
920                 talloc_free(r);
921                 return false;
922         }
923
924         ndr_err = call->ndr_push(push, NDR_OUT, r);
925         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
926                 talloc_free(r);
927                 return false;
928         }
929
930         blob = ndr_push_blob(push);
931         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
932                 talloc_free(r);
933                 return false;
934         }
935
936         talloc_free(r);
937
938         return true;
939 }
940
941 static bool api_wkssvc_NetrMessageBufferSend(pipes_struct *p)
942 {
943         const struct ndr_interface_call *call;
944         struct ndr_pull *pull;
945         struct ndr_push *push;
946         enum ndr_err_code ndr_err;
947         DATA_BLOB blob;
948         struct wkssvc_NetrMessageBufferSend *r;
949
950         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRMESSAGEBUFFERSEND];
951
952         r = talloc(talloc_tos(), struct wkssvc_NetrMessageBufferSend);
953         if (r == NULL) {
954                 return false;
955         }
956
957         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
958                 talloc_free(r);
959                 return false;
960         }
961
962         pull = ndr_pull_init_blob(&blob, r);
963         if (pull == NULL) {
964                 talloc_free(r);
965                 return false;
966         }
967
968         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
969         ndr_err = call->ndr_pull(pull, NDR_IN, r);
970         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
971                 talloc_free(r);
972                 return false;
973         }
974
975         if (DEBUGLEVEL >= 10) {
976                 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, r);
977         }
978
979         r->out.result = _wkssvc_NetrMessageBufferSend(p, r);
980
981         if (p->rng_fault_state) {
982                 talloc_free(r);
983                 /* Return true here, srv_pipe_hnd.c will take care */
984                 return true;
985         }
986
987         if (DEBUGLEVEL >= 10) {
988                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, r);
989         }
990
991         push = ndr_push_init_ctx(r);
992         if (push == NULL) {
993                 talloc_free(r);
994                 return false;
995         }
996
997         ndr_err = call->ndr_push(push, NDR_OUT, r);
998         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
999                 talloc_free(r);
1000                 return false;
1001         }
1002
1003         blob = ndr_push_blob(push);
1004         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1005                 talloc_free(r);
1006                 return false;
1007         }
1008
1009         talloc_free(r);
1010
1011         return true;
1012 }
1013
1014 static bool api_wkssvc_NetrWorkstationStatisticsGet(pipes_struct *p)
1015 {
1016         const struct ndr_interface_call *call;
1017         struct ndr_pull *pull;
1018         struct ndr_push *push;
1019         enum ndr_err_code ndr_err;
1020         DATA_BLOB blob;
1021         struct wkssvc_NetrWorkstationStatisticsGet *r;
1022
1023         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET];
1024
1025         r = talloc(talloc_tos(), struct wkssvc_NetrWorkstationStatisticsGet);
1026         if (r == NULL) {
1027                 return false;
1028         }
1029
1030         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1031                 talloc_free(r);
1032                 return false;
1033         }
1034
1035         pull = ndr_pull_init_blob(&blob, r);
1036         if (pull == NULL) {
1037                 talloc_free(r);
1038                 return false;
1039         }
1040
1041         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1042         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1043         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1044                 talloc_free(r);
1045                 return false;
1046         }
1047
1048         if (DEBUGLEVEL >= 10) {
1049                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r);
1050         }
1051
1052         ZERO_STRUCT(r->out);
1053         r->out.info = talloc_zero(r, struct wkssvc_NetrWorkstationStatistics *);
1054         if (r->out.info == NULL) {
1055                 talloc_free(r);
1056                 return false;
1057         }
1058
1059         r->out.result = _wkssvc_NetrWorkstationStatisticsGet(p, r);
1060
1061         if (p->rng_fault_state) {
1062                 talloc_free(r);
1063                 /* Return true here, srv_pipe_hnd.c will take care */
1064                 return true;
1065         }
1066
1067         if (DEBUGLEVEL >= 10) {
1068                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, r);
1069         }
1070
1071         push = ndr_push_init_ctx(r);
1072         if (push == NULL) {
1073                 talloc_free(r);
1074                 return false;
1075         }
1076
1077         ndr_err = call->ndr_push(push, NDR_OUT, r);
1078         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1079                 talloc_free(r);
1080                 return false;
1081         }
1082
1083         blob = ndr_push_blob(push);
1084         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1085                 talloc_free(r);
1086                 return false;
1087         }
1088
1089         talloc_free(r);
1090
1091         return true;
1092 }
1093
1094 static bool api_wkssvc_NetrLogonDomainNameAdd(pipes_struct *p)
1095 {
1096         const struct ndr_interface_call *call;
1097         struct ndr_pull *pull;
1098         struct ndr_push *push;
1099         enum ndr_err_code ndr_err;
1100         DATA_BLOB blob;
1101         struct wkssvc_NetrLogonDomainNameAdd *r;
1102
1103         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEADD];
1104
1105         r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameAdd);
1106         if (r == NULL) {
1107                 return false;
1108         }
1109
1110         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1111                 talloc_free(r);
1112                 return false;
1113         }
1114
1115         pull = ndr_pull_init_blob(&blob, r);
1116         if (pull == NULL) {
1117                 talloc_free(r);
1118                 return false;
1119         }
1120
1121         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1122         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1123         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1124                 talloc_free(r);
1125                 return false;
1126         }
1127
1128         if (DEBUGLEVEL >= 10) {
1129                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, r);
1130         }
1131
1132         r->out.result = _wkssvc_NetrLogonDomainNameAdd(p, r);
1133
1134         if (p->rng_fault_state) {
1135                 talloc_free(r);
1136                 /* Return true here, srv_pipe_hnd.c will take care */
1137                 return true;
1138         }
1139
1140         if (DEBUGLEVEL >= 10) {
1141                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, r);
1142         }
1143
1144         push = ndr_push_init_ctx(r);
1145         if (push == NULL) {
1146                 talloc_free(r);
1147                 return false;
1148         }
1149
1150         ndr_err = call->ndr_push(push, NDR_OUT, r);
1151         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1152                 talloc_free(r);
1153                 return false;
1154         }
1155
1156         blob = ndr_push_blob(push);
1157         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1158                 talloc_free(r);
1159                 return false;
1160         }
1161
1162         talloc_free(r);
1163
1164         return true;
1165 }
1166
1167 static bool api_wkssvc_NetrLogonDomainNameDel(pipes_struct *p)
1168 {
1169         const struct ndr_interface_call *call;
1170         struct ndr_pull *pull;
1171         struct ndr_push *push;
1172         enum ndr_err_code ndr_err;
1173         DATA_BLOB blob;
1174         struct wkssvc_NetrLogonDomainNameDel *r;
1175
1176         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL];
1177
1178         r = talloc(talloc_tos(), struct wkssvc_NetrLogonDomainNameDel);
1179         if (r == NULL) {
1180                 return false;
1181         }
1182
1183         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1184                 talloc_free(r);
1185                 return false;
1186         }
1187
1188         pull = ndr_pull_init_blob(&blob, r);
1189         if (pull == NULL) {
1190                 talloc_free(r);
1191                 return false;
1192         }
1193
1194         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1195         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1196         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1197                 talloc_free(r);
1198                 return false;
1199         }
1200
1201         if (DEBUGLEVEL >= 10) {
1202                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, r);
1203         }
1204
1205         r->out.result = _wkssvc_NetrLogonDomainNameDel(p, r);
1206
1207         if (p->rng_fault_state) {
1208                 talloc_free(r);
1209                 /* Return true here, srv_pipe_hnd.c will take care */
1210                 return true;
1211         }
1212
1213         if (DEBUGLEVEL >= 10) {
1214                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, r);
1215         }
1216
1217         push = ndr_push_init_ctx(r);
1218         if (push == NULL) {
1219                 talloc_free(r);
1220                 return false;
1221         }
1222
1223         ndr_err = call->ndr_push(push, NDR_OUT, r);
1224         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1225                 talloc_free(r);
1226                 return false;
1227         }
1228
1229         blob = ndr_push_blob(push);
1230         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1231                 talloc_free(r);
1232                 return false;
1233         }
1234
1235         talloc_free(r);
1236
1237         return true;
1238 }
1239
1240 static bool api_wkssvc_NetrJoinDomain(pipes_struct *p)
1241 {
1242         const struct ndr_interface_call *call;
1243         struct ndr_pull *pull;
1244         struct ndr_push *push;
1245         enum ndr_err_code ndr_err;
1246         DATA_BLOB blob;
1247         struct wkssvc_NetrJoinDomain *r;
1248
1249         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN];
1250
1251         r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain);
1252         if (r == NULL) {
1253                 return false;
1254         }
1255
1256         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1257                 talloc_free(r);
1258                 return false;
1259         }
1260
1261         pull = ndr_pull_init_blob(&blob, r);
1262         if (pull == NULL) {
1263                 talloc_free(r);
1264                 return false;
1265         }
1266
1267         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1268         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1269         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1270                 talloc_free(r);
1271                 return false;
1272         }
1273
1274         if (DEBUGLEVEL >= 10) {
1275                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, r);
1276         }
1277
1278         r->out.result = _wkssvc_NetrJoinDomain(p, r);
1279
1280         if (p->rng_fault_state) {
1281                 talloc_free(r);
1282                 /* Return true here, srv_pipe_hnd.c will take care */
1283                 return true;
1284         }
1285
1286         if (DEBUGLEVEL >= 10) {
1287                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, r);
1288         }
1289
1290         push = ndr_push_init_ctx(r);
1291         if (push == NULL) {
1292                 talloc_free(r);
1293                 return false;
1294         }
1295
1296         ndr_err = call->ndr_push(push, NDR_OUT, r);
1297         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1298                 talloc_free(r);
1299                 return false;
1300         }
1301
1302         blob = ndr_push_blob(push);
1303         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1304                 talloc_free(r);
1305                 return false;
1306         }
1307
1308         talloc_free(r);
1309
1310         return true;
1311 }
1312
1313 static bool api_wkssvc_NetrUnjoinDomain(pipes_struct *p)
1314 {
1315         const struct ndr_interface_call *call;
1316         struct ndr_pull *pull;
1317         struct ndr_push *push;
1318         enum ndr_err_code ndr_err;
1319         DATA_BLOB blob;
1320         struct wkssvc_NetrUnjoinDomain *r;
1321
1322         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN];
1323
1324         r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain);
1325         if (r == NULL) {
1326                 return false;
1327         }
1328
1329         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1330                 talloc_free(r);
1331                 return false;
1332         }
1333
1334         pull = ndr_pull_init_blob(&blob, r);
1335         if (pull == NULL) {
1336                 talloc_free(r);
1337                 return false;
1338         }
1339
1340         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1341         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1342         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1343                 talloc_free(r);
1344                 return false;
1345         }
1346
1347         if (DEBUGLEVEL >= 10) {
1348                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, r);
1349         }
1350
1351         r->out.result = _wkssvc_NetrUnjoinDomain(p, r);
1352
1353         if (p->rng_fault_state) {
1354                 talloc_free(r);
1355                 /* Return true here, srv_pipe_hnd.c will take care */
1356                 return true;
1357         }
1358
1359         if (DEBUGLEVEL >= 10) {
1360                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, r);
1361         }
1362
1363         push = ndr_push_init_ctx(r);
1364         if (push == NULL) {
1365                 talloc_free(r);
1366                 return false;
1367         }
1368
1369         ndr_err = call->ndr_push(push, NDR_OUT, r);
1370         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1371                 talloc_free(r);
1372                 return false;
1373         }
1374
1375         blob = ndr_push_blob(push);
1376         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1377                 talloc_free(r);
1378                 return false;
1379         }
1380
1381         talloc_free(r);
1382
1383         return true;
1384 }
1385
1386 static bool api_wkssvc_NetrRenameMachineInDomain(pipes_struct *p)
1387 {
1388         const struct ndr_interface_call *call;
1389         struct ndr_pull *pull;
1390         struct ndr_push *push;
1391         enum ndr_err_code ndr_err;
1392         DATA_BLOB blob;
1393         struct wkssvc_NetrRenameMachineInDomain *r;
1394
1395         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN];
1396
1397         r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain);
1398         if (r == NULL) {
1399                 return false;
1400         }
1401
1402         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1403                 talloc_free(r);
1404                 return false;
1405         }
1406
1407         pull = ndr_pull_init_blob(&blob, r);
1408         if (pull == NULL) {
1409                 talloc_free(r);
1410                 return false;
1411         }
1412
1413         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1414         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1415         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1416                 talloc_free(r);
1417                 return false;
1418         }
1419
1420         if (DEBUGLEVEL >= 10) {
1421                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, r);
1422         }
1423
1424         r->out.result = _wkssvc_NetrRenameMachineInDomain(p, r);
1425
1426         if (p->rng_fault_state) {
1427                 talloc_free(r);
1428                 /* Return true here, srv_pipe_hnd.c will take care */
1429                 return true;
1430         }
1431
1432         if (DEBUGLEVEL >= 10) {
1433                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, r);
1434         }
1435
1436         push = ndr_push_init_ctx(r);
1437         if (push == NULL) {
1438                 talloc_free(r);
1439                 return false;
1440         }
1441
1442         ndr_err = call->ndr_push(push, NDR_OUT, r);
1443         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1444                 talloc_free(r);
1445                 return false;
1446         }
1447
1448         blob = ndr_push_blob(push);
1449         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1450                 talloc_free(r);
1451                 return false;
1452         }
1453
1454         talloc_free(r);
1455
1456         return true;
1457 }
1458
1459 static bool api_wkssvc_NetrValidateName(pipes_struct *p)
1460 {
1461         const struct ndr_interface_call *call;
1462         struct ndr_pull *pull;
1463         struct ndr_push *push;
1464         enum ndr_err_code ndr_err;
1465         DATA_BLOB blob;
1466         struct wkssvc_NetrValidateName *r;
1467
1468         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME];
1469
1470         r = talloc(talloc_tos(), struct wkssvc_NetrValidateName);
1471         if (r == NULL) {
1472                 return false;
1473         }
1474
1475         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1476                 talloc_free(r);
1477                 return false;
1478         }
1479
1480         pull = ndr_pull_init_blob(&blob, r);
1481         if (pull == NULL) {
1482                 talloc_free(r);
1483                 return false;
1484         }
1485
1486         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1487         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1488         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1489                 talloc_free(r);
1490                 return false;
1491         }
1492
1493         if (DEBUGLEVEL >= 10) {
1494                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, r);
1495         }
1496
1497         r->out.result = _wkssvc_NetrValidateName(p, r);
1498
1499         if (p->rng_fault_state) {
1500                 talloc_free(r);
1501                 /* Return true here, srv_pipe_hnd.c will take care */
1502                 return true;
1503         }
1504
1505         if (DEBUGLEVEL >= 10) {
1506                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, r);
1507         }
1508
1509         push = ndr_push_init_ctx(r);
1510         if (push == NULL) {
1511                 talloc_free(r);
1512                 return false;
1513         }
1514
1515         ndr_err = call->ndr_push(push, NDR_OUT, r);
1516         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1517                 talloc_free(r);
1518                 return false;
1519         }
1520
1521         blob = ndr_push_blob(push);
1522         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1523                 talloc_free(r);
1524                 return false;
1525         }
1526
1527         talloc_free(r);
1528
1529         return true;
1530 }
1531
1532 static bool api_wkssvc_NetrGetJoinInformation(pipes_struct *p)
1533 {
1534         const struct ndr_interface_call *call;
1535         struct ndr_pull *pull;
1536         struct ndr_push *push;
1537         enum ndr_err_code ndr_err;
1538         DATA_BLOB blob;
1539         struct wkssvc_NetrGetJoinInformation *r;
1540
1541         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOININFORMATION];
1542
1543         r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinInformation);
1544         if (r == NULL) {
1545                 return false;
1546         }
1547
1548         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1549                 talloc_free(r);
1550                 return false;
1551         }
1552
1553         pull = ndr_pull_init_blob(&blob, r);
1554         if (pull == NULL) {
1555                 talloc_free(r);
1556                 return false;
1557         }
1558
1559         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1560         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1561         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1562                 talloc_free(r);
1563                 return false;
1564         }
1565
1566         if (DEBUGLEVEL >= 10) {
1567                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, r);
1568         }
1569
1570         ZERO_STRUCT(r->out);
1571         r->out.name_buffer = r->in.name_buffer;
1572         r->out.name_type = talloc_zero(r, enum wkssvc_NetJoinStatus);
1573         if (r->out.name_type == NULL) {
1574                 talloc_free(r);
1575                 return false;
1576         }
1577
1578         r->out.result = _wkssvc_NetrGetJoinInformation(p, r);
1579
1580         if (p->rng_fault_state) {
1581                 talloc_free(r);
1582                 /* Return true here, srv_pipe_hnd.c will take care */
1583                 return true;
1584         }
1585
1586         if (DEBUGLEVEL >= 10) {
1587                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, r);
1588         }
1589
1590         push = ndr_push_init_ctx(r);
1591         if (push == NULL) {
1592                 talloc_free(r);
1593                 return false;
1594         }
1595
1596         ndr_err = call->ndr_push(push, NDR_OUT, r);
1597         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1598                 talloc_free(r);
1599                 return false;
1600         }
1601
1602         blob = ndr_push_blob(push);
1603         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1604                 talloc_free(r);
1605                 return false;
1606         }
1607
1608         talloc_free(r);
1609
1610         return true;
1611 }
1612
1613 static bool api_wkssvc_NetrGetJoinableOus(pipes_struct *p)
1614 {
1615         const struct ndr_interface_call *call;
1616         struct ndr_pull *pull;
1617         struct ndr_push *push;
1618         enum ndr_err_code ndr_err;
1619         DATA_BLOB blob;
1620         struct wkssvc_NetrGetJoinableOus *r;
1621
1622         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS];
1623
1624         r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus);
1625         if (r == NULL) {
1626                 return false;
1627         }
1628
1629         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1630                 talloc_free(r);
1631                 return false;
1632         }
1633
1634         pull = ndr_pull_init_blob(&blob, r);
1635         if (pull == NULL) {
1636                 talloc_free(r);
1637                 return false;
1638         }
1639
1640         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1641         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1642         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1643                 talloc_free(r);
1644                 return false;
1645         }
1646
1647         if (DEBUGLEVEL >= 10) {
1648                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, r);
1649         }
1650
1651         ZERO_STRUCT(r->out);
1652         r->out.num_ous = r->in.num_ous;
1653         r->out.ous = talloc_zero(r, const char **);
1654         if (r->out.ous == NULL) {
1655                 talloc_free(r);
1656                 return false;
1657         }
1658
1659         r->out.result = _wkssvc_NetrGetJoinableOus(p, r);
1660
1661         if (p->rng_fault_state) {
1662                 talloc_free(r);
1663                 /* Return true here, srv_pipe_hnd.c will take care */
1664                 return true;
1665         }
1666
1667         if (DEBUGLEVEL >= 10) {
1668                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, r);
1669         }
1670
1671         push = ndr_push_init_ctx(r);
1672         if (push == NULL) {
1673                 talloc_free(r);
1674                 return false;
1675         }
1676
1677         ndr_err = call->ndr_push(push, NDR_OUT, r);
1678         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1679                 talloc_free(r);
1680                 return false;
1681         }
1682
1683         blob = ndr_push_blob(push);
1684         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1685                 talloc_free(r);
1686                 return false;
1687         }
1688
1689         talloc_free(r);
1690
1691         return true;
1692 }
1693
1694 static bool api_wkssvc_NetrJoinDomain2(pipes_struct *p)
1695 {
1696         const struct ndr_interface_call *call;
1697         struct ndr_pull *pull;
1698         struct ndr_push *push;
1699         enum ndr_err_code ndr_err;
1700         DATA_BLOB blob;
1701         struct wkssvc_NetrJoinDomain2 *r;
1702
1703         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRJOINDOMAIN2];
1704
1705         r = talloc(talloc_tos(), struct wkssvc_NetrJoinDomain2);
1706         if (r == NULL) {
1707                 return false;
1708         }
1709
1710         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1711                 talloc_free(r);
1712                 return false;
1713         }
1714
1715         pull = ndr_pull_init_blob(&blob, r);
1716         if (pull == NULL) {
1717                 talloc_free(r);
1718                 return false;
1719         }
1720
1721         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1722         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1723         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1724                 talloc_free(r);
1725                 return false;
1726         }
1727
1728         if (DEBUGLEVEL >= 10) {
1729                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, r);
1730         }
1731
1732         r->out.result = _wkssvc_NetrJoinDomain2(p, r);
1733
1734         if (p->rng_fault_state) {
1735                 talloc_free(r);
1736                 /* Return true here, srv_pipe_hnd.c will take care */
1737                 return true;
1738         }
1739
1740         if (DEBUGLEVEL >= 10) {
1741                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, r);
1742         }
1743
1744         push = ndr_push_init_ctx(r);
1745         if (push == NULL) {
1746                 talloc_free(r);
1747                 return false;
1748         }
1749
1750         ndr_err = call->ndr_push(push, NDR_OUT, r);
1751         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1752                 talloc_free(r);
1753                 return false;
1754         }
1755
1756         blob = ndr_push_blob(push);
1757         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1758                 talloc_free(r);
1759                 return false;
1760         }
1761
1762         talloc_free(r);
1763
1764         return true;
1765 }
1766
1767 static bool api_wkssvc_NetrUnjoinDomain2(pipes_struct *p)
1768 {
1769         const struct ndr_interface_call *call;
1770         struct ndr_pull *pull;
1771         struct ndr_push *push;
1772         enum ndr_err_code ndr_err;
1773         DATA_BLOB blob;
1774         struct wkssvc_NetrUnjoinDomain2 *r;
1775
1776         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRUNJOINDOMAIN2];
1777
1778         r = talloc(talloc_tos(), struct wkssvc_NetrUnjoinDomain2);
1779         if (r == NULL) {
1780                 return false;
1781         }
1782
1783         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1784                 talloc_free(r);
1785                 return false;
1786         }
1787
1788         pull = ndr_pull_init_blob(&blob, r);
1789         if (pull == NULL) {
1790                 talloc_free(r);
1791                 return false;
1792         }
1793
1794         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1795         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1796         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1797                 talloc_free(r);
1798                 return false;
1799         }
1800
1801         if (DEBUGLEVEL >= 10) {
1802                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, r);
1803         }
1804
1805         r->out.result = _wkssvc_NetrUnjoinDomain2(p, r);
1806
1807         if (p->rng_fault_state) {
1808                 talloc_free(r);
1809                 /* Return true here, srv_pipe_hnd.c will take care */
1810                 return true;
1811         }
1812
1813         if (DEBUGLEVEL >= 10) {
1814                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, r);
1815         }
1816
1817         push = ndr_push_init_ctx(r);
1818         if (push == NULL) {
1819                 talloc_free(r);
1820                 return false;
1821         }
1822
1823         ndr_err = call->ndr_push(push, NDR_OUT, r);
1824         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1825                 talloc_free(r);
1826                 return false;
1827         }
1828
1829         blob = ndr_push_blob(push);
1830         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1831                 talloc_free(r);
1832                 return false;
1833         }
1834
1835         talloc_free(r);
1836
1837         return true;
1838 }
1839
1840 static bool api_wkssvc_NetrRenameMachineInDomain2(pipes_struct *p)
1841 {
1842         const struct ndr_interface_call *call;
1843         struct ndr_pull *pull;
1844         struct ndr_push *push;
1845         enum ndr_err_code ndr_err;
1846         DATA_BLOB blob;
1847         struct wkssvc_NetrRenameMachineInDomain2 *r;
1848
1849         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2];
1850
1851         r = talloc(talloc_tos(), struct wkssvc_NetrRenameMachineInDomain2);
1852         if (r == NULL) {
1853                 return false;
1854         }
1855
1856         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1857                 talloc_free(r);
1858                 return false;
1859         }
1860
1861         pull = ndr_pull_init_blob(&blob, r);
1862         if (pull == NULL) {
1863                 talloc_free(r);
1864                 return false;
1865         }
1866
1867         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1868         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1869         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1870                 talloc_free(r);
1871                 return false;
1872         }
1873
1874         if (DEBUGLEVEL >= 10) {
1875                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, r);
1876         }
1877
1878         r->out.result = _wkssvc_NetrRenameMachineInDomain2(p, r);
1879
1880         if (p->rng_fault_state) {
1881                 talloc_free(r);
1882                 /* Return true here, srv_pipe_hnd.c will take care */
1883                 return true;
1884         }
1885
1886         if (DEBUGLEVEL >= 10) {
1887                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, r);
1888         }
1889
1890         push = ndr_push_init_ctx(r);
1891         if (push == NULL) {
1892                 talloc_free(r);
1893                 return false;
1894         }
1895
1896         ndr_err = call->ndr_push(push, NDR_OUT, r);
1897         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1898                 talloc_free(r);
1899                 return false;
1900         }
1901
1902         blob = ndr_push_blob(push);
1903         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1904                 talloc_free(r);
1905                 return false;
1906         }
1907
1908         talloc_free(r);
1909
1910         return true;
1911 }
1912
1913 static bool api_wkssvc_NetrValidateName2(pipes_struct *p)
1914 {
1915         const struct ndr_interface_call *call;
1916         struct ndr_pull *pull;
1917         struct ndr_push *push;
1918         enum ndr_err_code ndr_err;
1919         DATA_BLOB blob;
1920         struct wkssvc_NetrValidateName2 *r;
1921
1922         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRVALIDATENAME2];
1923
1924         r = talloc(talloc_tos(), struct wkssvc_NetrValidateName2);
1925         if (r == NULL) {
1926                 return false;
1927         }
1928
1929         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
1930                 talloc_free(r);
1931                 return false;
1932         }
1933
1934         pull = ndr_pull_init_blob(&blob, r);
1935         if (pull == NULL) {
1936                 talloc_free(r);
1937                 return false;
1938         }
1939
1940         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
1941         ndr_err = call->ndr_pull(pull, NDR_IN, r);
1942         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1943                 talloc_free(r);
1944                 return false;
1945         }
1946
1947         if (DEBUGLEVEL >= 10) {
1948                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, r);
1949         }
1950
1951         r->out.result = _wkssvc_NetrValidateName2(p, r);
1952
1953         if (p->rng_fault_state) {
1954                 talloc_free(r);
1955                 /* Return true here, srv_pipe_hnd.c will take care */
1956                 return true;
1957         }
1958
1959         if (DEBUGLEVEL >= 10) {
1960                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, r);
1961         }
1962
1963         push = ndr_push_init_ctx(r);
1964         if (push == NULL) {
1965                 talloc_free(r);
1966                 return false;
1967         }
1968
1969         ndr_err = call->ndr_push(push, NDR_OUT, r);
1970         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
1971                 talloc_free(r);
1972                 return false;
1973         }
1974
1975         blob = ndr_push_blob(push);
1976         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
1977                 talloc_free(r);
1978                 return false;
1979         }
1980
1981         talloc_free(r);
1982
1983         return true;
1984 }
1985
1986 static bool api_wkssvc_NetrGetJoinableOus2(pipes_struct *p)
1987 {
1988         const struct ndr_interface_call *call;
1989         struct ndr_pull *pull;
1990         struct ndr_push *push;
1991         enum ndr_err_code ndr_err;
1992         DATA_BLOB blob;
1993         struct wkssvc_NetrGetJoinableOus2 *r;
1994
1995         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRGETJOINABLEOUS2];
1996
1997         r = talloc(talloc_tos(), struct wkssvc_NetrGetJoinableOus2);
1998         if (r == NULL) {
1999                 return false;
2000         }
2001
2002         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2003                 talloc_free(r);
2004                 return false;
2005         }
2006
2007         pull = ndr_pull_init_blob(&blob, r);
2008         if (pull == NULL) {
2009                 talloc_free(r);
2010                 return false;
2011         }
2012
2013         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2014         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2015         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2016                 talloc_free(r);
2017                 return false;
2018         }
2019
2020         if (DEBUGLEVEL >= 10) {
2021                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, r);
2022         }
2023
2024         ZERO_STRUCT(r->out);
2025         r->out.num_ous = r->in.num_ous;
2026         r->out.ous = talloc_zero(r, const char **);
2027         if (r->out.ous == NULL) {
2028                 talloc_free(r);
2029                 return false;
2030         }
2031
2032         r->out.result = _wkssvc_NetrGetJoinableOus2(p, r);
2033
2034         if (p->rng_fault_state) {
2035                 talloc_free(r);
2036                 /* Return true here, srv_pipe_hnd.c will take care */
2037                 return true;
2038         }
2039
2040         if (DEBUGLEVEL >= 10) {
2041                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, r);
2042         }
2043
2044         push = ndr_push_init_ctx(r);
2045         if (push == NULL) {
2046                 talloc_free(r);
2047                 return false;
2048         }
2049
2050         ndr_err = call->ndr_push(push, NDR_OUT, r);
2051         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2052                 talloc_free(r);
2053                 return false;
2054         }
2055
2056         blob = ndr_push_blob(push);
2057         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2058                 talloc_free(r);
2059                 return false;
2060         }
2061
2062         talloc_free(r);
2063
2064         return true;
2065 }
2066
2067 static bool api_wkssvc_NetrAddAlternateComputerName(pipes_struct *p)
2068 {
2069         const struct ndr_interface_call *call;
2070         struct ndr_pull *pull;
2071         struct ndr_push *push;
2072         enum ndr_err_code ndr_err;
2073         DATA_BLOB blob;
2074         struct wkssvc_NetrAddAlternateComputerName *r;
2075
2076         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME];
2077
2078         r = talloc(talloc_tos(), struct wkssvc_NetrAddAlternateComputerName);
2079         if (r == NULL) {
2080                 return false;
2081         }
2082
2083         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2084                 talloc_free(r);
2085                 return false;
2086         }
2087
2088         pull = ndr_pull_init_blob(&blob, r);
2089         if (pull == NULL) {
2090                 talloc_free(r);
2091                 return false;
2092         }
2093
2094         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2095         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2096         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2097                 talloc_free(r);
2098                 return false;
2099         }
2100
2101         if (DEBUGLEVEL >= 10) {
2102                 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, r);
2103         }
2104
2105         r->out.result = _wkssvc_NetrAddAlternateComputerName(p, r);
2106
2107         if (p->rng_fault_state) {
2108                 talloc_free(r);
2109                 /* Return true here, srv_pipe_hnd.c will take care */
2110                 return true;
2111         }
2112
2113         if (DEBUGLEVEL >= 10) {
2114                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, r);
2115         }
2116
2117         push = ndr_push_init_ctx(r);
2118         if (push == NULL) {
2119                 talloc_free(r);
2120                 return false;
2121         }
2122
2123         ndr_err = call->ndr_push(push, NDR_OUT, r);
2124         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2125                 talloc_free(r);
2126                 return false;
2127         }
2128
2129         blob = ndr_push_blob(push);
2130         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2131                 talloc_free(r);
2132                 return false;
2133         }
2134
2135         talloc_free(r);
2136
2137         return true;
2138 }
2139
2140 static bool api_wkssvc_NetrRemoveAlternateComputerName(pipes_struct *p)
2141 {
2142         const struct ndr_interface_call *call;
2143         struct ndr_pull *pull;
2144         struct ndr_push *push;
2145         enum ndr_err_code ndr_err;
2146         DATA_BLOB blob;
2147         struct wkssvc_NetrRemoveAlternateComputerName *r;
2148
2149         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME];
2150
2151         r = talloc(talloc_tos(), struct wkssvc_NetrRemoveAlternateComputerName);
2152         if (r == NULL) {
2153                 return false;
2154         }
2155
2156         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2157                 talloc_free(r);
2158                 return false;
2159         }
2160
2161         pull = ndr_pull_init_blob(&blob, r);
2162         if (pull == NULL) {
2163                 talloc_free(r);
2164                 return false;
2165         }
2166
2167         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2168         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2169         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2170                 talloc_free(r);
2171                 return false;
2172         }
2173
2174         if (DEBUGLEVEL >= 10) {
2175                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r);
2176         }
2177
2178         r->out.result = _wkssvc_NetrRemoveAlternateComputerName(p, r);
2179
2180         if (p->rng_fault_state) {
2181                 talloc_free(r);
2182                 /* Return true here, srv_pipe_hnd.c will take care */
2183                 return true;
2184         }
2185
2186         if (DEBUGLEVEL >= 10) {
2187                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, r);
2188         }
2189
2190         push = ndr_push_init_ctx(r);
2191         if (push == NULL) {
2192                 talloc_free(r);
2193                 return false;
2194         }
2195
2196         ndr_err = call->ndr_push(push, NDR_OUT, r);
2197         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2198                 talloc_free(r);
2199                 return false;
2200         }
2201
2202         blob = ndr_push_blob(push);
2203         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2204                 talloc_free(r);
2205                 return false;
2206         }
2207
2208         talloc_free(r);
2209
2210         return true;
2211 }
2212
2213 static bool api_wkssvc_NetrSetPrimaryComputername(pipes_struct *p)
2214 {
2215         const struct ndr_interface_call *call;
2216         struct ndr_pull *pull;
2217         struct ndr_push *push;
2218         enum ndr_err_code ndr_err;
2219         DATA_BLOB blob;
2220         struct wkssvc_NetrSetPrimaryComputername *r;
2221
2222         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME];
2223
2224         r = talloc(talloc_tos(), struct wkssvc_NetrSetPrimaryComputername);
2225         if (r == NULL) {
2226                 return false;
2227         }
2228
2229         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2230                 talloc_free(r);
2231                 return false;
2232         }
2233
2234         pull = ndr_pull_init_blob(&blob, r);
2235         if (pull == NULL) {
2236                 talloc_free(r);
2237                 return false;
2238         }
2239
2240         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2241         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2242         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2243                 talloc_free(r);
2244                 return false;
2245         }
2246
2247         if (DEBUGLEVEL >= 10) {
2248                 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, r);
2249         }
2250
2251         r->out.result = _wkssvc_NetrSetPrimaryComputername(p, r);
2252
2253         if (p->rng_fault_state) {
2254                 talloc_free(r);
2255                 /* Return true here, srv_pipe_hnd.c will take care */
2256                 return true;
2257         }
2258
2259         if (DEBUGLEVEL >= 10) {
2260                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, r);
2261         }
2262
2263         push = ndr_push_init_ctx(r);
2264         if (push == NULL) {
2265                 talloc_free(r);
2266                 return false;
2267         }
2268
2269         ndr_err = call->ndr_push(push, NDR_OUT, r);
2270         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2271                 talloc_free(r);
2272                 return false;
2273         }
2274
2275         blob = ndr_push_blob(push);
2276         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2277                 talloc_free(r);
2278                 return false;
2279         }
2280
2281         talloc_free(r);
2282
2283         return true;
2284 }
2285
2286 static bool api_wkssvc_NetrEnumerateComputerNames(pipes_struct *p)
2287 {
2288         const struct ndr_interface_call *call;
2289         struct ndr_pull *pull;
2290         struct ndr_push *push;
2291         enum ndr_err_code ndr_err;
2292         DATA_BLOB blob;
2293         struct wkssvc_NetrEnumerateComputerNames *r;
2294
2295         call = &ndr_table_wkssvc.calls[NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES];
2296
2297         r = talloc(talloc_tos(), struct wkssvc_NetrEnumerateComputerNames);
2298         if (r == NULL) {
2299                 return false;
2300         }
2301
2302         if (!prs_data_blob(&p->in_data.data, &blob, r)) {
2303                 talloc_free(r);
2304                 return false;
2305         }
2306
2307         pull = ndr_pull_init_blob(&blob, r);
2308         if (pull == NULL) {
2309                 talloc_free(r);
2310                 return false;
2311         }
2312
2313         pull->flags |= LIBNDR_FLAG_REF_ALLOC;
2314         ndr_err = call->ndr_pull(pull, NDR_IN, r);
2315         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2316                 talloc_free(r);
2317                 return false;
2318         }
2319
2320         if (DEBUGLEVEL >= 10) {
2321                 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, r);
2322         }
2323
2324         ZERO_STRUCT(r->out);
2325         r->out.ctr = talloc_zero(r, struct wkssvc_ComputerNamesCtr *);
2326         if (r->out.ctr == NULL) {
2327                 talloc_free(r);
2328                 return false;
2329         }
2330
2331         r->out.result = _wkssvc_NetrEnumerateComputerNames(p, r);
2332
2333         if (p->rng_fault_state) {
2334                 talloc_free(r);
2335                 /* Return true here, srv_pipe_hnd.c will take care */
2336                 return true;
2337         }
2338
2339         if (DEBUGLEVEL >= 10) {
2340                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, r);
2341         }
2342
2343         push = ndr_push_init_ctx(r);
2344         if (push == NULL) {
2345                 talloc_free(r);
2346                 return false;
2347         }
2348
2349         ndr_err = call->ndr_push(push, NDR_OUT, r);
2350         if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
2351                 talloc_free(r);
2352                 return false;
2353         }
2354
2355         blob = ndr_push_blob(push);
2356         if (!prs_copy_data_in(&p->out_data.rdata, (const char *)blob.data, (uint32_t)blob.length)) {
2357                 talloc_free(r);
2358                 return false;
2359         }
2360
2361         talloc_free(r);
2362
2363         return true;
2364 }
2365
2366
2367 /* Tables */
2368 static struct api_struct api_wkssvc_cmds[] = 
2369 {
2370         {"WKSSVC_NETWKSTAGETINFO", NDR_WKSSVC_NETWKSTAGETINFO, api_wkssvc_NetWkstaGetInfo},
2371         {"WKSSVC_NETWKSTASETINFO", NDR_WKSSVC_NETWKSTASETINFO, api_wkssvc_NetWkstaSetInfo},
2372         {"WKSSVC_NETWKSTAENUMUSERS", NDR_WKSSVC_NETWKSTAENUMUSERS, api_wkssvc_NetWkstaEnumUsers},
2373         {"WKSSVC_NETRWKSTAUSERGETINFO", NDR_WKSSVC_NETRWKSTAUSERGETINFO, api_wkssvc_NetrWkstaUserGetInfo},
2374         {"WKSSVC_NETRWKSTAUSERSETINFO", NDR_WKSSVC_NETRWKSTAUSERSETINFO, api_wkssvc_NetrWkstaUserSetInfo},
2375         {"WKSSVC_NETWKSTATRANSPORTENUM", NDR_WKSSVC_NETWKSTATRANSPORTENUM, api_wkssvc_NetWkstaTransportEnum},
2376         {"WKSSVC_NETRWKSTATRANSPORTADD", NDR_WKSSVC_NETRWKSTATRANSPORTADD, api_wkssvc_NetrWkstaTransportAdd},
2377         {"WKSSVC_NETRWKSTATRANSPORTDEL", NDR_WKSSVC_NETRWKSTATRANSPORTDEL, api_wkssvc_NetrWkstaTransportDel},
2378         {"WKSSVC_NETRUSEADD", NDR_WKSSVC_NETRUSEADD, api_wkssvc_NetrUseAdd},
2379         {"WKSSVC_NETRUSEGETINFO", NDR_WKSSVC_NETRUSEGETINFO, api_wkssvc_NetrUseGetInfo},
2380         {"WKSSVC_NETRUSEDEL", NDR_WKSSVC_NETRUSEDEL, api_wkssvc_NetrUseDel},
2381         {"WKSSVC_NETRUSEENUM", NDR_WKSSVC_NETRUSEENUM, api_wkssvc_NetrUseEnum},
2382         {"WKSSVC_NETRMESSAGEBUFFERSEND", NDR_WKSSVC_NETRMESSAGEBUFFERSEND, api_wkssvc_NetrMessageBufferSend},
2383         {"WKSSVC_NETRWORKSTATIONSTATISTICSGET", NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET, api_wkssvc_NetrWorkstationStatisticsGet},
2384         {"WKSSVC_NETRLOGONDOMAINNAMEADD", NDR_WKSSVC_NETRLOGONDOMAINNAMEADD, api_wkssvc_NetrLogonDomainNameAdd},
2385         {"WKSSVC_NETRLOGONDOMAINNAMEDEL", NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL, api_wkssvc_NetrLogonDomainNameDel},
2386         {"WKSSVC_NETRJOINDOMAIN", NDR_WKSSVC_NETRJOINDOMAIN, api_wkssvc_NetrJoinDomain},
2387         {"WKSSVC_NETRUNJOINDOMAIN", NDR_WKSSVC_NETRUNJOINDOMAIN, api_wkssvc_NetrUnjoinDomain},
2388         {"WKSSVC_NETRRENAMEMACHINEINDOMAIN", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN, api_wkssvc_NetrRenameMachineInDomain},
2389         {"WKSSVC_NETRVALIDATENAME", NDR_WKSSVC_NETRVALIDATENAME, api_wkssvc_NetrValidateName},
2390         {"WKSSVC_NETRGETJOININFORMATION", NDR_WKSSVC_NETRGETJOININFORMATION, api_wkssvc_NetrGetJoinInformation},
2391         {"WKSSVC_NETRGETJOINABLEOUS", NDR_WKSSVC_NETRGETJOINABLEOUS, api_wkssvc_NetrGetJoinableOus},
2392         {"WKSSVC_NETRJOINDOMAIN2", NDR_WKSSVC_NETRJOINDOMAIN2, api_wkssvc_NetrJoinDomain2},
2393         {"WKSSVC_NETRUNJOINDOMAIN2", NDR_WKSSVC_NETRUNJOINDOMAIN2, api_wkssvc_NetrUnjoinDomain2},
2394         {"WKSSVC_NETRRENAMEMACHINEINDOMAIN2", NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2, api_wkssvc_NetrRenameMachineInDomain2},
2395         {"WKSSVC_NETRVALIDATENAME2", NDR_WKSSVC_NETRVALIDATENAME2, api_wkssvc_NetrValidateName2},
2396         {"WKSSVC_NETRGETJOINABLEOUS2", NDR_WKSSVC_NETRGETJOINABLEOUS2, api_wkssvc_NetrGetJoinableOus2},
2397         {"WKSSVC_NETRADDALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME, api_wkssvc_NetrAddAlternateComputerName},
2398         {"WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME", NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME, api_wkssvc_NetrRemoveAlternateComputerName},
2399         {"WKSSVC_NETRSETPRIMARYCOMPUTERNAME", NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME, api_wkssvc_NetrSetPrimaryComputername},
2400         {"WKSSVC_NETRENUMERATECOMPUTERNAMES", NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES, api_wkssvc_NetrEnumerateComputerNames},
2401 };
2402
2403 void wkssvc_get_pipe_fns(struct api_struct **fns, int *n_fns)
2404 {
2405         *fns = api_wkssvc_cmds;
2406         *n_fns = sizeof(api_wkssvc_cmds) / sizeof(struct api_struct);
2407 }
2408
2409 NTSTATUS rpc_wkssvc_init(void)
2410 {
2411         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "wkssvc", "wkssvc", api_wkssvc_cmds, sizeof(api_wkssvc_cmds) / sizeof(struct api_struct));
2412 }