build_docs: Use 'make distclean' instead of 'make clean'.
[ira/wip.git] / librpc / gen_ndr / cli_samr.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_samr.h"
8
9 NTSTATUS rpccli_samr_Connect(struct rpc_pipe_client *cli,
10                              TALLOC_CTX *mem_ctx,
11                              uint16_t *system_name /* [in] [unique] */,
12                              uint32_t access_mask /* [in]  */,
13                              struct policy_handle *connect_handle /* [out] [ref] */)
14 {
15         struct samr_Connect r;
16         NTSTATUS status;
17
18         /* In parameters */
19         r.in.system_name = system_name;
20         r.in.access_mask = access_mask;
21
22         if (DEBUGLEVEL >= 10) {
23                 NDR_PRINT_IN_DEBUG(samr_Connect, &r);
24         }
25
26         status = cli_do_rpc_ndr(cli,
27                                 mem_ctx,
28                                 &ndr_table_samr,
29                                 NDR_SAMR_CONNECT,
30                                 &r);
31
32         if (!NT_STATUS_IS_OK(status)) {
33                 return status;
34         }
35
36         if (DEBUGLEVEL >= 10) {
37                 NDR_PRINT_OUT_DEBUG(samr_Connect, &r);
38         }
39
40         if (NT_STATUS_IS_ERR(status)) {
41                 return status;
42         }
43
44         /* Return variables */
45         *connect_handle = *r.out.connect_handle;
46
47         /* Return result */
48         return r.out.result;
49 }
50
51 NTSTATUS rpccli_samr_Close(struct rpc_pipe_client *cli,
52                            TALLOC_CTX *mem_ctx,
53                            struct policy_handle *handle /* [in,out] [ref] */)
54 {
55         struct samr_Close r;
56         NTSTATUS status;
57
58         /* In parameters */
59         r.in.handle = handle;
60
61         if (DEBUGLEVEL >= 10) {
62                 NDR_PRINT_IN_DEBUG(samr_Close, &r);
63         }
64
65         status = cli_do_rpc_ndr(cli,
66                                 mem_ctx,
67                                 &ndr_table_samr,
68                                 NDR_SAMR_CLOSE,
69                                 &r);
70
71         if (!NT_STATUS_IS_OK(status)) {
72                 return status;
73         }
74
75         if (DEBUGLEVEL >= 10) {
76                 NDR_PRINT_OUT_DEBUG(samr_Close, &r);
77         }
78
79         if (NT_STATUS_IS_ERR(status)) {
80                 return status;
81         }
82
83         /* Return variables */
84         *handle = *r.out.handle;
85
86         /* Return result */
87         return r.out.result;
88 }
89
90 NTSTATUS rpccli_samr_SetSecurity(struct rpc_pipe_client *cli,
91                                  TALLOC_CTX *mem_ctx,
92                                  struct policy_handle *handle /* [in] [ref] */,
93                                  uint32_t sec_info /* [in]  */,
94                                  struct sec_desc_buf *sdbuf /* [in] [ref] */)
95 {
96         struct samr_SetSecurity r;
97         NTSTATUS status;
98
99         /* In parameters */
100         r.in.handle = handle;
101         r.in.sec_info = sec_info;
102         r.in.sdbuf = sdbuf;
103
104         if (DEBUGLEVEL >= 10) {
105                 NDR_PRINT_IN_DEBUG(samr_SetSecurity, &r);
106         }
107
108         status = cli_do_rpc_ndr(cli,
109                                 mem_ctx,
110                                 &ndr_table_samr,
111                                 NDR_SAMR_SETSECURITY,
112                                 &r);
113
114         if (!NT_STATUS_IS_OK(status)) {
115                 return status;
116         }
117
118         if (DEBUGLEVEL >= 10) {
119                 NDR_PRINT_OUT_DEBUG(samr_SetSecurity, &r);
120         }
121
122         if (NT_STATUS_IS_ERR(status)) {
123                 return status;
124         }
125
126         /* Return variables */
127
128         /* Return result */
129         return r.out.result;
130 }
131
132 NTSTATUS rpccli_samr_QuerySecurity(struct rpc_pipe_client *cli,
133                                    TALLOC_CTX *mem_ctx,
134                                    struct policy_handle *handle /* [in] [ref] */,
135                                    uint32_t sec_info /* [in]  */,
136                                    struct sec_desc_buf **sdbuf /* [out] [ref] */)
137 {
138         struct samr_QuerySecurity r;
139         NTSTATUS status;
140
141         /* In parameters */
142         r.in.handle = handle;
143         r.in.sec_info = sec_info;
144
145         if (DEBUGLEVEL >= 10) {
146                 NDR_PRINT_IN_DEBUG(samr_QuerySecurity, &r);
147         }
148
149         status = cli_do_rpc_ndr(cli,
150                                 mem_ctx,
151                                 &ndr_table_samr,
152                                 NDR_SAMR_QUERYSECURITY,
153                                 &r);
154
155         if (!NT_STATUS_IS_OK(status)) {
156                 return status;
157         }
158
159         if (DEBUGLEVEL >= 10) {
160                 NDR_PRINT_OUT_DEBUG(samr_QuerySecurity, &r);
161         }
162
163         if (NT_STATUS_IS_ERR(status)) {
164                 return status;
165         }
166
167         /* Return variables */
168         *sdbuf = *r.out.sdbuf;
169
170         /* Return result */
171         return r.out.result;
172 }
173
174 NTSTATUS rpccli_samr_Shutdown(struct rpc_pipe_client *cli,
175                               TALLOC_CTX *mem_ctx,
176                               struct policy_handle *connect_handle /* [in] [ref] */)
177 {
178         struct samr_Shutdown r;
179         NTSTATUS status;
180
181         /* In parameters */
182         r.in.connect_handle = connect_handle;
183
184         if (DEBUGLEVEL >= 10) {
185                 NDR_PRINT_IN_DEBUG(samr_Shutdown, &r);
186         }
187
188         status = cli_do_rpc_ndr(cli,
189                                 mem_ctx,
190                                 &ndr_table_samr,
191                                 NDR_SAMR_SHUTDOWN,
192                                 &r);
193
194         if (!NT_STATUS_IS_OK(status)) {
195                 return status;
196         }
197
198         if (DEBUGLEVEL >= 10) {
199                 NDR_PRINT_OUT_DEBUG(samr_Shutdown, &r);
200         }
201
202         if (NT_STATUS_IS_ERR(status)) {
203                 return status;
204         }
205
206         /* Return variables */
207
208         /* Return result */
209         return r.out.result;
210 }
211
212 NTSTATUS rpccli_samr_LookupDomain(struct rpc_pipe_client *cli,
213                                   TALLOC_CTX *mem_ctx,
214                                   struct policy_handle *connect_handle /* [in] [ref] */,
215                                   struct lsa_String *domain_name /* [in] [ref] */,
216                                   struct dom_sid2 **sid /* [out] [ref] */)
217 {
218         struct samr_LookupDomain r;
219         NTSTATUS status;
220
221         /* In parameters */
222         r.in.connect_handle = connect_handle;
223         r.in.domain_name = domain_name;
224
225         if (DEBUGLEVEL >= 10) {
226                 NDR_PRINT_IN_DEBUG(samr_LookupDomain, &r);
227         }
228
229         status = cli_do_rpc_ndr(cli,
230                                 mem_ctx,
231                                 &ndr_table_samr,
232                                 NDR_SAMR_LOOKUPDOMAIN,
233                                 &r);
234
235         if (!NT_STATUS_IS_OK(status)) {
236                 return status;
237         }
238
239         if (DEBUGLEVEL >= 10) {
240                 NDR_PRINT_OUT_DEBUG(samr_LookupDomain, &r);
241         }
242
243         if (NT_STATUS_IS_ERR(status)) {
244                 return status;
245         }
246
247         /* Return variables */
248         *sid = *r.out.sid;
249
250         /* Return result */
251         return r.out.result;
252 }
253
254 NTSTATUS rpccli_samr_EnumDomains(struct rpc_pipe_client *cli,
255                                  TALLOC_CTX *mem_ctx,
256                                  struct policy_handle *connect_handle /* [in] [ref] */,
257                                  uint32_t *resume_handle /* [in,out] [ref] */,
258                                  struct samr_SamArray **sam /* [out] [ref] */,
259                                  uint32_t buf_size /* [in]  */,
260                                  uint32_t *num_entries /* [out] [ref] */)
261 {
262         struct samr_EnumDomains r;
263         NTSTATUS status;
264
265         /* In parameters */
266         r.in.connect_handle = connect_handle;
267         r.in.resume_handle = resume_handle;
268         r.in.buf_size = buf_size;
269
270         if (DEBUGLEVEL >= 10) {
271                 NDR_PRINT_IN_DEBUG(samr_EnumDomains, &r);
272         }
273
274         status = cli_do_rpc_ndr(cli,
275                                 mem_ctx,
276                                 &ndr_table_samr,
277                                 NDR_SAMR_ENUMDOMAINS,
278                                 &r);
279
280         if (!NT_STATUS_IS_OK(status)) {
281                 return status;
282         }
283
284         if (DEBUGLEVEL >= 10) {
285                 NDR_PRINT_OUT_DEBUG(samr_EnumDomains, &r);
286         }
287
288         if (NT_STATUS_IS_ERR(status)) {
289                 return status;
290         }
291
292         /* Return variables */
293         *resume_handle = *r.out.resume_handle;
294         *sam = *r.out.sam;
295         *num_entries = *r.out.num_entries;
296
297         /* Return result */
298         return r.out.result;
299 }
300
301 NTSTATUS rpccli_samr_OpenDomain(struct rpc_pipe_client *cli,
302                                 TALLOC_CTX *mem_ctx,
303                                 struct policy_handle *connect_handle /* [in] [ref] */,
304                                 uint32_t access_mask /* [in]  */,
305                                 struct dom_sid2 *sid /* [in] [ref] */,
306                                 struct policy_handle *domain_handle /* [out] [ref] */)
307 {
308         struct samr_OpenDomain r;
309         NTSTATUS status;
310
311         /* In parameters */
312         r.in.connect_handle = connect_handle;
313         r.in.access_mask = access_mask;
314         r.in.sid = sid;
315
316         if (DEBUGLEVEL >= 10) {
317                 NDR_PRINT_IN_DEBUG(samr_OpenDomain, &r);
318         }
319
320         status = cli_do_rpc_ndr(cli,
321                                 mem_ctx,
322                                 &ndr_table_samr,
323                                 NDR_SAMR_OPENDOMAIN,
324                                 &r);
325
326         if (!NT_STATUS_IS_OK(status)) {
327                 return status;
328         }
329
330         if (DEBUGLEVEL >= 10) {
331                 NDR_PRINT_OUT_DEBUG(samr_OpenDomain, &r);
332         }
333
334         if (NT_STATUS_IS_ERR(status)) {
335                 return status;
336         }
337
338         /* Return variables */
339         *domain_handle = *r.out.domain_handle;
340
341         /* Return result */
342         return r.out.result;
343 }
344
345 NTSTATUS rpccli_samr_QueryDomainInfo(struct rpc_pipe_client *cli,
346                                      TALLOC_CTX *mem_ctx,
347                                      struct policy_handle *domain_handle /* [in] [ref] */,
348                                      uint16_t level /* [in]  */,
349                                      union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
350 {
351         struct samr_QueryDomainInfo r;
352         NTSTATUS status;
353
354         /* In parameters */
355         r.in.domain_handle = domain_handle;
356         r.in.level = level;
357
358         if (DEBUGLEVEL >= 10) {
359                 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo, &r);
360         }
361
362         status = cli_do_rpc_ndr(cli,
363                                 mem_ctx,
364                                 &ndr_table_samr,
365                                 NDR_SAMR_QUERYDOMAININFO,
366                                 &r);
367
368         if (!NT_STATUS_IS_OK(status)) {
369                 return status;
370         }
371
372         if (DEBUGLEVEL >= 10) {
373                 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo, &r);
374         }
375
376         if (NT_STATUS_IS_ERR(status)) {
377                 return status;
378         }
379
380         /* Return variables */
381         *info = *r.out.info;
382
383         /* Return result */
384         return r.out.result;
385 }
386
387 NTSTATUS rpccli_samr_SetDomainInfo(struct rpc_pipe_client *cli,
388                                    TALLOC_CTX *mem_ctx,
389                                    struct policy_handle *domain_handle /* [in] [ref] */,
390                                    uint16_t level /* [in]  */,
391                                    union samr_DomainInfo *info /* [in] [ref,switch_is(level)] */)
392 {
393         struct samr_SetDomainInfo r;
394         NTSTATUS status;
395
396         /* In parameters */
397         r.in.domain_handle = domain_handle;
398         r.in.level = level;
399         r.in.info = info;
400
401         if (DEBUGLEVEL >= 10) {
402                 NDR_PRINT_IN_DEBUG(samr_SetDomainInfo, &r);
403         }
404
405         status = cli_do_rpc_ndr(cli,
406                                 mem_ctx,
407                                 &ndr_table_samr,
408                                 NDR_SAMR_SETDOMAININFO,
409                                 &r);
410
411         if (!NT_STATUS_IS_OK(status)) {
412                 return status;
413         }
414
415         if (DEBUGLEVEL >= 10) {
416                 NDR_PRINT_OUT_DEBUG(samr_SetDomainInfo, &r);
417         }
418
419         if (NT_STATUS_IS_ERR(status)) {
420                 return status;
421         }
422
423         /* Return variables */
424
425         /* Return result */
426         return r.out.result;
427 }
428
429 NTSTATUS rpccli_samr_CreateDomainGroup(struct rpc_pipe_client *cli,
430                                        TALLOC_CTX *mem_ctx,
431                                        struct policy_handle *domain_handle /* [in] [ref] */,
432                                        struct lsa_String *name /* [in] [ref] */,
433                                        uint32_t access_mask /* [in]  */,
434                                        struct policy_handle *group_handle /* [out] [ref] */,
435                                        uint32_t *rid /* [out] [ref] */)
436 {
437         struct samr_CreateDomainGroup r;
438         NTSTATUS status;
439
440         /* In parameters */
441         r.in.domain_handle = domain_handle;
442         r.in.name = name;
443         r.in.access_mask = access_mask;
444
445         if (DEBUGLEVEL >= 10) {
446                 NDR_PRINT_IN_DEBUG(samr_CreateDomainGroup, &r);
447         }
448
449         status = cli_do_rpc_ndr(cli,
450                                 mem_ctx,
451                                 &ndr_table_samr,
452                                 NDR_SAMR_CREATEDOMAINGROUP,
453                                 &r);
454
455         if (!NT_STATUS_IS_OK(status)) {
456                 return status;
457         }
458
459         if (DEBUGLEVEL >= 10) {
460                 NDR_PRINT_OUT_DEBUG(samr_CreateDomainGroup, &r);
461         }
462
463         if (NT_STATUS_IS_ERR(status)) {
464                 return status;
465         }
466
467         /* Return variables */
468         *group_handle = *r.out.group_handle;
469         *rid = *r.out.rid;
470
471         /* Return result */
472         return r.out.result;
473 }
474
475 NTSTATUS rpccli_samr_EnumDomainGroups(struct rpc_pipe_client *cli,
476                                       TALLOC_CTX *mem_ctx,
477                                       struct policy_handle *domain_handle /* [in] [ref] */,
478                                       uint32_t *resume_handle /* [in,out] [ref] */,
479                                       struct samr_SamArray **sam /* [out] [ref] */,
480                                       uint32_t max_size /* [in]  */,
481                                       uint32_t *num_entries /* [out] [ref] */)
482 {
483         struct samr_EnumDomainGroups r;
484         NTSTATUS status;
485
486         /* In parameters */
487         r.in.domain_handle = domain_handle;
488         r.in.resume_handle = resume_handle;
489         r.in.max_size = max_size;
490
491         if (DEBUGLEVEL >= 10) {
492                 NDR_PRINT_IN_DEBUG(samr_EnumDomainGroups, &r);
493         }
494
495         status = cli_do_rpc_ndr(cli,
496                                 mem_ctx,
497                                 &ndr_table_samr,
498                                 NDR_SAMR_ENUMDOMAINGROUPS,
499                                 &r);
500
501         if (!NT_STATUS_IS_OK(status)) {
502                 return status;
503         }
504
505         if (DEBUGLEVEL >= 10) {
506                 NDR_PRINT_OUT_DEBUG(samr_EnumDomainGroups, &r);
507         }
508
509         if (NT_STATUS_IS_ERR(status)) {
510                 return status;
511         }
512
513         /* Return variables */
514         *resume_handle = *r.out.resume_handle;
515         *sam = *r.out.sam;
516         *num_entries = *r.out.num_entries;
517
518         /* Return result */
519         return r.out.result;
520 }
521
522 NTSTATUS rpccli_samr_CreateUser(struct rpc_pipe_client *cli,
523                                 TALLOC_CTX *mem_ctx,
524                                 struct policy_handle *domain_handle /* [in] [ref] */,
525                                 struct lsa_String *account_name /* [in] [ref] */,
526                                 uint32_t access_mask /* [in]  */,
527                                 struct policy_handle *user_handle /* [out] [ref] */,
528                                 uint32_t *rid /* [out] [ref] */)
529 {
530         struct samr_CreateUser r;
531         NTSTATUS status;
532
533         /* In parameters */
534         r.in.domain_handle = domain_handle;
535         r.in.account_name = account_name;
536         r.in.access_mask = access_mask;
537
538         if (DEBUGLEVEL >= 10) {
539                 NDR_PRINT_IN_DEBUG(samr_CreateUser, &r);
540         }
541
542         status = cli_do_rpc_ndr(cli,
543                                 mem_ctx,
544                                 &ndr_table_samr,
545                                 NDR_SAMR_CREATEUSER,
546                                 &r);
547
548         if (!NT_STATUS_IS_OK(status)) {
549                 return status;
550         }
551
552         if (DEBUGLEVEL >= 10) {
553                 NDR_PRINT_OUT_DEBUG(samr_CreateUser, &r);
554         }
555
556         if (NT_STATUS_IS_ERR(status)) {
557                 return status;
558         }
559
560         /* Return variables */
561         *user_handle = *r.out.user_handle;
562         *rid = *r.out.rid;
563
564         /* Return result */
565         return r.out.result;
566 }
567
568 NTSTATUS rpccli_samr_EnumDomainUsers(struct rpc_pipe_client *cli,
569                                      TALLOC_CTX *mem_ctx,
570                                      struct policy_handle *domain_handle /* [in] [ref] */,
571                                      uint32_t *resume_handle /* [in,out] [ref] */,
572                                      uint32_t acct_flags /* [in]  */,
573                                      struct samr_SamArray **sam /* [out] [ref] */,
574                                      uint32_t max_size /* [in]  */,
575                                      uint32_t *num_entries /* [out] [ref] */)
576 {
577         struct samr_EnumDomainUsers r;
578         NTSTATUS status;
579
580         /* In parameters */
581         r.in.domain_handle = domain_handle;
582         r.in.resume_handle = resume_handle;
583         r.in.acct_flags = acct_flags;
584         r.in.max_size = max_size;
585
586         if (DEBUGLEVEL >= 10) {
587                 NDR_PRINT_IN_DEBUG(samr_EnumDomainUsers, &r);
588         }
589
590         status = cli_do_rpc_ndr(cli,
591                                 mem_ctx,
592                                 &ndr_table_samr,
593                                 NDR_SAMR_ENUMDOMAINUSERS,
594                                 &r);
595
596         if (!NT_STATUS_IS_OK(status)) {
597                 return status;
598         }
599
600         if (DEBUGLEVEL >= 10) {
601                 NDR_PRINT_OUT_DEBUG(samr_EnumDomainUsers, &r);
602         }
603
604         if (NT_STATUS_IS_ERR(status)) {
605                 return status;
606         }
607
608         /* Return variables */
609         *resume_handle = *r.out.resume_handle;
610         *sam = *r.out.sam;
611         *num_entries = *r.out.num_entries;
612
613         /* Return result */
614         return r.out.result;
615 }
616
617 NTSTATUS rpccli_samr_CreateDomAlias(struct rpc_pipe_client *cli,
618                                     TALLOC_CTX *mem_ctx,
619                                     struct policy_handle *domain_handle /* [in] [ref] */,
620                                     struct lsa_String *alias_name /* [in] [ref] */,
621                                     uint32_t access_mask /* [in]  */,
622                                     struct policy_handle *alias_handle /* [out] [ref] */,
623                                     uint32_t *rid /* [out] [ref] */)
624 {
625         struct samr_CreateDomAlias r;
626         NTSTATUS status;
627
628         /* In parameters */
629         r.in.domain_handle = domain_handle;
630         r.in.alias_name = alias_name;
631         r.in.access_mask = access_mask;
632
633         if (DEBUGLEVEL >= 10) {
634                 NDR_PRINT_IN_DEBUG(samr_CreateDomAlias, &r);
635         }
636
637         status = cli_do_rpc_ndr(cli,
638                                 mem_ctx,
639                                 &ndr_table_samr,
640                                 NDR_SAMR_CREATEDOMALIAS,
641                                 &r);
642
643         if (!NT_STATUS_IS_OK(status)) {
644                 return status;
645         }
646
647         if (DEBUGLEVEL >= 10) {
648                 NDR_PRINT_OUT_DEBUG(samr_CreateDomAlias, &r);
649         }
650
651         if (NT_STATUS_IS_ERR(status)) {
652                 return status;
653         }
654
655         /* Return variables */
656         *alias_handle = *r.out.alias_handle;
657         *rid = *r.out.rid;
658
659         /* Return result */
660         return r.out.result;
661 }
662
663 NTSTATUS rpccli_samr_EnumDomainAliases(struct rpc_pipe_client *cli,
664                                        TALLOC_CTX *mem_ctx,
665                                        struct policy_handle *domain_handle /* [in] [ref] */,
666                                        uint32_t *resume_handle /* [in,out] [ref] */,
667                                        struct samr_SamArray **sam /* [out] [ref] */,
668                                        uint32_t max_size /* [in]  */,
669                                        uint32_t *num_entries /* [out] [ref] */)
670 {
671         struct samr_EnumDomainAliases r;
672         NTSTATUS status;
673
674         /* In parameters */
675         r.in.domain_handle = domain_handle;
676         r.in.resume_handle = resume_handle;
677         r.in.max_size = max_size;
678
679         if (DEBUGLEVEL >= 10) {
680                 NDR_PRINT_IN_DEBUG(samr_EnumDomainAliases, &r);
681         }
682
683         status = cli_do_rpc_ndr(cli,
684                                 mem_ctx,
685                                 &ndr_table_samr,
686                                 NDR_SAMR_ENUMDOMAINALIASES,
687                                 &r);
688
689         if (!NT_STATUS_IS_OK(status)) {
690                 return status;
691         }
692
693         if (DEBUGLEVEL >= 10) {
694                 NDR_PRINT_OUT_DEBUG(samr_EnumDomainAliases, &r);
695         }
696
697         if (NT_STATUS_IS_ERR(status)) {
698                 return status;
699         }
700
701         /* Return variables */
702         *resume_handle = *r.out.resume_handle;
703         *sam = *r.out.sam;
704         *num_entries = *r.out.num_entries;
705
706         /* Return result */
707         return r.out.result;
708 }
709
710 NTSTATUS rpccli_samr_GetAliasMembership(struct rpc_pipe_client *cli,
711                                         TALLOC_CTX *mem_ctx,
712                                         struct policy_handle *domain_handle /* [in] [ref] */,
713                                         struct lsa_SidArray *sids /* [in] [ref] */,
714                                         struct samr_Ids *rids /* [out] [ref] */)
715 {
716         struct samr_GetAliasMembership r;
717         NTSTATUS status;
718
719         /* In parameters */
720         r.in.domain_handle = domain_handle;
721         r.in.sids = sids;
722
723         if (DEBUGLEVEL >= 10) {
724                 NDR_PRINT_IN_DEBUG(samr_GetAliasMembership, &r);
725         }
726
727         status = cli_do_rpc_ndr(cli,
728                                 mem_ctx,
729                                 &ndr_table_samr,
730                                 NDR_SAMR_GETALIASMEMBERSHIP,
731                                 &r);
732
733         if (!NT_STATUS_IS_OK(status)) {
734                 return status;
735         }
736
737         if (DEBUGLEVEL >= 10) {
738                 NDR_PRINT_OUT_DEBUG(samr_GetAliasMembership, &r);
739         }
740
741         if (NT_STATUS_IS_ERR(status)) {
742                 return status;
743         }
744
745         /* Return variables */
746         *rids = *r.out.rids;
747
748         /* Return result */
749         return r.out.result;
750 }
751
752 NTSTATUS rpccli_samr_LookupNames(struct rpc_pipe_client *cli,
753                                  TALLOC_CTX *mem_ctx,
754                                  struct policy_handle *domain_handle /* [in] [ref] */,
755                                  uint32_t num_names /* [in] [range(0,1000)] */,
756                                  struct lsa_String *names /* [in] [length_is(num_names),size_is(1000)] */,
757                                  struct samr_Ids *rids /* [out] [ref] */,
758                                  struct samr_Ids *types /* [out] [ref] */)
759 {
760         struct samr_LookupNames r;
761         NTSTATUS status;
762
763         /* In parameters */
764         r.in.domain_handle = domain_handle;
765         r.in.num_names = num_names;
766         r.in.names = names;
767
768         if (DEBUGLEVEL >= 10) {
769                 NDR_PRINT_IN_DEBUG(samr_LookupNames, &r);
770         }
771
772         status = cli_do_rpc_ndr(cli,
773                                 mem_ctx,
774                                 &ndr_table_samr,
775                                 NDR_SAMR_LOOKUPNAMES,
776                                 &r);
777
778         if (!NT_STATUS_IS_OK(status)) {
779                 return status;
780         }
781
782         if (DEBUGLEVEL >= 10) {
783                 NDR_PRINT_OUT_DEBUG(samr_LookupNames, &r);
784         }
785
786         if (NT_STATUS_IS_ERR(status)) {
787                 return status;
788         }
789
790         /* Return variables */
791         *rids = *r.out.rids;
792         *types = *r.out.types;
793
794         /* Return result */
795         return r.out.result;
796 }
797
798 NTSTATUS rpccli_samr_LookupRids(struct rpc_pipe_client *cli,
799                                 TALLOC_CTX *mem_ctx,
800                                 struct policy_handle *domain_handle /* [in] [ref] */,
801                                 uint32_t num_rids /* [in] [range(0,1000)] */,
802                                 uint32_t *rids /* [in] [length_is(num_rids),size_is(1000)] */,
803                                 struct lsa_Strings *names /* [out] [ref] */,
804                                 struct samr_Ids *types /* [out] [ref] */)
805 {
806         struct samr_LookupRids r;
807         NTSTATUS status;
808
809         /* In parameters */
810         r.in.domain_handle = domain_handle;
811         r.in.num_rids = num_rids;
812         r.in.rids = rids;
813
814         if (DEBUGLEVEL >= 10) {
815                 NDR_PRINT_IN_DEBUG(samr_LookupRids, &r);
816         }
817
818         status = cli_do_rpc_ndr(cli,
819                                 mem_ctx,
820                                 &ndr_table_samr,
821                                 NDR_SAMR_LOOKUPRIDS,
822                                 &r);
823
824         if (!NT_STATUS_IS_OK(status)) {
825                 return status;
826         }
827
828         if (DEBUGLEVEL >= 10) {
829                 NDR_PRINT_OUT_DEBUG(samr_LookupRids, &r);
830         }
831
832         if (NT_STATUS_IS_ERR(status)) {
833                 return status;
834         }
835
836         /* Return variables */
837         *names = *r.out.names;
838         *types = *r.out.types;
839
840         /* Return result */
841         return r.out.result;
842 }
843
844 NTSTATUS rpccli_samr_OpenGroup(struct rpc_pipe_client *cli,
845                                TALLOC_CTX *mem_ctx,
846                                struct policy_handle *domain_handle /* [in] [ref] */,
847                                uint32_t access_mask /* [in]  */,
848                                uint32_t rid /* [in]  */,
849                                struct policy_handle *group_handle /* [out] [ref] */)
850 {
851         struct samr_OpenGroup r;
852         NTSTATUS status;
853
854         /* In parameters */
855         r.in.domain_handle = domain_handle;
856         r.in.access_mask = access_mask;
857         r.in.rid = rid;
858
859         if (DEBUGLEVEL >= 10) {
860                 NDR_PRINT_IN_DEBUG(samr_OpenGroup, &r);
861         }
862
863         status = cli_do_rpc_ndr(cli,
864                                 mem_ctx,
865                                 &ndr_table_samr,
866                                 NDR_SAMR_OPENGROUP,
867                                 &r);
868
869         if (!NT_STATUS_IS_OK(status)) {
870                 return status;
871         }
872
873         if (DEBUGLEVEL >= 10) {
874                 NDR_PRINT_OUT_DEBUG(samr_OpenGroup, &r);
875         }
876
877         if (NT_STATUS_IS_ERR(status)) {
878                 return status;
879         }
880
881         /* Return variables */
882         *group_handle = *r.out.group_handle;
883
884         /* Return result */
885         return r.out.result;
886 }
887
888 NTSTATUS rpccli_samr_QueryGroupInfo(struct rpc_pipe_client *cli,
889                                     TALLOC_CTX *mem_ctx,
890                                     struct policy_handle *group_handle /* [in] [ref] */,
891                                     enum samr_GroupInfoEnum level /* [in]  */,
892                                     union samr_GroupInfo **info /* [out] [ref,switch_is(level)] */)
893 {
894         struct samr_QueryGroupInfo r;
895         NTSTATUS status;
896
897         /* In parameters */
898         r.in.group_handle = group_handle;
899         r.in.level = level;
900
901         if (DEBUGLEVEL >= 10) {
902                 NDR_PRINT_IN_DEBUG(samr_QueryGroupInfo, &r);
903         }
904
905         status = cli_do_rpc_ndr(cli,
906                                 mem_ctx,
907                                 &ndr_table_samr,
908                                 NDR_SAMR_QUERYGROUPINFO,
909                                 &r);
910
911         if (!NT_STATUS_IS_OK(status)) {
912                 return status;
913         }
914
915         if (DEBUGLEVEL >= 10) {
916                 NDR_PRINT_OUT_DEBUG(samr_QueryGroupInfo, &r);
917         }
918
919         if (NT_STATUS_IS_ERR(status)) {
920                 return status;
921         }
922
923         /* Return variables */
924         *info = *r.out.info;
925
926         /* Return result */
927         return r.out.result;
928 }
929
930 NTSTATUS rpccli_samr_SetGroupInfo(struct rpc_pipe_client *cli,
931                                   TALLOC_CTX *mem_ctx,
932                                   struct policy_handle *group_handle /* [in] [ref] */,
933                                   enum samr_GroupInfoEnum level /* [in]  */,
934                                   union samr_GroupInfo *info /* [in] [ref,switch_is(level)] */)
935 {
936         struct samr_SetGroupInfo r;
937         NTSTATUS status;
938
939         /* In parameters */
940         r.in.group_handle = group_handle;
941         r.in.level = level;
942         r.in.info = info;
943
944         if (DEBUGLEVEL >= 10) {
945                 NDR_PRINT_IN_DEBUG(samr_SetGroupInfo, &r);
946         }
947
948         status = cli_do_rpc_ndr(cli,
949                                 mem_ctx,
950                                 &ndr_table_samr,
951                                 NDR_SAMR_SETGROUPINFO,
952                                 &r);
953
954         if (!NT_STATUS_IS_OK(status)) {
955                 return status;
956         }
957
958         if (DEBUGLEVEL >= 10) {
959                 NDR_PRINT_OUT_DEBUG(samr_SetGroupInfo, &r);
960         }
961
962         if (NT_STATUS_IS_ERR(status)) {
963                 return status;
964         }
965
966         /* Return variables */
967
968         /* Return result */
969         return r.out.result;
970 }
971
972 NTSTATUS rpccli_samr_AddGroupMember(struct rpc_pipe_client *cli,
973                                     TALLOC_CTX *mem_ctx,
974                                     struct policy_handle *group_handle /* [in] [ref] */,
975                                     uint32_t rid /* [in]  */,
976                                     uint32_t flags /* [in]  */)
977 {
978         struct samr_AddGroupMember r;
979         NTSTATUS status;
980
981         /* In parameters */
982         r.in.group_handle = group_handle;
983         r.in.rid = rid;
984         r.in.flags = flags;
985
986         if (DEBUGLEVEL >= 10) {
987                 NDR_PRINT_IN_DEBUG(samr_AddGroupMember, &r);
988         }
989
990         status = cli_do_rpc_ndr(cli,
991                                 mem_ctx,
992                                 &ndr_table_samr,
993                                 NDR_SAMR_ADDGROUPMEMBER,
994                                 &r);
995
996         if (!NT_STATUS_IS_OK(status)) {
997                 return status;
998         }
999
1000         if (DEBUGLEVEL >= 10) {
1001                 NDR_PRINT_OUT_DEBUG(samr_AddGroupMember, &r);
1002         }
1003
1004         if (NT_STATUS_IS_ERR(status)) {
1005                 return status;
1006         }
1007
1008         /* Return variables */
1009
1010         /* Return result */
1011         return r.out.result;
1012 }
1013
1014 NTSTATUS rpccli_samr_DeleteDomainGroup(struct rpc_pipe_client *cli,
1015                                        TALLOC_CTX *mem_ctx,
1016                                        struct policy_handle *group_handle /* [in,out] [ref] */)
1017 {
1018         struct samr_DeleteDomainGroup r;
1019         NTSTATUS status;
1020
1021         /* In parameters */
1022         r.in.group_handle = group_handle;
1023
1024         if (DEBUGLEVEL >= 10) {
1025                 NDR_PRINT_IN_DEBUG(samr_DeleteDomainGroup, &r);
1026         }
1027
1028         status = cli_do_rpc_ndr(cli,
1029                                 mem_ctx,
1030                                 &ndr_table_samr,
1031                                 NDR_SAMR_DELETEDOMAINGROUP,
1032                                 &r);
1033
1034         if (!NT_STATUS_IS_OK(status)) {
1035                 return status;
1036         }
1037
1038         if (DEBUGLEVEL >= 10) {
1039                 NDR_PRINT_OUT_DEBUG(samr_DeleteDomainGroup, &r);
1040         }
1041
1042         if (NT_STATUS_IS_ERR(status)) {
1043                 return status;
1044         }
1045
1046         /* Return variables */
1047         *group_handle = *r.out.group_handle;
1048
1049         /* Return result */
1050         return r.out.result;
1051 }
1052
1053 NTSTATUS rpccli_samr_DeleteGroupMember(struct rpc_pipe_client *cli,
1054                                        TALLOC_CTX *mem_ctx,
1055                                        struct policy_handle *group_handle /* [in] [ref] */,
1056                                        uint32_t rid /* [in]  */)
1057 {
1058         struct samr_DeleteGroupMember r;
1059         NTSTATUS status;
1060
1061         /* In parameters */
1062         r.in.group_handle = group_handle;
1063         r.in.rid = rid;
1064
1065         if (DEBUGLEVEL >= 10) {
1066                 NDR_PRINT_IN_DEBUG(samr_DeleteGroupMember, &r);
1067         }
1068
1069         status = cli_do_rpc_ndr(cli,
1070                                 mem_ctx,
1071                                 &ndr_table_samr,
1072                                 NDR_SAMR_DELETEGROUPMEMBER,
1073                                 &r);
1074
1075         if (!NT_STATUS_IS_OK(status)) {
1076                 return status;
1077         }
1078
1079         if (DEBUGLEVEL >= 10) {
1080                 NDR_PRINT_OUT_DEBUG(samr_DeleteGroupMember, &r);
1081         }
1082
1083         if (NT_STATUS_IS_ERR(status)) {
1084                 return status;
1085         }
1086
1087         /* Return variables */
1088
1089         /* Return result */
1090         return r.out.result;
1091 }
1092
1093 NTSTATUS rpccli_samr_QueryGroupMember(struct rpc_pipe_client *cli,
1094                                       TALLOC_CTX *mem_ctx,
1095                                       struct policy_handle *group_handle /* [in] [ref] */,
1096                                       struct samr_RidTypeArray **rids /* [out] [ref] */)
1097 {
1098         struct samr_QueryGroupMember r;
1099         NTSTATUS status;
1100
1101         /* In parameters */
1102         r.in.group_handle = group_handle;
1103
1104         if (DEBUGLEVEL >= 10) {
1105                 NDR_PRINT_IN_DEBUG(samr_QueryGroupMember, &r);
1106         }
1107
1108         status = cli_do_rpc_ndr(cli,
1109                                 mem_ctx,
1110                                 &ndr_table_samr,
1111                                 NDR_SAMR_QUERYGROUPMEMBER,
1112                                 &r);
1113
1114         if (!NT_STATUS_IS_OK(status)) {
1115                 return status;
1116         }
1117
1118         if (DEBUGLEVEL >= 10) {
1119                 NDR_PRINT_OUT_DEBUG(samr_QueryGroupMember, &r);
1120         }
1121
1122         if (NT_STATUS_IS_ERR(status)) {
1123                 return status;
1124         }
1125
1126         /* Return variables */
1127         *rids = *r.out.rids;
1128
1129         /* Return result */
1130         return r.out.result;
1131 }
1132
1133 NTSTATUS rpccli_samr_SetMemberAttributesOfGroup(struct rpc_pipe_client *cli,
1134                                                 TALLOC_CTX *mem_ctx,
1135                                                 struct policy_handle *group_handle /* [in] [ref] */,
1136                                                 uint32_t unknown1 /* [in]  */,
1137                                                 uint32_t unknown2 /* [in]  */)
1138 {
1139         struct samr_SetMemberAttributesOfGroup r;
1140         NTSTATUS status;
1141
1142         /* In parameters */
1143         r.in.group_handle = group_handle;
1144         r.in.unknown1 = unknown1;
1145         r.in.unknown2 = unknown2;
1146
1147         if (DEBUGLEVEL >= 10) {
1148                 NDR_PRINT_IN_DEBUG(samr_SetMemberAttributesOfGroup, &r);
1149         }
1150
1151         status = cli_do_rpc_ndr(cli,
1152                                 mem_ctx,
1153                                 &ndr_table_samr,
1154                                 NDR_SAMR_SETMEMBERATTRIBUTESOFGROUP,
1155                                 &r);
1156
1157         if (!NT_STATUS_IS_OK(status)) {
1158                 return status;
1159         }
1160
1161         if (DEBUGLEVEL >= 10) {
1162                 NDR_PRINT_OUT_DEBUG(samr_SetMemberAttributesOfGroup, &r);
1163         }
1164
1165         if (NT_STATUS_IS_ERR(status)) {
1166                 return status;
1167         }
1168
1169         /* Return variables */
1170
1171         /* Return result */
1172         return r.out.result;
1173 }
1174
1175 NTSTATUS rpccli_samr_OpenAlias(struct rpc_pipe_client *cli,
1176                                TALLOC_CTX *mem_ctx,
1177                                struct policy_handle *domain_handle /* [in] [ref] */,
1178                                uint32_t access_mask /* [in]  */,
1179                                uint32_t rid /* [in]  */,
1180                                struct policy_handle *alias_handle /* [out] [ref] */)
1181 {
1182         struct samr_OpenAlias r;
1183         NTSTATUS status;
1184
1185         /* In parameters */
1186         r.in.domain_handle = domain_handle;
1187         r.in.access_mask = access_mask;
1188         r.in.rid = rid;
1189
1190         if (DEBUGLEVEL >= 10) {
1191                 NDR_PRINT_IN_DEBUG(samr_OpenAlias, &r);
1192         }
1193
1194         status = cli_do_rpc_ndr(cli,
1195                                 mem_ctx,
1196                                 &ndr_table_samr,
1197                                 NDR_SAMR_OPENALIAS,
1198                                 &r);
1199
1200         if (!NT_STATUS_IS_OK(status)) {
1201                 return status;
1202         }
1203
1204         if (DEBUGLEVEL >= 10) {
1205                 NDR_PRINT_OUT_DEBUG(samr_OpenAlias, &r);
1206         }
1207
1208         if (NT_STATUS_IS_ERR(status)) {
1209                 return status;
1210         }
1211
1212         /* Return variables */
1213         *alias_handle = *r.out.alias_handle;
1214
1215         /* Return result */
1216         return r.out.result;
1217 }
1218
1219 NTSTATUS rpccli_samr_QueryAliasInfo(struct rpc_pipe_client *cli,
1220                                     TALLOC_CTX *mem_ctx,
1221                                     struct policy_handle *alias_handle /* [in] [ref] */,
1222                                     enum samr_AliasInfoEnum level /* [in]  */,
1223                                     union samr_AliasInfo **info /* [out] [ref,switch_is(level)] */)
1224 {
1225         struct samr_QueryAliasInfo r;
1226         NTSTATUS status;
1227
1228         /* In parameters */
1229         r.in.alias_handle = alias_handle;
1230         r.in.level = level;
1231
1232         if (DEBUGLEVEL >= 10) {
1233                 NDR_PRINT_IN_DEBUG(samr_QueryAliasInfo, &r);
1234         }
1235
1236         status = cli_do_rpc_ndr(cli,
1237                                 mem_ctx,
1238                                 &ndr_table_samr,
1239                                 NDR_SAMR_QUERYALIASINFO,
1240                                 &r);
1241
1242         if (!NT_STATUS_IS_OK(status)) {
1243                 return status;
1244         }
1245
1246         if (DEBUGLEVEL >= 10) {
1247                 NDR_PRINT_OUT_DEBUG(samr_QueryAliasInfo, &r);
1248         }
1249
1250         if (NT_STATUS_IS_ERR(status)) {
1251                 return status;
1252         }
1253
1254         /* Return variables */
1255         *info = *r.out.info;
1256
1257         /* Return result */
1258         return r.out.result;
1259 }
1260
1261 NTSTATUS rpccli_samr_SetAliasInfo(struct rpc_pipe_client *cli,
1262                                   TALLOC_CTX *mem_ctx,
1263                                   struct policy_handle *alias_handle /* [in] [ref] */,
1264                                   enum samr_AliasInfoEnum level /* [in]  */,
1265                                   union samr_AliasInfo *info /* [in] [ref,switch_is(level)] */)
1266 {
1267         struct samr_SetAliasInfo r;
1268         NTSTATUS status;
1269
1270         /* In parameters */
1271         r.in.alias_handle = alias_handle;
1272         r.in.level = level;
1273         r.in.info = info;
1274
1275         if (DEBUGLEVEL >= 10) {
1276                 NDR_PRINT_IN_DEBUG(samr_SetAliasInfo, &r);
1277         }
1278
1279         status = cli_do_rpc_ndr(cli,
1280                                 mem_ctx,
1281                                 &ndr_table_samr,
1282                                 NDR_SAMR_SETALIASINFO,
1283                                 &r);
1284
1285         if (!NT_STATUS_IS_OK(status)) {
1286                 return status;
1287         }
1288
1289         if (DEBUGLEVEL >= 10) {
1290                 NDR_PRINT_OUT_DEBUG(samr_SetAliasInfo, &r);
1291         }
1292
1293         if (NT_STATUS_IS_ERR(status)) {
1294                 return status;
1295         }
1296
1297         /* Return variables */
1298
1299         /* Return result */
1300         return r.out.result;
1301 }
1302
1303 NTSTATUS rpccli_samr_DeleteDomAlias(struct rpc_pipe_client *cli,
1304                                     TALLOC_CTX *mem_ctx,
1305                                     struct policy_handle *alias_handle /* [in,out] [ref] */)
1306 {
1307         struct samr_DeleteDomAlias r;
1308         NTSTATUS status;
1309
1310         /* In parameters */
1311         r.in.alias_handle = alias_handle;
1312
1313         if (DEBUGLEVEL >= 10) {
1314                 NDR_PRINT_IN_DEBUG(samr_DeleteDomAlias, &r);
1315         }
1316
1317         status = cli_do_rpc_ndr(cli,
1318                                 mem_ctx,
1319                                 &ndr_table_samr,
1320                                 NDR_SAMR_DELETEDOMALIAS,
1321                                 &r);
1322
1323         if (!NT_STATUS_IS_OK(status)) {
1324                 return status;
1325         }
1326
1327         if (DEBUGLEVEL >= 10) {
1328                 NDR_PRINT_OUT_DEBUG(samr_DeleteDomAlias, &r);
1329         }
1330
1331         if (NT_STATUS_IS_ERR(status)) {
1332                 return status;
1333         }
1334
1335         /* Return variables */
1336         *alias_handle = *r.out.alias_handle;
1337
1338         /* Return result */
1339         return r.out.result;
1340 }
1341
1342 NTSTATUS rpccli_samr_AddAliasMember(struct rpc_pipe_client *cli,
1343                                     TALLOC_CTX *mem_ctx,
1344                                     struct policy_handle *alias_handle /* [in] [ref] */,
1345                                     struct dom_sid2 *sid /* [in] [ref] */)
1346 {
1347         struct samr_AddAliasMember r;
1348         NTSTATUS status;
1349
1350         /* In parameters */
1351         r.in.alias_handle = alias_handle;
1352         r.in.sid = sid;
1353
1354         if (DEBUGLEVEL >= 10) {
1355                 NDR_PRINT_IN_DEBUG(samr_AddAliasMember, &r);
1356         }
1357
1358         status = cli_do_rpc_ndr(cli,
1359                                 mem_ctx,
1360                                 &ndr_table_samr,
1361                                 NDR_SAMR_ADDALIASMEMBER,
1362                                 &r);
1363
1364         if (!NT_STATUS_IS_OK(status)) {
1365                 return status;
1366         }
1367
1368         if (DEBUGLEVEL >= 10) {
1369                 NDR_PRINT_OUT_DEBUG(samr_AddAliasMember, &r);
1370         }
1371
1372         if (NT_STATUS_IS_ERR(status)) {
1373                 return status;
1374         }
1375
1376         /* Return variables */
1377
1378         /* Return result */
1379         return r.out.result;
1380 }
1381
1382 NTSTATUS rpccli_samr_DeleteAliasMember(struct rpc_pipe_client *cli,
1383                                        TALLOC_CTX *mem_ctx,
1384                                        struct policy_handle *alias_handle /* [in] [ref] */,
1385                                        struct dom_sid2 *sid /* [in] [ref] */)
1386 {
1387         struct samr_DeleteAliasMember r;
1388         NTSTATUS status;
1389
1390         /* In parameters */
1391         r.in.alias_handle = alias_handle;
1392         r.in.sid = sid;
1393
1394         if (DEBUGLEVEL >= 10) {
1395                 NDR_PRINT_IN_DEBUG(samr_DeleteAliasMember, &r);
1396         }
1397
1398         status = cli_do_rpc_ndr(cli,
1399                                 mem_ctx,
1400                                 &ndr_table_samr,
1401                                 NDR_SAMR_DELETEALIASMEMBER,
1402                                 &r);
1403
1404         if (!NT_STATUS_IS_OK(status)) {
1405                 return status;
1406         }
1407
1408         if (DEBUGLEVEL >= 10) {
1409                 NDR_PRINT_OUT_DEBUG(samr_DeleteAliasMember, &r);
1410         }
1411
1412         if (NT_STATUS_IS_ERR(status)) {
1413                 return status;
1414         }
1415
1416         /* Return variables */
1417
1418         /* Return result */
1419         return r.out.result;
1420 }
1421
1422 NTSTATUS rpccli_samr_GetMembersInAlias(struct rpc_pipe_client *cli,
1423                                        TALLOC_CTX *mem_ctx,
1424                                        struct policy_handle *alias_handle /* [in] [ref] */,
1425                                        struct lsa_SidArray *sids /* [out] [ref] */)
1426 {
1427         struct samr_GetMembersInAlias r;
1428         NTSTATUS status;
1429
1430         /* In parameters */
1431         r.in.alias_handle = alias_handle;
1432
1433         if (DEBUGLEVEL >= 10) {
1434                 NDR_PRINT_IN_DEBUG(samr_GetMembersInAlias, &r);
1435         }
1436
1437         status = cli_do_rpc_ndr(cli,
1438                                 mem_ctx,
1439                                 &ndr_table_samr,
1440                                 NDR_SAMR_GETMEMBERSINALIAS,
1441                                 &r);
1442
1443         if (!NT_STATUS_IS_OK(status)) {
1444                 return status;
1445         }
1446
1447         if (DEBUGLEVEL >= 10) {
1448                 NDR_PRINT_OUT_DEBUG(samr_GetMembersInAlias, &r);
1449         }
1450
1451         if (NT_STATUS_IS_ERR(status)) {
1452                 return status;
1453         }
1454
1455         /* Return variables */
1456         *sids = *r.out.sids;
1457
1458         /* Return result */
1459         return r.out.result;
1460 }
1461
1462 NTSTATUS rpccli_samr_OpenUser(struct rpc_pipe_client *cli,
1463                               TALLOC_CTX *mem_ctx,
1464                               struct policy_handle *domain_handle /* [in] [ref] */,
1465                               uint32_t access_mask /* [in]  */,
1466                               uint32_t rid /* [in]  */,
1467                               struct policy_handle *user_handle /* [out] [ref] */)
1468 {
1469         struct samr_OpenUser r;
1470         NTSTATUS status;
1471
1472         /* In parameters */
1473         r.in.domain_handle = domain_handle;
1474         r.in.access_mask = access_mask;
1475         r.in.rid = rid;
1476
1477         if (DEBUGLEVEL >= 10) {
1478                 NDR_PRINT_IN_DEBUG(samr_OpenUser, &r);
1479         }
1480
1481         status = cli_do_rpc_ndr(cli,
1482                                 mem_ctx,
1483                                 &ndr_table_samr,
1484                                 NDR_SAMR_OPENUSER,
1485                                 &r);
1486
1487         if (!NT_STATUS_IS_OK(status)) {
1488                 return status;
1489         }
1490
1491         if (DEBUGLEVEL >= 10) {
1492                 NDR_PRINT_OUT_DEBUG(samr_OpenUser, &r);
1493         }
1494
1495         if (NT_STATUS_IS_ERR(status)) {
1496                 return status;
1497         }
1498
1499         /* Return variables */
1500         *user_handle = *r.out.user_handle;
1501
1502         /* Return result */
1503         return r.out.result;
1504 }
1505
1506 NTSTATUS rpccli_samr_DeleteUser(struct rpc_pipe_client *cli,
1507                                 TALLOC_CTX *mem_ctx,
1508                                 struct policy_handle *user_handle /* [in,out] [ref] */)
1509 {
1510         struct samr_DeleteUser r;
1511         NTSTATUS status;
1512
1513         /* In parameters */
1514         r.in.user_handle = user_handle;
1515
1516         if (DEBUGLEVEL >= 10) {
1517                 NDR_PRINT_IN_DEBUG(samr_DeleteUser, &r);
1518         }
1519
1520         status = cli_do_rpc_ndr(cli,
1521                                 mem_ctx,
1522                                 &ndr_table_samr,
1523                                 NDR_SAMR_DELETEUSER,
1524                                 &r);
1525
1526         if (!NT_STATUS_IS_OK(status)) {
1527                 return status;
1528         }
1529
1530         if (DEBUGLEVEL >= 10) {
1531                 NDR_PRINT_OUT_DEBUG(samr_DeleteUser, &r);
1532         }
1533
1534         if (NT_STATUS_IS_ERR(status)) {
1535                 return status;
1536         }
1537
1538         /* Return variables */
1539         *user_handle = *r.out.user_handle;
1540
1541         /* Return result */
1542         return r.out.result;
1543 }
1544
1545 NTSTATUS rpccli_samr_QueryUserInfo(struct rpc_pipe_client *cli,
1546                                    TALLOC_CTX *mem_ctx,
1547                                    struct policy_handle *user_handle /* [in] [ref] */,
1548                                    uint16_t level /* [in]  */,
1549                                    union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
1550 {
1551         struct samr_QueryUserInfo r;
1552         NTSTATUS status;
1553
1554         /* In parameters */
1555         r.in.user_handle = user_handle;
1556         r.in.level = level;
1557
1558         if (DEBUGLEVEL >= 10) {
1559                 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo, &r);
1560         }
1561
1562         status = cli_do_rpc_ndr(cli,
1563                                 mem_ctx,
1564                                 &ndr_table_samr,
1565                                 NDR_SAMR_QUERYUSERINFO,
1566                                 &r);
1567
1568         if (!NT_STATUS_IS_OK(status)) {
1569                 return status;
1570         }
1571
1572         if (DEBUGLEVEL >= 10) {
1573                 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo, &r);
1574         }
1575
1576         if (NT_STATUS_IS_ERR(status)) {
1577                 return status;
1578         }
1579
1580         /* Return variables */
1581         *info = *r.out.info;
1582
1583         /* Return result */
1584         return r.out.result;
1585 }
1586
1587 NTSTATUS rpccli_samr_SetUserInfo(struct rpc_pipe_client *cli,
1588                                  TALLOC_CTX *mem_ctx,
1589                                  struct policy_handle *user_handle /* [in] [ref] */,
1590                                  uint16_t level /* [in]  */,
1591                                  union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
1592 {
1593         struct samr_SetUserInfo r;
1594         NTSTATUS status;
1595
1596         /* In parameters */
1597         r.in.user_handle = user_handle;
1598         r.in.level = level;
1599         r.in.info = info;
1600
1601         if (DEBUGLEVEL >= 10) {
1602                 NDR_PRINT_IN_DEBUG(samr_SetUserInfo, &r);
1603         }
1604
1605         status = cli_do_rpc_ndr(cli,
1606                                 mem_ctx,
1607                                 &ndr_table_samr,
1608                                 NDR_SAMR_SETUSERINFO,
1609                                 &r);
1610
1611         if (!NT_STATUS_IS_OK(status)) {
1612                 return status;
1613         }
1614
1615         if (DEBUGLEVEL >= 10) {
1616                 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo, &r);
1617         }
1618
1619         if (NT_STATUS_IS_ERR(status)) {
1620                 return status;
1621         }
1622
1623         /* Return variables */
1624
1625         /* Return result */
1626         return r.out.result;
1627 }
1628
1629 NTSTATUS rpccli_samr_ChangePasswordUser(struct rpc_pipe_client *cli,
1630                                         TALLOC_CTX *mem_ctx,
1631                                         struct policy_handle *user_handle /* [in] [ref] */,
1632                                         uint8_t lm_present /* [in]  */,
1633                                         struct samr_Password *old_lm_crypted /* [in] [unique] */,
1634                                         struct samr_Password *new_lm_crypted /* [in] [unique] */,
1635                                         uint8_t nt_present /* [in]  */,
1636                                         struct samr_Password *old_nt_crypted /* [in] [unique] */,
1637                                         struct samr_Password *new_nt_crypted /* [in] [unique] */,
1638                                         uint8_t cross1_present /* [in]  */,
1639                                         struct samr_Password *nt_cross /* [in] [unique] */,
1640                                         uint8_t cross2_present /* [in]  */,
1641                                         struct samr_Password *lm_cross /* [in] [unique] */)
1642 {
1643         struct samr_ChangePasswordUser r;
1644         NTSTATUS status;
1645
1646         /* In parameters */
1647         r.in.user_handle = user_handle;
1648         r.in.lm_present = lm_present;
1649         r.in.old_lm_crypted = old_lm_crypted;
1650         r.in.new_lm_crypted = new_lm_crypted;
1651         r.in.nt_present = nt_present;
1652         r.in.old_nt_crypted = old_nt_crypted;
1653         r.in.new_nt_crypted = new_nt_crypted;
1654         r.in.cross1_present = cross1_present;
1655         r.in.nt_cross = nt_cross;
1656         r.in.cross2_present = cross2_present;
1657         r.in.lm_cross = lm_cross;
1658
1659         if (DEBUGLEVEL >= 10) {
1660                 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser, &r);
1661         }
1662
1663         status = cli_do_rpc_ndr(cli,
1664                                 mem_ctx,
1665                                 &ndr_table_samr,
1666                                 NDR_SAMR_CHANGEPASSWORDUSER,
1667                                 &r);
1668
1669         if (!NT_STATUS_IS_OK(status)) {
1670                 return status;
1671         }
1672
1673         if (DEBUGLEVEL >= 10) {
1674                 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser, &r);
1675         }
1676
1677         if (NT_STATUS_IS_ERR(status)) {
1678                 return status;
1679         }
1680
1681         /* Return variables */
1682
1683         /* Return result */
1684         return r.out.result;
1685 }
1686
1687 NTSTATUS rpccli_samr_GetGroupsForUser(struct rpc_pipe_client *cli,
1688                                       TALLOC_CTX *mem_ctx,
1689                                       struct policy_handle *user_handle /* [in] [ref] */,
1690                                       struct samr_RidWithAttributeArray **rids /* [out] [ref] */)
1691 {
1692         struct samr_GetGroupsForUser r;
1693         NTSTATUS status;
1694
1695         /* In parameters */
1696         r.in.user_handle = user_handle;
1697
1698         if (DEBUGLEVEL >= 10) {
1699                 NDR_PRINT_IN_DEBUG(samr_GetGroupsForUser, &r);
1700         }
1701
1702         status = cli_do_rpc_ndr(cli,
1703                                 mem_ctx,
1704                                 &ndr_table_samr,
1705                                 NDR_SAMR_GETGROUPSFORUSER,
1706                                 &r);
1707
1708         if (!NT_STATUS_IS_OK(status)) {
1709                 return status;
1710         }
1711
1712         if (DEBUGLEVEL >= 10) {
1713                 NDR_PRINT_OUT_DEBUG(samr_GetGroupsForUser, &r);
1714         }
1715
1716         if (NT_STATUS_IS_ERR(status)) {
1717                 return status;
1718         }
1719
1720         /* Return variables */
1721         *rids = *r.out.rids;
1722
1723         /* Return result */
1724         return r.out.result;
1725 }
1726
1727 NTSTATUS rpccli_samr_QueryDisplayInfo(struct rpc_pipe_client *cli,
1728                                       TALLOC_CTX *mem_ctx,
1729                                       struct policy_handle *domain_handle /* [in] [ref] */,
1730                                       uint16_t level /* [in]  */,
1731                                       uint32_t start_idx /* [in]  */,
1732                                       uint32_t max_entries /* [in]  */,
1733                                       uint32_t buf_size /* [in]  */,
1734                                       uint32_t *total_size /* [out] [ref] */,
1735                                       uint32_t *returned_size /* [out] [ref] */,
1736                                       union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
1737 {
1738         struct samr_QueryDisplayInfo r;
1739         NTSTATUS status;
1740
1741         /* In parameters */
1742         r.in.domain_handle = domain_handle;
1743         r.in.level = level;
1744         r.in.start_idx = start_idx;
1745         r.in.max_entries = max_entries;
1746         r.in.buf_size = buf_size;
1747
1748         if (DEBUGLEVEL >= 10) {
1749                 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo, &r);
1750         }
1751
1752         status = cli_do_rpc_ndr(cli,
1753                                 mem_ctx,
1754                                 &ndr_table_samr,
1755                                 NDR_SAMR_QUERYDISPLAYINFO,
1756                                 &r);
1757
1758         if (!NT_STATUS_IS_OK(status)) {
1759                 return status;
1760         }
1761
1762         if (DEBUGLEVEL >= 10) {
1763                 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo, &r);
1764         }
1765
1766         if (NT_STATUS_IS_ERR(status)) {
1767                 return status;
1768         }
1769
1770         /* Return variables */
1771         *total_size = *r.out.total_size;
1772         *returned_size = *r.out.returned_size;
1773         *info = *r.out.info;
1774
1775         /* Return result */
1776         return r.out.result;
1777 }
1778
1779 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex(struct rpc_pipe_client *cli,
1780                                                 TALLOC_CTX *mem_ctx,
1781                                                 struct policy_handle *domain_handle /* [in] [ref] */,
1782                                                 uint16_t level /* [in]  */,
1783                                                 struct lsa_String *name /* [in] [ref] */,
1784                                                 uint32_t *idx /* [out] [ref] */)
1785 {
1786         struct samr_GetDisplayEnumerationIndex r;
1787         NTSTATUS status;
1788
1789         /* In parameters */
1790         r.in.domain_handle = domain_handle;
1791         r.in.level = level;
1792         r.in.name = name;
1793
1794         if (DEBUGLEVEL >= 10) {
1795                 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex, &r);
1796         }
1797
1798         status = cli_do_rpc_ndr(cli,
1799                                 mem_ctx,
1800                                 &ndr_table_samr,
1801                                 NDR_SAMR_GETDISPLAYENUMERATIONINDEX,
1802                                 &r);
1803
1804         if (!NT_STATUS_IS_OK(status)) {
1805                 return status;
1806         }
1807
1808         if (DEBUGLEVEL >= 10) {
1809                 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex, &r);
1810         }
1811
1812         if (NT_STATUS_IS_ERR(status)) {
1813                 return status;
1814         }
1815
1816         /* Return variables */
1817         *idx = *r.out.idx;
1818
1819         /* Return result */
1820         return r.out.result;
1821 }
1822
1823 NTSTATUS rpccli_samr_TestPrivateFunctionsDomain(struct rpc_pipe_client *cli,
1824                                                 TALLOC_CTX *mem_ctx,
1825                                                 struct policy_handle *domain_handle /* [in] [ref] */)
1826 {
1827         struct samr_TestPrivateFunctionsDomain r;
1828         NTSTATUS status;
1829
1830         /* In parameters */
1831         r.in.domain_handle = domain_handle;
1832
1833         if (DEBUGLEVEL >= 10) {
1834                 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsDomain, &r);
1835         }
1836
1837         status = cli_do_rpc_ndr(cli,
1838                                 mem_ctx,
1839                                 &ndr_table_samr,
1840                                 NDR_SAMR_TESTPRIVATEFUNCTIONSDOMAIN,
1841                                 &r);
1842
1843         if (!NT_STATUS_IS_OK(status)) {
1844                 return status;
1845         }
1846
1847         if (DEBUGLEVEL >= 10) {
1848                 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsDomain, &r);
1849         }
1850
1851         if (NT_STATUS_IS_ERR(status)) {
1852                 return status;
1853         }
1854
1855         /* Return variables */
1856
1857         /* Return result */
1858         return r.out.result;
1859 }
1860
1861 NTSTATUS rpccli_samr_TestPrivateFunctionsUser(struct rpc_pipe_client *cli,
1862                                               TALLOC_CTX *mem_ctx,
1863                                               struct policy_handle *user_handle /* [in] [ref] */)
1864 {
1865         struct samr_TestPrivateFunctionsUser r;
1866         NTSTATUS status;
1867
1868         /* In parameters */
1869         r.in.user_handle = user_handle;
1870
1871         if (DEBUGLEVEL >= 10) {
1872                 NDR_PRINT_IN_DEBUG(samr_TestPrivateFunctionsUser, &r);
1873         }
1874
1875         status = cli_do_rpc_ndr(cli,
1876                                 mem_ctx,
1877                                 &ndr_table_samr,
1878                                 NDR_SAMR_TESTPRIVATEFUNCTIONSUSER,
1879                                 &r);
1880
1881         if (!NT_STATUS_IS_OK(status)) {
1882                 return status;
1883         }
1884
1885         if (DEBUGLEVEL >= 10) {
1886                 NDR_PRINT_OUT_DEBUG(samr_TestPrivateFunctionsUser, &r);
1887         }
1888
1889         if (NT_STATUS_IS_ERR(status)) {
1890                 return status;
1891         }
1892
1893         /* Return variables */
1894
1895         /* Return result */
1896         return r.out.result;
1897 }
1898
1899 NTSTATUS rpccli_samr_GetUserPwInfo(struct rpc_pipe_client *cli,
1900                                    TALLOC_CTX *mem_ctx,
1901                                    struct policy_handle *user_handle /* [in] [ref] */,
1902                                    struct samr_PwInfo *info /* [out] [ref] */)
1903 {
1904         struct samr_GetUserPwInfo r;
1905         NTSTATUS status;
1906
1907         /* In parameters */
1908         r.in.user_handle = user_handle;
1909
1910         if (DEBUGLEVEL >= 10) {
1911                 NDR_PRINT_IN_DEBUG(samr_GetUserPwInfo, &r);
1912         }
1913
1914         status = cli_do_rpc_ndr(cli,
1915                                 mem_ctx,
1916                                 &ndr_table_samr,
1917                                 NDR_SAMR_GETUSERPWINFO,
1918                                 &r);
1919
1920         if (!NT_STATUS_IS_OK(status)) {
1921                 return status;
1922         }
1923
1924         if (DEBUGLEVEL >= 10) {
1925                 NDR_PRINT_OUT_DEBUG(samr_GetUserPwInfo, &r);
1926         }
1927
1928         if (NT_STATUS_IS_ERR(status)) {
1929                 return status;
1930         }
1931
1932         /* Return variables */
1933         *info = *r.out.info;
1934
1935         /* Return result */
1936         return r.out.result;
1937 }
1938
1939 NTSTATUS rpccli_samr_RemoveMemberFromForeignDomain(struct rpc_pipe_client *cli,
1940                                                    TALLOC_CTX *mem_ctx,
1941                                                    struct policy_handle *domain_handle /* [in] [ref] */,
1942                                                    struct dom_sid2 *sid /* [in] [ref] */)
1943 {
1944         struct samr_RemoveMemberFromForeignDomain r;
1945         NTSTATUS status;
1946
1947         /* In parameters */
1948         r.in.domain_handle = domain_handle;
1949         r.in.sid = sid;
1950
1951         if (DEBUGLEVEL >= 10) {
1952                 NDR_PRINT_IN_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
1953         }
1954
1955         status = cli_do_rpc_ndr(cli,
1956                                 mem_ctx,
1957                                 &ndr_table_samr,
1958                                 NDR_SAMR_REMOVEMEMBERFROMFOREIGNDOMAIN,
1959                                 &r);
1960
1961         if (!NT_STATUS_IS_OK(status)) {
1962                 return status;
1963         }
1964
1965         if (DEBUGLEVEL >= 10) {
1966                 NDR_PRINT_OUT_DEBUG(samr_RemoveMemberFromForeignDomain, &r);
1967         }
1968
1969         if (NT_STATUS_IS_ERR(status)) {
1970                 return status;
1971         }
1972
1973         /* Return variables */
1974
1975         /* Return result */
1976         return r.out.result;
1977 }
1978
1979 NTSTATUS rpccli_samr_QueryDomainInfo2(struct rpc_pipe_client *cli,
1980                                       TALLOC_CTX *mem_ctx,
1981                                       struct policy_handle *domain_handle /* [in] [ref] */,
1982                                       uint16_t level /* [in]  */,
1983                                       union samr_DomainInfo **info /* [out] [ref,switch_is(level)] */)
1984 {
1985         struct samr_QueryDomainInfo2 r;
1986         NTSTATUS status;
1987
1988         /* In parameters */
1989         r.in.domain_handle = domain_handle;
1990         r.in.level = level;
1991
1992         if (DEBUGLEVEL >= 10) {
1993                 NDR_PRINT_IN_DEBUG(samr_QueryDomainInfo2, &r);
1994         }
1995
1996         status = cli_do_rpc_ndr(cli,
1997                                 mem_ctx,
1998                                 &ndr_table_samr,
1999                                 NDR_SAMR_QUERYDOMAININFO2,
2000                                 &r);
2001
2002         if (!NT_STATUS_IS_OK(status)) {
2003                 return status;
2004         }
2005
2006         if (DEBUGLEVEL >= 10) {
2007                 NDR_PRINT_OUT_DEBUG(samr_QueryDomainInfo2, &r);
2008         }
2009
2010         if (NT_STATUS_IS_ERR(status)) {
2011                 return status;
2012         }
2013
2014         /* Return variables */
2015         *info = *r.out.info;
2016
2017         /* Return result */
2018         return r.out.result;
2019 }
2020
2021 NTSTATUS rpccli_samr_QueryUserInfo2(struct rpc_pipe_client *cli,
2022                                     TALLOC_CTX *mem_ctx,
2023                                     struct policy_handle *user_handle /* [in] [ref] */,
2024                                     uint16_t level /* [in]  */,
2025                                     union samr_UserInfo **info /* [out] [ref,switch_is(level)] */)
2026 {
2027         struct samr_QueryUserInfo2 r;
2028         NTSTATUS status;
2029
2030         /* In parameters */
2031         r.in.user_handle = user_handle;
2032         r.in.level = level;
2033
2034         if (DEBUGLEVEL >= 10) {
2035                 NDR_PRINT_IN_DEBUG(samr_QueryUserInfo2, &r);
2036         }
2037
2038         status = cli_do_rpc_ndr(cli,
2039                                 mem_ctx,
2040                                 &ndr_table_samr,
2041                                 NDR_SAMR_QUERYUSERINFO2,
2042                                 &r);
2043
2044         if (!NT_STATUS_IS_OK(status)) {
2045                 return status;
2046         }
2047
2048         if (DEBUGLEVEL >= 10) {
2049                 NDR_PRINT_OUT_DEBUG(samr_QueryUserInfo2, &r);
2050         }
2051
2052         if (NT_STATUS_IS_ERR(status)) {
2053                 return status;
2054         }
2055
2056         /* Return variables */
2057         *info = *r.out.info;
2058
2059         /* Return result */
2060         return r.out.result;
2061 }
2062
2063 NTSTATUS rpccli_samr_QueryDisplayInfo2(struct rpc_pipe_client *cli,
2064                                        TALLOC_CTX *mem_ctx,
2065                                        struct policy_handle *domain_handle /* [in] [ref] */,
2066                                        uint16_t level /* [in]  */,
2067                                        uint32_t start_idx /* [in]  */,
2068                                        uint32_t max_entries /* [in]  */,
2069                                        uint32_t buf_size /* [in]  */,
2070                                        uint32_t *total_size /* [out] [ref] */,
2071                                        uint32_t *returned_size /* [out] [ref] */,
2072                                        union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
2073 {
2074         struct samr_QueryDisplayInfo2 r;
2075         NTSTATUS status;
2076
2077         /* In parameters */
2078         r.in.domain_handle = domain_handle;
2079         r.in.level = level;
2080         r.in.start_idx = start_idx;
2081         r.in.max_entries = max_entries;
2082         r.in.buf_size = buf_size;
2083
2084         if (DEBUGLEVEL >= 10) {
2085                 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo2, &r);
2086         }
2087
2088         status = cli_do_rpc_ndr(cli,
2089                                 mem_ctx,
2090                                 &ndr_table_samr,
2091                                 NDR_SAMR_QUERYDISPLAYINFO2,
2092                                 &r);
2093
2094         if (!NT_STATUS_IS_OK(status)) {
2095                 return status;
2096         }
2097
2098         if (DEBUGLEVEL >= 10) {
2099                 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo2, &r);
2100         }
2101
2102         if (NT_STATUS_IS_ERR(status)) {
2103                 return status;
2104         }
2105
2106         /* Return variables */
2107         *total_size = *r.out.total_size;
2108         *returned_size = *r.out.returned_size;
2109         *info = *r.out.info;
2110
2111         /* Return result */
2112         return r.out.result;
2113 }
2114
2115 NTSTATUS rpccli_samr_GetDisplayEnumerationIndex2(struct rpc_pipe_client *cli,
2116                                                  TALLOC_CTX *mem_ctx,
2117                                                  struct policy_handle *domain_handle /* [in] [ref] */,
2118                                                  uint16_t level /* [in]  */,
2119                                                  struct lsa_String *name /* [in] [ref] */,
2120                                                  uint32_t *idx /* [out] [ref] */)
2121 {
2122         struct samr_GetDisplayEnumerationIndex2 r;
2123         NTSTATUS status;
2124
2125         /* In parameters */
2126         r.in.domain_handle = domain_handle;
2127         r.in.level = level;
2128         r.in.name = name;
2129
2130         if (DEBUGLEVEL >= 10) {
2131                 NDR_PRINT_IN_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
2132         }
2133
2134         status = cli_do_rpc_ndr(cli,
2135                                 mem_ctx,
2136                                 &ndr_table_samr,
2137                                 NDR_SAMR_GETDISPLAYENUMERATIONINDEX2,
2138                                 &r);
2139
2140         if (!NT_STATUS_IS_OK(status)) {
2141                 return status;
2142         }
2143
2144         if (DEBUGLEVEL >= 10) {
2145                 NDR_PRINT_OUT_DEBUG(samr_GetDisplayEnumerationIndex2, &r);
2146         }
2147
2148         if (NT_STATUS_IS_ERR(status)) {
2149                 return status;
2150         }
2151
2152         /* Return variables */
2153         *idx = *r.out.idx;
2154
2155         /* Return result */
2156         return r.out.result;
2157 }
2158
2159 NTSTATUS rpccli_samr_CreateUser2(struct rpc_pipe_client *cli,
2160                                  TALLOC_CTX *mem_ctx,
2161                                  struct policy_handle *domain_handle /* [in] [ref] */,
2162                                  struct lsa_String *account_name /* [in] [ref] */,
2163                                  uint32_t acct_flags /* [in]  */,
2164                                  uint32_t access_mask /* [in]  */,
2165                                  struct policy_handle *user_handle /* [out] [ref] */,
2166                                  uint32_t *access_granted /* [out] [ref] */,
2167                                  uint32_t *rid /* [out] [ref] */)
2168 {
2169         struct samr_CreateUser2 r;
2170         NTSTATUS status;
2171
2172         /* In parameters */
2173         r.in.domain_handle = domain_handle;
2174         r.in.account_name = account_name;
2175         r.in.acct_flags = acct_flags;
2176         r.in.access_mask = access_mask;
2177
2178         if (DEBUGLEVEL >= 10) {
2179                 NDR_PRINT_IN_DEBUG(samr_CreateUser2, &r);
2180         }
2181
2182         status = cli_do_rpc_ndr(cli,
2183                                 mem_ctx,
2184                                 &ndr_table_samr,
2185                                 NDR_SAMR_CREATEUSER2,
2186                                 &r);
2187
2188         if (!NT_STATUS_IS_OK(status)) {
2189                 return status;
2190         }
2191
2192         if (DEBUGLEVEL >= 10) {
2193                 NDR_PRINT_OUT_DEBUG(samr_CreateUser2, &r);
2194         }
2195
2196         if (NT_STATUS_IS_ERR(status)) {
2197                 return status;
2198         }
2199
2200         /* Return variables */
2201         *user_handle = *r.out.user_handle;
2202         *access_granted = *r.out.access_granted;
2203         *rid = *r.out.rid;
2204
2205         /* Return result */
2206         return r.out.result;
2207 }
2208
2209 NTSTATUS rpccli_samr_QueryDisplayInfo3(struct rpc_pipe_client *cli,
2210                                        TALLOC_CTX *mem_ctx,
2211                                        struct policy_handle *domain_handle /* [in] [ref] */,
2212                                        uint16_t level /* [in]  */,
2213                                        uint32_t start_idx /* [in]  */,
2214                                        uint32_t max_entries /* [in]  */,
2215                                        uint32_t buf_size /* [in]  */,
2216                                        uint32_t *total_size /* [out] [ref] */,
2217                                        uint32_t *returned_size /* [out] [ref] */,
2218                                        union samr_DispInfo *info /* [out] [ref,switch_is(level)] */)
2219 {
2220         struct samr_QueryDisplayInfo3 r;
2221         NTSTATUS status;
2222
2223         /* In parameters */
2224         r.in.domain_handle = domain_handle;
2225         r.in.level = level;
2226         r.in.start_idx = start_idx;
2227         r.in.max_entries = max_entries;
2228         r.in.buf_size = buf_size;
2229
2230         if (DEBUGLEVEL >= 10) {
2231                 NDR_PRINT_IN_DEBUG(samr_QueryDisplayInfo3, &r);
2232         }
2233
2234         status = cli_do_rpc_ndr(cli,
2235                                 mem_ctx,
2236                                 &ndr_table_samr,
2237                                 NDR_SAMR_QUERYDISPLAYINFO3,
2238                                 &r);
2239
2240         if (!NT_STATUS_IS_OK(status)) {
2241                 return status;
2242         }
2243
2244         if (DEBUGLEVEL >= 10) {
2245                 NDR_PRINT_OUT_DEBUG(samr_QueryDisplayInfo3, &r);
2246         }
2247
2248         if (NT_STATUS_IS_ERR(status)) {
2249                 return status;
2250         }
2251
2252         /* Return variables */
2253         *total_size = *r.out.total_size;
2254         *returned_size = *r.out.returned_size;
2255         *info = *r.out.info;
2256
2257         /* Return result */
2258         return r.out.result;
2259 }
2260
2261 NTSTATUS rpccli_samr_AddMultipleMembersToAlias(struct rpc_pipe_client *cli,
2262                                                TALLOC_CTX *mem_ctx,
2263                                                struct policy_handle *alias_handle /* [in] [ref] */,
2264                                                struct lsa_SidArray *sids /* [in] [ref] */)
2265 {
2266         struct samr_AddMultipleMembersToAlias r;
2267         NTSTATUS status;
2268
2269         /* In parameters */
2270         r.in.alias_handle = alias_handle;
2271         r.in.sids = sids;
2272
2273         if (DEBUGLEVEL >= 10) {
2274                 NDR_PRINT_IN_DEBUG(samr_AddMultipleMembersToAlias, &r);
2275         }
2276
2277         status = cli_do_rpc_ndr(cli,
2278                                 mem_ctx,
2279                                 &ndr_table_samr,
2280                                 NDR_SAMR_ADDMULTIPLEMEMBERSTOALIAS,
2281                                 &r);
2282
2283         if (!NT_STATUS_IS_OK(status)) {
2284                 return status;
2285         }
2286
2287         if (DEBUGLEVEL >= 10) {
2288                 NDR_PRINT_OUT_DEBUG(samr_AddMultipleMembersToAlias, &r);
2289         }
2290
2291         if (NT_STATUS_IS_ERR(status)) {
2292                 return status;
2293         }
2294
2295         /* Return variables */
2296
2297         /* Return result */
2298         return r.out.result;
2299 }
2300
2301 NTSTATUS rpccli_samr_RemoveMultipleMembersFromAlias(struct rpc_pipe_client *cli,
2302                                                     TALLOC_CTX *mem_ctx,
2303                                                     struct policy_handle *alias_handle /* [in] [ref] */,
2304                                                     struct lsa_SidArray *sids /* [in] [ref] */)
2305 {
2306         struct samr_RemoveMultipleMembersFromAlias r;
2307         NTSTATUS status;
2308
2309         /* In parameters */
2310         r.in.alias_handle = alias_handle;
2311         r.in.sids = sids;
2312
2313         if (DEBUGLEVEL >= 10) {
2314                 NDR_PRINT_IN_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
2315         }
2316
2317         status = cli_do_rpc_ndr(cli,
2318                                 mem_ctx,
2319                                 &ndr_table_samr,
2320                                 NDR_SAMR_REMOVEMULTIPLEMEMBERSFROMALIAS,
2321                                 &r);
2322
2323         if (!NT_STATUS_IS_OK(status)) {
2324                 return status;
2325         }
2326
2327         if (DEBUGLEVEL >= 10) {
2328                 NDR_PRINT_OUT_DEBUG(samr_RemoveMultipleMembersFromAlias, &r);
2329         }
2330
2331         if (NT_STATUS_IS_ERR(status)) {
2332                 return status;
2333         }
2334
2335         /* Return variables */
2336
2337         /* Return result */
2338         return r.out.result;
2339 }
2340
2341 NTSTATUS rpccli_samr_OemChangePasswordUser2(struct rpc_pipe_client *cli,
2342                                             TALLOC_CTX *mem_ctx,
2343                                             struct lsa_AsciiString *server /* [in] [unique] */,
2344                                             struct lsa_AsciiString *account /* [in] [ref] */,
2345                                             struct samr_CryptPassword *password /* [in] [unique] */,
2346                                             struct samr_Password *hash /* [in] [unique] */)
2347 {
2348         struct samr_OemChangePasswordUser2 r;
2349         NTSTATUS status;
2350
2351         /* In parameters */
2352         r.in.server = server;
2353         r.in.account = account;
2354         r.in.password = password;
2355         r.in.hash = hash;
2356
2357         if (DEBUGLEVEL >= 10) {
2358                 NDR_PRINT_IN_DEBUG(samr_OemChangePasswordUser2, &r);
2359         }
2360
2361         status = cli_do_rpc_ndr(cli,
2362                                 mem_ctx,
2363                                 &ndr_table_samr,
2364                                 NDR_SAMR_OEMCHANGEPASSWORDUSER2,
2365                                 &r);
2366
2367         if (!NT_STATUS_IS_OK(status)) {
2368                 return status;
2369         }
2370
2371         if (DEBUGLEVEL >= 10) {
2372                 NDR_PRINT_OUT_DEBUG(samr_OemChangePasswordUser2, &r);
2373         }
2374
2375         if (NT_STATUS_IS_ERR(status)) {
2376                 return status;
2377         }
2378
2379         /* Return variables */
2380
2381         /* Return result */
2382         return r.out.result;
2383 }
2384
2385 NTSTATUS rpccli_samr_ChangePasswordUser2(struct rpc_pipe_client *cli,
2386                                          TALLOC_CTX *mem_ctx,
2387                                          struct lsa_String *server /* [in] [unique] */,
2388                                          struct lsa_String *account /* [in] [ref] */,
2389                                          struct samr_CryptPassword *nt_password /* [in] [unique] */,
2390                                          struct samr_Password *nt_verifier /* [in] [unique] */,
2391                                          uint8_t lm_change /* [in]  */,
2392                                          struct samr_CryptPassword *lm_password /* [in] [unique] */,
2393                                          struct samr_Password *lm_verifier /* [in] [unique] */)
2394 {
2395         struct samr_ChangePasswordUser2 r;
2396         NTSTATUS status;
2397
2398         /* In parameters */
2399         r.in.server = server;
2400         r.in.account = account;
2401         r.in.nt_password = nt_password;
2402         r.in.nt_verifier = nt_verifier;
2403         r.in.lm_change = lm_change;
2404         r.in.lm_password = lm_password;
2405         r.in.lm_verifier = lm_verifier;
2406
2407         if (DEBUGLEVEL >= 10) {
2408                 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser2, &r);
2409         }
2410
2411         status = cli_do_rpc_ndr(cli,
2412                                 mem_ctx,
2413                                 &ndr_table_samr,
2414                                 NDR_SAMR_CHANGEPASSWORDUSER2,
2415                                 &r);
2416
2417         if (!NT_STATUS_IS_OK(status)) {
2418                 return status;
2419         }
2420
2421         if (DEBUGLEVEL >= 10) {
2422                 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser2, &r);
2423         }
2424
2425         if (NT_STATUS_IS_ERR(status)) {
2426                 return status;
2427         }
2428
2429         /* Return variables */
2430
2431         /* Return result */
2432         return r.out.result;
2433 }
2434
2435 NTSTATUS rpccli_samr_GetDomPwInfo(struct rpc_pipe_client *cli,
2436                                   TALLOC_CTX *mem_ctx,
2437                                   struct lsa_String *domain_name /* [in] [unique] */,
2438                                   struct samr_PwInfo *info /* [out] [ref] */)
2439 {
2440         struct samr_GetDomPwInfo r;
2441         NTSTATUS status;
2442
2443         /* In parameters */
2444         r.in.domain_name = domain_name;
2445
2446         if (DEBUGLEVEL >= 10) {
2447                 NDR_PRINT_IN_DEBUG(samr_GetDomPwInfo, &r);
2448         }
2449
2450         status = cli_do_rpc_ndr(cli,
2451                                 mem_ctx,
2452                                 &ndr_table_samr,
2453                                 NDR_SAMR_GETDOMPWINFO,
2454                                 &r);
2455
2456         if (!NT_STATUS_IS_OK(status)) {
2457                 return status;
2458         }
2459
2460         if (DEBUGLEVEL >= 10) {
2461                 NDR_PRINT_OUT_DEBUG(samr_GetDomPwInfo, &r);
2462         }
2463
2464         if (NT_STATUS_IS_ERR(status)) {
2465                 return status;
2466         }
2467
2468         /* Return variables */
2469         *info = *r.out.info;
2470
2471         /* Return result */
2472         return r.out.result;
2473 }
2474
2475 NTSTATUS rpccli_samr_Connect2(struct rpc_pipe_client *cli,
2476                               TALLOC_CTX *mem_ctx,
2477                               const char *system_name /* [in] [unique,charset(UTF16)] */,
2478                               uint32_t access_mask /* [in]  */,
2479                               struct policy_handle *connect_handle /* [out] [ref] */)
2480 {
2481         struct samr_Connect2 r;
2482         NTSTATUS status;
2483
2484         /* In parameters */
2485         r.in.system_name = system_name;
2486         r.in.access_mask = access_mask;
2487
2488         if (DEBUGLEVEL >= 10) {
2489                 NDR_PRINT_IN_DEBUG(samr_Connect2, &r);
2490         }
2491
2492         status = cli_do_rpc_ndr(cli,
2493                                 mem_ctx,
2494                                 &ndr_table_samr,
2495                                 NDR_SAMR_CONNECT2,
2496                                 &r);
2497
2498         if (!NT_STATUS_IS_OK(status)) {
2499                 return status;
2500         }
2501
2502         if (DEBUGLEVEL >= 10) {
2503                 NDR_PRINT_OUT_DEBUG(samr_Connect2, &r);
2504         }
2505
2506         if (NT_STATUS_IS_ERR(status)) {
2507                 return status;
2508         }
2509
2510         /* Return variables */
2511         *connect_handle = *r.out.connect_handle;
2512
2513         /* Return result */
2514         return r.out.result;
2515 }
2516
2517 NTSTATUS rpccli_samr_SetUserInfo2(struct rpc_pipe_client *cli,
2518                                   TALLOC_CTX *mem_ctx,
2519                                   struct policy_handle *user_handle /* [in] [ref] */,
2520                                   uint16_t level /* [in]  */,
2521                                   union samr_UserInfo *info /* [in] [ref,switch_is(level)] */)
2522 {
2523         struct samr_SetUserInfo2 r;
2524         NTSTATUS status;
2525
2526         /* In parameters */
2527         r.in.user_handle = user_handle;
2528         r.in.level = level;
2529         r.in.info = info;
2530
2531         if (DEBUGLEVEL >= 10) {
2532                 NDR_PRINT_IN_DEBUG(samr_SetUserInfo2, &r);
2533         }
2534
2535         status = cli_do_rpc_ndr(cli,
2536                                 mem_ctx,
2537                                 &ndr_table_samr,
2538                                 NDR_SAMR_SETUSERINFO2,
2539                                 &r);
2540
2541         if (!NT_STATUS_IS_OK(status)) {
2542                 return status;
2543         }
2544
2545         if (DEBUGLEVEL >= 10) {
2546                 NDR_PRINT_OUT_DEBUG(samr_SetUserInfo2, &r);
2547         }
2548
2549         if (NT_STATUS_IS_ERR(status)) {
2550                 return status;
2551         }
2552
2553         /* Return variables */
2554
2555         /* Return result */
2556         return r.out.result;
2557 }
2558
2559 NTSTATUS rpccli_samr_SetBootKeyInformation(struct rpc_pipe_client *cli,
2560                                            TALLOC_CTX *mem_ctx,
2561                                            struct policy_handle *connect_handle /* [in] [ref] */,
2562                                            uint32_t unknown1 /* [in]  */,
2563                                            uint32_t unknown2 /* [in]  */,
2564                                            uint32_t unknown3 /* [in]  */)
2565 {
2566         struct samr_SetBootKeyInformation r;
2567         NTSTATUS status;
2568
2569         /* In parameters */
2570         r.in.connect_handle = connect_handle;
2571         r.in.unknown1 = unknown1;
2572         r.in.unknown2 = unknown2;
2573         r.in.unknown3 = unknown3;
2574
2575         if (DEBUGLEVEL >= 10) {
2576                 NDR_PRINT_IN_DEBUG(samr_SetBootKeyInformation, &r);
2577         }
2578
2579         status = cli_do_rpc_ndr(cli,
2580                                 mem_ctx,
2581                                 &ndr_table_samr,
2582                                 NDR_SAMR_SETBOOTKEYINFORMATION,
2583                                 &r);
2584
2585         if (!NT_STATUS_IS_OK(status)) {
2586                 return status;
2587         }
2588
2589         if (DEBUGLEVEL >= 10) {
2590                 NDR_PRINT_OUT_DEBUG(samr_SetBootKeyInformation, &r);
2591         }
2592
2593         if (NT_STATUS_IS_ERR(status)) {
2594                 return status;
2595         }
2596
2597         /* Return variables */
2598
2599         /* Return result */
2600         return r.out.result;
2601 }
2602
2603 NTSTATUS rpccli_samr_GetBootKeyInformation(struct rpc_pipe_client *cli,
2604                                            TALLOC_CTX *mem_ctx,
2605                                            struct policy_handle *domain_handle /* [in] [ref] */,
2606                                            uint32_t *unknown /* [out] [ref] */)
2607 {
2608         struct samr_GetBootKeyInformation r;
2609         NTSTATUS status;
2610
2611         /* In parameters */
2612         r.in.domain_handle = domain_handle;
2613
2614         if (DEBUGLEVEL >= 10) {
2615                 NDR_PRINT_IN_DEBUG(samr_GetBootKeyInformation, &r);
2616         }
2617
2618         status = cli_do_rpc_ndr(cli,
2619                                 mem_ctx,
2620                                 &ndr_table_samr,
2621                                 NDR_SAMR_GETBOOTKEYINFORMATION,
2622                                 &r);
2623
2624         if (!NT_STATUS_IS_OK(status)) {
2625                 return status;
2626         }
2627
2628         if (DEBUGLEVEL >= 10) {
2629                 NDR_PRINT_OUT_DEBUG(samr_GetBootKeyInformation, &r);
2630         }
2631
2632         if (NT_STATUS_IS_ERR(status)) {
2633                 return status;
2634         }
2635
2636         /* Return variables */
2637         *unknown = *r.out.unknown;
2638
2639         /* Return result */
2640         return r.out.result;
2641 }
2642
2643 NTSTATUS rpccli_samr_Connect3(struct rpc_pipe_client *cli,
2644                               TALLOC_CTX *mem_ctx,
2645                               const char *system_name /* [in] [unique,charset(UTF16)] */,
2646                               uint32_t unknown /* [in]  */,
2647                               uint32_t access_mask /* [in]  */,
2648                               struct policy_handle *connect_handle /* [out] [ref] */)
2649 {
2650         struct samr_Connect3 r;
2651         NTSTATUS status;
2652
2653         /* In parameters */
2654         r.in.system_name = system_name;
2655         r.in.unknown = unknown;
2656         r.in.access_mask = access_mask;
2657
2658         if (DEBUGLEVEL >= 10) {
2659                 NDR_PRINT_IN_DEBUG(samr_Connect3, &r);
2660         }
2661
2662         status = cli_do_rpc_ndr(cli,
2663                                 mem_ctx,
2664                                 &ndr_table_samr,
2665                                 NDR_SAMR_CONNECT3,
2666                                 &r);
2667
2668         if (!NT_STATUS_IS_OK(status)) {
2669                 return status;
2670         }
2671
2672         if (DEBUGLEVEL >= 10) {
2673                 NDR_PRINT_OUT_DEBUG(samr_Connect3, &r);
2674         }
2675
2676         if (NT_STATUS_IS_ERR(status)) {
2677                 return status;
2678         }
2679
2680         /* Return variables */
2681         *connect_handle = *r.out.connect_handle;
2682
2683         /* Return result */
2684         return r.out.result;
2685 }
2686
2687 NTSTATUS rpccli_samr_Connect4(struct rpc_pipe_client *cli,
2688                               TALLOC_CTX *mem_ctx,
2689                               const char *system_name /* [in] [unique,charset(UTF16)] */,
2690                               enum samr_ConnectVersion client_version /* [in]  */,
2691                               uint32_t access_mask /* [in]  */,
2692                               struct policy_handle *connect_handle /* [out] [ref] */)
2693 {
2694         struct samr_Connect4 r;
2695         NTSTATUS status;
2696
2697         /* In parameters */
2698         r.in.system_name = system_name;
2699         r.in.client_version = client_version;
2700         r.in.access_mask = access_mask;
2701
2702         if (DEBUGLEVEL >= 10) {
2703                 NDR_PRINT_IN_DEBUG(samr_Connect4, &r);
2704         }
2705
2706         status = cli_do_rpc_ndr(cli,
2707                                 mem_ctx,
2708                                 &ndr_table_samr,
2709                                 NDR_SAMR_CONNECT4,
2710                                 &r);
2711
2712         if (!NT_STATUS_IS_OK(status)) {
2713                 return status;
2714         }
2715
2716         if (DEBUGLEVEL >= 10) {
2717                 NDR_PRINT_OUT_DEBUG(samr_Connect4, &r);
2718         }
2719
2720         if (NT_STATUS_IS_ERR(status)) {
2721                 return status;
2722         }
2723
2724         /* Return variables */
2725         *connect_handle = *r.out.connect_handle;
2726
2727         /* Return result */
2728         return r.out.result;
2729 }
2730
2731 NTSTATUS rpccli_samr_ChangePasswordUser3(struct rpc_pipe_client *cli,
2732                                          TALLOC_CTX *mem_ctx,
2733                                          struct lsa_String *server /* [in] [unique] */,
2734                                          struct lsa_String *account /* [in] [ref] */,
2735                                          struct samr_CryptPassword *nt_password /* [in] [unique] */,
2736                                          struct samr_Password *nt_verifier /* [in] [unique] */,
2737                                          uint8_t lm_change /* [in]  */,
2738                                          struct samr_CryptPassword *lm_password /* [in] [unique] */,
2739                                          struct samr_Password *lm_verifier /* [in] [unique] */,
2740                                          struct samr_CryptPassword *password3 /* [in] [unique] */,
2741                                          struct samr_DomInfo1 **dominfo /* [out] [ref] */,
2742                                          struct samr_ChangeReject **reject /* [out] [ref] */)
2743 {
2744         struct samr_ChangePasswordUser3 r;
2745         NTSTATUS status;
2746
2747         /* In parameters */
2748         r.in.server = server;
2749         r.in.account = account;
2750         r.in.nt_password = nt_password;
2751         r.in.nt_verifier = nt_verifier;
2752         r.in.lm_change = lm_change;
2753         r.in.lm_password = lm_password;
2754         r.in.lm_verifier = lm_verifier;
2755         r.in.password3 = password3;
2756
2757         if (DEBUGLEVEL >= 10) {
2758                 NDR_PRINT_IN_DEBUG(samr_ChangePasswordUser3, &r);
2759         }
2760
2761         status = cli_do_rpc_ndr(cli,
2762                                 mem_ctx,
2763                                 &ndr_table_samr,
2764                                 NDR_SAMR_CHANGEPASSWORDUSER3,
2765                                 &r);
2766
2767         if (!NT_STATUS_IS_OK(status)) {
2768                 return status;
2769         }
2770
2771         if (DEBUGLEVEL >= 10) {
2772                 NDR_PRINT_OUT_DEBUG(samr_ChangePasswordUser3, &r);
2773         }
2774
2775         if (NT_STATUS_IS_ERR(status)) {
2776                 return status;
2777         }
2778
2779         /* Return variables */
2780         *dominfo = *r.out.dominfo;
2781         *reject = *r.out.reject;
2782
2783         /* Return result */
2784         return r.out.result;
2785 }
2786
2787 NTSTATUS rpccli_samr_Connect5(struct rpc_pipe_client *cli,
2788                               TALLOC_CTX *mem_ctx,
2789                               const char *system_name /* [in] [unique,charset(UTF16)] */,
2790                               uint32_t access_mask /* [in]  */,
2791                               uint32_t level_in /* [in]  */,
2792                               union samr_ConnectInfo *info_in /* [in] [ref,switch_is(level_in)] */,
2793                               uint32_t *level_out /* [out] [ref] */,
2794                               union samr_ConnectInfo *info_out /* [out] [ref,switch_is(*level_out)] */,
2795                               struct policy_handle *connect_handle /* [out] [ref] */)
2796 {
2797         struct samr_Connect5 r;
2798         NTSTATUS status;
2799
2800         /* In parameters */
2801         r.in.system_name = system_name;
2802         r.in.access_mask = access_mask;
2803         r.in.level_in = level_in;
2804         r.in.info_in = info_in;
2805
2806         if (DEBUGLEVEL >= 10) {
2807                 NDR_PRINT_IN_DEBUG(samr_Connect5, &r);
2808         }
2809
2810         status = cli_do_rpc_ndr(cli,
2811                                 mem_ctx,
2812                                 &ndr_table_samr,
2813                                 NDR_SAMR_CONNECT5,
2814                                 &r);
2815
2816         if (!NT_STATUS_IS_OK(status)) {
2817                 return status;
2818         }
2819
2820         if (DEBUGLEVEL >= 10) {
2821                 NDR_PRINT_OUT_DEBUG(samr_Connect5, &r);
2822         }
2823
2824         if (NT_STATUS_IS_ERR(status)) {
2825                 return status;
2826         }
2827
2828         /* Return variables */
2829         *level_out = *r.out.level_out;
2830         *info_out = *r.out.info_out;
2831         *connect_handle = *r.out.connect_handle;
2832
2833         /* Return result */
2834         return r.out.result;
2835 }
2836
2837 NTSTATUS rpccli_samr_RidToSid(struct rpc_pipe_client *cli,
2838                               TALLOC_CTX *mem_ctx,
2839                               struct policy_handle *domain_handle /* [in] [ref] */,
2840                               uint32_t rid /* [in]  */,
2841                               struct dom_sid2 **sid /* [out] [ref] */)
2842 {
2843         struct samr_RidToSid r;
2844         NTSTATUS status;
2845
2846         /* In parameters */
2847         r.in.domain_handle = domain_handle;
2848         r.in.rid = rid;
2849
2850         if (DEBUGLEVEL >= 10) {
2851                 NDR_PRINT_IN_DEBUG(samr_RidToSid, &r);
2852         }
2853
2854         status = cli_do_rpc_ndr(cli,
2855                                 mem_ctx,
2856                                 &ndr_table_samr,
2857                                 NDR_SAMR_RIDTOSID,
2858                                 &r);
2859
2860         if (!NT_STATUS_IS_OK(status)) {
2861                 return status;
2862         }
2863
2864         if (DEBUGLEVEL >= 10) {
2865                 NDR_PRINT_OUT_DEBUG(samr_RidToSid, &r);
2866         }
2867
2868         if (NT_STATUS_IS_ERR(status)) {
2869                 return status;
2870         }
2871
2872         /* Return variables */
2873         *sid = *r.out.sid;
2874
2875         /* Return result */
2876         return r.out.result;
2877 }
2878
2879 NTSTATUS rpccli_samr_SetDsrmPassword(struct rpc_pipe_client *cli,
2880                                      TALLOC_CTX *mem_ctx,
2881                                      struct lsa_String *name /* [in] [unique] */,
2882                                      uint32_t unknown /* [in]  */,
2883                                      struct samr_Password *hash /* [in] [unique] */)
2884 {
2885         struct samr_SetDsrmPassword r;
2886         NTSTATUS status;
2887
2888         /* In parameters */
2889         r.in.name = name;
2890         r.in.unknown = unknown;
2891         r.in.hash = hash;
2892
2893         if (DEBUGLEVEL >= 10) {
2894                 NDR_PRINT_IN_DEBUG(samr_SetDsrmPassword, &r);
2895         }
2896
2897         status = cli_do_rpc_ndr(cli,
2898                                 mem_ctx,
2899                                 &ndr_table_samr,
2900                                 NDR_SAMR_SETDSRMPASSWORD,
2901                                 &r);
2902
2903         if (!NT_STATUS_IS_OK(status)) {
2904                 return status;
2905         }
2906
2907         if (DEBUGLEVEL >= 10) {
2908                 NDR_PRINT_OUT_DEBUG(samr_SetDsrmPassword, &r);
2909         }
2910
2911         if (NT_STATUS_IS_ERR(status)) {
2912                 return status;
2913         }
2914
2915         /* Return variables */
2916
2917         /* Return result */
2918         return r.out.result;
2919 }
2920
2921 NTSTATUS rpccli_samr_ValidatePassword(struct rpc_pipe_client *cli,
2922                                       TALLOC_CTX *mem_ctx,
2923                                       enum samr_ValidatePasswordLevel level /* [in]  */,
2924                                       union samr_ValidatePasswordReq *req /* [in] [ref,switch_is(level)] */,
2925                                       union samr_ValidatePasswordRep **rep /* [out] [ref,switch_is(level)] */)
2926 {
2927         struct samr_ValidatePassword r;
2928         NTSTATUS status;
2929
2930         /* In parameters */
2931         r.in.level = level;
2932         r.in.req = req;
2933
2934         if (DEBUGLEVEL >= 10) {
2935                 NDR_PRINT_IN_DEBUG(samr_ValidatePassword, &r);
2936         }
2937
2938         status = cli_do_rpc_ndr(cli,
2939                                 mem_ctx,
2940                                 &ndr_table_samr,
2941                                 NDR_SAMR_VALIDATEPASSWORD,
2942                                 &r);
2943
2944         if (!NT_STATUS_IS_OK(status)) {
2945                 return status;
2946         }
2947
2948         if (DEBUGLEVEL >= 10) {
2949                 NDR_PRINT_OUT_DEBUG(samr_ValidatePassword, &r);
2950         }
2951
2952         if (NT_STATUS_IS_ERR(status)) {
2953                 return status;
2954         }
2955
2956         /* Return variables */
2957         *rep = *r.out.rep;
2958
2959         /* Return result */
2960         return r.out.result;
2961 }
2962