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