b82e95311f619dc6d9cb7ab494139a451bfda8b9
[sfrench/samba-autobuild/.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 NTSTATUS rpccli_wkssvc_NetWkstaGetInfo(struct rpc_pipe_client *cli,
10                                        TALLOC_CTX *mem_ctx,
11                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
12                                        uint32_t level /* [in]  */,
13                                        union wkssvc_NetWkstaInfo *info /* [out] [ref,switch_is(level)] */,
14                                        WERROR *werror)
15 {
16         struct wkssvc_NetWkstaGetInfo r;
17         NTSTATUS status;
18
19         /* In parameters */
20         r.in.server_name = server_name;
21         r.in.level = level;
22
23         if (DEBUGLEVEL >= 10) {
24                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaGetInfo, &r);
25         }
26
27         status = cli_do_rpc_ndr(cli,
28                                 mem_ctx,
29                                 &ndr_table_wkssvc,
30                                 NDR_WKSSVC_NETWKSTAGETINFO,
31                                 &r);
32
33         if (!NT_STATUS_IS_OK(status)) {
34                 return status;
35         }
36
37         if (DEBUGLEVEL >= 10) {
38                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaGetInfo, &r);
39         }
40
41         if (NT_STATUS_IS_ERR(status)) {
42                 return status;
43         }
44
45         /* Return variables */
46         *info = *r.out.info;
47
48         /* Return result */
49         if (werror) {
50                 *werror = r.out.result;
51         }
52
53         return werror_to_ntstatus(r.out.result);
54 }
55
56 NTSTATUS rpccli_wkssvc_NetWkstaSetInfo(struct rpc_pipe_client *cli,
57                                        TALLOC_CTX *mem_ctx,
58                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
59                                        uint32_t level /* [in]  */,
60                                        union wkssvc_NetWkstaInfo *info /* [in] [ref,switch_is(level)] */,
61                                        uint32_t *parm_error /* [in,out] [ref] */,
62                                        WERROR *werror)
63 {
64         struct wkssvc_NetWkstaSetInfo r;
65         NTSTATUS status;
66
67         /* In parameters */
68         r.in.server_name = server_name;
69         r.in.level = level;
70         r.in.info = info;
71         r.in.parm_error = parm_error;
72
73         if (DEBUGLEVEL >= 10) {
74                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaSetInfo, &r);
75         }
76
77         status = cli_do_rpc_ndr(cli,
78                                 mem_ctx,
79                                 &ndr_table_wkssvc,
80                                 NDR_WKSSVC_NETWKSTASETINFO,
81                                 &r);
82
83         if (!NT_STATUS_IS_OK(status)) {
84                 return status;
85         }
86
87         if (DEBUGLEVEL >= 10) {
88                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaSetInfo, &r);
89         }
90
91         if (NT_STATUS_IS_ERR(status)) {
92                 return status;
93         }
94
95         /* Return variables */
96         *parm_error = *r.out.parm_error;
97
98         /* Return result */
99         if (werror) {
100                 *werror = r.out.result;
101         }
102
103         return werror_to_ntstatus(r.out.result);
104 }
105
106 NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli,
107                                          TALLOC_CTX *mem_ctx,
108                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
109                                          struct wkssvc_NetWkstaEnumUsersInfo *info /* [in,out] [ref] */,
110                                          uint32_t prefmaxlen /* [in]  */,
111                                          uint32_t *entries_read /* [out] [ref] */,
112                                          uint32_t *resume_handle /* [in,out] [unique] */,
113                                          WERROR *werror)
114 {
115         struct wkssvc_NetWkstaEnumUsers r;
116         NTSTATUS status;
117
118         /* In parameters */
119         r.in.server_name = server_name;
120         r.in.info = info;
121         r.in.prefmaxlen = prefmaxlen;
122         r.in.resume_handle = resume_handle;
123
124         if (DEBUGLEVEL >= 10) {
125                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
126         }
127
128         status = cli_do_rpc_ndr(cli,
129                                 mem_ctx,
130                                 &ndr_table_wkssvc,
131                                 NDR_WKSSVC_NETWKSTAENUMUSERS,
132                                 &r);
133
134         if (!NT_STATUS_IS_OK(status)) {
135                 return status;
136         }
137
138         if (DEBUGLEVEL >= 10) {
139                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaEnumUsers, &r);
140         }
141
142         if (NT_STATUS_IS_ERR(status)) {
143                 return status;
144         }
145
146         /* Return variables */
147         *info = *r.out.info;
148         *entries_read = *r.out.entries_read;
149         if (resume_handle && r.out.resume_handle) {
150                 *resume_handle = *r.out.resume_handle;
151         }
152
153         /* Return result */
154         if (werror) {
155                 *werror = r.out.result;
156         }
157
158         return werror_to_ntstatus(r.out.result);
159 }
160
161 NTSTATUS rpccli_wkssvc_NetrWkstaUserGetInfo(struct rpc_pipe_client *cli,
162                                             TALLOC_CTX *mem_ctx,
163                                             const char *unknown /* [in] [unique,charset(UTF16)] */,
164                                             uint32_t level /* [in]  */,
165                                             union wkssvc_NetrWkstaUserInfo *info /* [out] [ref,switch_is(level)] */,
166                                             WERROR *werror)
167 {
168         struct wkssvc_NetrWkstaUserGetInfo r;
169         NTSTATUS status;
170
171         /* In parameters */
172         r.in.unknown = unknown;
173         r.in.level = level;
174
175         if (DEBUGLEVEL >= 10) {
176                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
177         }
178
179         status = cli_do_rpc_ndr(cli,
180                                 mem_ctx,
181                                 &ndr_table_wkssvc,
182                                 NDR_WKSSVC_NETRWKSTAUSERGETINFO,
183                                 &r);
184
185         if (!NT_STATUS_IS_OK(status)) {
186                 return status;
187         }
188
189         if (DEBUGLEVEL >= 10) {
190                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserGetInfo, &r);
191         }
192
193         if (NT_STATUS_IS_ERR(status)) {
194                 return status;
195         }
196
197         /* Return variables */
198         *info = *r.out.info;
199
200         /* Return result */
201         if (werror) {
202                 *werror = r.out.result;
203         }
204
205         return werror_to_ntstatus(r.out.result);
206 }
207
208 NTSTATUS rpccli_wkssvc_NetrWkstaUserSetInfo(struct rpc_pipe_client *cli,
209                                             TALLOC_CTX *mem_ctx,
210                                             const char *unknown /* [in] [unique,charset(UTF16)] */,
211                                             uint32_t level /* [in]  */,
212                                             union wkssvc_NetrWkstaUserInfo *info /* [in] [ref,switch_is(level)] */,
213                                             uint32_t *parm_err /* [in,out] [unique] */,
214                                             WERROR *werror)
215 {
216         struct wkssvc_NetrWkstaUserSetInfo r;
217         NTSTATUS status;
218
219         /* In parameters */
220         r.in.unknown = unknown;
221         r.in.level = level;
222         r.in.info = info;
223         r.in.parm_err = parm_err;
224
225         if (DEBUGLEVEL >= 10) {
226                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
227         }
228
229         status = cli_do_rpc_ndr(cli,
230                                 mem_ctx,
231                                 &ndr_table_wkssvc,
232                                 NDR_WKSSVC_NETRWKSTAUSERSETINFO,
233                                 &r);
234
235         if (!NT_STATUS_IS_OK(status)) {
236                 return status;
237         }
238
239         if (DEBUGLEVEL >= 10) {
240                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaUserSetInfo, &r);
241         }
242
243         if (NT_STATUS_IS_ERR(status)) {
244                 return status;
245         }
246
247         /* Return variables */
248         if (parm_err && r.out.parm_err) {
249                 *parm_err = *r.out.parm_err;
250         }
251
252         /* Return result */
253         if (werror) {
254                 *werror = r.out.result;
255         }
256
257         return werror_to_ntstatus(r.out.result);
258 }
259
260 NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli,
261                                              TALLOC_CTX *mem_ctx,
262                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
263                                              struct wkssvc_NetWkstaTransportInfo *info /* [in,out] [ref] */,
264                                              uint32_t max_buffer /* [in]  */,
265                                              uint32_t *total_entries /* [out] [ref] */,
266                                              uint32_t *resume_handle /* [in,out] [unique] */,
267                                              WERROR *werror)
268 {
269         struct wkssvc_NetWkstaTransportEnum r;
270         NTSTATUS status;
271
272         /* In parameters */
273         r.in.server_name = server_name;
274         r.in.info = info;
275         r.in.max_buffer = max_buffer;
276         r.in.resume_handle = resume_handle;
277
278         if (DEBUGLEVEL >= 10) {
279                 NDR_PRINT_IN_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
280         }
281
282         status = cli_do_rpc_ndr(cli,
283                                 mem_ctx,
284                                 &ndr_table_wkssvc,
285                                 NDR_WKSSVC_NETWKSTATRANSPORTENUM,
286                                 &r);
287
288         if (!NT_STATUS_IS_OK(status)) {
289                 return status;
290         }
291
292         if (DEBUGLEVEL >= 10) {
293                 NDR_PRINT_OUT_DEBUG(wkssvc_NetWkstaTransportEnum, &r);
294         }
295
296         if (NT_STATUS_IS_ERR(status)) {
297                 return status;
298         }
299
300         /* Return variables */
301         *info = *r.out.info;
302         *total_entries = *r.out.total_entries;
303         if (resume_handle && r.out.resume_handle) {
304                 *resume_handle = *r.out.resume_handle;
305         }
306
307         /* Return result */
308         if (werror) {
309                 *werror = r.out.result;
310         }
311
312         return werror_to_ntstatus(r.out.result);
313 }
314
315 NTSTATUS rpccli_wkssvc_NetrWkstaTransportAdd(struct rpc_pipe_client *cli,
316                                              TALLOC_CTX *mem_ctx,
317                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
318                                              uint32_t level /* [in]  */,
319                                              struct wkssvc_NetWkstaTransportInfo0 *info0 /* [in] [ref] */,
320                                              uint32_t *parm_err /* [in,out] [unique] */,
321                                              WERROR *werror)
322 {
323         struct wkssvc_NetrWkstaTransportAdd r;
324         NTSTATUS status;
325
326         /* In parameters */
327         r.in.server_name = server_name;
328         r.in.level = level;
329         r.in.info0 = info0;
330         r.in.parm_err = parm_err;
331
332         if (DEBUGLEVEL >= 10) {
333                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
334         }
335
336         status = cli_do_rpc_ndr(cli,
337                                 mem_ctx,
338                                 &ndr_table_wkssvc,
339                                 NDR_WKSSVC_NETRWKSTATRANSPORTADD,
340                                 &r);
341
342         if (!NT_STATUS_IS_OK(status)) {
343                 return status;
344         }
345
346         if (DEBUGLEVEL >= 10) {
347                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportAdd, &r);
348         }
349
350         if (NT_STATUS_IS_ERR(status)) {
351                 return status;
352         }
353
354         /* Return variables */
355         if (parm_err && r.out.parm_err) {
356                 *parm_err = *r.out.parm_err;
357         }
358
359         /* Return result */
360         if (werror) {
361                 *werror = r.out.result;
362         }
363
364         return werror_to_ntstatus(r.out.result);
365 }
366
367 NTSTATUS rpccli_wkssvc_NetrWkstaTransportDel(struct rpc_pipe_client *cli,
368                                              TALLOC_CTX *mem_ctx,
369                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
370                                              const char *transport_name /* [in] [unique,charset(UTF16)] */,
371                                              uint32_t unknown3 /* [in]  */,
372                                              WERROR *werror)
373 {
374         struct wkssvc_NetrWkstaTransportDel r;
375         NTSTATUS status;
376
377         /* In parameters */
378         r.in.server_name = server_name;
379         r.in.transport_name = transport_name;
380         r.in.unknown3 = unknown3;
381
382         if (DEBUGLEVEL >= 10) {
383                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
384         }
385
386         status = cli_do_rpc_ndr(cli,
387                                 mem_ctx,
388                                 &ndr_table_wkssvc,
389                                 NDR_WKSSVC_NETRWKSTATRANSPORTDEL,
390                                 &r);
391
392         if (!NT_STATUS_IS_OK(status)) {
393                 return status;
394         }
395
396         if (DEBUGLEVEL >= 10) {
397                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWkstaTransportDel, &r);
398         }
399
400         if (NT_STATUS_IS_ERR(status)) {
401                 return status;
402         }
403
404         /* Return variables */
405
406         /* Return result */
407         if (werror) {
408                 *werror = r.out.result;
409         }
410
411         return werror_to_ntstatus(r.out.result);
412 }
413
414 NTSTATUS rpccli_wkssvc_NetrUseAdd(struct rpc_pipe_client *cli,
415                                   TALLOC_CTX *mem_ctx,
416                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
417                                   uint32_t level /* [in]  */,
418                                   union wkssvc_NetrUseGetInfoCtr *ctr /* [in] [ref,switch_is(level)] */,
419                                   uint32_t *parm_err /* [in,out] [unique] */,
420                                   WERROR *werror)
421 {
422         struct wkssvc_NetrUseAdd r;
423         NTSTATUS status;
424
425         /* In parameters */
426         r.in.server_name = server_name;
427         r.in.level = level;
428         r.in.ctr = ctr;
429         r.in.parm_err = parm_err;
430
431         if (DEBUGLEVEL >= 10) {
432                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseAdd, &r);
433         }
434
435         status = cli_do_rpc_ndr(cli,
436                                 mem_ctx,
437                                 &ndr_table_wkssvc,
438                                 NDR_WKSSVC_NETRUSEADD,
439                                 &r);
440
441         if (!NT_STATUS_IS_OK(status)) {
442                 return status;
443         }
444
445         if (DEBUGLEVEL >= 10) {
446                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseAdd, &r);
447         }
448
449         if (NT_STATUS_IS_ERR(status)) {
450                 return status;
451         }
452
453         /* Return variables */
454         if (parm_err && r.out.parm_err) {
455                 *parm_err = *r.out.parm_err;
456         }
457
458         /* Return result */
459         if (werror) {
460                 *werror = r.out.result;
461         }
462
463         return werror_to_ntstatus(r.out.result);
464 }
465
466 NTSTATUS rpccli_wkssvc_NetrUseGetInfo(struct rpc_pipe_client *cli,
467                                       TALLOC_CTX *mem_ctx,
468                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
469                                       const char *use_name /* [in] [ref,charset(UTF16)] */,
470                                       uint32_t level /* [in]  */,
471                                       union wkssvc_NetrUseGetInfoCtr *ctr /* [out] [ref,switch_is(level)] */,
472                                       WERROR *werror)
473 {
474         struct wkssvc_NetrUseGetInfo r;
475         NTSTATUS status;
476
477         /* In parameters */
478         r.in.server_name = server_name;
479         r.in.use_name = use_name;
480         r.in.level = level;
481
482         if (DEBUGLEVEL >= 10) {
483                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseGetInfo, &r);
484         }
485
486         status = cli_do_rpc_ndr(cli,
487                                 mem_ctx,
488                                 &ndr_table_wkssvc,
489                                 NDR_WKSSVC_NETRUSEGETINFO,
490                                 &r);
491
492         if (!NT_STATUS_IS_OK(status)) {
493                 return status;
494         }
495
496         if (DEBUGLEVEL >= 10) {
497                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseGetInfo, &r);
498         }
499
500         if (NT_STATUS_IS_ERR(status)) {
501                 return status;
502         }
503
504         /* Return variables */
505         *ctr = *r.out.ctr;
506
507         /* Return result */
508         if (werror) {
509                 *werror = r.out.result;
510         }
511
512         return werror_to_ntstatus(r.out.result);
513 }
514
515 NTSTATUS rpccli_wkssvc_NetrUseDel(struct rpc_pipe_client *cli,
516                                   TALLOC_CTX *mem_ctx,
517                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
518                                   const char *use_name /* [in] [ref,charset(UTF16)] */,
519                                   uint32_t force_cond /* [in]  */,
520                                   WERROR *werror)
521 {
522         struct wkssvc_NetrUseDel r;
523         NTSTATUS status;
524
525         /* In parameters */
526         r.in.server_name = server_name;
527         r.in.use_name = use_name;
528         r.in.force_cond = force_cond;
529
530         if (DEBUGLEVEL >= 10) {
531                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseDel, &r);
532         }
533
534         status = cli_do_rpc_ndr(cli,
535                                 mem_ctx,
536                                 &ndr_table_wkssvc,
537                                 NDR_WKSSVC_NETRUSEDEL,
538                                 &r);
539
540         if (!NT_STATUS_IS_OK(status)) {
541                 return status;
542         }
543
544         if (DEBUGLEVEL >= 10) {
545                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseDel, &r);
546         }
547
548         if (NT_STATUS_IS_ERR(status)) {
549                 return status;
550         }
551
552         /* Return variables */
553
554         /* Return result */
555         if (werror) {
556                 *werror = r.out.result;
557         }
558
559         return werror_to_ntstatus(r.out.result);
560 }
561
562 NTSTATUS rpccli_wkssvc_NetrUseEnum(struct rpc_pipe_client *cli,
563                                    TALLOC_CTX *mem_ctx,
564                                    const char *server_name /* [in] [unique,charset(UTF16)] */,
565                                    struct wkssvc_NetrUseEnumInfo *info /* [in,out] [ref] */,
566                                    uint32_t prefmaxlen /* [in]  */,
567                                    uint32_t *entries_read /* [out] [ref] */,
568                                    uint32_t *resume_handle /* [in,out] [unique] */,
569                                    WERROR *werror)
570 {
571         struct wkssvc_NetrUseEnum r;
572         NTSTATUS status;
573
574         /* In parameters */
575         r.in.server_name = server_name;
576         r.in.info = info;
577         r.in.prefmaxlen = prefmaxlen;
578         r.in.resume_handle = resume_handle;
579
580         if (DEBUGLEVEL >= 10) {
581                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUseEnum, &r);
582         }
583
584         status = cli_do_rpc_ndr(cli,
585                                 mem_ctx,
586                                 &ndr_table_wkssvc,
587                                 NDR_WKSSVC_NETRUSEENUM,
588                                 &r);
589
590         if (!NT_STATUS_IS_OK(status)) {
591                 return status;
592         }
593
594         if (DEBUGLEVEL >= 10) {
595                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUseEnum, &r);
596         }
597
598         if (NT_STATUS_IS_ERR(status)) {
599                 return status;
600         }
601
602         /* Return variables */
603         *info = *r.out.info;
604         *entries_read = *r.out.entries_read;
605         if (resume_handle && r.out.resume_handle) {
606                 *resume_handle = *r.out.resume_handle;
607         }
608
609         /* Return result */
610         if (werror) {
611                 *werror = r.out.result;
612         }
613
614         return werror_to_ntstatus(r.out.result);
615 }
616
617 NTSTATUS rpccli_wkssvc_NetrMessageBufferSend(struct rpc_pipe_client *cli,
618                                              TALLOC_CTX *mem_ctx,
619                                              const char *server_name /* [in] [unique,charset(UTF16)] */,
620                                              const char *message_name /* [in] [ref,charset(UTF16)] */,
621                                              const char *message_sender_name /* [in] [unique,charset(UTF16)] */,
622                                              uint8_t *message_buffer /* [in] [ref,size_is(message_size)] */,
623                                              uint32_t message_size /* [in]  */,
624                                              WERROR *werror)
625 {
626         struct wkssvc_NetrMessageBufferSend r;
627         NTSTATUS status;
628
629         /* In parameters */
630         r.in.server_name = server_name;
631         r.in.message_name = message_name;
632         r.in.message_sender_name = message_sender_name;
633         r.in.message_buffer = message_buffer;
634         r.in.message_size = message_size;
635
636         if (DEBUGLEVEL >= 10) {
637                 NDR_PRINT_IN_DEBUG(wkssvc_NetrMessageBufferSend, &r);
638         }
639
640         status = cli_do_rpc_ndr(cli,
641                                 mem_ctx,
642                                 &ndr_table_wkssvc,
643                                 NDR_WKSSVC_NETRMESSAGEBUFFERSEND,
644                                 &r);
645
646         if (!NT_STATUS_IS_OK(status)) {
647                 return status;
648         }
649
650         if (DEBUGLEVEL >= 10) {
651                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrMessageBufferSend, &r);
652         }
653
654         if (NT_STATUS_IS_ERR(status)) {
655                 return status;
656         }
657
658         /* Return variables */
659
660         /* Return result */
661         if (werror) {
662                 *werror = r.out.result;
663         }
664
665         return werror_to_ntstatus(r.out.result);
666 }
667
668 NTSTATUS rpccli_wkssvc_NetrWorkstationStatisticsGet(struct rpc_pipe_client *cli,
669                                                     TALLOC_CTX *mem_ctx,
670                                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
671                                                     const char *unknown2 /* [in] [unique,charset(UTF16)] */,
672                                                     uint32_t unknown3 /* [in]  */,
673                                                     uint32_t unknown4 /* [in]  */,
674                                                     struct wkssvc_NetrWorkstationStatistics **info /* [out] [ref] */,
675                                                     WERROR *werror)
676 {
677         struct wkssvc_NetrWorkstationStatisticsGet r;
678         NTSTATUS status;
679
680         /* In parameters */
681         r.in.server_name = server_name;
682         r.in.unknown2 = unknown2;
683         r.in.unknown3 = unknown3;
684         r.in.unknown4 = unknown4;
685
686         if (DEBUGLEVEL >= 10) {
687                 NDR_PRINT_IN_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
688         }
689
690         status = cli_do_rpc_ndr(cli,
691                                 mem_ctx,
692                                 &ndr_table_wkssvc,
693                                 NDR_WKSSVC_NETRWORKSTATIONSTATISTICSGET,
694                                 &r);
695
696         if (!NT_STATUS_IS_OK(status)) {
697                 return status;
698         }
699
700         if (DEBUGLEVEL >= 10) {
701                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrWorkstationStatisticsGet, &r);
702         }
703
704         if (NT_STATUS_IS_ERR(status)) {
705                 return status;
706         }
707
708         /* Return variables */
709         *info = *r.out.info;
710
711         /* Return result */
712         if (werror) {
713                 *werror = r.out.result;
714         }
715
716         return werror_to_ntstatus(r.out.result);
717 }
718
719 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameAdd(struct rpc_pipe_client *cli,
720                                               TALLOC_CTX *mem_ctx,
721                                               const char *domain_name /* [in] [ref,charset(UTF16)] */,
722                                               WERROR *werror)
723 {
724         struct wkssvc_NetrLogonDomainNameAdd r;
725         NTSTATUS status;
726
727         /* In parameters */
728         r.in.domain_name = domain_name;
729
730         if (DEBUGLEVEL >= 10) {
731                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
732         }
733
734         status = cli_do_rpc_ndr(cli,
735                                 mem_ctx,
736                                 &ndr_table_wkssvc,
737                                 NDR_WKSSVC_NETRLOGONDOMAINNAMEADD,
738                                 &r);
739
740         if (!NT_STATUS_IS_OK(status)) {
741                 return status;
742         }
743
744         if (DEBUGLEVEL >= 10) {
745                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameAdd, &r);
746         }
747
748         if (NT_STATUS_IS_ERR(status)) {
749                 return status;
750         }
751
752         /* Return variables */
753
754         /* Return result */
755         if (werror) {
756                 *werror = r.out.result;
757         }
758
759         return werror_to_ntstatus(r.out.result);
760 }
761
762 NTSTATUS rpccli_wkssvc_NetrLogonDomainNameDel(struct rpc_pipe_client *cli,
763                                               TALLOC_CTX *mem_ctx,
764                                               const char *domain_name /* [in] [ref,charset(UTF16)] */,
765                                               WERROR *werror)
766 {
767         struct wkssvc_NetrLogonDomainNameDel r;
768         NTSTATUS status;
769
770         /* In parameters */
771         r.in.domain_name = domain_name;
772
773         if (DEBUGLEVEL >= 10) {
774                 NDR_PRINT_IN_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
775         }
776
777         status = cli_do_rpc_ndr(cli,
778                                 mem_ctx,
779                                 &ndr_table_wkssvc,
780                                 NDR_WKSSVC_NETRLOGONDOMAINNAMEDEL,
781                                 &r);
782
783         if (!NT_STATUS_IS_OK(status)) {
784                 return status;
785         }
786
787         if (DEBUGLEVEL >= 10) {
788                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrLogonDomainNameDel, &r);
789         }
790
791         if (NT_STATUS_IS_ERR(status)) {
792                 return status;
793         }
794
795         /* Return variables */
796
797         /* Return result */
798         if (werror) {
799                 *werror = r.out.result;
800         }
801
802         return werror_to_ntstatus(r.out.result);
803 }
804
805 NTSTATUS rpccli_wkssvc_NetrJoinDomain(struct rpc_pipe_client *cli,
806                                       TALLOC_CTX *mem_ctx,
807                                       const char *server_name /* [in] [unique,charset(UTF16)] */,
808                                       const char *domain_name /* [in] [ref,charset(UTF16)] */,
809                                       const char *account_ou /* [in] [unique,charset(UTF16)] */,
810                                       const char *Account /* [in] [unique,charset(UTF16)] */,
811                                       const char *password /* [in] [unique,charset(UTF16)] */,
812                                       uint32_t join_flags /* [in]  */,
813                                       WERROR *werror)
814 {
815         struct wkssvc_NetrJoinDomain r;
816         NTSTATUS status;
817
818         /* In parameters */
819         r.in.server_name = server_name;
820         r.in.domain_name = domain_name;
821         r.in.account_ou = account_ou;
822         r.in.Account = Account;
823         r.in.password = password;
824         r.in.join_flags = join_flags;
825
826         if (DEBUGLEVEL >= 10) {
827                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain, &r);
828         }
829
830         status = cli_do_rpc_ndr(cli,
831                                 mem_ctx,
832                                 &ndr_table_wkssvc,
833                                 NDR_WKSSVC_NETRJOINDOMAIN,
834                                 &r);
835
836         if (!NT_STATUS_IS_OK(status)) {
837                 return status;
838         }
839
840         if (DEBUGLEVEL >= 10) {
841                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain, &r);
842         }
843
844         if (NT_STATUS_IS_ERR(status)) {
845                 return status;
846         }
847
848         /* Return variables */
849
850         /* Return result */
851         if (werror) {
852                 *werror = r.out.result;
853         }
854
855         return werror_to_ntstatus(r.out.result);
856 }
857
858 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain(struct rpc_pipe_client *cli,
859                                         TALLOC_CTX *mem_ctx,
860                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
861                                         const char *Account /* [in] [unique,charset(UTF16)] */,
862                                         const char *password /* [in] [unique,charset(UTF16)] */,
863                                         uint32_t unjoin_flags /* [in]  */,
864                                         WERROR *werror)
865 {
866         struct wkssvc_NetrUnjoinDomain r;
867         NTSTATUS status;
868
869         /* In parameters */
870         r.in.server_name = server_name;
871         r.in.Account = Account;
872         r.in.password = password;
873         r.in.unjoin_flags = unjoin_flags;
874
875         if (DEBUGLEVEL >= 10) {
876                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain, &r);
877         }
878
879         status = cli_do_rpc_ndr(cli,
880                                 mem_ctx,
881                                 &ndr_table_wkssvc,
882                                 NDR_WKSSVC_NETRUNJOINDOMAIN,
883                                 &r);
884
885         if (!NT_STATUS_IS_OK(status)) {
886                 return status;
887         }
888
889         if (DEBUGLEVEL >= 10) {
890                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain, &r);
891         }
892
893         if (NT_STATUS_IS_ERR(status)) {
894                 return status;
895         }
896
897         /* Return variables */
898
899         /* Return result */
900         if (werror) {
901                 *werror = r.out.result;
902         }
903
904         return werror_to_ntstatus(r.out.result);
905 }
906
907 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain(struct rpc_pipe_client *cli,
908                                                  TALLOC_CTX *mem_ctx,
909                                                  const char *server_name /* [in] [unique,charset(UTF16)] */,
910                                                  const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
911                                                  const char *Account /* [in] [unique,charset(UTF16)] */,
912                                                  const char *password /* [in] [unique,charset(UTF16)] */,
913                                                  uint32_t RenameOptions /* [in]  */,
914                                                  WERROR *werror)
915 {
916         struct wkssvc_NetrRenameMachineInDomain r;
917         NTSTATUS status;
918
919         /* In parameters */
920         r.in.server_name = server_name;
921         r.in.NewMachineName = NewMachineName;
922         r.in.Account = Account;
923         r.in.password = password;
924         r.in.RenameOptions = RenameOptions;
925
926         if (DEBUGLEVEL >= 10) {
927                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
928         }
929
930         status = cli_do_rpc_ndr(cli,
931                                 mem_ctx,
932                                 &ndr_table_wkssvc,
933                                 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN,
934                                 &r);
935
936         if (!NT_STATUS_IS_OK(status)) {
937                 return status;
938         }
939
940         if (DEBUGLEVEL >= 10) {
941                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain, &r);
942         }
943
944         if (NT_STATUS_IS_ERR(status)) {
945                 return status;
946         }
947
948         /* Return variables */
949
950         /* Return result */
951         if (werror) {
952                 *werror = r.out.result;
953         }
954
955         return werror_to_ntstatus(r.out.result);
956 }
957
958 NTSTATUS rpccli_wkssvc_NetrValidateName(struct rpc_pipe_client *cli,
959                                         TALLOC_CTX *mem_ctx,
960                                         const char *server_name /* [in] [unique,charset(UTF16)] */,
961                                         const char *name /* [in] [ref,charset(UTF16)] */,
962                                         const char *Account /* [in] [unique,charset(UTF16)] */,
963                                         const char *Password /* [in] [unique,charset(UTF16)] */,
964                                         enum wkssvc_NetValidateNameType name_type /* [in]  */,
965                                         WERROR *werror)
966 {
967         struct wkssvc_NetrValidateName r;
968         NTSTATUS status;
969
970         /* In parameters */
971         r.in.server_name = server_name;
972         r.in.name = name;
973         r.in.Account = Account;
974         r.in.Password = Password;
975         r.in.name_type = name_type;
976
977         if (DEBUGLEVEL >= 10) {
978                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName, &r);
979         }
980
981         status = cli_do_rpc_ndr(cli,
982                                 mem_ctx,
983                                 &ndr_table_wkssvc,
984                                 NDR_WKSSVC_NETRVALIDATENAME,
985                                 &r);
986
987         if (!NT_STATUS_IS_OK(status)) {
988                 return status;
989         }
990
991         if (DEBUGLEVEL >= 10) {
992                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName, &r);
993         }
994
995         if (NT_STATUS_IS_ERR(status)) {
996                 return status;
997         }
998
999         /* Return variables */
1000
1001         /* Return result */
1002         if (werror) {
1003                 *werror = r.out.result;
1004         }
1005
1006         return werror_to_ntstatus(r.out.result);
1007 }
1008
1009 NTSTATUS rpccli_wkssvc_NetrGetJoinInformation(struct rpc_pipe_client *cli,
1010                                               TALLOC_CTX *mem_ctx,
1011                                               const char *server_name /* [in] [unique,charset(UTF16)] */,
1012                                               const char **name_buffer /* [in,out] [ref,charset(UTF16)] */,
1013                                               enum wkssvc_NetJoinStatus *name_type /* [out] [ref] */,
1014                                               WERROR *werror)
1015 {
1016         struct wkssvc_NetrGetJoinInformation r;
1017         NTSTATUS status;
1018
1019         /* In parameters */
1020         r.in.server_name = server_name;
1021         r.in.name_buffer = name_buffer;
1022
1023         if (DEBUGLEVEL >= 10) {
1024                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinInformation, &r);
1025         }
1026
1027         status = cli_do_rpc_ndr(cli,
1028                                 mem_ctx,
1029                                 &ndr_table_wkssvc,
1030                                 NDR_WKSSVC_NETRGETJOININFORMATION,
1031                                 &r);
1032
1033         if (!NT_STATUS_IS_OK(status)) {
1034                 return status;
1035         }
1036
1037         if (DEBUGLEVEL >= 10) {
1038                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinInformation, &r);
1039         }
1040
1041         if (NT_STATUS_IS_ERR(status)) {
1042                 return status;
1043         }
1044
1045         /* Return variables */
1046         *name_buffer = *r.out.name_buffer;
1047         *name_type = *r.out.name_type;
1048
1049         /* Return result */
1050         if (werror) {
1051                 *werror = r.out.result;
1052         }
1053
1054         return werror_to_ntstatus(r.out.result);
1055 }
1056
1057 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus(struct rpc_pipe_client *cli,
1058                                           TALLOC_CTX *mem_ctx,
1059                                           const char *server_name /* [in] [unique,charset(UTF16)] */,
1060                                           const char *domain_name /* [in] [ref,charset(UTF16)] */,
1061                                           const char *Account /* [in] [unique,charset(UTF16)] */,
1062                                           const char *unknown /* [in] [unique,charset(UTF16)] */,
1063                                           uint32_t *num_ous /* [in,out] [ref] */,
1064                                           const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
1065                                           WERROR *werror)
1066 {
1067         struct wkssvc_NetrGetJoinableOus r;
1068         NTSTATUS status;
1069
1070         /* In parameters */
1071         r.in.server_name = server_name;
1072         r.in.domain_name = domain_name;
1073         r.in.Account = Account;
1074         r.in.unknown = unknown;
1075         r.in.num_ous = num_ous;
1076
1077         if (DEBUGLEVEL >= 10) {
1078                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus, &r);
1079         }
1080
1081         status = cli_do_rpc_ndr(cli,
1082                                 mem_ctx,
1083                                 &ndr_table_wkssvc,
1084                                 NDR_WKSSVC_NETRGETJOINABLEOUS,
1085                                 &r);
1086
1087         if (!NT_STATUS_IS_OK(status)) {
1088                 return status;
1089         }
1090
1091         if (DEBUGLEVEL >= 10) {
1092                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus, &r);
1093         }
1094
1095         if (NT_STATUS_IS_ERR(status)) {
1096                 return status;
1097         }
1098
1099         /* Return variables */
1100         *num_ous = *r.out.num_ous;
1101         *ous = *r.out.ous;
1102
1103         /* Return result */
1104         if (werror) {
1105                 *werror = r.out.result;
1106         }
1107
1108         return werror_to_ntstatus(r.out.result);
1109 }
1110
1111 NTSTATUS rpccli_wkssvc_NetrJoinDomain2(struct rpc_pipe_client *cli,
1112                                        TALLOC_CTX *mem_ctx,
1113                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
1114                                        const char *domain_name /* [in] [ref,charset(UTF16)] */,
1115                                        const char *account_ou /* [in] [unique,charset(UTF16)] */,
1116                                        const char *admin_account /* [in] [unique,charset(UTF16)] */,
1117                                        struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
1118                                        uint32_t join_flags /* [in]  */,
1119                                        WERROR *werror)
1120 {
1121         struct wkssvc_NetrJoinDomain2 r;
1122         NTSTATUS status;
1123
1124         /* In parameters */
1125         r.in.server_name = server_name;
1126         r.in.domain_name = domain_name;
1127         r.in.account_ou = account_ou;
1128         r.in.admin_account = admin_account;
1129         r.in.encrypted_password = encrypted_password;
1130         r.in.join_flags = join_flags;
1131
1132         if (DEBUGLEVEL >= 10) {
1133                 NDR_PRINT_IN_DEBUG(wkssvc_NetrJoinDomain2, &r);
1134         }
1135
1136         status = cli_do_rpc_ndr(cli,
1137                                 mem_ctx,
1138                                 &ndr_table_wkssvc,
1139                                 NDR_WKSSVC_NETRJOINDOMAIN2,
1140                                 &r);
1141
1142         if (!NT_STATUS_IS_OK(status)) {
1143                 return status;
1144         }
1145
1146         if (DEBUGLEVEL >= 10) {
1147                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrJoinDomain2, &r);
1148         }
1149
1150         if (NT_STATUS_IS_ERR(status)) {
1151                 return status;
1152         }
1153
1154         /* Return variables */
1155
1156         /* Return result */
1157         if (werror) {
1158                 *werror = r.out.result;
1159         }
1160
1161         return werror_to_ntstatus(r.out.result);
1162 }
1163
1164 NTSTATUS rpccli_wkssvc_NetrUnjoinDomain2(struct rpc_pipe_client *cli,
1165                                          TALLOC_CTX *mem_ctx,
1166                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
1167                                          const char *account /* [in] [unique,charset(UTF16)] */,
1168                                          struct wkssvc_PasswordBuffer *encrypted_password /* [in] [unique] */,
1169                                          uint32_t unjoin_flags /* [in]  */,
1170                                          WERROR *werror)
1171 {
1172         struct wkssvc_NetrUnjoinDomain2 r;
1173         NTSTATUS status;
1174
1175         /* In parameters */
1176         r.in.server_name = server_name;
1177         r.in.account = account;
1178         r.in.encrypted_password = encrypted_password;
1179         r.in.unjoin_flags = unjoin_flags;
1180
1181         if (DEBUGLEVEL >= 10) {
1182                 NDR_PRINT_IN_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
1183         }
1184
1185         status = cli_do_rpc_ndr(cli,
1186                                 mem_ctx,
1187                                 &ndr_table_wkssvc,
1188                                 NDR_WKSSVC_NETRUNJOINDOMAIN2,
1189                                 &r);
1190
1191         if (!NT_STATUS_IS_OK(status)) {
1192                 return status;
1193         }
1194
1195         if (DEBUGLEVEL >= 10) {
1196                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrUnjoinDomain2, &r);
1197         }
1198
1199         if (NT_STATUS_IS_ERR(status)) {
1200                 return status;
1201         }
1202
1203         /* Return variables */
1204
1205         /* Return result */
1206         if (werror) {
1207                 *werror = r.out.result;
1208         }
1209
1210         return werror_to_ntstatus(r.out.result);
1211 }
1212
1213 NTSTATUS rpccli_wkssvc_NetrRenameMachineInDomain2(struct rpc_pipe_client *cli,
1214                                                   TALLOC_CTX *mem_ctx,
1215                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
1216                                                   const char *NewMachineName /* [in] [unique,charset(UTF16)] */,
1217                                                   const char *Account /* [in] [unique,charset(UTF16)] */,
1218                                                   struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1219                                                   uint32_t RenameOptions /* [in]  */,
1220                                                   WERROR *werror)
1221 {
1222         struct wkssvc_NetrRenameMachineInDomain2 r;
1223         NTSTATUS status;
1224
1225         /* In parameters */
1226         r.in.server_name = server_name;
1227         r.in.NewMachineName = NewMachineName;
1228         r.in.Account = Account;
1229         r.in.EncryptedPassword = EncryptedPassword;
1230         r.in.RenameOptions = RenameOptions;
1231
1232         if (DEBUGLEVEL >= 10) {
1233                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
1234         }
1235
1236         status = cli_do_rpc_ndr(cli,
1237                                 mem_ctx,
1238                                 &ndr_table_wkssvc,
1239                                 NDR_WKSSVC_NETRRENAMEMACHINEINDOMAIN2,
1240                                 &r);
1241
1242         if (!NT_STATUS_IS_OK(status)) {
1243                 return status;
1244         }
1245
1246         if (DEBUGLEVEL >= 10) {
1247                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRenameMachineInDomain2, &r);
1248         }
1249
1250         if (NT_STATUS_IS_ERR(status)) {
1251                 return status;
1252         }
1253
1254         /* Return variables */
1255
1256         /* Return result */
1257         if (werror) {
1258                 *werror = r.out.result;
1259         }
1260
1261         return werror_to_ntstatus(r.out.result);
1262 }
1263
1264 NTSTATUS rpccli_wkssvc_NetrValidateName2(struct rpc_pipe_client *cli,
1265                                          TALLOC_CTX *mem_ctx,
1266                                          const char *server_name /* [in] [unique,charset(UTF16)] */,
1267                                          const char *name /* [in] [ref,charset(UTF16)] */,
1268                                          const char *Account /* [in] [unique,charset(UTF16)] */,
1269                                          struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1270                                          enum wkssvc_NetValidateNameType name_type /* [in]  */,
1271                                          WERROR *werror)
1272 {
1273         struct wkssvc_NetrValidateName2 r;
1274         NTSTATUS status;
1275
1276         /* In parameters */
1277         r.in.server_name = server_name;
1278         r.in.name = name;
1279         r.in.Account = Account;
1280         r.in.EncryptedPassword = EncryptedPassword;
1281         r.in.name_type = name_type;
1282
1283         if (DEBUGLEVEL >= 10) {
1284                 NDR_PRINT_IN_DEBUG(wkssvc_NetrValidateName2, &r);
1285         }
1286
1287         status = cli_do_rpc_ndr(cli,
1288                                 mem_ctx,
1289                                 &ndr_table_wkssvc,
1290                                 NDR_WKSSVC_NETRVALIDATENAME2,
1291                                 &r);
1292
1293         if (!NT_STATUS_IS_OK(status)) {
1294                 return status;
1295         }
1296
1297         if (DEBUGLEVEL >= 10) {
1298                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrValidateName2, &r);
1299         }
1300
1301         if (NT_STATUS_IS_ERR(status)) {
1302                 return status;
1303         }
1304
1305         /* Return variables */
1306
1307         /* Return result */
1308         if (werror) {
1309                 *werror = r.out.result;
1310         }
1311
1312         return werror_to_ntstatus(r.out.result);
1313 }
1314
1315 NTSTATUS rpccli_wkssvc_NetrGetJoinableOus2(struct rpc_pipe_client *cli,
1316                                            TALLOC_CTX *mem_ctx,
1317                                            const char *server_name /* [in] [unique,charset(UTF16)] */,
1318                                            const char *domain_name /* [in] [ref,charset(UTF16)] */,
1319                                            const char *Account /* [in] [unique,charset(UTF16)] */,
1320                                            struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1321                                            uint32_t *num_ous /* [in,out] [ref] */,
1322                                            const char ***ous /* [out] [ref,charset(UTF16),size_is(,*num_ous)] */,
1323                                            WERROR *werror)
1324 {
1325         struct wkssvc_NetrGetJoinableOus2 r;
1326         NTSTATUS status;
1327
1328         /* In parameters */
1329         r.in.server_name = server_name;
1330         r.in.domain_name = domain_name;
1331         r.in.Account = Account;
1332         r.in.EncryptedPassword = EncryptedPassword;
1333         r.in.num_ous = num_ous;
1334
1335         if (DEBUGLEVEL >= 10) {
1336                 NDR_PRINT_IN_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
1337         }
1338
1339         status = cli_do_rpc_ndr(cli,
1340                                 mem_ctx,
1341                                 &ndr_table_wkssvc,
1342                                 NDR_WKSSVC_NETRGETJOINABLEOUS2,
1343                                 &r);
1344
1345         if (!NT_STATUS_IS_OK(status)) {
1346                 return status;
1347         }
1348
1349         if (DEBUGLEVEL >= 10) {
1350                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrGetJoinableOus2, &r);
1351         }
1352
1353         if (NT_STATUS_IS_ERR(status)) {
1354                 return status;
1355         }
1356
1357         /* Return variables */
1358         *num_ous = *r.out.num_ous;
1359         *ous = *r.out.ous;
1360
1361         /* Return result */
1362         if (werror) {
1363                 *werror = r.out.result;
1364         }
1365
1366         return werror_to_ntstatus(r.out.result);
1367 }
1368
1369 NTSTATUS rpccli_wkssvc_NetrAddAlternateComputerName(struct rpc_pipe_client *cli,
1370                                                     TALLOC_CTX *mem_ctx,
1371                                                     const char *server_name /* [in] [unique,charset(UTF16)] */,
1372                                                     const char *NewAlternateMachineName /* [in] [unique,charset(UTF16)] */,
1373                                                     const char *Account /* [in] [unique,charset(UTF16)] */,
1374                                                     struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1375                                                     uint32_t Reserved /* [in]  */,
1376                                                     WERROR *werror)
1377 {
1378         struct wkssvc_NetrAddAlternateComputerName r;
1379         NTSTATUS status;
1380
1381         /* In parameters */
1382         r.in.server_name = server_name;
1383         r.in.NewAlternateMachineName = NewAlternateMachineName;
1384         r.in.Account = Account;
1385         r.in.EncryptedPassword = EncryptedPassword;
1386         r.in.Reserved = Reserved;
1387
1388         if (DEBUGLEVEL >= 10) {
1389                 NDR_PRINT_IN_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
1390         }
1391
1392         status = cli_do_rpc_ndr(cli,
1393                                 mem_ctx,
1394                                 &ndr_table_wkssvc,
1395                                 NDR_WKSSVC_NETRADDALTERNATECOMPUTERNAME,
1396                                 &r);
1397
1398         if (!NT_STATUS_IS_OK(status)) {
1399                 return status;
1400         }
1401
1402         if (DEBUGLEVEL >= 10) {
1403                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrAddAlternateComputerName, &r);
1404         }
1405
1406         if (NT_STATUS_IS_ERR(status)) {
1407                 return status;
1408         }
1409
1410         /* Return variables */
1411
1412         /* Return result */
1413         if (werror) {
1414                 *werror = r.out.result;
1415         }
1416
1417         return werror_to_ntstatus(r.out.result);
1418 }
1419
1420 NTSTATUS rpccli_wkssvc_NetrRemoveAlternateComputerName(struct rpc_pipe_client *cli,
1421                                                        TALLOC_CTX *mem_ctx,
1422                                                        const char *server_name /* [in] [unique,charset(UTF16)] */,
1423                                                        const char *AlternateMachineNameToRemove /* [in] [unique,charset(UTF16)] */,
1424                                                        const char *Account /* [in] [unique,charset(UTF16)] */,
1425                                                        struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1426                                                        uint32_t Reserved /* [in]  */,
1427                                                        WERROR *werror)
1428 {
1429         struct wkssvc_NetrRemoveAlternateComputerName r;
1430         NTSTATUS status;
1431
1432         /* In parameters */
1433         r.in.server_name = server_name;
1434         r.in.AlternateMachineNameToRemove = AlternateMachineNameToRemove;
1435         r.in.Account = Account;
1436         r.in.EncryptedPassword = EncryptedPassword;
1437         r.in.Reserved = Reserved;
1438
1439         if (DEBUGLEVEL >= 10) {
1440                 NDR_PRINT_IN_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
1441         }
1442
1443         status = cli_do_rpc_ndr(cli,
1444                                 mem_ctx,
1445                                 &ndr_table_wkssvc,
1446                                 NDR_WKSSVC_NETRREMOVEALTERNATECOMPUTERNAME,
1447                                 &r);
1448
1449         if (!NT_STATUS_IS_OK(status)) {
1450                 return status;
1451         }
1452
1453         if (DEBUGLEVEL >= 10) {
1454                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrRemoveAlternateComputerName, &r);
1455         }
1456
1457         if (NT_STATUS_IS_ERR(status)) {
1458                 return status;
1459         }
1460
1461         /* Return variables */
1462
1463         /* Return result */
1464         if (werror) {
1465                 *werror = r.out.result;
1466         }
1467
1468         return werror_to_ntstatus(r.out.result);
1469 }
1470
1471 NTSTATUS rpccli_wkssvc_NetrSetPrimaryComputername(struct rpc_pipe_client *cli,
1472                                                   TALLOC_CTX *mem_ctx,
1473                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
1474                                                   const char *primary_name /* [in] [unique,charset(UTF16)] */,
1475                                                   const char *Account /* [in] [unique,charset(UTF16)] */,
1476                                                   struct wkssvc_PasswordBuffer *EncryptedPassword /* [in] [unique] */,
1477                                                   uint32_t Reserved /* [in]  */,
1478                                                   WERROR *werror)
1479 {
1480         struct wkssvc_NetrSetPrimaryComputername r;
1481         NTSTATUS status;
1482
1483         /* In parameters */
1484         r.in.server_name = server_name;
1485         r.in.primary_name = primary_name;
1486         r.in.Account = Account;
1487         r.in.EncryptedPassword = EncryptedPassword;
1488         r.in.Reserved = Reserved;
1489
1490         if (DEBUGLEVEL >= 10) {
1491                 NDR_PRINT_IN_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
1492         }
1493
1494         status = cli_do_rpc_ndr(cli,
1495                                 mem_ctx,
1496                                 &ndr_table_wkssvc,
1497                                 NDR_WKSSVC_NETRSETPRIMARYCOMPUTERNAME,
1498                                 &r);
1499
1500         if (!NT_STATUS_IS_OK(status)) {
1501                 return status;
1502         }
1503
1504         if (DEBUGLEVEL >= 10) {
1505                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrSetPrimaryComputername, &r);
1506         }
1507
1508         if (NT_STATUS_IS_ERR(status)) {
1509                 return status;
1510         }
1511
1512         /* Return variables */
1513
1514         /* Return result */
1515         if (werror) {
1516                 *werror = r.out.result;
1517         }
1518
1519         return werror_to_ntstatus(r.out.result);
1520 }
1521
1522 NTSTATUS rpccli_wkssvc_NetrEnumerateComputerNames(struct rpc_pipe_client *cli,
1523                                                   TALLOC_CTX *mem_ctx,
1524                                                   const char *server_name /* [in] [unique,charset(UTF16)] */,
1525                                                   enum wkssvc_ComputerNameType name_type /* [in]  */,
1526                                                   uint32_t Reserved /* [in]  */,
1527                                                   struct wkssvc_ComputerNamesCtr **ctr /* [out] [ref] */,
1528                                                   WERROR *werror)
1529 {
1530         struct wkssvc_NetrEnumerateComputerNames r;
1531         NTSTATUS status;
1532
1533         /* In parameters */
1534         r.in.server_name = server_name;
1535         r.in.name_type = name_type;
1536         r.in.Reserved = Reserved;
1537
1538         if (DEBUGLEVEL >= 10) {
1539                 NDR_PRINT_IN_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
1540         }
1541
1542         status = cli_do_rpc_ndr(cli,
1543                                 mem_ctx,
1544                                 &ndr_table_wkssvc,
1545                                 NDR_WKSSVC_NETRENUMERATECOMPUTERNAMES,
1546                                 &r);
1547
1548         if (!NT_STATUS_IS_OK(status)) {
1549                 return status;
1550         }
1551
1552         if (DEBUGLEVEL >= 10) {
1553                 NDR_PRINT_OUT_DEBUG(wkssvc_NetrEnumerateComputerNames, &r);
1554         }
1555
1556         if (NT_STATUS_IS_ERR(status)) {
1557                 return status;
1558         }
1559
1560         /* Return variables */
1561         *ctr = *r.out.ctr;
1562
1563         /* Return result */
1564         if (werror) {
1565                 *werror = r.out.result;
1566         }
1567
1568         return werror_to_ntstatus(r.out.result);
1569 }
1570